Example usage for java.awt Font ITALIC

List of usage examples for java.awt Font ITALIC

Introduction

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

Prototype

int ITALIC

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

Click Source Link

Document

The italicized style constant.

Usage

From source file:lucee.runtime.img.Image.java

public void drawString(String text, int x, int y, Struct attr) throws PageException {

    if (attr != null && attr.size() > 0) {

        // font/*ww  w . j a v  a  2 s .  c o m*/
        String font = StringUtil.toLowerCase(Caster.toString(attr.get("font", ""))).trim();
        if (!StringUtil.isEmpty(font)) {
            font = FontUtil.getFont(font).getFontName();
        } else
            font = "Serif";

        // alpha
        //float alpha=Caster.toFloatValue(attr.get("alpha",null),1F);

        // size
        int size = Caster.toIntValue(attr.get("size", Constants.INTEGER_10));

        // style
        int style = Font.PLAIN;
        String strStyle = StringUtil.toLowerCase(Caster.toString(attr.get("style", "")));
        strStyle = StringUtil.removeWhiteSpace(strStyle);
        if (!StringUtil.isEmpty(strStyle)) {
            if ("plain".equals(strStyle))
                style = Font.PLAIN;
            else if ("bold".equals(strStyle))
                style = Font.BOLD;
            else if ("italic".equals(strStyle))
                style = Font.ITALIC;
            else if ("bolditalic".equals(strStyle))
                style = Font.BOLD + Font.ITALIC;
            else if ("bold,italic".equals(strStyle))
                style = Font.BOLD + Font.ITALIC;
            else if ("italicbold".equals(strStyle))
                style = Font.BOLD + Font.ITALIC;
            else if ("italic,bold".equals(strStyle))
                style = Font.BOLD + Font.ITALIC;
            else
                throw new ExpressionException("key style of argument attributeCollection has an invalid value ["
                        + strStyle + "], valid values are [plain,bold,italic,bolditalic]");
        }

        // strikethrough
        boolean strikethrough = Caster.toBooleanValue(attr.get("strikethrough", Boolean.FALSE));

        // underline
        boolean underline = Caster.toBooleanValue(attr.get("underline", Boolean.FALSE));

        AttributedString as = new AttributedString(text);
        as.addAttribute(TextAttribute.FONT, new Font(font, style, size));
        if (strikethrough)
            as.addAttribute(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON);
        if (underline)
            as.addAttribute(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
        Graphics2D g = getGraphics();
        //if(alpha!=1D) setAlpha(g,alpha);

        g.drawString(as.getIterator(), x, y);
    } else
        getGraphics().drawString(text, x, y);

}

From source file:skoa.helpers.ConfiguracionGraficas.java

private void comun() {
    ndirs.setEditable(true);//  ww w. j a v  a  2s.com
    ndirs.setSelectedIndex(0);
    boton3.setEnabled(true);
    f1.setSelected(false);
    f2.setSelected(false);
    nd1 = 0; //En caso de haber elegido ya DGs, y cambiar de consulta, reestablecemos la seleccion de DGS.
    direcciones.removeAllElements();
    datos.removeAll();
    panel.removeAll();
    panel = new JPanel(); //Volvemos a crear y a configurar "panel" para no tener problemas al cambiar de vista.
    panel.setLayout(new GridLayout(2, 1));
    panel.setBorder(BorderFactory.createEtchedBorder());
    opciones.removeAll();
    opciones2.removeAll();
    JPanel dualA = new JPanel();
    dualA.setLayout(new GridLayout(1, 3));
    JLabel aux = new JLabel("Opcin de visualizacin: ");
    aux.setFont(new Font("Dialog", Font.ITALIC, 12));
    dualA.add(aux);
    dualA.add(dual);
    dualA.add(new JPanel());
    opciones.add(dualA);
    opciones.add(c1);
    opciones.add(c2);
    opciones.add(c3);
    opciones.add(c4);
    dirs.removeAll();
    dirs.add(l3);
    dirs2.add(l4);
    fichero = new JPanel(); //Volvemos a crear y a configurar "panel" para no tener problemas al cambiar de vista.
    fichero.setLayout(new GridLayout(1, 2));
    fichero.setBackground(Color.WHITE);
}

From source file:be.vds.jtbdive.client.view.core.dive.profile.DiveProfileGraphicDetailPanel.java

private void fillOptions() {
    List<DiveTankEquipment> dts = currentDive.getDiveEquipment().getDiveTanks();
    if (dts != null) {
        Collections.sort(dts, new DiveTankSwitchTimeComparator());
        Collections.reverse(dts);
        double endTime = diveProfile.getLastTimeEntry();
        double maxDepth = diveProfile.getMaxDepth();
        for (DiveTankEquipment diveTankEquipment : dts) {
            GazMix gazMix = diveTankEquipment.getGazMix();

            XYSeries serie = new XYSeries(gazMix.toString());
            serie.add(diveTankEquipment.getSwitchTime(), maxDepth);
            serie.add(endTime, maxDepth);
            gazMixCollection.addSeries(serie);
            endTime = diveTankEquipment.getSwitchTime();

            XYTextAnnotation annotation = new XYTextAnnotation(gazMix.toString(), endTime, maxDepth);
            annotation.setTextAnchor(TextAnchor.BOTTOM_LEFT);
            annotation.setFont(new Font("Arial", Font.ITALIC + Font.BOLD, 13));
            annotation.setPaint(Color.WHITE);
            gazAnnotations.add(annotation);
        }/*from www.  j av a 2s. c  o m*/
    }
}

From source file:de.dmarcini.submatix.pclogger.gui.spx42LogGraphPanel.java

/**
 * Initialisiere das Panel fr die Verbindungen Project: SubmatixBTForPC Package: de.dmarcini.submatix.pclogger.gui
 * //from ww  w. ja  v  a  2  s.c  om
 * @author Dirk Marciniak (dirk_marciniak@arcor.de) Stand: 22.04.2012
 */
private void initPanel() {
    setLayout(new BorderLayout(0, 0));
    setBackground(Color.WHITE);
    topPanel = new JPanel();
    topPanel.setBackground(Color.WHITE);
    add(topPanel, BorderLayout.NORTH);
    deviceComboBox = new JComboBox<String>();
    deviceComboBox.setBackground(Color.WHITE);
    deviceComboBox.setMaximumRowCount(26);
    deviceComboBox.setFont(new Font("Dialog", Font.PLAIN, 12));
    deviceComboBox.setActionCommand("change_device_to_display");
    diveSelectComboBox = new JComboBox<String>();
    diveSelectComboBox.setBackground(Color.WHITE);
    diveSelectComboBox.setMaximumRowCount(26);
    diveSelectComboBox.setFont(new Font("Dialog", Font.PLAIN, 12));
    diveSelectComboBox.setActionCommand("change_dive_to_display");
    computeGraphButton = new JButton(LangStrings.getString("spx42LogGraphPanel.computeGraphButton.text")); //$NON-NLS-1$
    computeGraphButton.setMinimumSize(new Dimension(80, 23));
    computeGraphButton.setPreferredSize(new Dimension(80, 23));
    computeGraphButton.setSize(new Dimension(80, 23));
    computeGraphButton.setMaximumSize(new Dimension(80, 23));
    computeGraphButton.setActionCommand("show_log_graph");
    detailGraphButton = new JButton(LangStrings.getString("spx42LogGraphPanel.detailGraphButton.text")); //$NON-NLS-1$
    detailGraphButton.setMinimumSize(new Dimension(80, 23));
    detailGraphButton.setSize(new Dimension(80, 23));
    detailGraphButton.setPreferredSize(new Dimension(80, 23));
    detailGraphButton.setMaximumSize(new Dimension(80, 23));
    detailGraphButton.setActionCommand("set_detail_for_show_graph");
    GroupLayout gl_topPanel = new GroupLayout(topPanel);
    gl_topPanel.setHorizontalGroup(gl_topPanel.createParallelGroup(Alignment.TRAILING).addGroup(gl_topPanel
            .createSequentialGroup().addContainerGap().addComponent(deviceComboBox, 0, 270, Short.MAX_VALUE)
            .addGap(18)
            .addComponent(diveSelectComboBox, GroupLayout.PREFERRED_SIZE, 282, GroupLayout.PREFERRED_SIZE)
            .addGap(32)
            .addComponent(computeGraphButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                    GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(ComponentPlacement.RELATED).addComponent(detailGraphButton,
                    GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addGap(18)));
    gl_topPanel.setVerticalGroup(gl_topPanel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_topPanel.createSequentialGroup()
                    .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(gl_topPanel.createParallelGroup(Alignment.BASELINE)
                            .addComponent(deviceComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(computeGraphButton, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addComponent(detailGraphButton, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addComponent(diveSelectComboBox, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))));
    topPanel.setLayout(gl_topPanel);
    bottomPanel = new JPanel();
    bottomPanel.setBackground(Color.WHITE);
    add(bottomPanel, BorderLayout.SOUTH);
    maxDepthValueLabel = new JLabel("0");
    coldestTempValueLabel = new JLabel("0");
    diveLenValueLabel = new JLabel("0");
    notesLabel = new JLabel(LangStrings.getString("spx42LoglistPanel.diveNotesLabel.text")); //$NON-NLS-1$
    notesLabel.setForeground(new Color(0, 100, 0));
    notesLabel.setFont(new Font("Tahoma", Font.ITALIC, 12));
    notesEditButton = new JButton("...");
    notesEditButton.setActionCommand("edit_notes_for_dive");
    notesEditButton.setIcon(
            new ImageIcon(spx42LogGraphPanel.class.getResource("/de/dmarcini/submatix/pclogger/res/142.png")));
    notesEditButton.setForeground(new Color(0, 100, 0));
    diluentLabel = new JLabel(""); //$NON-NLS-1$
    diluentLabel.setForeground(new Color(0, 0, 128));
    diluentLabel.setFont(new Font("Segoe UI", Font.PLAIN, 12));
    GroupLayout gl_bottomPanel = new GroupLayout(bottomPanel);
    gl_bottomPanel.setHorizontalGroup(gl_bottomPanel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_bottomPanel.createSequentialGroup().addContainerGap()
                    .addGroup(gl_bottomPanel.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_bottomPanel.createSequentialGroup()
                                    .addComponent(maxDepthValueLabel, GroupLayout.PREFERRED_SIZE, 206,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(18)
                                    .addComponent(coldestTempValueLabel, GroupLayout.PREFERRED_SIZE, 211,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(18)
                                    .addComponent(diveLenValueLabel, GroupLayout.PREFERRED_SIZE, 200,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(18))
                            .addGroup(Alignment.TRAILING,
                                    gl_bottomPanel.createSequentialGroup()
                                            .addGroup(gl_bottomPanel.createParallelGroup(Alignment.TRAILING)
                                                    .addComponent(diluentLabel, Alignment.LEADING,
                                                            GroupLayout.DEFAULT_SIZE, 667, Short.MAX_VALUE)
                                                    .addComponent(notesLabel, GroupLayout.DEFAULT_SIZE, 653,
                                                            Short.MAX_VALUE))
                                            .addPreferredGap(ComponentPlacement.RELATED)))
                    .addComponent(notesEditButton, GroupLayout.PREFERRED_SIZE, 75, GroupLayout.PREFERRED_SIZE)
                    .addGap(40)));
    gl_bottomPanel.setVerticalGroup(gl_bottomPanel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_bottomPanel.createSequentialGroup().addGap(18).addGroup(gl_bottomPanel
                    .createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_bottomPanel.createSequentialGroup()
                            .addGroup(gl_bottomPanel.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(notesEditButton).addComponent(notesLabel))
                            .addContainerGap())
                    .addGroup(Alignment.TRAILING,
                            gl_bottomPanel
                                    .createParallelGroup(Alignment.BASELINE).addComponent(maxDepthValueLabel)
                                    .addComponent(coldestTempValueLabel).addComponent(diveLenValueLabel))))
            .addGroup(gl_bottomPanel.createSequentialGroup().addContainerGap().addComponent(diluentLabel)));
    bottomPanel.setLayout(gl_bottomPanel);
    chartPanel = null;
}

From source file:com.github.lucapino.sheetmaker.renderer.JavaTemplateRenderer.java

private Font parseFont(String fontSpecs) {
    // split attribute value to get font name and carachteristics
    // bold, italic, underline, and strikeout.
    // Size and Unit (Point, Pixel, Millimeter, Inch)
    String[] fontSpecsArray = fontSpecs.split(",");
    int fontStyle = Font.PLAIN;
    boolean isUnderline = false;
    boolean isStrikeout = false;
    // TODO: manage unit
    String unit;//from w  w  w  .  ja  v  a 2  s.co  m
    // font name
    String fontName = "Droid Sans"; //fontSpecsArray[0];
    int size = Integer.valueOf(fontSpecsArray[1]);
    //        size = (int)Math.round(size * Toolkit.getDefaultToolkit().getScreenResolution() / 72.0);
    if (fontSpecsArray.length > 5) {
        // her we have a full description
        // bold
        if (Boolean.valueOf(fontSpecsArray[2])) {
            fontStyle += Font.BOLD;
        }
        // italic
        if (Boolean.valueOf(fontSpecsArray[3])) {
            fontStyle += Font.ITALIC;
        }
        // underline
        isUnderline = Boolean.valueOf(fontSpecsArray[4]);
        // strikeout
        isStrikeout = Boolean.valueOf(fontSpecsArray[5]);
        // unit
        unit = fontSpecsArray[6];
    } else {
        // unit
        unit = fontSpecsArray[2];
    }
    Font font = new Font(fontName, fontStyle, size);
    Map attributes = font.getAttributes();
    if (isStrikeout) {
        attributes.put(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON);
    }
    if (isUnderline) {
        attributes.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
    }
    return new Font(attributes);
}

From source file:skoa.helpers.Graficos.java

private void barrasDual2() {
    unificarDatosFicheros();/*  ww  w . j  a v a  2  s.  c  o  m*/
    Vector<String> vectorOrdenUnidades = new Vector<String>();
    vectorOrdenUnidades = ordenDeUnidades();
    aplicarDiferencia(vectorOrdenUnidades);
    //En este caso, que queremos 2 ejes, MARCAMOS LA DIFERENCIA AL RECOGER EL 2 DATASET.
    CategoryDataset dataset = obtenerSerieBarrasDual(1);
    //String unidad=vectorOrdenUnidades.elementAt(0);
    String unidad;
    if (vectorOrdenUnidades.elementAt(0).indexOf("W") >= 0 || vectorOrdenUnidades.elementAt(0).indexOf("L") >= 0
            || vectorOrdenUnidades.elementAt(0).indexOf("m") >= 0
            || vectorOrdenUnidades.elementAt(0).indexOf("B") >= 0)
        unidad = vectorOrdenUnidades.elementAt(0);
    else if (vectorOrdenUnidades.elementAt(0).indexOf("C") >= 0)
        unidad = "C";
    else
        unidad = "";
    final CategoryAxis domainAxis = new CategoryAxis("Fechas");
    final NumberAxis rangeAxis = new NumberAxis("Mediciones (" + unidad + ")");
    final BarRenderer renderer1 = new BarRenderer();
    final CategoryPlot plot = new CategoryPlot(dataset, domainAxis, rangeAxis, renderer1) {
        private static final long serialVersionUID = 1L;

        //ESPECIAL. Modificamos la leyenda, para que se vea correcta, cogiendo los 2 items deseados.
        public LegendItemCollection getLegendItems() {
            final LegendItemCollection result = new LegendItemCollection();
            final CategoryDataset data = getDataset();
            if (data != null) {
                final CategoryItemRenderer r = getRenderer();
                if (r != null) {
                    final LegendItem item;
                    try { //Se recoge la excepcion en caso de haber solo
                        item = r.getLegendItem(0, 0); //una lnea en el fichero unificado, porque
                    } catch (Exception e) { //no habria nada en diferenciaAplicada.
                        System.out.println("MAL " + e);
                        return null;
                    }
                    result.add(item);
                }
            }
            final CategoryDataset dset2 = getDataset(1);
            if (dset2 != null) {
                final CategoryItemRenderer renderer2 = getRenderer(1);
                if (renderer2 != null) {
                    final LegendItem item = renderer2.getLegendItem(1, 1);
                    result.add(item);
                }
            }
            return result;
        }
    };
    final JFreeChart grafica = new JFreeChart("Valores medidos de las direcciones de grupo", plot);
    plot.setBackgroundPaint(new Color(0xEE, 0xEE, 0xFF));
    plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);
    CategoryDataset dataset2 = obtenerSerieBarrasDual(2);
    //unidad=vectorOrdenUnidades.elementAt(1);
    if (vectorOrdenUnidades.elementAt(1).indexOf("W") >= 0 || vectorOrdenUnidades.elementAt(1).indexOf("L") >= 0
            || vectorOrdenUnidades.elementAt(1).indexOf("m") >= 0
            || vectorOrdenUnidades.elementAt(1).indexOf("B") >= 0)
        unidad = vectorOrdenUnidades.elementAt(1);
    else if (vectorOrdenUnidades.elementAt(1).indexOf("C") >= 0)
        unidad = "C";
    else
        unidad = "";
    plot.setDataset(1, dataset2);
    plot.mapDatasetToRangeAxis(1, 1);
    final ValueAxis axis2 = new NumberAxis("Mediciones (" + unidad + ")");
    plot.setRangeAxis(1, axis2);
    plot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_RIGHT);
    final BarRenderer renderer2 = new BarRenderer();
    renderer2.setShadowVisible(false); //Esconder las sombras de la barra 1.
    plot.setRenderer(1, renderer2);
    BarRenderer renderer = new BarRenderer();
    renderer.setShadowVisible(false); //Esconder las sombras de la barra 2.
    plot.setRenderer(0, renderer);
    plot.setRangeGridlinePaint(Color.BLACK); //Color de las lineas divisorias.
    //Subttulos
    if (fechaInicial.isEmpty()) {
        fechaInicial = fechaFinal = "?";
    }
    TextTitle t = new TextTitle("desde " + fechaInicial + " hasta " + fechaFinal,
            new Font("SanSerif", Font.ITALIC, 12));
    grafica.addSubtitle(t);
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0));
    domainAxis.setTickLabelFont(new Font("Dialog", Font.PLAIN, 8)); //Letra de las fechas ms pequea
    grafica.setBackgroundPaint(Color.white);
    //-------------------------------------------------
    //Guarda la imagen:
    BufferedImage i1 = grafica.createBufferedImage(400, 300);
    BufferedImage i2 = grafica.createBufferedImage(900, 600);
    BufferedImage imag1 = convertirTipo(i1, BufferedImage.TYPE_INT_RGB);//!OBLIGATORIO!Para que al guardar la imagen,
    BufferedImage imag2 = convertirTipo(i2, BufferedImage.TYPE_INT_RGB);//no se vea transparente naranja.
    try {
        ImageIO.write(imag1, "jpg", new File(ruta + "BarrasSmall.jpg"));
        ImageIO.write(imag2, "jpg", new File(ruta + "BarrasBig.jpg"));
    } catch (IOException e) {
        System.out.println("Error de escritura");
    }
}

