Example usage for java.awt Color magenta

List of usage examples for java.awt Color magenta

Introduction

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

Prototype

Color magenta

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

Click Source Link

Document

The color magenta.

Usage

From source file:org.zaproxy.zap.extension.ascan.ScanProgressDialog.java

/**
 * /*from ww w .  ja va 2 s . com*/
 */
private void initialize() {
    this.setSize(new Dimension(580, 504));

    if (site != null) {
        this.setTitle(MessageFormat.format(Constant.messages.getString("ascan.progress.title"), site));
    }

    JTabbedPane tabbedPane = new JTabbedPane();
    JPanel tab1 = new JPanel();
    tab1.setLayout(new GridBagLayout());

    JPanel hostPanel = new JPanel();
    hostPanel.setLayout(new GridBagLayout());
    hostPanel.add(new JLabel(Constant.messages.getString("ascan.progress.label.host")),
            LayoutHelper.getGBC(0, 0, 1, 0.4D));
    hostPanel.add(getHostSelect(), LayoutHelper.getGBC(1, 0, 1, 0.6D));
    tab1.add(hostPanel, LayoutHelper.getGBC(0, 0, 3, 1.0D, 0.0D));

    tab1.add(getJScrollPane(), LayoutHelper.getGBC(0, 1, 3, 1.0D, 1.0D));

    tab1.add(new JLabel(), LayoutHelper.getGBC(0, 1, 1, 1.0D, 0.0D)); // spacer
    tab1.add(getCloseButton(), LayoutHelper.getGBC(1, 2, 1, 0.0D, 0.0D));
    tab1.add(new JLabel(), LayoutHelper.getGBC(2, 1, 1, 1.0D, 0.0D)); // spacer

    tabbedPane.insertTab(Constant.messages.getString("ascan.progress.tab.progress"), null, tab1, null, 0);
    this.add(tabbedPane);

    int mins = extension.getScannerParam().getMaxChartTimeInMins();
    if (mins > 0) {
        // Treat zero mins as disabled
        JPanel tab2 = new JPanel();
        tab2.setLayout(new GridBagLayout());

        this.seriesTotal = new TimeSeries("TotalResponses"); // Name not shown, so no need to i18n
        final TimeSeriesCollection dataset = new TimeSeriesCollection(this.seriesTotal);

        this.series100 = new TimeSeries(Constant.messages.getString("ascan.progress.chart.1xx"));
        this.series200 = new TimeSeries(Constant.messages.getString("ascan.progress.chart.2xx"));
        this.series300 = new TimeSeries(Constant.messages.getString("ascan.progress.chart.3xx"));
        this.series400 = new TimeSeries(Constant.messages.getString("ascan.progress.chart.4xx"));
        this.series500 = new TimeSeries(Constant.messages.getString("ascan.progress.chart.5xx"));

        this.seriesTotal.setMaximumItemAge(mins * 60);
        this.series100.setMaximumItemAge(mins * 60);
        this.series200.setMaximumItemAge(mins * 60);
        this.series300.setMaximumItemAge(mins * 60);
        this.series400.setMaximumItemAge(mins * 60);
        this.series500.setMaximumItemAge(mins * 60);

        dataset.addSeries(series100);
        dataset.addSeries(series200);
        dataset.addSeries(series300);
        dataset.addSeries(series400);
        dataset.addSeries(series500);

        chart = createChart(dataset);
        // Set up some vaguesly sensible colours
        chart.getXYPlot().getRenderer(0).setSeriesPaint(0, Color.BLACK); // Totals
        chart.getXYPlot().getRenderer(0).setSeriesPaint(1, Color.GRAY); // 100: Info
        chart.getXYPlot().getRenderer(0).setSeriesPaint(2, Color.GREEN); // 200: OK
        chart.getXYPlot().getRenderer(0).setSeriesPaint(3, Color.BLUE); // 300: Info
        chart.getXYPlot().getRenderer(0).setSeriesPaint(4, Color.MAGENTA); // 400: Bad req
        chart.getXYPlot().getRenderer(0).setSeriesPaint(5, Color.RED); // 500: Internal error

        final ChartPanel chartPanel = new ChartPanel(chart);
        tab2.add(chartPanel, LayoutHelper.getGBC(0, 0, 1, 1.0D, 1.0D));

        tabbedPane.insertTab(Constant.messages.getString("ascan.progress.tab.chart"), null, tab2, null, 1);
    }

    // Stop the updating thread when the window is closed
    this.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosed(WindowEvent e) {
            stopThread = true;
        }
    });
}

