Example usage for java.awt Color cyan

List of usage examples for java.awt Color cyan

Introduction

In this page you can find the example usage for java.awt Color cyan.

Prototype

Color cyan

To view the source code for java.awt Color cyan.

Click Source Link

Document

The color cyan.

Usage

From source file:net.sf.jasperreports.chartthemes.simple.SimpleSettingsFactory.java

/**
 *
 *///from   w ww  .  j  ava  2s . c om
public static final ChartThemeSettings createChartThemeSettings() {
    ChartThemeSettings settings = new ChartThemeSettings();

    ChartSettings chartSettings = settings.getChartSettings();
    chartSettings.setBackgroundPaint(new GradientPaintProvider(Color.green, Color.blue));
    chartSettings.setBackgroundImage(
            new FileImageProvider("net/sf/jasperreports/chartthemes/simple/jasperreports.png"));
    chartSettings.setBackgroundImageAlignment(Align.TOP_RIGHT);
    chartSettings.setBackgroundImageAlpha(1f);
    chartSettings.setBorderVisible(Boolean.TRUE);
    chartSettings.setBorderPaint(new ColorProvider(Color.GREEN));
    chartSettings.setBorderStroke(new BasicStroke(1f));
    chartSettings.setAntiAlias(Boolean.TRUE);
    chartSettings.setTextAntiAlias(Boolean.TRUE);
    chartSettings.setPadding(new RectangleInsets(UnitType.ABSOLUTE, 1.1, 2.2, 3.3, 4.4));

    TitleSettings titleSettings = settings.getTitleSettings();
    titleSettings.setShowTitle(Boolean.TRUE);
    titleSettings.setPosition(EdgeEnum.TOP);
    titleSettings.setForegroundPaint(new ColorProvider(Color.black));
    titleSettings.setBackgroundPaint(new GradientPaintProvider(Color.green, Color.blue));
    titleSettings.getFont().setBold(Boolean.TRUE);
    titleSettings.getFont().setFontSize(22f);
    titleSettings.setHorizontalAlignment(HorizontalAlignment.CENTER);
    titleSettings.setVerticalAlignment(VerticalAlignment.TOP);
    titleSettings.setPadding(new RectangleInsets(UnitType.ABSOLUTE, 1.1, 2.2, 3.3, 4.4));

    TitleSettings subtitleSettings = settings.getSubtitleSettings();
    subtitleSettings.setShowTitle(Boolean.TRUE);
    subtitleSettings.setPosition(EdgeEnum.TOP);
    subtitleSettings.setForegroundPaint(new ColorProvider(Color.red));
    subtitleSettings.setBackgroundPaint(new GradientPaintProvider(Color.green, Color.blue));
    subtitleSettings.getFont().setBold(Boolean.TRUE);
    subtitleSettings.setHorizontalAlignment(HorizontalAlignment.LEFT);
    subtitleSettings.setVerticalAlignment(VerticalAlignment.CENTER);
    subtitleSettings.setPadding(new RectangleInsets(UnitType.ABSOLUTE, 1.1, 2.2, 3.3, 4.4));

    LegendSettings legendSettings = settings.getLegendSettings();
    legendSettings.setShowLegend(Boolean.TRUE);
    legendSettings.setPosition(EdgeEnum.BOTTOM);
    legendSettings.setForegroundPaint(new ColorProvider(Color.black));
    legendSettings.setBackgroundPaint(new GradientPaintProvider(Color.green, Color.blue));
    legendSettings.getFont().setBold(Boolean.TRUE);
    legendSettings.setHorizontalAlignment(HorizontalAlignment.CENTER);
    legendSettings.setVerticalAlignment(VerticalAlignment.BOTTOM);
    //FIXMETHEME legendSettings.setBlockFrame();
    legendSettings.setPadding(new RectangleInsets(UnitType.ABSOLUTE, 1.1, 2.2, 3.3, 4.4));

    PlotSettings plotSettings = settings.getPlotSettings();
    plotSettings.setOrientation(PlotOrientation.VERTICAL);
    //      plotSettings.setForegroundAlpha(0.5f);
    plotSettings.setBackgroundPaint(new GradientPaintProvider(Color.green, Color.blue));
    //      plotSettings.setBackgroundAlpha(0.5f);
    plotSettings.setBackgroundImage(
            new FileImageProvider("net/sf/jasperreports/chartthemes/simple/jasperreports.png"));
    plotSettings.setBackgroundImageAlpha(0.5f);
    plotSettings.setBackgroundImageAlignment(Align.NORTH_WEST);
    plotSettings.setLabelRotation(0d);
    plotSettings.setPadding(new RectangleInsets(UnitType.ABSOLUTE, 1.1, 2.2, 3.3, 4.4));
    plotSettings.setOutlineVisible(Boolean.TRUE);
    plotSettings.setOutlinePaint(new ColorProvider(Color.red));
    plotSettings.setOutlineStroke(new BasicStroke(1f));
    plotSettings.setSeriesColorSequence(COLORS);
    //      plotSettings.setSeriesGradientPaintSequence(GRADIENT_PAINTS);
    plotSettings.setSeriesOutlinePaintSequence(COLORS_DARKER);
    plotSettings.setSeriesStrokeSequence(STROKES);
    plotSettings.setSeriesOutlineStrokeSequence(OUTLINE_STROKES);
    plotSettings.setDomainGridlineVisible(Boolean.TRUE);
    plotSettings.setDomainGridlinePaint(new ColorProvider(Color.DARK_GRAY));
    plotSettings.setDomainGridlineStroke(new BasicStroke(0.5f));
    plotSettings.setRangeGridlineVisible(Boolean.TRUE);
    plotSettings.setRangeGridlinePaint(new ColorProvider(Color.BLACK));
    plotSettings.setRangeGridlineStroke(new BasicStroke(0.5f));
    plotSettings.getTickLabelFont().setFontName("Courier");
    plotSettings.getTickLabelFont().setBold(Boolean.TRUE);
    plotSettings.getTickLabelFont().setFontSize(10f);
    plotSettings.getDisplayFont().setFontName("Arial");
    plotSettings.getDisplayFont().setBold(Boolean.TRUE);
    plotSettings.getDisplayFont().setFontSize(12f);

    AxisSettings domainAxisSettings = settings.getDomainAxisSettings();
    domainAxisSettings.setVisible(Boolean.TRUE);
    domainAxisSettings.setLocation(AxisLocation.BOTTOM_OR_RIGHT);
    domainAxisSettings.setLinePaint(new ColorProvider(Color.green));
    domainAxisSettings.setLineStroke(new BasicStroke(1f));
    domainAxisSettings.setLineVisible(Boolean.TRUE);
    //      domainAxisSettings.setLabel("Domain Axis");
    domainAxisSettings.setLabelAngle(0.0d);
    domainAxisSettings.setLabelPaint(new ColorProvider(Color.magenta));
    domainAxisSettings.getLabelFont().setBold(Boolean.TRUE);
    domainAxisSettings.getLabelFont().setItalic(Boolean.TRUE);
    domainAxisSettings.getLabelFont().setFontName("Comic Sans MS");
    domainAxisSettings.getLabelFont().setFontSize(12f);
    domainAxisSettings.setLabelInsets(new RectangleInsets(UnitType.ABSOLUTE, 0.5, 0.5, 1, 1));
    domainAxisSettings.setLabelVisible(Boolean.TRUE);
    domainAxisSettings.setTickLabelPaint(new ColorProvider(Color.cyan));
    domainAxisSettings.getTickLabelFont().setBold(Boolean.TRUE);
    domainAxisSettings.getTickLabelFont().setItalic(Boolean.FALSE);
    domainAxisSettings.getTickLabelFont().setFontName("Arial");
    domainAxisSettings.getTickLabelFont().setFontSize(10f);
    domainAxisSettings.setTickLabelInsets(new RectangleInsets(UnitType.ABSOLUTE, 0.5, 0.5, 0.5, 0.5));
    domainAxisSettings.setTickLabelsVisible(Boolean.TRUE);
    domainAxisSettings.setTickMarksInsideLength(0.1f);
    domainAxisSettings.setTickMarksOutsideLength(0.2f);
    domainAxisSettings.setTickMarksPaint(new ColorProvider(Color.ORANGE));
    domainAxisSettings.setTickMarksStroke(new BasicStroke(1f));
    domainAxisSettings.setTickMarksVisible(Boolean.TRUE);
    domainAxisSettings.setTickCount(5);

    AxisSettings rangeAxisSettings = settings.getRangeAxisSettings();
    rangeAxisSettings.setVisible(Boolean.TRUE);
    rangeAxisSettings.setLocation(AxisLocation.TOP_OR_RIGHT);
    rangeAxisSettings.setLinePaint(new ColorProvider(Color.yellow));
    rangeAxisSettings.setLineStroke(new BasicStroke(1f));
    rangeAxisSettings.setLineVisible(Boolean.TRUE);
    //      rangeAxisSettings.setLabel("Range Axis");
    rangeAxisSettings.setLabelAngle(Math.PI / 2.0d);
    rangeAxisSettings.setLabelPaint(new ColorProvider(Color.green));
    rangeAxisSettings.getLabelFont().setBold(Boolean.TRUE);
    rangeAxisSettings.getLabelFont().setItalic(Boolean.TRUE);
    rangeAxisSettings.getLabelFont().setFontName("Comic Sans MS");
    rangeAxisSettings.getLabelFont().setFontSize(12f);
    rangeAxisSettings.setLabelInsets(new RectangleInsets(UnitType.ABSOLUTE, 0.5, 0.5, 1, 1));
    rangeAxisSettings.setLabelVisible(Boolean.TRUE);
    rangeAxisSettings.setTickLabelPaint(new ColorProvider(Color.pink));
    rangeAxisSettings.getTickLabelFont().setBold(Boolean.FALSE);
    rangeAxisSettings.getTickLabelFont().setItalic(Boolean.TRUE);
    rangeAxisSettings.getTickLabelFont().setFontName("Arial");
    rangeAxisSettings.getTickLabelFont().setFontSize(10f);
    rangeAxisSettings.setTickLabelInsets(new RectangleInsets(UnitType.ABSOLUTE, 0.5, 0.5, 0.5, 0.5));
    rangeAxisSettings.setTickLabelsVisible(Boolean.TRUE);
    rangeAxisSettings.setTickMarksInsideLength(0.2f);
    rangeAxisSettings.setTickMarksOutsideLength(0.1f);
    rangeAxisSettings.setTickMarksPaint(new ColorProvider(Color.black));
    rangeAxisSettings.setTickMarksStroke(new BasicStroke(1f));
    rangeAxisSettings.setTickMarksVisible(Boolean.TRUE);
    rangeAxisSettings.setTickCount(6);

    return settings;
}

