Example usage for java.awt Font PLAIN

List of usage examples for java.awt Font PLAIN

Introduction

In this page you can find the example usage for java.awt Font PLAIN.

Prototype

int PLAIN

To view the source code for java.awt Font PLAIN.

Click Source Link

Document

The plain style constant.

Usage

From source file:it.eng.spagobi.engines.kpi.bo.charttypes.dialcharts.Speedometer.java

/**
 * Creates a chart of type Speedometer./*from w ww .j  a  va  2s  .  co m*/
 * 
 * @return A Speedometer Chart
 */
public JFreeChart createChart() {
    logger.debug("IN");

    if (dataset == null) {
        logger.debug("The dataset to be represented is null");
        return null;
    }

    DialPlot plot = new DialPlot();
    logger.debug("Created new DialPlot");

    plot.setDataset((ValueDataset) dataset);
    plot.setDialFrame(new StandardDialFrame());
    plot.setBackground(new DialBackground());

    if (dialtextuse) {
        //Usually it shoudn'tbe used. It is a type of title written into the graph
        DialTextAnnotation annotation1 = new DialTextAnnotation(dialtext);
        annotation1.setFont(styleTitle.getFont());
        annotation1.setRadius(0.7);
        plot.addLayer(annotation1);
    }

    DialValueIndicator dvi = new DialValueIndicator(0);
    plot.addLayer(dvi);

    increment = (upper - lower) / 10;
    StandardDialScale scale = new StandardDialScale(lower, upper, -120, -300, 10.0, 4);
    //      if (!( increment > 0)){
    //         increment = 0.01;
    //      }
    scale.setMajorTickIncrement(increment);
    logger.debug("Setted the unit after which a new MajorTickline will be drawed");
    scale.setMinorTickCount(minorTickCount);
    logger.debug("Setted the number of MinorTickLines between every MajorTickline");
    scale.setTickRadius(0.88);
    scale.setTickLabelOffset(0.15);
    Font f = new Font("Arial", Font.PLAIN, 11);
    scale.setTickLabelFont(f);
    plot.addScale(0, scale);
    plot.addPointer(new DialPointer.Pin());

    DialCap cap = new DialCap();
    plot.setCap(cap);

    // sets intervals
    for (Iterator iterator = intervals.iterator(); iterator.hasNext();) {
        KpiInterval interval = (KpiInterval) iterator.next();
        StandardDialRange range = new StandardDialRange(interval.getMin(), interval.getMax(),
                interval.getColor());
        range.setInnerRadius(0.52);
        range.setOuterRadius(0.55);
        plot.addLayer(range);
        logger.debug("new range added to the plot");
    }

    GradientPaint gp = new GradientPaint(new Point(), new Color(255, 255, 255), new Point(),
            new Color(170, 170, 220));
    DialBackground db = new DialBackground(gp);
    db.setGradientPaintTransformer(new StandardGradientPaintTransformer(GradientPaintTransformType.VERTICAL));
    plot.setBackground(db);
    plot.removePointer(0);

    DialPointer.Pointer p = new DialPointer.Pointer();
    //Pointer color
    p.setFillPaint(Color.black);
    plot.addPointer(p);
    logger.debug("Setted all properties of the plot");

    JFreeChart chart = new JFreeChart(name, plot);
    logger.debug("Created the chart");
    TextTitle title = setStyleTitle(name, styleTitle);
    chart.setTitle(title);
    logger.debug("Setted the title of the chart");
    if (subName != null && !subName.equals("")) {
        TextTitle subTitle = setStyleTitle(subName, styleSubTitle);
        chart.addSubtitle(subTitle);
        logger.debug("Setted the subtitle of the chart");
    }

    chart.setBackgroundPaint(color);
    logger.debug("Setted background color of the chart");

    logger.debug("OUT");
    return chart;
}

From source file:de.biomedical_imaging.ij.plot.HistogramPlotter.java