From source file:visualizer.datamining.dataanalysis.NeighborhoodHit.java

private JFreeChart createChart(XYDataset xydataset) {
    JFreeChart chart = ChartFactory.createXYLineChart("Neighborhood Hit", "Number Neighbors", "Precision",
            xydataset, PlotOrientation.VERTICAL, true, true, false);

    chart.setBackgroundPaint(Color.WHITE);

    XYPlot xyplot = (XYPlot) chart.getPlot();
    NumberAxis numberaxis = (NumberAxis) xyplot.getRangeAxis();
    numberaxis.setAutoRangeIncludesZero(false);

    xyplot.setDomainGridlinePaint(Color.BLACK);
    xyplot.setRangeGridlinePaint(Color.BLACK);

    xyplot.setOutlinePaint(Color.BLACK);
    xyplot.setOutlineStroke(new BasicStroke(1.0f));
    xyplot.setBackgroundPaint(Color.white);
    xyplot.setDomainCrosshairVisible(true);
    xyplot.setRangeCrosshairVisible(true);

    xyplot.setDrawingSupplier(new DefaultDrawingSupplier(
            new Paint[] { Color.RED, Color.BLUE, Color.GREEN, Color.MAGENTA, Color.CYAN, Color.ORANGE,
                    Color.BLACK, Color.DARK_GRAY, Color.GRAY, Color.LIGHT_GRAY, Color.YELLOW },
            DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE));

    XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer) xyplot.getRenderer();
    xylineandshaperenderer.setBaseShapesVisible(true);
    xylineandshaperenderer.setBaseShapesFilled(true);
    xylineandshaperenderer.setDrawOutlines(true);

    return chart;
}

From source file:Logic.FinanceController.java

public void drawYearlyChart(String olddate, String newdate) {
    int[] valuesOld;
    int[] valuesnew;
    valuesOld = getFinacialRecords(olddate);
    valuesnew = getFinacialRecords(newdate);
    int oldcost = -(valuesOld[1] + valuesOld[2] + valuesOld[3]);
    int oldprofit = valuesOld[0] - oldcost;

    int newcost = -(valuesnew[1] + valuesnew[2] + valuesnew[3]);
    int newprofit = valuesnew[0] - newcost;

    DefaultCategoryDataset data = new DefaultCategoryDataset();
    data.setValue(valuesOld[0], olddate, "Sales");
    data.setValue(oldcost, olddate, "Cost");
    data.setValue(oldprofit, olddate, "Profit");

    data.setValue(valuesnew[0], newdate, "Sales");
    data.setValue(newcost, newdate, "Cost");
    data.setValue(newprofit, newdate, "Profit");

    JFreeChart chart = ChartFactory.createBarChart3D("Profit Analysis", "Years", "Values in Rupees", data,
            PlotOrientation.VERTICAL, true, true, false);

    CategoryPlot p = chart.getCategoryPlot();
    p.setRangeGridlinePaint(Color.MAGENTA);
    ChartFrame frame = new ChartFrame("Testing", chart);
    frame.setVisible(true);//  ww  w  .j  av a2 s  .c  o  m
    frame.setLocation(910, 100);
    frame.setSize(400, 400);
}

From source file:patientview.HistoryJFrame.java