From source file:edu.cmu.sv.modelinference.eventtool.EventVisualizer.java

private static Map<EventClass, Color> assignClassColors(ClassificationResult results) {
    Color[] COLORS = { Color.GREEN, Color.RED, Color.BLACK, Color.BLUE, Color.GRAY, Color.CYAN, Color.DARK_GRAY,
            Color.MAGENTA };//from   www  . j ava  2 s .c  o  m
    int colorIdx = 0;
    Map<EventClass, Color> cluster2Color = new HashMap<>();
    for (EventClass cl : results.getEventClasses()) {
        cluster2Color.put(cl, COLORS[colorIdx % COLORS.length]);
        colorIdx++;
    }
    return cluster2Color;
}

From source file:metdemo.Finance.SHNetworks.java

/**
 * //from   w w  w. ja va2 s . c o m
 * @param fileNameNetwork
 * @param hmgraph
 * @param dgraph
 * @param minEdgeWeight
 * @param vips
 * @param allAcctList
 * @throws IOException
 */
public void startFunction(String fileNameNetwork, HashMap<String, HashMap> hmgraph, int minEdgeWeight,
        HashMap<String, vipUser> vips) throws IOException {
    // allAccts = allAcctList;
    // viphm_hashmap = vips;
    m_graph = getGraph(fileNameNetwork, hmgraph, minEdgeWeight, vips);
    // dg = getDGraph(dgraph, minEdgeWeight);
    // calcPageRank(dg);

    pr = new PluggableRenderer();

    // create the OrgChart like "tree" layout
    m_layout = new FRLayout(m_graph);
    m_visualizationview = new VisualizationViewer(m_layout, pr);
    moveVertices();

    // add Shape based pick support
    m_visualizationview.setPickSupport(new ShapePickSupport());
    PickedState picked_state = m_visualizationview.getPickedState();
    picked_state.addItemListener(new PickedListItemListener());

    affineTransformer = m_visualizationview.getLayoutTransformer();

    // create decorators
    vcf = new SeedColor(picked_state);
    ewcs = new EdgeWeightStrokeFunction(dgraphEdgeWeight);
    vsh = new VertexStrokeHighlight(picked_state);
    vsh.setHighlight(true);
    ff = new FontHandler();
    vs_none = new ConstantVertexStringer(null);
    es_none = new ConstantEdgeStringer(null);
    vssa = new VertexShapeSizeAspect(voltages);
    show_edge = new DirectionDisplayPredicate(true, true);
    show_arrow = new DirectionDisplayPredicate(true, false);
    show_vertex = new VertexDisplayPredicate(false);

    // uses a gradient edge if unpicked, otherwise uses picked selection
    edgePaint = new GradientPickedEdgePaintFunction(
            new PickableEdgePaintFunction(picked_state, Color.black, Color.cyan), m_visualizationview,
            m_visualizationview, picked_state);

    pr.setVertexPaintFunction(vcf);
    pr.setVertexStrokeFunction(vsh);
    //pr.setVertexStringer(vs_none);
    pr.setVertexStringer(new VertexStringer() {

        public String getLabel(ArchetypeVertex v) {

            //can check if global show label is checked off
            if (m_showLabels.isSelected()) {
                return v.toString();
            }

            //want to only draw the string if we are in pick state
            else if (m_visualizationview.getPickedState().isPicked(v)) {
                return v.toString();
            }
            return "";
        }

    });

    // pr.setVertexFontFunction(ff);
    pr.setVertexShapeFunction(vssa);
    pr.setVertexIncludePredicate(show_vertex);

    pr.setEdgePaintFunction(edgePaint);
    pr.setEdgeStringer(es_none);
    // pr.setEdgeFontFunction(ff);
    pr.setEdgeStrokeFunction(ewcs);
    pr.setEdgeIncludePredicate(show_edge);
    pr.setEdgeShapeFunction(new EdgeShape.Line());
    pr.setEdgeArrowPredicate(show_arrow);
    JPanel jp = new JPanel();
    jp.setLayout(new BorderLayout());

    m_visualizationview.setBackground(Color.white);
    // Uncomment the following four lines, and comment the line
    // immediately following, to enable panning and zooming support
    // (including dragging of window to pan, and zooming with
    // mouse's scroll wheel).
    GraphZoomScrollPane scrollPane = new GraphZoomScrollPane(m_visualizationview);
    jp.add(scrollPane);
    m_graphmouse = new DefaultModalGraphMouse();
    m_visualizationview.setGraphMouse(m_graphmouse);

    addBottomControls(jp, vips.keySet().toArray(new String[vips.keySet().size()]));
    vssa.setScaling(true);

    m_visualizationview.setToolTipFunction(new VoltageTips());
    // vv.setToolTipText("<html><center>Use the mouse wheel to zoom<p>Click
    // and Drag the mouse to pan<p>Shift-click and Drag to
    // Rotate</center></html>");

    JFrame jf = new JFrame();
    jf.getContentPane().add(jp);
    jf.pack();
    jf.setVisible(true);
}