public HistogramPlotter(String title, String xlabel, double[][] data, int numberOfParticles,
        int meanTrackLength, IDatasetCreator datacreator) {

    super(title);
    this.title = title;
    this.xlabel = xlabel;
    this.numberOfParticles = numberOfParticles;
    this.meanTrackLength = meanTrackLength;
    IntervalXYDataset xydataset = datacreator.create(data);
    boolean isbarplot = (datacreator instanceof BarplotDataset);
    txt = new JLabel();
    Font f = new Font("Verdana", Font.PLAIN, 12);
    txt.setFont(f);//from   w w  w  .  ja v a 2 s.  c  o  m

    JFreeChart chart = createChart(xydataset, isbarplot);

    ChartPanel chartPanel = new ChartPanel(chart);

    txt.setText(formatSettingsString());

    main = new JPanel();
    main.setPreferredSize(new java.awt.Dimension(500, 350));
    main.add(chartPanel);
    main.add(txt);
    setContentPane(main);

    setLayout(new BoxLayout(main, BoxLayout.Y_AXIS));

    pack();
    setVisible(true);

    JMenuItem savebutton = ((JMenuItem) chartPanel.getPopupMenu().getComponent(3));
    chartPanel.getPopupMenu().remove(3); // Remove Save button
    //ActionListener al = savebutton.getActionListeners()[0];
    savebutton = new JMenuItem("Save as png");
    //savebutton.removeActionListener(al);
    savebutton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent arg0) {
            // TODO Auto-generated method stub

            try {
                JFileChooser saveFile = new JFileChooser();
                saveFile.setAcceptAllFileFilterUsed(false);
                saveFile.addChoosableFileFilter(new FileNameExtensionFilter("Images", "png"));
                int userSelection = saveFile.showSaveDialog(main);
                if (userSelection == JFileChooser.APPROVE_OPTION) {
                    BufferedImage bi = ScreenImage.createImage(main);
                    File fileToSave = saveFile.getSelectedFile();
                    String filename = fileToSave.getName();
                    int i = filename.lastIndexOf('.');
                    String suffix = filename.substring(i + 1);
                    String path = fileToSave.getAbsolutePath();
                    if (!(suffix.equals("png"))) {
                        path += ".png";
                    }
                    ScreenImage.writeImage(bi, path);
                }
            } catch (IOException e) {
                // TODO Auto-generated catch block
                IJ.log("" + e.getMessage());
            }

        }
    });
    chartPanel.getPopupMenu().insert(savebutton, 3);

}

From source file:org.matsim.contrib.socnetsim.usage.analysis.CourtesyHistogramListener.java

static JFreeChart getGraphic(final CourtesyHistogram.DataFrame dataFrame, int iteration, String actType) {
    final XYSeriesCollection xyData = new XYSeriesCollection();
    final XYSeries helloSeries = new XYSeries("hello", false, true);
    final XYSeries goodbyeSerie = new XYSeries("goodbye", false, true);
    final XYSeries togetherSerie = new XYSeries("pairs together", false, true);
    int together = 0;
    for (int i = 0; i < dataFrame.countsHello.length; i++) {
        together = together + dataFrame.countsHello[i] - dataFrame.countsGoodbye[i];
        double hour = i * dataFrame.binSize / 60.0 / 60.0;
        helloSeries.add(hour, dataFrame.countsHello[i]);
        goodbyeSerie.add(hour, dataFrame.countsGoodbye[i]);
        togetherSerie.add(hour, together);
    }//from w  w  w  .  j  a  v a 2  s . co m

    xyData.addSeries(helloSeries);
    xyData.addSeries(goodbyeSerie);
    xyData.addSeries(togetherSerie);

    final JFreeChart chart = ChartFactory.createXYStepChart(
            "Courtesy Statistics," + "actType " + actType + " it." + iteration, "time", "# persons", xyData,
            PlotOrientation.VERTICAL, true, // legend
            false, // tooltips
            false // urls
    );

    XYPlot plot = chart.getXYPlot();

    final CategoryAxis axis1 = new CategoryAxis("hour");
    axis1.setTickLabelFont(new Font("SansSerif", Font.PLAIN, 7));
    plot.setDomainAxis(new NumberAxis("time"));

    plot.getRenderer().setSeriesStroke(0, new BasicStroke(2.0f));
    plot.getRenderer().setSeriesStroke(1, new BasicStroke(2.0f));
    plot.getRenderer().setSeriesStroke(2, new BasicStroke(2.0f));
    plot.setBackgroundPaint(Color.white);
    plot.setRangeGridlinePaint(Color.gray);
    plot.setDomainGridlinePaint(Color.gray);

    return chart;
}