public void genGraph(int code) {
    //ArrayList<LiveData> data = thisPatient.getLiveDatahistory(timerCSeconds); //Displays live data up untill the current moment
    ArrayList<LiveData> data = thisPatient.getAllLiveData();

    //create and populate graph
    XYSeries rr = new XYSeries("Respiratory rate (breaths/min)");
    XYSeries os = new XYSeries("Oxygen saturation (%)");
    XYSeries t = new XYSeries("Temperature (C)");
    XYSeries sbp = new XYSeries("Systolic blood pressure (mmHg)");
    XYSeries hr = new XYSeries("Heart rate (beats/min)");

    for (int i = 0; i < data.size(); i++) {
        rr.add(i * 5, data.get(i).rr);/*ww w  .j a va2s.c om*/
        os.add(i * 5, data.get(i).os);
        t.add(i * 5, data.get(i).t);
        sbp.add(i * 5, data.get(i).sbp);
        hr.add(i * 5, data.get(i).hr);
    }

    XYDataset xyDataset1 = new XYSeriesCollection(rr);
    XYDataset xyDataset2 = new XYSeriesCollection(os);
    XYDataset xyDataset3 = new XYSeriesCollection(t);
    XYDataset xyDataset4 = new XYSeriesCollection(sbp);
    XYDataset xyDataset5 = new XYSeriesCollection(hr);

    JFreeChart chart = ChartFactory.createXYLineChart(thisPatient.getFullName(), "Time (s)", "", null,
            PlotOrientation.VERTICAL, true, true, false);

    this.plot = chart.getXYPlot();

    this.plot.setRenderer(0, new StandardXYItemRenderer());
    this.plot.setRenderer(1, new StandardXYItemRenderer());
    this.plot.setRenderer(2, new StandardXYItemRenderer());
    this.plot.setRenderer(3, new StandardXYItemRenderer());
    this.plot.setRenderer(4, new StandardXYItemRenderer());

    boolean markers = false;
    if ((code & 32) == 32) {
        markers = true;
    }
    //respiratory rate
    if ((code & 1) == 1) {
        this.plot.setDataset(0, xyDataset1);
        if (markers) {
            IntervalMarker zone = new IntervalMarker(9, 20);
            zone.setPaint(new Color(255, 0, 0, 64));
            plot.addRangeMarker(zone);
        }
        this.plot.getRendererForDataset(plot.getDataset(0)).setSeriesPaint(0, Color.red);
    }
    //oxygen saturation
    if ((code & 2) == 2) {
        this.plot.setDataset(1, xyDataset2);
        if (markers) {
            IntervalMarker zone = new IntervalMarker(93, 100);
            zone.setPaint(new Color(0, 255, 0, 64));
            plot.addRangeMarker(zone);
        }
        this.plot.getRendererForDataset(plot.getDataset(1)).setSeriesPaint(0, Color.green);
    }
    //temperature
    if ((code & 4) == 4) {
        this.plot.setDataset(2, xyDataset3);
        if (markers) {
            IntervalMarker zone = new IntervalMarker(36, 37.9);
            zone.setPaint(new Color(0, 0, 255, 64));
            plot.addRangeMarker(zone);
        }
        this.plot.getRendererForDataset(plot.getDataset(2)).setSeriesPaint(0, Color.blue);
    }
    //systolic blood pressure
    if ((code & 8) == 8) {
        this.plot.setDataset(3, xyDataset4);
        if (markers) {
            IntervalMarker zone = new IntervalMarker(100, 199);
            zone.setPaint(new Color(255, 255, 0, 64));
            plot.addRangeMarker(zone);
        }
        this.plot.getRendererForDataset(plot.getDataset(3)).setSeriesPaint(0, Color.yellow);
    }
    //heart rate
    if ((code & 16) == 16) {
        this.plot.setDataset(4, xyDataset5);
        if (markers) {
            IntervalMarker zone = new IntervalMarker(50, 99);
            zone.setPaint(new Color(255, 0, 255, 64));
            plot.addRangeMarker(zone);
        }
        this.plot.getRendererForDataset(plot.getDataset(4)).setSeriesPaint(0, Color.magenta);
    }

    graphPanel.removeAll();
    cp = new ChartPanel(chart);
    cp.setMouseWheelEnabled(true);
    cp.setPreferredSize(new Dimension(640, 480));
    graphPanel.setLayout(new java.awt.BorderLayout());
    graphPanel.add(cp, java.awt.BorderLayout.CENTER);
    graphPanel.validate();

}

From source file:savant.view.tracks.VariantTrackRenderer.java