From source file:MyLink.java

public JPanel printableKSGenerate() {
    // create a simple graph for the demo
    graph = new SparseMultigraph<Integer, MyLink>();

    Integer[] v = createVertices(getTermNum());
    createEdges(v);/*from w  w  w .ja  va 2 s. c o  m*/

    vv = new VisualizationViewer<Integer, MyLink>(new KKLayout<Integer, MyLink>(graph));
    vv.setPreferredSize(new Dimension(520, 520)); // 570, 640 | 565, 640 

    vv.getRenderContext().setVertexLabelTransformer(new UnicodeVertexStringer<Integer>(v));
    vv.getRenderContext().setVertexLabelRenderer(new DefaultVertexLabelRenderer(Color.magenta));
    vv.getRenderContext().setEdgeLabelRenderer(new DefaultEdgeLabelRenderer(Color.magenta));
    VertexIconShapeTransformer<Integer> vertexIconShapeFunction = new VertexIconShapeTransformer<Integer>(
            new EllipseVertexShapeTransformer<Integer>());
    DefaultVertexIconTransformer<Integer> vertexIconFunction = new DefaultVertexIconTransformer<Integer>();
    vv.getRenderContext().setVertexShapeTransformer(vertexIconShapeFunction);
    vv.getRenderContext().setVertexIconTransformer(vertexIconFunction);
    loadImages(v, vertexIconFunction.getIconMap());
    vertexIconShapeFunction.setIconMap(vertexIconFunction.getIconMap());
    vv.getRenderContext().setVertexFillPaintTransformer(new PickableVertexPaintTransformer<Integer>(
            vv.getPickedVertexState(), new Color(0, 102, 255), Color.red));
    vv.getRenderContext().setEdgeDrawPaintTransformer(
            new PickableEdgePaintTransformer<MyLink>(vv.getPickedEdgeState(), Color.orange, Color.cyan));
    vv.setBackground(Color.white);

    final int maxSize = findMaxSizeNumber();

    File file = new File("./output/DESC_TERM_COUNT.txt");
    String s;

    try {
        BufferedReader fis = new BufferedReader(new InputStreamReader(new FileInputStream(file)));

        s = fis.readLine();
        userSelectedTermsCount = Integer.parseInt(s);
        termIndex = new int[userSelectedTermsCount];

        int i = 0;
        while ((s = fis.readLine()) != null) {
            String[] tmp = s.split("=");
            termIndex[i] = Integer.parseInt(tmp[1].trim());
            i++;
        }

    } catch (IOException e) {
        System.out.println(e.getMessage());
    }

    Transformer<Integer, Shape> vertexSize = new Transformer<Integer, Shape>() {
        public Shape transform(Integer i) {
            double sizeInt = termIndex[i];
            sizeInt = (double) sizeInt / (double) maxSize;
            sizeInt = (double) sizeInt * (double) 30 + 10;
            Ellipse2D circle = new Ellipse2D.Double(sizeInt / 2 * (-1), sizeInt / 2 * (-1), sizeInt, sizeInt);
            return circle;
        }
    };
    vv.getRenderContext().setVertexShapeTransformer(vertexSize);
    vv.getRenderer().getVertexLabelRenderer().setPosition(Position.N);

    // add my listener for ToolTips
    vv.setVertexToolTipTransformer(new ToStringLabeller<Integer>());

    // create a frome to hold the graph
    APanel = new JPanel();
    APanel.setLayout(new BoxLayout(APanel, BoxLayout.Y_AXIS));

    final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv);

    final ModalGraphMouse gm = new DefaultModalGraphMouse<Integer, Number>();
    vv.setGraphMouse(gm);

    final ScalingControl scaler = new CrossoverScalingControl();

    JButton plus = new JButton("+");
    plus.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            scaler.scale(vv, 1.1f, vv.getCenter());
        }
    });
    JButton minus = new JButton("-");
    minus.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            scaler.scale(vv, 1 / 1.1f, vv.getCenter());
        }
    });

    JCheckBox lo = new JCheckBox("Show Labels");
    lo.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            showLabels = e.getStateChange() == ItemEvent.SELECTED;

            vv.repaint();
        }
    });
    lo.setSelected(true);

    JPanel controls = new JPanel();
    controls.add(plus);
    controls.add(minus);
    controls.add(lo);
    controls.add(((DefaultModalGraphMouse<Integer, Number>) gm).getModeComboBox());
    APanel.add(vv);
    APanel.add(controls);

    return APanel;
}