From source file:org.kuali.mobility.people.service.PeopleServiceImpl.java

@Override
public BufferedImage generateObfuscatedImage(String text) {
    int width = 250;
    int height = 25;

    BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);

    Graphics2D g2d = bufferedImage.createGraphics();
    Font font = new Font("Arial", Font.PLAIN, 14);
    g2d.setFont(font);// ww w  .  j  a v a  2s . c o m

    RenderingHints rh = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    rh.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);

    g2d.setRenderingHints(rh);

    Paint bg = new Color(255, 255, 255);
    g2d.setPaint(bg);
    g2d.fillRect(0, 0, width, height);

    int x = 0;
    int y = height - 7;

    Paint textPaint = new Color(0, 0, 0);
    g2d.setPaint(textPaint);
    g2d.drawString(text, x, y);

    g2d.dispose();
    return bufferedImage;
}

From source file:it.eng.spagobi.engines.chart.bo.charttypes.clusterchart.SimpleCluster.java

public JFreeChart createChart(DatasetMap datasets) {

    DefaultXYZDataset dataset = (DefaultXYZDataset) datasets.getDatasets().get("1");

    JFreeChart chart = ChartFactory.createBubbleChart(name, yLabel, xLabel, dataset, PlotOrientation.HORIZONTAL,
            legend, true, false);//  w ww.  j a  v  a  2 s . com

    /*Font font = new Font("Tahoma", Font.BOLD, titleDimension);
    TextTitle title = new TextTitle(name, font);
    chart.setTitle(title);*/

    TextTitle title = setStyleTitle(name, styleTitle);
    chart.setTitle(title);
    if (subName != null && !subName.equals("")) {
        TextTitle subTitle = setStyleTitle(subName, styleSubTitle);
        chart.addSubtitle(subTitle);
    }

    Color colorSubInvisibleTitle = Color.decode("#FFFFFF");
    StyleLabel styleSubSubTitle = new StyleLabel("Arial", 12, colorSubInvisibleTitle);
    TextTitle subsubTitle = setStyleTitle("", styleSubSubTitle);
    chart.addSubtitle(subsubTitle);

    chart.setBackgroundPaint(color);
    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setSeriesRenderingOrder(SeriesRenderingOrder.FORWARD);
    //plot.setForegroundAlpha(0.50f);
    plot.setForegroundAlpha(0.65f);

    XYItemRenderer renderer = plot.getRenderer();

    //define colors
    int seriesN = dataset.getSeriesCount();
    if (colorMap != null) {
        boolean isSerieSel = true;
        for (int i = 0; i < seriesN; i++) {
            String serieName = (String) dataset.getSeriesKey(i);
            String tmpName = serieName.replaceAll(" ", "");
            tmpName = tmpName.replace('.', ' ').trim();
            if (serie_selected != null && serie_selected.size() > 0) {
                String serieSel = serie_selected.get(tmpName).toString();
                isSerieSel = (serieSel.equalsIgnoreCase("TRUE") || serieSel.equalsIgnoreCase("YES")
                        || serieSel.equalsIgnoreCase("1")) ? true : false;
                serieName = tmpName;
            }

            if (color != null && isSerieSel) {
                Color color = (Color) colorMap.get(serieName);
                renderer.setSeriesPaint(i, color);
            } else {
                Color color = new Color(Integer.decode(defaultColor).intValue());
                renderer.setSeriesPaint(i, color);
            }
        }
    }

    // increase the margins to account for the fact that the auto-range 
    // doesn't take into account the bubble size...
    NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
    //domainAxis.setAutoRange(true);
    domainAxis.setRange(yMin, yMax);
    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();

    rangeAxis.setLabelFont(new Font(styleXaxesLabels.getFontName(), Font.PLAIN, styleXaxesLabels.getSize()));
    rangeAxis.setLabelPaint(styleXaxesLabels.getColor());
    rangeAxis
            .setTickLabelFont(new Font(styleXaxesLabels.getFontName(), Font.PLAIN, styleXaxesLabels.getSize()));
    rangeAxis.setTickLabelPaint(styleXaxesLabels.getColor());

    //rangeAxis.setAutoRange(true);
    rangeAxis.setRange(xMin, xMax);

    TickUnits units = null;
    if (decimalXValues == false)
        units = (TickUnits) NumberAxis.createIntegerTickUnits();
    else
        units = (TickUnits) NumberAxis.createStandardTickUnits();
    rangeAxis.setStandardTickUnits(units);

    TickUnits domainUnits = null;
    if (decimalYValues == false)
        domainUnits = (TickUnits) NumberAxis.createIntegerTickUnits();
    else
        domainUnits = (TickUnits) NumberAxis.createStandardTickUnits();
    domainAxis.setStandardTickUnits(domainUnits);

    rangeAxis.setLowerMargin(1.0);
    rangeAxis.setUpperMargin(1.0);

    domainAxis.setLabelFont(new Font(styleYaxesLabels.getFontName(), Font.PLAIN, styleYaxesLabels.getSize()));
    domainAxis.setLabelPaint(styleYaxesLabels.getColor());
    domainAxis
            .setTickLabelFont(new Font(styleYaxesLabels.getFontName(), Font.PLAIN, styleYaxesLabels.getSize()));
    domainAxis.setTickLabelPaint(styleYaxesLabels.getColor());

    domainAxis.setLowerMargin(1.0);
    domainAxis.setUpperMargin(1.0);
    //DecimalFormat format=(new DecimalFormat("0"));
    //rangeAxis.setNumberFormatOverride(format);

    if (legend == true)
        drawLegend(chart);

    return chart;
}