@Override
public void drawLegend(Graphics2D g2, DrawingMode ignored) {
    int x = 6, y = 17;
    drawBaseLegend(g2, x, y, ColourKey.A, ColourKey.C, ColourKey.G, ColourKey.T);

    y += LEGEND_LINE_HEIGHT;//from ww  w  .  ja  v  a 2 s  .c  o m
    g2.setColor(Color.BLACK);
    g2.fillRect(x, y - SWATCH_SIZE.height + 2, SWATCH_SIZE.width, SWATCH_SIZE.height);
    g2.setColor(Color.BLACK);
    g2.drawString("Deletion", x + SWATCH_SIZE.width + 3, y);
    x += 66;
    g2.setColor(Color.MAGENTA);
    g2.fillRect(x, y - SWATCH_SIZE.height + 2, SWATCH_SIZE.width, SWATCH_SIZE.height);
    g2.setColor(Color.BLACK);
    g2.drawString("Insertion", x + 12, y);
    y += LEGEND_LINE_HEIGHT;
    g2.drawString("Translucent = Heterozygous", 6, y);
}

From source file:visualizer.datamining.dataanalysis.NeighborhoodPreservation.java

private JFreeChart createChart(XYDataset xydataset) {
    JFreeChart chart = ChartFactory.createXYLineChart("Neighborhood Preservation", "Number Neighbors",
            "Precision", xydataset, PlotOrientation.VERTICAL, true, true, false);

    chart.setBackgroundPaint(Color.WHITE);

    XYPlot xyplot = (XYPlot) chart.getPlot();
    NumberAxis numberaxis = (NumberAxis) xyplot.getRangeAxis();
    numberaxis.setAutoRangeIncludesZero(false);

    xyplot.setDomainGridlinePaint(Color.BLACK);
    xyplot.setRangeGridlinePaint(Color.BLACK);

    xyplot.setOutlinePaint(Color.BLACK);
    xyplot.setOutlineStroke(new BasicStroke(1.0f));
    xyplot.setBackgroundPaint(Color.white);
    xyplot.setDomainCrosshairVisible(true);
    xyplot.setRangeCrosshairVisible(true);

    xyplot.setDrawingSupplier(new DefaultDrawingSupplier(
            new Paint[] { Color.RED, Color.BLUE, Color.GREEN, Color.MAGENTA, Color.CYAN, Color.ORANGE,
                    Color.BLACK, Color.DARK_GRAY, Color.GRAY, Color.LIGHT_GRAY, Color.YELLOW },
            DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE));

    XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer) xyplot.getRenderer();
    xylineandshaperenderer.setBaseShapesVisible(true);
    xylineandshaperenderer.setBaseShapesFilled(true);
    xylineandshaperenderer.setDrawOutlines(true);

    return chart;
}

From source file:visualizer.datamining.dataanalysis.CreateLineGraph.java

private JFreeChart createChart(XYDataset xydataset, String title, String xtitle, String ytitle) {
    JFreeChart chart = ChartFactory.createXYLineChart(title, xtitle, ytitle, xydataset,
            PlotOrientation.VERTICAL, true, true, false);

    chart.setBackgroundPaint(Color.WHITE);

    XYPlot xyplot = (XYPlot) chart.getPlot();
    NumberAxis numberaxis = (NumberAxis) xyplot.getRangeAxis();
    numberaxis.setAutoRangeIncludesZero(false);

    xyplot.setDomainGridlinePaint(Color.BLACK);
    xyplot.setRangeGridlinePaint(Color.BLACK);

    xyplot.setOutlinePaint(Color.BLACK);
    xyplot.setOutlineStroke(new BasicStroke(1.0f));
    xyplot.setBackgroundPaint(Color.white);
    xyplot.setDomainCrosshairVisible(true);
    xyplot.setRangeCrosshairVisible(true);

    xyplot.setDrawingSupplier(new DefaultDrawingSupplier(
            new Paint[] { Color.RED, Color.BLUE, Color.GREEN, Color.MAGENTA, Color.CYAN, Color.ORANGE,
                    Color.BLACK, Color.DARK_GRAY, Color.GRAY, Color.LIGHT_GRAY, Color.YELLOW },
            DefaultDrawingSupplier.DEFAULT_OUTLINE_PAINT_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_STROKE_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_OUTLINE_STROKE_SEQUENCE,
            DefaultDrawingSupplier.DEFAULT_SHAPE_SEQUENCE));

    XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer) xyplot.getRenderer();
    xylineandshaperenderer.setBaseShapesVisible(true);
    xylineandshaperenderer.setBaseShapesFilled(true);
    xylineandshaperenderer.setDrawOutlines(true);

    return chart;
}