From source file:com.polivoto.vistas.acciones.Datos.java

private void setcolors() {
    colores.add(Color.red);/* w  ww  .j ava2 s.  c om*/
    colores.add(Color.green);
    colores.add(Color.blue);
    colores.add(Color.yellow);
    colores.add(Color.magenta);
    colores.add(Color.cyan);
    colores.add(Color.pink);
    colores.add(Color.orange);
    colores.add(Color.darkGray);
    colores.add(Color.white);
}

From source file:edu.umn.cs.spatialHadoop.OperationsParams.java

public static Color getColor(Configuration conf, String key, Color defaultValue) {
    String colorName = conf.get(key);
    if (colorName == null)
        return defaultValue;

    colorName = colorName.toLowerCase();
    Color color = defaultValue;/*from   ww  w.  j a va 2  s  . c  om*/
    if (colorName.equals("red")) {
        color = Color.RED;
    } else if (colorName.equals("pink")) {
        color = Color.PINK;
    } else if (colorName.equals("blue")) {
        color = Color.BLUE;
    } else if (colorName.equals("cyan")) {
        color = Color.CYAN;
    } else if (colorName.equals("green")) {
        color = Color.GREEN;
    } else if (colorName.equals("black")) {
        color = Color.BLACK;
    } else if (colorName.equals("white")) {
        color = Color.WHITE;
    } else if (colorName.equals("gray")) {
        color = Color.GRAY;
    } else if (colorName.equals("yellow")) {
        color = Color.YELLOW;
    } else if (colorName.equals("orange")) {
        color = Color.ORANGE;
    } else if (colorName.equals("none")) {
        color = new Color(0, 0, 255, 0);
    } else if (colorName.matches("#[a-zA-Z0-9]{8}")) {
        String redHex = colorName.substring(1, 2);
        String greenHex = colorName.substring(3, 4);
        String blueHex = colorName.substring(5, 6);
        String opacityHex = colorName.substring(7, 8);
        int red = Integer.parseInt(redHex, 16);
        int green = Integer.parseInt(greenHex, 16);
        int blue = Integer.parseInt(blueHex, 16);
        int opacity = Integer.parseInt(opacityHex, 16);
        color = new Color(red, green, blue, opacity);
    } else {
        LOG.warn("Does not understand the color '" + conf.get(key) + "'");
    }

    return color;
}