From source file:edu.harvard.i2b2.query.ui.QueryTopPanel.java

/** Creates new form QueryTopPanel */
public QueryTopPanel(QueryPanel parent) {
    parentPanel = parent;//from  ww w.  j  av a2s  .c o  m
    dataModel = parent.dataModel();

    UIManager.put("Label.font", new Font("Tahoma", Font.PLAIN, 11));

    UIManager.put("Button.font", new Font("Tahoma", Font.PLAIN, 11));

    UIManager.put("TextField.font", new Font("Tahoma", Font.PLAIN, 11));

    UIManager.put("CheckBox.font", new Font("Tahoma", Font.PLAIN, 11));

    UIManager.put("RadioButton.font", new Font("Tahoma", Font.PLAIN, 11));

    UIManager.put("Tree.font", new Font("Tahoma", Font.PLAIN, 11));

    UIManager.put("ComboBox.font", new Font("Tahoma", Font.PLAIN, 11));

    initComponents();
    jGetPatientCountCheckBox.setSelected(true);
    jShowTimelineCheckBox.setSelected(true);

    addComponentListener(new java.awt.event.ComponentAdapter() {
        @Override
        public void componentMoved(java.awt.event.ComponentEvent evt) {
            // formComponentMoved(evt);
        }

        @Override
        public void componentResized(java.awt.event.ComponentEvent evt) {
            // formComponentResized(evt);
            // System.out.println("waiting panel resizing ...");
            int width = (getParent().getWidth());
            int height = (getParent().getHeight());
            if (width < 5 || height < 5) {
                return;
            }

            resizePanels(width, height);
            // log.info("width: "+width+", height: "+height);

            if (firsttime) {
                firsttime = false;
                resizePanels(width, height + 3);
                // log.info("second width: "+width+", height: "+(height+3));
            }
        }
    });
}

