Example usage for java.awt Color orange

List of usage examples for java.awt Color orange

Introduction

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

Prototype

Color orange

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

Click Source Link

Document

The color orange.

Usage

From source file:org.gridchem.client.gui.panels.myccg.resource.HPCChartPanel.java

private void renderStackedBarChart(JFreeChart chart) {
    CategoryPlot plot = (CategoryPlot) chart.getPlot();

    // set the range axis to display integers only...
    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    rangeAxis.setUpperBound(100);/*from  ww w  . j av a 2 s .c om*/

    StackedBarRenderer renderer = (StackedBarRenderer) plot.getRenderer();
    renderer.setItemLabelsVisible(true);
    renderer.setMaximumBarWidth(1.0);

    // set up gradient paints for series...
    final GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 0.0f, 0.0f, Color.black);
    final GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, Color.black);
    final GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 0.0f, 0.0f, Color.black);
    final GradientPaint gp3 = new GradientPaint(0.0f, 0.0f, Color.orange, 0.0f, 0.0f, Color.black);

    renderer.setSeriesPaint(0, gp0);
    renderer.setSeriesPaint(1, gp1);
    renderer.setSeriesPaint(2, gp2);
    renderer.setSeriesPaint(3, gp3);

}

From source file:com.juanhg.cicloc.cicloCApplet.java