From source file:monitor.processing.OLD.Drawing3D.java

public void drawTree(BaseNode n, RealVector v) {

    Color c = Color.WHITE;

    if (n instanceof TransformNode) {
        //v = ((TransformNode) n).getTrasformMatrix().getColumnVector(3);
        v = ((TransformNode) n).getTrasformMatrix().operate(v);
        //stroke(0, 0, 255);
        //            line((float) bef[0] * scale, (float) bef[1] * scale, (float) bef[2] * scale, (float) att[0] * scale, (float) att[1] * scale, (float) att[2] * scale);

        c = Color.BLACK;// ww w .jav a2  s . c om
    } else if (n instanceof StaticMesh) {
        StaticMesh sm = (StaticMesh) n;

        if (sm.isTransparent()) {
            c = Color.BLUE;
        } else if (sm.isVisible()) {
            //                System.out.println(n.getInfo());
            //                System.out.println(v);
            c = Color.RED;
            if (sm.getModel().contains("naohead") || sm.getModel().contains("naobody")) {
                c = Color.PINK;
            }
        } else {
            c = Color.CYAN;
        }

    } else if (n instanceof StaticMeshNode) {
        StaticMeshNode smn = (StaticMeshNode) n;

        if (smn.isTransparent()) {
            c = Color.GREEN;
            //                cameraSceneX = (float)v.getEntry(0);
            //                cameraSceneY = (float)v.getEntry(1);
            //                cameraSceneZ = (float)v.getEntry(2);
        } else if (smn.isVisible()) {
            c = Color.YELLOW;
        } else {
            c = Color.MAGENTA;
        }

    }

    //        if (n.getInfo().contains("naohead")){
    //            c = Color.CYAN;
    //            pushMatrix();
    //            fill(c.getRed(), c.getGreen(), c.getBlue());
    //
    //            noStroke();
    //            translate((float) (scale * v.getEntry(0)), (float) (-scale * v.getEntry(1)), (float) (scale * v.getEntry(2)));
    //            box(50);
    //            popMatrix();
    //        }

    pushMatrix();
    fill(c.getRed(), c.getGreen(), c.getBlue());
    noStroke();
    translate((float) (scale * v.getEntry(0)), (float) (-scale * v.getEntry(1)),
            (float) (scale * v.getEntry(2)));
    box(0.05f * scale);
    popMatrix();

    if (n.getAddress() == selected) {
        path.add(v);
        pushMatrix();
        fill(0, 255, 255, selectedAlpha);
        selectedAlpha += (selectedAlpha >= 255) ? -255 : 10;
        noStroke();
        translate((float) (scale * v.getEntry(0)), (float) (-scale * v.getEntry(1)),
                (float) (scale * v.getEntry(2)));
        pushMatrix();
        //rotateX(t);
        rotateZ(selectedTheta);
        selectedTheta += 1 / 8f;
        box(0.1f * scale);
        popMatrix();
        // info
        rotateZ(PI / 2);
        rotateX(-PI / 2);
        translate(0.1f * scale, -0.1f * scale);
        fill(0);
        textSize(0.1f * scale);
        text(n.getInfo(), 0, 0, 0);

        popMatrix();

        RealVector ant = null;
        int o = 0;

        for (RealVector w : path) {
            if (ant != null) {
                stroke(o, 255 - o, 0, 200);
                //                    System.out.println(ant);
                //                    System.out.println(w);
                line((float) ant.getEntry(0) * scale, (float) ant.getEntry(1) * -scale,
                        (float) ant.getEntry(2) * scale, (float) w.getEntry(0) * scale,
                        (float) w.getEntry(1) * -scale, (float) w.getEntry(2));
                o += (o >= 255) ? -200 : 10;
            }
            ant = w;

            pushMatrix();
            stroke(255, 255, 0, 200);
            translate((float) (scale * w.getEntry(0)), (float) (-scale * w.getEntry(1)),
                    (float) (scale * w.getEntry(2)));

            box(2);
            popMatrix();
        }
    }

    for (int a = n.getChildren().size() - 1; a >= 0; a--) {
        drawTree(((ArrayList<BaseNode>) n.getChildren()).get(a), v);
    }

}

From source file:com.jaspersoft.studio.components.chart.editor.wizard.BaseSettingsFactory.java

/**
 *
 *//*ww  w .  j ava 2  s .co m*/