From source file:org.matsim.counts.algorithms.graphs.BiasNormalizedErrorGraph.java

@Override
public JFreeChart createChart(final int nbr) {
    DefaultCategoryDataset dataset0 = new DefaultCategoryDataset();
    DefaultCategoryDataset dataset1 = new DefaultCategoryDataset();

    this.errorStats = new ComparisonErrorStatsCalculator(this.ccl_);

    double[] meanNormRelError = this.errorStats.getMeanNormRelError();
    //      double[] meanAbsError = this.errorStats.getMeanAbsError();
    double[] meanBias = this.errorStats.getMeanBias();

    for (int h = 0; h < 24; h++) {
        meanNormRelError[h] *= 100;/*from   w  w w. j ava 2  s  .c om*/
        dataset0.addValue(meanNormRelError[h], "Mean norm rel error", Integer.toString(h + 1));
        //         dataset1.addValue(meanAbsError[h], "Mean abs error", Integer.toString(h + 1));
        dataset1.addValue(meanBias[h], "Mean bias", Integer.toString(h + 1));
    }

    this.chart_ = ChartFactory.createLineChart("", "Hour", "Mean norm rel error [%]", dataset0,
            PlotOrientation.VERTICAL, true, // legend?
            true, // tooltips?
            false // URLs?
    );
    CategoryPlot plot = this.chart_.getCategoryPlot();
    plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);
    plot.setDataset(1, dataset1);
    plot.mapDatasetToRangeAxis(1, 1);

    final LineAndShapeRenderer renderer = new LineAndShapeRenderer();
    renderer.setSeriesToolTipGenerator(0, new StandardCategoryToolTipGenerator());
    plot.setRenderer(0, renderer);

    final CategoryAxis axis1 = new CategoryAxis("Hour");
    axis1.setTickLabelFont(new Font("SansSerif", Font.PLAIN, 7));
    plot.setDomainAxis(axis1);

    //      final ValueAxis axis2 = new NumberAxis("Mean abs {bias, error} [veh/h]");
    final ValueAxis axis2 = new NumberAxis("Mean bias [veh/h]");
    plot.setRangeAxis(1, axis2);

    final ValueAxis axis3 = plot.getRangeAxis(0);
    axis3.setRange(0.0, 100.0);

    final LineAndShapeRenderer renderer2 = new LineAndShapeRenderer();
    renderer2.setSeriesToolTipGenerator(0, new StandardCategoryToolTipGenerator());
    renderer2.setSeriesToolTipGenerator(1, new StandardCategoryToolTipGenerator());
    //      renderer2.setSeriesPaint(0, Color.black);
    plot.setRenderer(1, renderer2);
    plot.setDatasetRenderingOrder(DatasetRenderingOrder.REVERSE);

    return this.chart_;
}

From source file:edu.ku.brc.specify.utilapps.DataModelClassGenerator.java

/**
 * @param dataClass/*from  ww w  .  ja  v a  2s.c o m*/
 * @param tableId
 */