From source file:org.pentaho.di.core.gui.SwingDirectGC.java

public void setFont(String fontName, int fontSize, boolean fontBold, boolean fontItalic) {
    int style = Font.PLAIN;
    if (fontBold) {
        style = Font.BOLD;/*from   ww  w  . j  a va2s  .  co  m*/
    }
    if (fontItalic) {
        style = style | Font.ITALIC;
    }

    Font font = new Font(fontName, style, fontSize);
    gc.setFont(font);
}

From source file:com.isencia.passerelle.hmi.generic.GenericHMI.java

@SuppressWarnings("unchecked")
private void renderModelComponentAnnotations(final NamedObj e, final JPanel b) {
    final List<TextAttribute> annotations = e.attributeList(TextAttribute.class);
    if (!annotations.isEmpty()) {
        final Box annotationsBox = new Box(BoxLayout.Y_AXIS);
        // annotationsBox.setBorder(BorderFactory.createTitledBorder("Info"));
        for (final TextAttribute textAttribute : annotations) {

            if (isAnnotionAuthorizedForEditor(textAttribute)) {
                final Box subBox = new Box(BoxLayout.Y_AXIS);

                // subBox.setBorder(BorderFactory.createTitledBorder(textAttribute.getName()));
                final String[] annotationLines = textAttribute.text.getExpression().split("\n");

                for (final String annotationLine : annotationLines) {
                    final JLabel lab = new JLabel(annotationLine);
                    textAttribute.fontFamily.getExpression();
                    int bold = 0;
                    if (textAttribute.bold.getExpression().compareTo("true") == 0) {
                        bold = Font.BOLD;
                    }//from  w  w  w. j  a  v a 2  s .  c om
                    int italic = 0;
                    if (textAttribute.italic.getExpression().compareTo("true") == 0) {
                        italic = Font.ITALIC;
                    }
                    final int textSize = Integer.valueOf(textAttribute.textSize.getExpression());
                    final Font font = new Font(textAttribute.fontFamily.getExpression(), bold | italic,
                            textSize);
                    lab.setFont(font);
                    final String colorString = textAttribute.textColor.getExpression();
                    final String sub = colorString.substring(1, colorString.lastIndexOf("}"));
                    final String[] rgba = sub.split(",");
                    final float r = Float.valueOf(rgba[0]);
                    final float g = Float.valueOf(rgba[1]);
                    final float bl = Float.valueOf(rgba[2]);
                    final float a = Float.valueOf(rgba[3]);
                    final Color color = new Color(r, g, bl, a);
                    lab.setForeground(color);
                    subBox.add(lab);
                }
                annotationsBox.add(subBox);
            }
        }
        b.add(annotationsBox);
    }
}