public static final ChartThemeSettings createChartThemeSettings() {
    ChartThemeSettings settings = new ChartThemeSettings();

    ChartSettings chartSettings = settings.getChartSettings();
    chartSettings.setBackgroundPaint(new GradientPaintProvider(CHART_BACKGROUND1, CHART_BACKGROUND2));
    chartSettings.setBackgroundImage(
            new FileImageProvider("net/sf/jasperreports/chartthemes/simple/jasperreports.png"));
    chartSettings.setBackgroundImageAlignment(new Integer(Align.TOP_RIGHT));
    chartSettings.setBackgroundImageAlpha(new Float(1f));
    chartSettings.setBorderVisible(Boolean.FALSE);
    chartSettings.setBorderPaint(new ColorProvider(Color.BLACK));
    chartSettings.setBorderStroke(new BasicStroke(1f));
    chartSettings.setAntiAlias(Boolean.TRUE);
    chartSettings.setTextAntiAlias(Boolean.TRUE);
    chartSettings.setPadding(new RectangleInsets(UnitType.ABSOLUTE, 1.1, 2.2, 3.3, 4.4));

    TitleSettings titleSettings = settings.getTitleSettings();
    titleSettings.setShowTitle(Boolean.TRUE);
    titleSettings.setPosition(EdgeEnum.TOP);
    titleSettings.setForegroundPaint(new ColorProvider(Color.black));
    titleSettings.setBackgroundPaint(new ColorProvider(TITLE_BACKGROUND));
    titleSettings.getFont().setBold(Boolean.TRUE);
    titleSettings.getFont().setFontSize(22);
    titleSettings.setHorizontalAlignment(HorizontalAlignment.CENTER);
    titleSettings.setVerticalAlignment(VerticalAlignment.TOP);
    titleSettings.setPadding(new RectangleInsets(UnitType.ABSOLUTE, 1.1, 2.2, 3.3, 4.4));

    TitleSettings subtitleSettings = settings.getSubtitleSettings();
    subtitleSettings.setShowTitle(Boolean.TRUE);
    subtitleSettings.setPosition(EdgeEnum.TOP);
    subtitleSettings.setForegroundPaint(new ColorProvider(Color.BLACK));
    subtitleSettings.setBackgroundPaint(new ColorProvider(SUBTITLE_BACKGROUND));
    subtitleSettings.getFont().setBold(Boolean.TRUE);
    subtitleSettings.setHorizontalAlignment(HorizontalAlignment.CENTER);
    subtitleSettings.setVerticalAlignment(VerticalAlignment.TOP);
    subtitleSettings.setPadding(new RectangleInsets(UnitType.ABSOLUTE, 1.1, 2.2, 3.3, 4.4));

    LegendSettings legendSettings = settings.getLegendSettings();
    legendSettings.setShowLegend(Boolean.TRUE);
    legendSettings.setPosition(EdgeEnum.BOTTOM);
    legendSettings.setForegroundPaint(new ColorProvider(Color.black));
    legendSettings.setBackgroundPaint(new ColorProvider(Color.white));
    legendSettings.getFont().setBold(Boolean.TRUE);
    legendSettings.getFont().setFontSize(7);
    legendSettings.setHorizontalAlignment(HorizontalAlignment.CENTER);
    legendSettings.setVerticalAlignment(VerticalAlignment.BOTTOM);
    //FIXMETHEME legendSettings.setBlockFrame();
    legendSettings.setPadding(new RectangleInsets(UnitType.ABSOLUTE, 1.1, 2.2, 3.3, 4.4));

    PlotSettings plotSettings = settings.getPlotSettings();
    plotSettings.setOrientation(PlotOrientation.VERTICAL);
    //      plotSettings.setForegroundAlpha(new Float(0.5f));
    plotSettings.setBackgroundPaint(new ColorProvider(Color.white));
    plotSettings.setBackgroundAlpha(new Float(0.0f));
    plotSettings.setBackgroundImage(
            new FileImageProvider("net/sf/jasperreports/chartthemes/simple/jasperreports.png"));
    plotSettings.setBackgroundImageAlpha(new Float(0.5f));
    plotSettings.setBackgroundImageAlignment(new Integer(Align.NORTH_WEST));
    plotSettings.setLabelRotation(new Double(0));
    plotSettings.setPadding(new RectangleInsets(UnitType.ABSOLUTE, 1.1, 2.2, 3.3, 4.4));
    plotSettings.setOutlineVisible(Boolean.TRUE);
    plotSettings.setOutlinePaint(new ColorProvider(Color.BLACK));
    plotSettings.setOutlineStroke(new BasicStroke(1f));
    plotSettings.setSeriesColorSequence(COLORS);
    //      plotSettings.setSeriesGradientPaintSequence(GRADIENT_PAINTS);
    plotSettings.setSeriesOutlinePaintSequence(COLORS_DARKER);
    plotSettings.setSeriesStrokeSequence(STROKES);
    plotSettings.setSeriesOutlineStrokeSequence(OUTLINE_STROKES);
    plotSettings.setDomainGridlineVisible(Boolean.TRUE);
    plotSettings.setDomainGridlinePaint(new ColorProvider(Color.BLACK));
    plotSettings.setDomainGridlineStroke(new BasicStroke(0.5f));
    plotSettings.setRangeGridlineVisible(Boolean.TRUE);
    plotSettings.setRangeGridlinePaint(new ColorProvider(Color.BLACK));
    plotSettings.setRangeGridlineStroke(new BasicStroke(0.5f));
    plotSettings.getTickLabelFont().setFontName("Arial");
    plotSettings.getTickLabelFont().setBold(Boolean.TRUE);
    plotSettings.getTickLabelFont().setFontSize(10);
    plotSettings.getDisplayFont().setFontName("Arial");
    plotSettings.getDisplayFont().setBold(Boolean.TRUE);
    plotSettings.getDisplayFont().setFontSize(12);

    AxisSettings domainAxisSettings = settings.getDomainAxisSettings();
    domainAxisSettings.setVisible(Boolean.TRUE);
    domainAxisSettings.setLocation(AxisLocation.BOTTOM_OR_RIGHT);
    domainAxisSettings.setLinePaint(new ColorProvider(Color.white));
    domainAxisSettings.setLineStroke(new BasicStroke(1f));
    domainAxisSettings.setLineVisible(Boolean.TRUE);
    //      domainAxisSettings.setLabel("Domain Axis");
    domainAxisSettings.setLabelAngle(new Double(0.0));
    domainAxisSettings.setLabelPaint(new ColorProvider(Color.black));
    domainAxisSettings.getLabelFont().setBold(Boolean.TRUE);
    domainAxisSettings.getLabelFont().setItalic(Boolean.FALSE);
    domainAxisSettings.getLabelFont().setFontName("Times New Roman");
    domainAxisSettings.getLabelFont().setFontSize(10);
    domainAxisSettings.setLabelInsets(new RectangleInsets(UnitType.ABSOLUTE, 0.5, 0.5, 1, 1));
    domainAxisSettings.setLabelVisible(Boolean.TRUE);
    domainAxisSettings.setTickLabelPaint(new ColorProvider(Color.cyan));
    domainAxisSettings.getTickLabelFont().setBold(Boolean.TRUE);
    domainAxisSettings.getTickLabelFont().setItalic(Boolean.FALSE);
    domainAxisSettings.getTickLabelFont().setFontName("Times New Roman");
    domainAxisSettings.getTickLabelFont().setFontSize(7);
    domainAxisSettings.getTickLabelFont().setItalic(Boolean.TRUE);
    domainAxisSettings.setTickLabelInsets(new RectangleInsets(UnitType.ABSOLUTE, 0.5, 0.5, 0.5, 0.5));
    domainAxisSettings.setTickLabelsVisible(Boolean.TRUE);
    domainAxisSettings.setTickMarksInsideLength(new Float(0.1f));
    domainAxisSettings.setTickMarksOutsideLength(new Float(0.2f));
    domainAxisSettings.setTickMarksPaint(new ColorProvider(Color.black));
    domainAxisSettings.setTickMarksStroke(new BasicStroke(1f));
    domainAxisSettings.setTickMarksVisible(Boolean.TRUE);
    domainAxisSettings.setTickCount(new Integer(5));

    AxisSettings rangeAxisSettings = settings.getRangeAxisSettings();
    rangeAxisSettings.setVisible(Boolean.TRUE);
    rangeAxisSettings.setLocation(AxisLocation.TOP_OR_RIGHT);
    rangeAxisSettings.setLinePaint(new ColorProvider(Color.white));
    rangeAxisSettings.setLineStroke(new BasicStroke(1f));
    rangeAxisSettings.setLineVisible(Boolean.TRUE);
    //      rangeAxisSettings.setLabel("Range Axis");
    rangeAxisSettings.setLabelAngle(new Double(Math.PI / 2.0));
    rangeAxisSettings.setLabelPaint(new ColorProvider(Color.black));
    rangeAxisSettings.getLabelFont().setBold(Boolean.TRUE);
    rangeAxisSettings.getLabelFont().setItalic(Boolean.FALSE);
    rangeAxisSettings.getLabelFont().setFontName("Times New Roman");
    rangeAxisSettings.getLabelFont().setFontSize(10);
    rangeAxisSettings.setLabelInsets(new RectangleInsets(UnitType.ABSOLUTE, 0.5, 0.5, 1, 1));
    rangeAxisSettings.setLabelVisible(Boolean.TRUE);
    rangeAxisSettings.setTickLabelPaint(new ColorProvider(Color.pink));
    rangeAxisSettings.getTickLabelFont().setBold(Boolean.FALSE);
    rangeAxisSettings.getTickLabelFont().setItalic(Boolean.FALSE);
    rangeAxisSettings.getTickLabelFont().setFontName("Times New Roman");
    rangeAxisSettings.getTickLabelFont().setFontSize(7);
    rangeAxisSettings.getTickLabelFont().setItalic(Boolean.TRUE);
    rangeAxisSettings.setTickLabelInsets(new RectangleInsets(UnitType.ABSOLUTE, 0.5, 0.5, 0.5, 0.5));
    rangeAxisSettings.setTickLabelsVisible(Boolean.TRUE);
    rangeAxisSettings.setTickMarksInsideLength(new Float(0.2f));
    rangeAxisSettings.setTickMarksOutsideLength(new Float(0.1f));
    rangeAxisSettings.setTickMarksPaint(new ColorProvider(Color.black));
    rangeAxisSettings.setTickMarksStroke(new BasicStroke(1f));
    rangeAxisSettings.setTickMarksVisible(Boolean.TRUE);
    rangeAxisSettings.setTickCount(new Integer(6));

    return settings;
}