public DataModelClassGenerator(final Class<?> dataClass) {
    this.dataClass = dataClass;

    Class<?>[] baseClasses = { Boolean.class, Integer.class, Double.class, String.class, Float.class,
            Character.class, Short.class, Byte.class, BigDecimal.class, Date.class, Calendar.class };
    for (Class<?> cls : baseClasses) {
        baseClassHash.put(cls.getSimpleName(), true);
    }

    int cnt = 0;
    for (Field field : dataClass.getDeclaredFields()) {
        if (field.getType() == String.class || Collection.class.isAssignableFrom(field.getType())) {
            cnt++;
        }
    }
    Font font = new Font("Courier", Font.PLAIN, 10);

    logArea = new JTextArea();
    logArea.setFont(font);

    tableIdTxt = new JTextField(10);
    devTxt = new JTextField(10);

    PanelBuilder outer = new PanelBuilder(new FormLayout("p,2px,p,2px,f:p:g", "200px:g,4px,f:300px:g,4px,p"));

    PanelBuilder pb = new PanelBuilder(new FormLayout("p,2px,p,2px,l:p:g,2px,l:p",
            UIHelper.createDuplicateJGoodiesDef("p", "2px", cnt + 2)));
    CellConstraints cc = new CellConstraints();

    pb.add(new JLabel("Table Id"), cc.xy(1, 1));
    pb.add(tableIdTxt, cc.xywh(3, 1, 3, 1));

    pb.add(new JLabel("Dev"), cc.xy(1, 3));
    pb.add(devTxt, cc.xywh(3, 3, 3, 1));

    int y = 5;
    for (Field field : dataClass.getDeclaredFields()) {
        if (field.getType() == String.class) {
            UIRow row = new UIRow(DataType.String, field);
            pb.add(new JLabel(field.getName()), cc.xy(1, y));
            pb.add(row.getSizetxt(), cc.xywh(3, y, 1, 1));
            y += 2;
            rows.add(row);
            fieldRowhash.put(field, row);
        }

        if (Collection.class.isAssignableFrom(field.getType())) {
            UIRow row = new UIRow(DataType.Set, field);
            pb.add(new JLabel(field.getName()), cc.xy(1, y));
            pb.add(row.getSizetxt(), cc.xywh(3, y, 3, 1));
            pb.add(new JLabel("(Set)", SwingConstants.LEFT), cc.xy(7, y));
            y += 2;
            rows.add(row);
            fieldRowhash.put(field, row);
        }
    }

    JButton processBtn = UIHelper.createButton("Process");
    JButton cancelBtn = UIHelper.createButton("Cancel");

    processBtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            process();
        }
    });

    cancelBtn.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            setVisible(false);
        }
    });
    pb.getPanel().setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));

    JPanel panel = ButtonBarFactory.buildGrowingBar(new JButton[] { processBtn, cancelBtn });

    outer.add(new JScrollPane(pb.getPanel(), ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED), cc.xywh(1, 1, 5, 1));
    outer.add(new JScrollPane(logArea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED), cc.xywh(1, 3, 5, 1));
    outer.add(panel, cc.xy(5, 5));
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

    JPanel p = new JPanel(new BorderLayout());
    p.add(outer.getPanel(), BorderLayout.CENTER);
    setContentPane(p);
    //setSize(500,500);
    pack();
    setSize(500, getSize().height);
}

From source file:org.jfree.fx.demo.FXGraphics2DDemo1.java

/**
 * Creates a chart./*  ww  w  .  j av  a  2s .co  m*/
 *
 * @param dataset  a dataset.
 *
 * @return A chart.
 */
private static JFreeChart createChart(XYDataset dataset) {

    JFreeChart chart = ChartFactory.createTimeSeriesChart("International Coffee Organisation : Coffee Prices", // title
            null, // x-axis label
            "US cents/lb", // y-axis label
            dataset);

    String fontName = "Palatino";
    chart.getTitle().setFont(new Font(fontName, Font.BOLD, 18));
    chart.addSubtitle(new TextTitle("Source: http://www.ico.org/historical/2010-19/PDF/HIST-PRICES.pdf",
            new Font(fontName, Font.PLAIN, 14)));

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setDomainPannable(true);
    plot.setRangePannable(false);
    plot.setDomainCrosshairVisible(true);
    plot.setRangeCrosshairVisible(true);
    plot.getDomainAxis().setLowerMargin(0.0);
    plot.getDomainAxis().setLabelFont(new Font(fontName, Font.BOLD, 14));
    plot.getDomainAxis().setTickLabelFont(new Font(fontName, Font.PLAIN, 12));
    plot.getRangeAxis().setLabelFont(new Font(fontName, Font.BOLD, 14));
    plot.getRangeAxis().setTickLabelFont(new Font(fontName, Font.PLAIN, 12));
    chart.getLegend().setItemFont(new Font(fontName, Font.PLAIN, 14));
    chart.getLegend().setFrame(BlockBorder.NONE);
    chart.getLegend().setHorizontalAlignment(HorizontalAlignment.CENTER);
    XYItemRenderer r = plot.getRenderer();
    if (r instanceof XYLineAndShapeRenderer) {
        XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
        renderer.setBaseShapesVisible(false);
        renderer.setDrawSeriesLineAsPath(true);
        // set the default stroke for all series
        renderer.setAutoPopulateSeriesStroke(false);
        renderer.setDefaultStroke(new BasicStroke(3.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL), false);
        renderer.setSeriesPaint(0, Color.RED);
        renderer.setSeriesPaint(1, new Color(24, 123, 58));
        renderer.setSeriesPaint(2, new Color(149, 201, 136));
        renderer.setSeriesPaint(3, new Color(1, 62, 29));
        renderer.setSeriesPaint(4, new Color(81, 176, 86));
        renderer.setSeriesPaint(5, new Color(0, 55, 122));
        renderer.setSeriesPaint(6, new Color(0, 92, 165));
    }

    return chart;

}