From source file:net.liuxuan.device.VACVBS.JIF_DrawChart_vacvbs.java

/**
 * ?jfreechart/*from   w  w w . j  a  v  a2  s .c  om*/
 */
public void initChart() {
    ts_LP = new TimeSeries("LowPressure", Millisecond.class);
    ts_HP = new TimeSeries("HighPressure", Millisecond.class);
    ts_humidity = new TimeSeries("Humidity", Millisecond.class);
    ts_temprature = new TimeSeries("Temperature", Millisecond.class);
    ts_time = new TimeSeries("TestTime", Millisecond.class);
    ts_num = new TimeSeries("num", Millisecond.class);
    ts_reserved1 = new TimeSeries("reserved1", Millisecond.class);
    ts_reserved2 = new TimeSeries("reserved2", Millisecond.class);
    ts_reserved3 = new TimeSeries("reserved3", Millisecond.class);
    trcollection = new TimeSeriesCollection(ts_LP);

    trcollection.addSeries(ts_HP);

    trcollection2 = new TimeSeriesCollection(ts_humidity);

    trcollection2.addSeries(ts_temprature);

    //        trcollection2.addSeries(ts_num);
    //        trcollection2.addSeries(ts_time);
    //trcollection2.addSeries(ts_reserved1);
    //trcollection2.addSeries(ts_reserved2);
    //trcollection2.addSeries(ts_reserved3);

    //        timeseriescopylist.add(getTimeSeries(3).createCopy(0, getTimeSeries(3).getItemCount() - 1));
    JFreeChart jfreechart = ChartFactory.createTimeSeriesChart("", "Time(s)", "PPM", trcollection,
            true, true, false);
    XYPlot xyplot = jfreechart.getXYPlot();

    xyplot.setDomainCrosshairVisible(true);
    xyplot.setRangeCrosshairVisible(true);

    Font fs = new Font("", Font.BOLD, 14);
    Font fs2 = new Font("", Font.BOLD, 12);

    XYLineAndShapeRenderer line0render = (XYLineAndShapeRenderer) xyplot.getRenderer(0);

    Color purple = new Color(139, 0, 255);

    line0render.setSeriesPaint(0, Color.blue);
    line0render.setSeriesPaint(1, Color.green);
    line0render.setSeriesPaint(2, Color.red);
    line0render.setSeriesPaint(3, purple);

    //        line0render.setSeriesPaint(3, Color.ORANGE);
    XYLineAndShapeRenderer line1render = new XYLineAndShapeRenderer();
    Color Rosered = new Color(230, 28, 100);
    line1render.setSeriesPaint(0, Color.cyan);
    line1render.setSeriesPaint(1, Rosered);
    line1render.setSeriesPaint(2, Color.orange);
    line1render.setSeriesPaint(3, Color.yellow);
    line1render.setBaseShapesVisible(false);
    xyplot.setRenderer(1, line1render);

    //??
    ValueAxis valueaxis = xyplot.getDomainAxis();

    //
    valueaxis.setLabelFont(fs);

    //
    valueaxis.setTickLabelFont(fs2);

    ValueAxis valueaxis2 = new NumberAxis("");
    valueaxis2.setLabelFont(fs);
    valueaxis2.setTickLabelFont(fs2);

    xyplot.setRangeAxis(1, valueaxis2);
    xyplot.setDataset(1, trcollection2);
    xyplot.mapDatasetToRangeAxis(1, 1);

    //??
    valueaxis.setAutoRange(true);
    //?? 7days
    //                valueaxis.setFixedAutoRange(604800000D);
    valueaxis = xyplot.getRangeAxis();

    valueaxis.setLabelFont(new Font("", Font.BOLD, 14));
    valueaxis.setLabelPaint(line0render.getSeriesPaint(0));
    valueaxis2.setLabelPaint(line1render.getSeriesPaint(0));

    jfreechart.getTitle().setFont(new Font("", Font.BOLD, 20));//
    jfreechart.getLegend().setItemFont(new Font("", Font.ITALIC, 15));
    xyplot.getRenderer(0).setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator("{1}, {2}",
            new SimpleDateFormat("MM-dd HH:mm:ss"), new DecimalFormat("0.0000")));
    xyplot.getRenderer(1).setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator("{1}, {2}",
            new SimpleDateFormat("MM-dd HH:mm:ss"), new DecimalFormat("0.0000")));
    chartPanel = new ChartPanel(jfreechart);

    initChartMenu();
    //        chartPanel.getPopupMenu().add(jmenuitem2);
    //        chartPanel.getPopupMenu().getPopupMenuListeners();

    chartPanel.setSize(950, 620);
    chartPanel.setPreferredSize(new Dimension(950, 620));
    jPanel_Show.add(chartPanel, BorderLayout.CENTER);
}

From source file:CircleOfSquares.java

LabeledRegister(String labelText) {

    setLayout(new BorderLayout(5, 5));

    registerContents = new ColoredLabel("00000000", Label.CENTER, Color.lightGray);
    registerContents.setFont(new Font("TimesRoman", Font.PLAIN, 11));

    Label title = new Label(labelText, Label.RIGHT);
    title.setFont(new Font("Helvetica", Font.ITALIC, 11));

    add("East", registerContents);
    add("Center", title);
}