From source file:org.owasp.benchmark.score.report.ScatterTools.java

private void makeLegend(OverallResults or, double x, double y, XYSeriesCollection dataset, XYPlot xyplot) {
    char ch = ScatterHome.INITIAL_LABEL;
    int i = 0;//from www . j ava2 s .  com
    int toolCount = 0;
    double totalScore = 0;
    for (OverallResult r : or.getResults()) {
        toolCount++;
        // Special hack to make it line up better if the letter is an 'I' or 'i'
        String label = (ch == 'I' || ch == 'i' ? ch + ":  " : "" + ch + ": ");
        double score = 100 * (r.truePositiveRate - r.falsePositiveRate);
        String msg = "\u25A0 " + label + r.category + " (" + Math.round(score) + "%)";
        totalScore += score;
        XYTextAnnotation stroketext = new XYTextAnnotation(msg, x, y + i * -3.3);
        stroketext.setTextAnchor(TextAnchor.CENTER_LEFT);
        stroketext.setBackgroundPaint(Color.white);
        stroketext.setPaint(Color.blue);
        stroketext.setFont(theme.getRegularFont());
        xyplot.addAnnotation(stroketext);
        i++;
        // Weak hack if there are more than 26 tools scored. This will only get us to 52.
        if (ch == 'Z')
            ch = 'a';
        else
            ch++;
    }

    if (toolCount > 1) {
        double averageScore = totalScore / toolCount;
        XYTextAnnotation stroketext = new XYTextAnnotation(
                "\u25A0 " + ch + ": Average Score for this Tool" + " (" + Math.round(averageScore) + "%)", x,
                y + i * -3.3);
        stroketext.setTextAnchor(TextAnchor.CENTER_LEFT);
        stroketext.setBackgroundPaint(Color.white);
        stroketext.setPaint(Color.magenta);
        stroketext.setFont(theme.getRegularFont());
        xyplot.addAnnotation(stroketext);

        Point2D averagePoint = new Point2D.Double(afpr * 100, atpr * 100);
        makePoint(xyplot, averagePoint, 3, Color.magenta);
    }
}

From source file:snepsui.Interface.DrawNetwork.java

/**
 * Initializes the components in the DrawNetwork panel
 *//*  ww  w .j  a v a  2 s  . c o  m*/