From source file:Interface.FoodCollectionSupervisor.TypesOfFoodRestaurant.java

private void btnCalculateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCalculateActionPerformed
    // TODO add your handling code here:
    Date toDate1 = jDateChooser1.getDate();
    Date toDate2 = jDateChooser2.getDate();
    if ((toDate1 == null) || (toDate2 == null)) {
        JOptionPane.showMessageDialog(null, "Invalid date..Kindly enter valid date.");
        return;/*from   ww w .  j  ava2 s  .  c o  m*/
    }
    long fromDate = (jDateChooser1.getDate().getTime()) / (1000 * 60 * 60 * 24);
    long toDate = (jDateChooser2.getDate().getTime()) / (1000 * 60 * 60 * 24);
    int homeFoodType = 0;
    int cannedType = 0;
    int purchasedType = 0;

    for (WorkRequest request : organization.getWorkQueue().getWorkRequestList()) {

        long requestDate = (request.getRequestDate().getTime()) / (1000 * 60 * 60 * 24);
        Employee e = request.getSender().getEmployee();
        if (e instanceof RestaurantEmployee) {
            if ((requestDate >= fromDate) && (requestDate <= toDate)) {

                if (!request.getStatus().equalsIgnoreCase("New Request")) {

                    if (((FoodCollectionWorkRequest) request).getFood().getFoodType()
                            .equalsIgnoreCase("Canned Food")) {
                        cannedType++;
                    } else if (((FoodCollectionWorkRequest) request).getFood().getFoodType()
                            .equalsIgnoreCase("Home made Food")) {
                        homeFoodType++;

                    } else if (((FoodCollectionWorkRequest) request).getFood().getFoodType()
                            .equalsIgnoreCase("Purchased Food")) {
                        purchasedType++;
                    }

                }
            }
            //                else{
            //                    
            //                    JOptionPane.showMessageDialog(null, "There are no records for this search criteria.");
            //                }
        }

    }

    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    dataset.setValue(cannedType, "Number of food collected", "Canned Food");
    dataset.setValue(purchasedType, "Number of food collected", "Purchased Food");
    dataset.setValue(homeFoodType, "Number of food collected", "Home made Food");

    JFreeChart chart = ChartFactory.createBarChart("Restaurants-Different types of food collected",
            "Types of food", "Number of food collected", dataset, PlotOrientation.VERTICAL, false, true, false);
    CategoryPlot plot = chart.getCategoryPlot();
    plot.setRangeGridlinePaint(Color.CYAN);
    ChartFrame frame = new ChartFrame("Bar Chart for Types of food collected", chart);
    frame.setVisible(true);
    frame.setSize(450, 350);
}