From source file:gui.TwopointPWDPanel.java

private JPanel createControls() {
    // Marker model (for ordered list of markers)
    markerModel = new PWDTableModel();

    // Populate the marker table
    markerTable = new JTable(markerModel);
    markerTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    markerTable.getColumnModel().getColumn(1).setPreferredWidth(175);
    markerTable.getColumnModel().getColumn(2).setPreferredWidth(60);
    for (CMarker cm : order.getLinkageGroup().getMarkers()) {
        markerModel.addRow(new Object[] { cm.marker.getPrefix(), cm, cm.marker.getRatio() });
    }//from   ww  w  .  j a v  a 2s.  c  o  m
    markerTable.getSelectionModel().addListSelectionListener(this);

    // Phase model (for scores of each ordered marker against the others)
    phaseModel = new PWDTableModel2();
    phaseModel.setColumnIdentifiers(new Object[] { "Graph Code", "Marker Name", "Recom Freq", "LOD Score" });

    phaseTable = new JTable(phaseModel);
    phaseTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    phaseTable.getSelectionModel().addListSelectionListener(this);

    rfqChart = new PWDChartPanel("Recombination Freq");
    lodChart = new PWDChartPanel("LOD Score");

    m1Label = new JLabel("");
    m1Label.setFont(new Font("Monospaced", Font.PLAIN, 11));
    m2Label = new JLabel("");
    m2Label.setFont(new Font("Monospaced", Font.PLAIN, 11));

    JScrollPane mSP = new JScrollPane(markerTable);
    mSP.setPreferredSize(new Dimension(300, 10));

    JPanel p1 = new JPanel(new BorderLayout(5, 0));
    p1.add(new JLabel("Ordered Markers:"), BorderLayout.NORTH);
    p1.add(mSP);

    JPanel p2 = new JPanel(new BorderLayout(5, 0));
    p2.add(new JLabel("Scores:"), BorderLayout.NORTH);
    p2.add(new JScrollPane(phaseTable));

    JPanel p3 = new JPanel(new GridLayout(2, 1, 2, 2));
    p3.setBorder(BorderFactory.createLoweredBevelBorder());
    p3.add(m1Label);
    p3.add(m2Label);

    JPanel p4 = new JPanel(new GridLayout(1, 2, 5, 5));
    p4.add(rfqChart);
    p4.add(lodChart);

    JPanel p5 = new JPanel(new BorderLayout(5, 5));
    p5.add(p3, BorderLayout.NORTH);
    p5.add(p4, BorderLayout.CENTER);

    JSplitPane splits = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    splits.setResizeWeight(0.5);
    splits.setLeftComponent(p1);
    splits.setRightComponent(p2);

    JPanel p6 = new JPanel(new BorderLayout(5, 5));
    p6.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    p6.add(splits);
    p6.add(p5, BorderLayout.SOUTH);

    return p6;
}