private void initGUI() {
    nodesList = new LinkedList<Node>();
    molNodes = new Hashtable<String, CaseFrame>();
    builtMolNodes = new Hashtable<String, Node>();

    this.setPreferredSize(new Dimension(815, 600));

    graph = new DirectedOrderedSparseMultigraph<String, String>();

    this.layout = new StaticLayout<String, String>(graph, new Dimension(700, 450));

    shape = new Transformer<String, Integer>() {
        public Integer transform(String vertex) {
            int stringLength = 0;
            if (molNodes.containsKey(vertex)) {
                stringLength = 3;
            } else {
                for (Node node : nodesList) {
                    if (vertex.equals(node.getIdentifier())) {
                        stringLength = node.getIdentifier().length();
                    }
                }
            }
            return stringLength;
        }
    };

    vertexPaint = new Transformer<String, Paint>() {
        public Paint transform(String vertex) {
            if (molNodes.containsKey(vertex)) {
                if (builtMolNodes.containsKey(vertex)) {
                    Node node = builtMolNodes.get(vertex);
                    if (node.getClass().getSimpleName().equals("PatternNode")) {
                        return Color.blue;
                    } else if (node.getClass().getSimpleName().equals("ClosedNode")) {
                        return Color.yellow;
                    }
                } else
                    return Color.white;
            } else {
                for (Node node : nodesList) {
                    if (node.getIdentifier().equals(vertex)) {
                        if (node.getClass().getSimpleName().equals("BaseNode")) {
                            return Color.green;
                        } else if (node.getClass().getSimpleName().equals("VariableNode")) {
                            return Color.gray;
                        } else if (node.getClass().getSimpleName().equals("PatternNode")) {
                            return Color.blue;
                        } else if (node.getClass().getSimpleName().equals("ClosedNode")) {
                            return Color.yellow;
                        } else {
                            return Color.magenta;
                        }
                    }
                }
            }
            return Color.white;
        }
    };

    edgeLabel = new Transformer<String, String>() {
        public String transform(String edge) {
            String result = "";

            if (edge.isEmpty())
                graph.removeEdge("");
            vv.repaint();
            try {
                result = edge.substring(0, edge.indexOf(":"));
            } catch (StringIndexOutOfBoundsException e) {

            }
            return result;
        }
    };

    VertexShapeSizeAspect<String> vssa = new VertexShapeSizeAspect<String>(graph, shape);

    vv = new VisualizationViewer<String, String>(layout, new Dimension(700, 470));
    vv.setBackground(Color.white);

    vv.getRenderContext().setVertexLabelTransformer(MapTransformer.<String, String>getInstance(
            LazyMap.<String, String>decorate(new HashMap<String, String>(), new ToStringLabeller<String>())));
    vv.getRenderContext().setEdgeLabelTransformer(MapTransformer.<String, String>getInstance(
            LazyMap.<String, String>decorate(new HashMap<String, String>(), new ToStringLabeller<String>())));
    vv.setVertexToolTipTransformer(vv.getRenderContext().getVertexLabelTransformer());
    vv.getRenderer().getVertexLabelRenderer().setPosition(Position.CNTR);
    vv.getRenderContext().setVertexShapeTransformer(vssa);
    vv.getRenderContext()
            .setEdgeLabelClosenessTransformer(new ConstantDirectionalEdgeValueTransformer(0.5, 0.5));
    vv.getRenderContext().setEdgeLabelTransformer(edgeLabel);
    vv.getRenderContext().setVertexFillPaintTransformer(vertexPaint);
    vv.addMouseListener(new MouseAdapter() {
        public void mousePressed(MouseEvent e) {
            point = e.getPoint();
        }

        public void mouseReleased(MouseEvent e) {
            vv.repaint();
        }
    });
    vssa.setScaling(true);

    final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv);
    this.add(panel);
    Factory<String> vertexFactory = new VertexFactory();
    Factory<String> edgeFactory = new EdgeFactory();

    final EditingModalGraphMouse<String, String> graphMouse = new EditingModalGraphMouse<String, String>(
            vv.getRenderContext(), vertexFactory, edgeFactory);

    graphMouse.add(new CustomEditingPopupGraphMousePlugin<String>(vertexFactory, edgeFactory));
    graphMouse.remove(graphMouse.getPopupEditingPlugin());

    vv.setGraphMouse(graphMouse);
    vv.addKeyListener(graphMouse.getModeKeyListener());

    graphMouse.setMode(ModalGraphMouse.Mode.EDITING);

    final ScalingControl scaler = new CrossoverScalingControl();

    vv.scaleToLayout(scaler);

    String path = "src/snepsui/Interface/resources/icons/";

    JButton plus = new JButton();
    plus.setIcon(new ImageIcon(path + "zoom_in.png"));
    plus.setSize(18, 18);
    plus.setFocusPainted(false);
    plus.setBorderPainted(false);
    plus.setContentAreaFilled(false);
    plus.setMargin(new Insets(0, 0, 0, 0));
    plus.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            scaler.scale(vv, 1.1f, vv.getCenter());
        }
    });

    JButton minus = new JButton();
    minus.setIcon(new ImageIcon(path + "zoom_out.png"));
    minus.setSize(18, 18);
    minus.setFocusPainted(false);
    minus.setBorderPainted(false);
    minus.setContentAreaFilled(false);
    minus.setMargin(new Insets(0, 0, 0, 0));
    minus.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            scaler.scale(vv, 1 / 1.1f, vv.getCenter());
        }
    });

    JPanel scaleGrid = new JPanel(new GridLayout(1, 2));
    scaleGrid.setBorder(BorderFactory.createTitledBorder("Zoom"));

    JButton colors = new JButton(new ImageIcon(path + "colors.png"));
    colors.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            JOptionPane.showMessageDialog(getRootPane(), new NodeColors());
        }
    });

    JButton infoButton = new JButton(new ImageIcon(path + "info.png"));
    infoButton.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            JOptionPane.showMessageDialog(vv, instructions, "Instructions", JOptionPane.INFORMATION_MESSAGE,
                    new ImageIcon("src/snepsui/Interface/resources/icons/info.png"));
        }
    });

    JButton resetbutton = new JButton(new ImageIcon(path + "refresh.png"));
    resetbutton.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            ImageIcon icon = new ImageIcon("src/snepsui/Interface/resources/icons/info.png");
            int result = JOptionPane.showConfirmDialog(vv, "Are you sure you want to reset the drawing area?",
                    "Reset", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, icon);
            if (result == JOptionPane.YES_OPTION) {
                builtMolNodes.clear();
                molNodes.clear();
                nodesList.clear();

                LinkedList<String> vertexList = new LinkedList<String>();
                Collection<String> vertices = graph.getVertices();
                for (String vertex : vertices) {
                    vertexList.add(vertex);
                }

                for (String item : vertexList) {
                    graph.removeVertex(item);
                }
                vv.repaint();
            }
        }
    });

    JLabel caseframeLabel = new JLabel("Case Frames");
    DefaultComboBoxModel caseframeComboBoxModel = new DefaultComboBoxModel(
            new String[] { "define-caseframe", "undefine-caseframe" });
    caseframeComboBox = new JComboBox();
    caseframeComboBox.setModel(caseframeComboBoxModel);
    caseframeComboBox.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            addCaseFrameCommands(e);
        }
    });

    JLabel relationsLabel = new JLabel("Relations");
    DefaultComboBoxModel relationsComboBoxModel = new DefaultComboBoxModel(
            new String[] { "define", "undefine" });
    relationsComboBox = new JComboBox();
    relationsComboBox.setModel(relationsComboBoxModel);
    relationsComboBox.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            addRelationCommands(e);
        }
    });

    JPanel options = new JPanel(new GridLayout(3, 1));
    options.add(infoButton);
    options.add(resetbutton);
    options.add(colors);
    this.add(options, BorderLayout.EAST);

    JPanel controls = new JPanel();
    scaleGrid.add(plus);
    scaleGrid.add(minus);
    controls.add(scaleGrid);
    controls.add(relationsLabel);
    controls.add(relationsComboBox);
    controls.add(caseframeLabel);
    controls.add(caseframeComboBox);
    JComboBox modeBox = graphMouse.getModeComboBox();
    controls.add(modeBox);
    this.add(controls, BorderLayout.SOUTH);
}

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