From source file:uk.co.real_logic.aeron.tools.perf_tools.AeronLatencyUnderLoadPublisher.java

private void generateScatterPlot() throws IOException {
    final BufferedImage image = new BufferedImage(1800, 1000, BufferedImage.TYPE_INT_ARGB);
    final Graphics2D g2 = image.createGraphics();
    final FontMetrics fm = g2.getFontMetrics();
    final String filename = "throughputency.png";
    final File imageFile = new File(filename);

    final int height = 940;
    double min = Double.MAX_VALUE;
    double max = Double.MIN_VALUE;
    for (final long timestamp : timestamps) {
        final double ts = timestamp / 1000.0;
        if (ts < min) {
            min = ts;//from   w w  w .jav a 2 s  .  c  om
        }
        if (ts > max) {
            max = ts;
        }
    }
    final double stepY = height / max;

    g2.setColor(Color.white);
    g2.fillRect(0, 0, 1800, 1000);
    g2.setColor(Color.black);
    g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
    g2.drawString("Latency ScatterPlot (microseconds)",
            900 - fm.stringWidth("Latency ScatterPlot (microseconds)") / 2, 20);
    g2.drawString("" + max, 10, 20);
    g2.drawLine(100, 20, 100, 960);
    g2.drawLine(100, 960, 1790, 960);
    int start = 0;
    int end = 100;
    final double width = 1690.0 / 7.0;
    g2.setColor(Color.red);
    plotSubset(g2, start, end, "10 msgs/sec", 100, width, stepY, means[0]);

    start = 100;
    end = 1100;
    g2.setColor(Color.green);
    plotSubset(g2, start, end, "100 msgs/sec", 100 + width, width, stepY, means[1]);

    start = 1100;
    end = 11100;
    g2.setColor(Color.blue);
    plotSubset(g2, start, end, "1K msgs/sec", 100 + width * 2, width, stepY, means[2]);

    start = 11100;
    end = 111100;
    g2.setColor(Color.cyan);
    plotSubset(g2, start, end, "10K msgs/sec", 100 + width * 3, width, stepY, means[3]);

    start = 111100;
    end = 1111100;
    g2.setColor(Color.magenta);
    plotSubset(g2, start, end, "100K msgs/sec", 100 + width * 4, width, stepY, means[4]);

    start = 1111100;
    end = 11111100;
    g2.setColor(Color.yellow);
    plotSubset(g2, start, end, "1M msgs/sec", 100 + width * 5, width, stepY, means[5]);

    start = 11111100;
    end = 41111100;
    g2.setColor(Color.orange);
    plotSubset(g2, start, end, "3M msgs/sec", 100 + width * 6, width, stepY, means[6]);

    ImageIO.write(image, "png", imageFile);
}