private void autogeneratedCode() {
    JPanel panel_control = new JPanel();
    panel_control.setBorder(new CompoundBorder(new EtchedBorder(EtchedBorder.RAISED, null, null),
            new BevelBorder(BevelBorder.RAISED, null, null, null, null)));

    JPanel panelInputs = new JPanel();
    panelInputs.setToolTipText("");
    panelInputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelOutputs = new JPanel();
    panelOutputs.setToolTipText("");
    panelOutputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelTitleOutputs = new JPanel();
    panelTitleOutputs.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    JLabel labelOutputData = new JLabel("Datos de la Simulaci\u00F3n");
    labelOutputData.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitleOutputs.add(labelOutputData);

    lblPhase = new JLabel("Trabajo Ciclo:");
    lblPhase.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblTrabajoCValue = new JLabel();
    lblTrabajoCValue.setText("0");
    lblTrabajoCValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblPosicion = new JLabel("Trabajo:");
    lblPosicion.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblTrabajoValue = new JLabel();
    lblTrabajoValue.setText("0");
    lblTrabajoValue.setFont(new Font("Tahoma", Font.PLAIN, 14));
    hotImage = loadImage(hot);/* w ww . j  a v  a  2  s  . co m*/

    coldImage = loadImage(cold);

    lblE = new JLabel("Rendimiento:");
    lblE.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblEValue = new JLabel();
    lblEValue.setText("0");
    lblEValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    GroupLayout gl_panelOutputs = new GroupLayout(panelOutputs);
    gl_panelOutputs.setHorizontalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelOutputs.createSequentialGroup().addGap(22).addGroup(gl_panelOutputs
                    .createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panelOutputs.createSequentialGroup()
                            .addComponent(lblE, GroupLayout.PREFERRED_SIZE, 84, GroupLayout.PREFERRED_SIZE)
                            .addGap(26).addComponent(lblEValue, GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE))
                    .addGroup(gl_panelOutputs.createSequentialGroup()
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.TRAILING)
                                    .addGroup(gl_panelOutputs.createSequentialGroup()
                                            .addComponent(lblPhase, GroupLayout.DEFAULT_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addGap(26))
                                    .addGroup(gl_panelOutputs.createSequentialGroup()
                                            .addComponent(lblPosicion, GroupLayout.PREFERRED_SIZE, 81,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addGap(29)))
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING, false)
                                    .addComponent(lblTrabajoValue, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(lblTrabajoCValue, GroupLayout.PREFERRED_SIZE, 103,
                                            GroupLayout.PREFERRED_SIZE))))
                    .addGap(109))
            .addGroup(gl_panelOutputs.createSequentialGroup().addComponent(panelTitleOutputs,
                    GroupLayout.PREFERRED_SIZE, 262, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(82, Short.MAX_VALUE)));
    gl_panelOutputs
            .setVerticalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panelOutputs.createSequentialGroup()
                            .addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(lblTrabajoCValue).addComponent(lblPhase))
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(lblPosicion, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblTrabajoValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                                    .addComponent(lblE, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblEValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGap(79)));
    panelOutputs.setLayout(gl_panelOutputs);

    panel_1 = new JPanel();
    panel_1.setBorder(new LineBorder(new Color(0, 0, 0)));

    JPanel panel_6 = new JPanel();
    panel_6.setBorder(new LineBorder(new Color(0, 0, 0)));
    GroupLayout gl_panel_control = new GroupLayout(panel_control);
    gl_panel_control.setHorizontalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panel_control.createSequentialGroup().addContainerGap()
                    .addGroup(gl_panel_control.createParallelGroup(Alignment.LEADING, false)
                            .addComponent(panelOutputs, 0, 0, Short.MAX_VALUE)
                            .addComponent(panelInputs, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(panel_6, 0, 0, Short.MAX_VALUE).addComponent(panel_1,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addContainerGap(92, Short.MAX_VALUE)));
    gl_panel_control.setVerticalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panel_control.createSequentialGroup().addContainerGap()
                    .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 213, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 129, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_6, GroupLayout.PREFERRED_SIZE, 146, Short.MAX_VALUE)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(panel_1,
                            GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addGap(17)));

    btnLaunchSimulation = new JButton("Iniciar");
    btnLaunchSimulation.setFont(new Font("Tahoma", Font.PLAIN, 16));
    btnLaunchSimulation.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            btnLaunchSimulationEvent(event);
        }
    });

    btnCold = new JButton("");
    btnCold.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            btnHot.setEnabled(true);
            btnCold.setEnabled(false);
            isHot = false;
            lblE.setText("Eficiencia");

            lblModeValue.setText("Modo Frig");
            panelMode.setBackground(Color.BLUE);

        }
    });
    btnCold.setIcon(new ImageIcon(coldImage));
    btnCold.setEnabled(true);

    panelMode = new JPanel();
    panelMode.setBorder(new LineBorder(new Color(0, 0, 0)));
    panelMode.setBackground(Color.ORANGE);

    btnHot = new JButton("");
    btnHot.setIcon(new ImageIcon(hotImage));
    btnHot.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            btnHot.setEnabled(false);
            btnCold.setEnabled(true);
            isHot = true;
            lblE.setText("Rendimiento");

            lblModeValue.setText("Modo Motor");
            panelMode.setBackground(Color.ORANGE);
        }
    });
    btnHot.setEnabled(false);
    GroupLayout gl_panel_6 = new GroupLayout(panel_6);
    gl_panel_6.setHorizontalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING).addGroup(gl_panel_6
            .createSequentialGroup().addContainerGap()
            .addGroup(gl_panel_6.createParallelGroup(Alignment.LEADING, false)
                    .addComponent(panelMode, Alignment.TRAILING, 0, 0, Short.MAX_VALUE)
                    .addComponent(btnHot, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 111, Short.MAX_VALUE))
            .addGap(10)
            .addGroup(gl_panel_6.createParallelGroup(Alignment.TRAILING, false)
                    .addComponent(btnCold, GroupLayout.PREFERRED_SIZE, 112, GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnLaunchSimulation, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE))
            .addContainerGap()));
    gl_panel_6.setVerticalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_6.createSequentialGroup().addGap(10)
                    .addGroup(gl_panel_6.createParallelGroup(Alignment.LEADING)
                            .addComponent(panelMode, 0, 0, Short.MAX_VALUE).addComponent(btnLaunchSimulation,
                                    GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_panel_6.createParallelGroup(Alignment.TRAILING)
                            .addComponent(btnCold, GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE)
                            .addComponent(btnHot, GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE))
                    .addContainerGap()));

    lblModeValue = new JLabel("Modo Motor");
    lblModeValue.setFont(new Font("Tahoma", Font.PLAIN, 17));
    GroupLayout gl_panelMode = new GroupLayout(panelMode);
    gl_panelMode.setHorizontalGroup(gl_panelMode.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelMode.createSequentialGroup().addContainerGap()
                    .addComponent(lblModeValue, GroupLayout.PREFERRED_SIZE, 113, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    gl_panelMode
            .setVerticalGroup(gl_panelMode.createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panelMode
                            .createSequentialGroup().addContainerGap().addComponent(lblModeValue,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGap(52)));
    panelMode.setLayout(gl_panelMode);
    panel_6.setLayout(gl_panel_6);

    JLabel lblNewLabel = new JLabel("GNU GENERAL PUBLIC LICENSE");
    panel_1.add(lblNewLabel);

    JLabel LabelT1 = new JLabel("T1");
    LabelT1.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel labelT2 = new JLabel("T2");
    labelT2.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel labelVmin = new JLabel("Vm\u00EDn");
    labelVmin.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JPanel panelTitle = new JPanel();
    panelTitle.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    lblT2Value = new JLabel("300");
    lblT2Value.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblVminValue = new JLabel("2");
    lblVminValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblT1Value = new JLabel("400");
    lblT1Value.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderT1 = new JSlider();
    sliderT1.setMinimum(350);
    sliderT1.setMaximum(450);
    sliderT1.setMinorTickSpacing(1);
    sliderT1.setValue(400);
    sliderT1.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent event) {
            sliderT1Event();
        }
    });

    sliderT2 = new JSlider();
    sliderT2.setMinimum(270);
    sliderT2.setMaximum(330);
    sliderT2.setMinorTickSpacing(1);
    sliderT2.setValue(300);
    sliderT2.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderT2Event();
        }
    });

    sliderVMin = new JSlider();
    sliderVMin.setMaximum(4);
    sliderVMin.setMinimum(1);
    sliderVMin.setValue(2);
    sliderVMin.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderVminEvent();
        }
    });

    JLabel lblVmax = new JLabel("Vm\u00E1x");
    lblVmax.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblVmaxValue = new JLabel("7");
    lblVmaxValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderVMax = new JSlider();
    sliderVMax.setMaximum(10);
    sliderVMax.setMinimum(6);
    sliderVMax.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent arg0) {
            sliderVmaxEvent();
        }
    });
    sliderVMax.setValue(7);
    sliderVMax.setMinorTickSpacing(1);

    JLabel labelN = new JLabel("N");
    labelN.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblNValue = new JLabel("10");
    lblNValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderN = new JSlider();
    sliderN.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderNEvent();
        }
    });
    sliderN.setValue(10);
    sliderN.setMinorTickSpacing(1);

    GroupLayout gl_panelInputs = new GroupLayout(panelInputs);
    gl_panelInputs.setHorizontalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelInputs.createSequentialGroup().addGap(19).addGroup(gl_panelInputs
                    .createParallelGroup(Alignment.LEADING, false)
                    .addComponent(labelN, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(lblVmax, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(labelVmin, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE)
                    .addComponent(labelT2, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(LabelT1, GroupLayout.PREFERRED_SIZE, 65, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING, false)
                            .addGroup(gl_panelInputs.createSequentialGroup()
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                            .addComponent(lblT1Value, GroupLayout.PREFERRED_SIZE, 42,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblT2Value, GroupLayout.PREFERRED_SIZE, 56,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblVminValue, GroupLayout.PREFERRED_SIZE, 56,
                                                    GroupLayout.PREFERRED_SIZE))
                                    .addGap(18)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING, false)
                                            .addComponent(sliderT1, 0, 0, Short.MAX_VALUE)
                                            .addComponent(sliderT2, 0, 0, Short.MAX_VALUE)
                                            .addComponent(sliderVMin, GroupLayout.PREFERRED_SIZE, 88,
                                                    GroupLayout.PREFERRED_SIZE)))
                            .addGroup(gl_panelInputs.createSequentialGroup()
                                    .addComponent(lblVmaxValue, GroupLayout.PREFERRED_SIZE, 56,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(18).addComponent(sliderVMax, GroupLayout.PREFERRED_SIZE, 88,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGroup(gl_panelInputs.createSequentialGroup()
                                    .addComponent(lblNValue, GroupLayout.PREFERRED_SIZE, 56,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(18)
                                    .addComponent(sliderN, GroupLayout.PREFERRED_SIZE, 88,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(ComponentPlacement.RELATED)))
                    .addContainerGap())
            .addComponent(panelTitle, GroupLayout.DEFAULT_SIZE, 259, Short.MAX_VALUE));
    gl_panelInputs.setVerticalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelInputs.createSequentialGroup()
                    .addComponent(panelTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addGap(18)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createSequentialGroup().addComponent(LabelT1).addGap(12)
                                    .addComponent(labelT2).addGap(17).addComponent(labelVmin).addGap(17)
                                    .addComponent(lblVmax, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(17).addComponent(labelN, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGroup(gl_panelInputs.createSequentialGroup()
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                            .addComponent(lblT1Value, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(sliderT1, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                            .addComponent(lblT2Value, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(sliderT2, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                                    .addGap(11)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                            .addComponent(lblVminValue, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(sliderVMin, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(ComponentPlacement.UNRELATED)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                            .addComponent(lblVmaxValue, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(sliderVMax, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING)
                                            .addComponent(lblNValue, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(sliderN, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))))
                    .addGap(8)));

    JLabel lblDatosDeEntrada = new JLabel("Datos de Entrada");
    lblDatosDeEntrada.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitle.add(lblDatosDeEntrada);
    panelInputs.setLayout(gl_panelInputs);
    panel_control.setLayout(gl_panel_control);

    JPanel panel_visualizar = new JPanel();
    panel_visualizar.setBackground(Color.WHITE);

    GroupLayout groupLayout = new GroupLayout(getContentPane());
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
            .addGroup(Alignment.LEADING, groupLayout.createSequentialGroup().addContainerGap()
                    .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 286, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(panel_visualizar,
                            GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(93, Short.MAX_VALUE)));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING).addGroup(groupLayout
            .createSequentialGroup().addContainerGap()
            .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
                    .addComponent(panel_visualizar, GroupLayout.DEFAULT_SIZE, 567, Short.MAX_VALUE)
                    .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 568, GroupLayout.PREFERRED_SIZE))
            .addContainerGap()));

    JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);

    panelPiston = new JPanelGrafica();
    panelPiston.setBackground(Color.WHITE);

    JPanel panel_5 = new JPanel();
    panel_5.setBackground(Color.WHITE);

    JPanel panel = new JPanel();
    panel.setBackground(Color.WHITE);
    GroupLayout gl_panel_visualizar = new GroupLayout(panel_visualizar);
    gl_panel_visualizar.setHorizontalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING)
            .addComponent(tabbedPane, GroupLayout.DEFAULT_SIZE, 845, Short.MAX_VALUE)
            .addGroup(gl_panel_visualizar.createSequentialGroup().addContainerGap()
                    .addComponent(panelPiston, GroupLayout.PREFERRED_SIZE, 355, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel, GroupLayout.PREFERRED_SIZE, 183, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_5, GroupLayout.DEFAULT_SIZE, 275, Short.MAX_VALUE).addContainerGap()));
    gl_panel_visualizar.setVerticalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_visualizar.createSequentialGroup()
                    .addComponent(tabbedPane, GroupLayout.PREFERRED_SIZE, 289, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING)
                            .addComponent(panel, GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE)
                            .addComponent(panelPiston, GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE)
                            .addComponent(panel_5, GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE))
                    .addContainerGap()));

    panelTermo = new JPanelGrafica();
    panelTermo.setBackground(Color.WHITE);
    GroupLayout gl_panel = new GroupLayout(panel);
    gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(panelTermo,
            GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE));
    gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(panelTermo,
            GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE));
    panel.setLayout(gl_panel);

    panelPistonInterno = new JPanelGrafica();
    panelPistonInterno.setBackground(Color.WHITE);
    GroupLayout gl_panelPiston = new GroupLayout(panelPiston);
    gl_panelPiston.setHorizontalGroup(gl_panelPiston.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelPiston.createSequentialGroup()
                    .addComponent(panelPistonInterno, GroupLayout.PREFERRED_SIZE, 354,
                            GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    gl_panelPiston.setVerticalGroup(gl_panelPiston.createParallelGroup(Alignment.LEADING)
            .addComponent(panelPistonInterno, GroupLayout.DEFAULT_SIZE, 261, Short.MAX_VALUE));
    panelPiston.setLayout(gl_panelPiston);

    JPanel panelBulb = new JPanel();
    panelBulb.setBackground(Color.WHITE);

    JPanel panelLED = new JPanel();
    panelLED.setBackground(Color.WHITE);

    lblBulbValue = new JLabel("-  Horas");

    lblLEDValue = new JLabel("-  Horas");
    GroupLayout gl_panel_5 = new GroupLayout(panel_5);
    gl_panel_5.setHorizontalGroup(gl_panel_5.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_5.createSequentialGroup()
                    .addGroup(gl_panel_5.createParallelGroup(Alignment.LEADING, false)
                            .addComponent(panelLED, 0, 0, Short.MAX_VALUE)
                            .addComponent(panelBulb, GroupLayout.PREFERRED_SIZE, 132, Short.MAX_VALUE))
                    .addGap(18).addGroup(gl_panel_5.createParallelGroup(Alignment.LEADING)
                            .addComponent(lblBulbValue).addComponent(lblLEDValue))
                    .addContainerGap(87, Short.MAX_VALUE)));
    gl_panel_5.setVerticalGroup(gl_panel_5.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_5.createSequentialGroup()
                    .addComponent(panelBulb, GroupLayout.PREFERRED_SIZE, 143, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addComponent(panelLED, GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE))
            .addGroup(gl_panel_5.createSequentialGroup().addGap(64).addComponent(lblBulbValue)
                    .addPreferredGap(ComponentPlacement.RELATED, 135, Short.MAX_VALUE).addComponent(lblLEDValue)
                    .addGap(64)));

    LEDOnImage = loadImage(LEDOn);
    LEDOffImage = loadImage(LEDOff);
    lblLED = new JLabel(new ImageIcon(LEDOffImage));
    lblLED.setBackground(Color.WHITE);

    GroupLayout gl_panelLED = new GroupLayout(panelLED);
    gl_panelLED.setHorizontalGroup(gl_panelLED.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelLED.createSequentialGroup()
                    .addComponent(lblLED, GroupLayout.PREFERRED_SIZE, 131, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(33, Short.MAX_VALUE)));
    gl_panelLED.setVerticalGroup(gl_panelLED.createParallelGroup(Alignment.TRAILING).addGroup(Alignment.LEADING,
            gl_panelLED.createSequentialGroup().addContainerGap().addComponent(lblLED, GroupLayout.DEFAULT_SIZE,
                    126, Short.MAX_VALUE)));
    panelLED.setLayout(gl_panelLED);

    bulbOnImage = loadImage(bulbOn);
    bulbOffImage = loadImage(bulbOff);
    lblBulb = new JLabel(new ImageIcon(bulbOffImage));
    lblBulb.setBackground(Color.WHITE);

    GroupLayout gl_panelBulb = new GroupLayout(panelBulb);
    gl_panelBulb.setHorizontalGroup(gl_panelBulb.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelBulb.createSequentialGroup()
                    .addComponent(lblBulb, GroupLayout.PREFERRED_SIZE, 134, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(30, Short.MAX_VALUE)));
    gl_panelBulb.setVerticalGroup(gl_panelBulb.createParallelGroup(Alignment.LEADING).addComponent(lblBulb,
            GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE));
    panelBulb.setLayout(gl_panelBulb);
    panel_5.setLayout(gl_panel_5);

    JPanel panelXV = new JPanel();
    panelXV.setBackground(Color.WHITE);
    tabbedPane.addTab("Grficas V", null, panelXV, null);

    JPanel panel_2 = new JPanel();

    JPanel panel_3 = new JPanel();

    JPanel panel_4 = new JPanel();

    panelTV = new JPanelGrafica();
    GroupLayout gl_panel_4 = new GroupLayout(panel_4);
    gl_panel_4.setHorizontalGroup(
            gl_panel_4.createParallelGroup(Alignment.LEADING).addGap(0, 272, Short.MAX_VALUE)
                    .addComponent(panelTV, GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE));
    gl_panel_4
            .setVerticalGroup(gl_panel_4.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE)
                    .addGroup(gl_panel_4.createSequentialGroup()
                            .addComponent(panelTV, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(306, Short.MAX_VALUE)));
    panel_4.setLayout(gl_panel_4);
    GroupLayout gl_panelXV = new GroupLayout(panelXV);
    gl_panelXV.setHorizontalGroup(gl_panelXV.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelXV.createSequentialGroup().addContainerGap()
                    .addComponent(panel_2, GroupLayout.PREFERRED_SIZE, 263, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_4, GroupLayout.PREFERRED_SIZE, 272, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(11, Short.MAX_VALUE)));
    gl_panelXV.setVerticalGroup(gl_panelXV.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelXV.createSequentialGroup().addContainerGap()
                    .addGroup(gl_panelXV.createParallelGroup(Alignment.LEADING)
                            .addComponent(panel_4, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE)
                            .addGroup(gl_panelXV.createParallelGroup(Alignment.TRAILING, false)
                                    .addComponent(panel_3, Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                                    .addComponent(panel_2, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 241,
                                            Short.MAX_VALUE)))
                    .addContainerGap(317, Short.MAX_VALUE)));

    panelUV = new JPanelGrafica();
    GroupLayout gl_panel_3 = new GroupLayout(panel_3);
    gl_panel_3.setHorizontalGroup(gl_panel_3.createParallelGroup(Alignment.LEADING).addComponent(panelUV,
            GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE));
    gl_panel_3.setVerticalGroup(gl_panel_3.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_3.createSequentialGroup()
                    .addComponent(panelUV, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(306, Short.MAX_VALUE)));
    panel_3.setLayout(gl_panel_3);

    panelPV = new JPanelGrafica();
    GroupLayout gl_panel_2 = new GroupLayout(panel_2);
    gl_panel_2.setHorizontalGroup(gl_panel_2.createParallelGroup(Alignment.LEADING).addComponent(panelPV,
            GroupLayout.DEFAULT_SIZE, 249, Short.MAX_VALUE));
    gl_panel_2.setVerticalGroup(gl_panel_2.createParallelGroup(Alignment.LEADING).addComponent(panelPV,
            GroupLayout.DEFAULT_SIZE, 225, Short.MAX_VALUE));
    panel_2.setLayout(gl_panel_2);
    panelXV.setLayout(gl_panelXV);

    JPanel panelXT = new JPanel();
    panelXT.setBackground(Color.WHITE);
    tabbedPane.addTab("Grficas T", null, panelXT, null);

    JPanel panel_9 = new JPanel();

    panelPT = new JPanelGrafica();
    GroupLayout gl_panel_9 = new GroupLayout(panel_9);
    gl_panel_9.setHorizontalGroup(
            gl_panel_9.createParallelGroup(Alignment.LEADING).addGap(0, 263, Short.MAX_VALUE)
                    .addComponent(panelPT, GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE));
    gl_panel_9
            .setVerticalGroup(gl_panel_9.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE)
                    .addComponent(panelPT, GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE));
    panel_9.setLayout(gl_panel_9);

    JPanel panel_10 = new JPanel();

    panelST = new JPanelGrafica();
    GroupLayout gl_panel_10 = new GroupLayout(panel_10);
    gl_panel_10.setHorizontalGroup(
            gl_panel_10.createParallelGroup(Alignment.LEADING).addGap(0, 272, Short.MAX_VALUE)
                    .addComponent(panelST, GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE));
    gl_panel_10
            .setVerticalGroup(gl_panel_10.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE)
                    .addGroup(gl_panel_10.createSequentialGroup()
                            .addComponent(panelST, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    panel_10.setLayout(gl_panel_10);

    JPanel panel_11 = new JPanel();

    panelUT = new JPanelGrafica();
    GroupLayout gl_panel_11 = new GroupLayout(panel_11);
    gl_panel_11.setHorizontalGroup(
            gl_panel_11.createParallelGroup(Alignment.LEADING).addGap(0, 272, Short.MAX_VALUE)
                    .addComponent(panelUT, GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE));
    gl_panel_11
            .setVerticalGroup(gl_panel_11.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE)
                    .addGroup(gl_panel_11.createSequentialGroup()
                            .addComponent(panelUT, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    panel_11.setLayout(gl_panel_11);
    GroupLayout gl_panelXT = new GroupLayout(panelXT);
    gl_panelXT.setHorizontalGroup(gl_panelXT.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelXT.createSequentialGroup().addContainerGap()
                    .addComponent(panel_9, GroupLayout.PREFERRED_SIZE, 263, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_10, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_11, GroupLayout.PREFERRED_SIZE, 272, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(11, Short.MAX_VALUE)));
    gl_panelXT.setVerticalGroup(gl_panelXT.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelXT.createSequentialGroup().addContainerGap()
                    .addGroup(gl_panelXT.createParallelGroup(Alignment.LEADING)
                            .addComponent(panel_11, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE)
                            .addGroup(gl_panelXT.createParallelGroup(Alignment.TRAILING, false)
                                    .addComponent(panel_10, Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                                    .addComponent(panel_9, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 241,
                                            Short.MAX_VALUE)))
                    .addContainerGap(317, Short.MAX_VALUE)));
    panelXT.setLayout(gl_panelXT);
    panel_visualizar.setLayout(gl_panel_visualizar);

    getContentPane().setLayout(groupLayout);
}

From source file:edu.ucla.stat.SOCR.applications.demo.BinomialTradingApplication.java

public void addNode(String name, int x, int y) {
    //System.out.println("adding node:"+node.toString()+" to cell "+cellCount);

    cells[cellCount] = createVertex(name, x, y, XSize, YSize, Color.ORANGE, true);
    nodeCount++;//w  w w.j  a v a2  s  . c  o  m
    cellCount++;
}

From source file:de.codesourcery.jasm16.ide.ui.views.SourceCodeView.java

public SourceCodeView(IResourceResolver resourceResolver, IWorkspace workspace,
        NavigationHistory navigationHistory, boolean isEditable) {
    if (workspace == null) {
        throw new IllegalArgumentException("workspace must not be null");
    }//from  ww  w .ja  va2s.  com
    if (resourceResolver == null) {
        throw new IllegalArgumentException("resourceResolver must not be NULL.");
    }
    this.navigationHistory = navigationHistory;
    this.resourceResolver = resourceResolver;
    this.editable = isEditable;
    this.workspace = workspace;
    defaultStyle = new SimpleAttributeSet();
    errorStyle = createStyle(Color.RED);
    registerStyle = createStyle(Color.ORANGE);
    commentStyle = createStyle(Color.WHITE);
    macroDefinitionStyle = createStyle(Color.YELLOW);
    macroInvocationStyle = createStyle(Color.YELLOW);
    instructionStyle = createStyle(new Color(50, 186, 223));
    labelStyle = createStyle(new Color(237, 237, 81));
    preProcessorStyle = createStyle(new Color(200, 200, 200));
    workspace.addWorkspaceListener(workspaceListener);
    navigationHistory.addListener(navigationHistoryListener);
}

From source file:no.met.jtimeseries.MeteogramWrapper.java

private void plotDewPointTemperature(GenericDataModel model, ChartPlotter plotter) {

    NumberPhenomenon temperature = model.getNumberPhenomenon(PhenomenonName.dewPointTemperature.toString());
    if (temperature == null)
        throw new NullPointerException(
                "Missing parameter [" + messages.getString("parameter.dewPointTemperature") + "]");
    Color temperatureColor = Color.ORANGE;
    // number axis to be used for wind speed plot
    NumberAxis numberAxis = new NumberAxis();
    numberAxis.setLabelPaint(temperatureColor);
    numberAxis.setTickLabelPaint(temperatureColor);
    numberAxis.setLabel(messages.getString("parameter.dewPointTemperature") + " (\u00B0 C)");
    double maxValue = temperature.getMaxValue();
    double minValue = temperature.getMinValue();

    ChartPlotter.setAxisBound(numberAxis, maxValue, minValue, 8, BACKGROUND_LINES);

    PlotStyle plotStyle = new PlotStyle.Builder("Dew point").seriesColor(temperatureColor)
            .plusDegreeColor(temperatureColor).spline(SplineStyle.HYBRID).stroke(new BasicStroke(2.0f))
            .numberAxis(numberAxis).build();

    plotter.addLineChart(TimeBase.SECOND, temperature, plotStyle);

}

From source file:rita.widget.SourceCode.java

public void highlightCode(RenderableBlock renderableBlock) {
    try {//  w  ww  .  j  a  v a2 s .  c om
        paneJavaCode.getHighlighter().removeAllHighlights();
        int startPos = 0;
        // encontrar la posicion en funcion del numero de repeticion del
        // LABEL
        String labelToFind = renderableBlock.getBlock().getBlockLabel();
        for (int i = 0; i < renderableBlock.getLabelInstanceNumber(); i++) {
            if (startPos > 0)
                startPos += labelToFind.length();
            startPos = paneJavaCode.getText().indexOf(labelToFind, startPos);
        }

        int lastPos = startPos + renderableBlock.getBlock().getBlockLabel().length();
        paneJavaCode.getHighlighter().addHighlight(startPos, lastPos,
                new DefaultHighlightPainter(Color.ORANGE));
    } catch (BadLocationException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

}

From source file:practica1.Babage.java

private void cargarGraficos(DefaultCategoryDataset barchartdata, String tipoGrafica) {
    String titulo;//  w  w  w .java 2 s. c o m
    titulo = (tipoGrafica != null) ? "Distribucin de frecuencias en ingls"
            : "Distribucin de frecuencias L" + String.valueOf(this.posicionClaveActual);

    JFreeChart barchart = ChartFactory.createBarChart(titulo, "letra", "cantidad", barchartdata,
            PlotOrientation.VERTICAL, false, true, false);
    CategoryPlot barchrt = barchart.getCategoryPlot();
    barchrt.setRangeGridlinePaint(Color.ORANGE);
    ChartPanel barPanel = new ChartPanel(barchart);

    if (tipoGrafica != null) {
        grafica2.removeAll();
        grafica2.add(barPanel, BorderLayout.CENTER);
        grafica2.validate();
    } else {
        grafica1.removeAll();
        grafica1.add(barPanel, BorderLayout.CENTER);
        grafica1.validate();
    }

}

From source file:net.liuxuan.device.w3330.JIF_DrawChart_w3330.java

/**
 * ?jfreechart/*from w  ww .  j  a v a  2 s.  c  om*/
 */
public void initChart() {
    ts_wppm = new TimeSeries("PPM", Millisecond.class);
    ts_wppm_zero = new TimeSeries("PPM-Zero", Millisecond.class);
    ts_flux = new TimeSeries("Flux", Millisecond.class);
    ts_wvtr = new TimeSeries("WVTR", Millisecond.class);
    ts_tempcell = new TimeSeries(" Cell Temperature", Millisecond.class);
    ts_tempambi = new TimeSeries("Ambient Temperature", Millisecond.class);
    ts_status = new TimeSeries("Status", Millisecond.class);
    ts_fitting = new TimeSeries("fitting curve1", Millisecond.class);
    ts_fitting2 = new TimeSeries("fitting curve2", Millisecond.class);
    trcollection = new TimeSeriesCollection(ts_wppm);

    trcollection.addSeries(ts_wppm_zero);

    trcollection.addSeries(ts_wvtr);

    trcollection.addSeries(ts_fitting2);//ppm
    trcollection2 = new TimeSeriesCollection(ts_flux);

    trcollection2.addSeries(ts_fitting);//temp3

    trcollection2.addSeries(ts_tempcell);

    trcollection2.addSeries(ts_tempambi);

    trcollection2.addSeries(ts_status);
    //        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.orange);
    line1render.setSeriesPaint(1, Color.yellow);
    line1render.setSeriesPaint(2, Color.cyan);
    line1render.setSeriesPaint(3, Rosered);
    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:edu.purdue.cc.bionet.ui.CorrelationDisplayPanel.java

/**
 * The itemStateChanged method of the ItemListener interface.
 * @see ItemListener#itemStateChanged(ItemEvent)
 * //from   ww w  . j av a 2  s .com
 * @param e The event which triggered this action.
 */
public void itemStateChanged(ItemEvent e) {
    if (e.getStateChange() == ItemEvent.SELECTED) {
        Object item = e.getSource();
        if (item == this.highContrastColorMenuItem) {
            graph.setBackground(Color.BLACK);
            graph.setForeground(Color.WHITE);
            graph.setPickedLabelColor(Color.WHITE);
            graph.setVertexPaint(Color.ORANGE.darker());
            graph.setPickedVertexPaint(Color.RED);
            graph.setPickedEdgePaint(Color.WHITE);
            heatMapPanel.setBackground(Color.BLACK);
            heatMapPanel.setForeground(Color.WHITE);
        } else if (item == this.normalColorMenuItem) {
            graph.setBackground(Color.WHITE);
            graph.setForeground(Color.BLACK);
            graph.setPickedLabelColor(Color.BLUE);
            graph.setVertexPaint(Color.ORANGE);
            graph.setPickedVertexPaint(Color.YELLOW);
            graph.setPickedEdgePaint(Color.BLACK);
            heatMapPanel.setForeground(Color.BLACK);
            heatMapPanel.setBackground(Color.WHITE);
        } else if (item == pearsonCalculationMenuItem) {
            correlationMethod.setValue(Correlation.PEARSON);
        } else if (item == spearmanCalculationMenuItem) {
            correlationMethod.setValue(Correlation.SPEARMAN);
        } else if (item == kendallCalculationMenuItem) {
            correlationMethod.setValue(Correlation.KENDALL);
        }
        graph.filterEdges();
        graph.repaint();
    }
}

From source file:org.oscarehr.web.reports.ocan.NeedRatingOverTimeReportGenerator.java

private JFreeChart generateNeedsOverTimeChart() {

    CategoryDataset dataset = this.createDataset();

    JFreeChart chart = ChartFactory.createStackedBarChart("Needs over Time (Consumer and Staff)", // chart title
            "Assessments", // x axis label
            "# of Domain", // y axis label
            dataset, // data
            PlotOrientation.VERTICAL, true, // include legend
            true, // tooltips
            false // urls
    );// w  w w . ja  va 2s.c om

    chart.setBackgroundPaint(Color.LIGHT_GRAY);

    GroupedStackedBarRenderer renderer = new GroupedStackedBarRenderer();
    KeyToGroupMap map = new KeyToGroupMap("G1");
    map.mapKeyToGroup("Consumer (Unknown)", "G1");
    map.mapKeyToGroup("Consumer (No Needs)", "G1");
    map.mapKeyToGroup("Consumer (Met Needs)", "G1");
    map.mapKeyToGroup("Consumer (Unmet Needs)", "G1");

    map.mapKeyToGroup("Staff (Unknown)", "G2");
    map.mapKeyToGroup("Staff (No Needs)", "G2");
    map.mapKeyToGroup("Staff (Met Needs)", "G2");
    map.mapKeyToGroup("Staff (Unmet Needs)", "G2");

    renderer.setSeriesToGroupMap(map);
    renderer.setItemMargin(0.1);
    //renderer.setItemLabelsVisible(true);
    renderer.setMaximumBarWidth(15);

    Paint p1 = Color.GREEN;
    renderer.setSeriesPaint(0, p1);
    renderer.setSeriesPaint(4, p1);
    renderer.setSeriesPaint(7, p1);

    Paint p2 = Color.BLUE;
    renderer.setSeriesPaint(1, p2);
    renderer.setSeriesPaint(5, p2);
    renderer.setSeriesPaint(8, p2);

    Paint p3 = new Color(255, 255, 153);
    renderer.setSeriesPaint(2, p3);
    renderer.setSeriesPaint(6, p3);
    renderer.setSeriesPaint(9, p3);

    Paint p4 = Color.ORANGE;
    renderer.setSeriesPaint(3, p4);
    renderer.setSeriesPaint(7, p4);
    renderer.setSeriesPaint(10, p4);

    SubCategoryAxis domainAxis = new SubCategoryAxis("Assessments");
    domainAxis.setCategoryMargin(0.05);
    domainAxis.addSubCategory("Consumer");
    domainAxis.addSubCategory("Staff");
    domainAxis.setMinorTickMarkInsideLength(10);
    domainAxis.setMinorTickMarkInsideLength(10);
    domainAxis.setMinorTickMarksVisible(true);

    CategoryPlot plot = (CategoryPlot) chart.getPlot();
    plot.setDomainAxis(domainAxis);
    plot.setRenderer(renderer);

    LegendItemCollection result = new LegendItemCollection();
    LegendItem item1 = new LegendItem("Unknown", Color.GREEN);
    LegendItem item2 = new LegendItem("No Needs", Color.BLUE);
    LegendItem item3 = new LegendItem("Met Needs", new Color(255, 255, 153));
    LegendItem item4 = new LegendItem("Unmet Needs", Color.ORANGE);

    result.add(item1);
    result.add(item2);
    result.add(item3);
    result.add(item4);

    plot.setFixedLegendItems(result);
    plot.setBackgroundPaint(Color.lightGray);
    plot.setRangeGridlinePaint(Color.black);

    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setRange(new Range(0, 24), true, false);
    rangeAxis.setTickUnit(new NumberTickUnit(4));

    plot.getDomainAxis().setCategoryMargin(0.35);

    renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    renderer.setBaseItemLabelsVisible(true);
    renderer.setBasePositiveItemLabelPosition(
            new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.BASELINE_LEFT));

    return chart;
}