/**
 *
 *///from w  w w. j a  v  a2 s  . 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/fspdfs/chartthemes/simple/fspdfs.png"));
    chartSettings.setBackgroundImageAlignment(new Integer(Align.TOP_RIGHT));
    chartSettings.setBackgroundImageAlpha(new Float(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(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.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(new Float(0.5f));
    plotSettings.setBackgroundPaint(new GradientPaintProvider(Color.green, Color.blue));
    //      plotSettings.setBackgroundAlpha(new Float(0.5f));
    plotSettings.setBackgroundImage(new FileImageProvider("net/sf/fspdfs/chartthemes/simple/fspdfs.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.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(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.green));
    domainAxisSettings.setLineStroke(new BasicStroke(1f));
    domainAxisSettings.setLineVisible(Boolean.TRUE);
    //      domainAxisSettings.setLabel("Domain Axis");
    domainAxisSettings.setLabelAngle(new Double(0.0));
    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(12);
    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(10);
    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.ORANGE));
    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.yellow));
    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.green));
    rangeAxisSettings.getLabelFont().setBold(Boolean.TRUE);
    rangeAxisSettings.getLabelFont().setItalic(Boolean.TRUE);
    rangeAxisSettings.getLabelFont().setFontName("Comic Sans MS");
    rangeAxisSettings.getLabelFont().setFontSize(12);
    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(10);
    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;
}