Search in sources :

Example 1 with LCBLayout

use of org.jfree.layout.LCBLayout in project SIMVA-SoS by SESoS.

the class DefaultValueAxisEditor method createTickUnitPanel.

protected JPanel createTickUnitPanel() {
    JPanel tickUnitPanel = new JPanel(new LCBLayout(3));
    tickUnitPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
    tickUnitPanel.add(new JPanel());
    this.autoTickUnitSelectionCheckBox = new JCheckBox(localizationResources.getString("Auto-TickUnit_Selection"), this.autoTickUnitSelection);
    this.autoTickUnitSelectionCheckBox.setActionCommand("AutoTickOnOff");
    this.autoTickUnitSelectionCheckBox.addActionListener(this);
    tickUnitPanel.add(this.autoTickUnitSelectionCheckBox);
    tickUnitPanel.add(new JPanel());
    return tickUnitPanel;
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) LCBLayout(org.jfree.layout.LCBLayout)

Example 2 with LCBLayout

use of org.jfree.layout.LCBLayout in project SIMVA-SoS by SESoS.

the class DefaultPlotEditor method createPlotPanel.

protected JPanel createPlotPanel(Plot plot) {
    this.plotInsets = plot.getInsets();
    this.backgroundPaintSample = new PaintSample(plot.getBackgroundPaint());
    this.outlineStrokeSample = new StrokeSample(plot.getOutlineStroke());
    this.outlinePaintSample = new PaintSample(plot.getOutlinePaint());
    if (plot instanceof CategoryPlot) {
        this.plotOrientation = ((CategoryPlot) plot).getOrientation();
    } else if (plot instanceof XYPlot) {
        this.plotOrientation = ((XYPlot) plot).getOrientation();
    }
    if (plot instanceof CategoryPlot) {
        CategoryItemRenderer renderer = ((CategoryPlot) plot).getRenderer();
        if (renderer instanceof LineAndShapeRenderer) {
            LineAndShapeRenderer r = (LineAndShapeRenderer) renderer;
            this.drawLines = BooleanUtilities.valueOf(r.getBaseLinesVisible());
            this.drawShapes = BooleanUtilities.valueOf(r.getBaseShapesVisible());
        }
    } else if (plot instanceof XYPlot) {
        XYItemRenderer renderer = ((XYPlot) plot).getRenderer();
        if (renderer instanceof StandardXYItemRenderer) {
            StandardXYItemRenderer r = (StandardXYItemRenderer) renderer;
            this.drawLines = BooleanUtilities.valueOf(r.getPlotLines());
            this.drawShapes = BooleanUtilities.valueOf(r.getBaseShapesVisible());
        }
    }
    setLayout(new BorderLayout());
    this.availableStrokeSamples = new StrokeSample[4];
    this.availableStrokeSamples[0] = new StrokeSample(null);
    this.availableStrokeSamples[1] = new StrokeSample(new BasicStroke(1.0f));
    this.availableStrokeSamples[2] = new StrokeSample(new BasicStroke(2.0f));
    this.availableStrokeSamples[3] = new StrokeSample(new BasicStroke(3.0f));
    // create a panel for the settings...
    JPanel panel = new JPanel(new BorderLayout());
    panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), plot.getPlotType() + localizationResources.getString(":")));
    JPanel general = new JPanel(new BorderLayout());
    general.setBorder(BorderFactory.createTitledBorder(localizationResources.getString("General")));
    JPanel interior = new JPanel(new LCBLayout(7));
    interior.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    // interior.add(new JLabel(localizationResources.getString("Insets")));
    // JButton button = new JButton(
    // localizationResources.getString("Edit...")
    // );
    // button.setActionCommand("Insets");
    // button.addActionListener(this);
    // 
    // this.insetsTextField = new InsetsTextField(this.plotInsets);
    // this.insetsTextField.setEnabled(false);
    // interior.add(this.insetsTextField);
    // interior.add(button);
    interior.add(new JLabel(localizationResources.getString("Outline_stroke")));
    JButton button = new JButton(localizationResources.getString("Select..."));
    button.setActionCommand("OutlineStroke");
    button.addActionListener(this);
    interior.add(this.outlineStrokeSample);
    interior.add(button);
    interior.add(new JLabel(localizationResources.getString("Outline_Paint")));
    button = new JButton(localizationResources.getString("Select..."));
    button.setActionCommand("OutlinePaint");
    button.addActionListener(this);
    interior.add(this.outlinePaintSample);
    interior.add(button);
    interior.add(new JLabel(localizationResources.getString("Background_paint")));
    button = new JButton(localizationResources.getString("Select..."));
    button.setActionCommand("BackgroundPaint");
    button.addActionListener(this);
    interior.add(this.backgroundPaintSample);
    interior.add(button);
    if (this.plotOrientation != null) {
        boolean isVertical = this.plotOrientation.equals(PlotOrientation.VERTICAL);
        int index = isVertical ? ORIENTATION_VERTICAL : ORIENTATION_HORIZONTAL;
        interior.add(new JLabel(localizationResources.getString("Orientation")));
        this.orientationCombo = new JComboBox(orientationNames);
        this.orientationCombo.setSelectedIndex(index);
        this.orientationCombo.setActionCommand("Orientation");
        this.orientationCombo.addActionListener(this);
        interior.add(new JPanel());
        interior.add(this.orientationCombo);
    }
    if (this.drawLines != null) {
        interior.add(new JLabel(localizationResources.getString("Draw_lines")));
        this.drawLinesCheckBox = new JCheckBox();
        this.drawLinesCheckBox.setSelected(this.drawLines.booleanValue());
        this.drawLinesCheckBox.setActionCommand("DrawLines");
        this.drawLinesCheckBox.addActionListener(this);
        interior.add(new JPanel());
        interior.add(this.drawLinesCheckBox);
    }
    if (this.drawShapes != null) {
        interior.add(new JLabel(localizationResources.getString("Draw_shapes")));
        this.drawShapesCheckBox = new JCheckBox();
        this.drawShapesCheckBox.setSelected(this.drawShapes.booleanValue());
        this.drawShapesCheckBox.setActionCommand("DrawShapes");
        this.drawShapesCheckBox.addActionListener(this);
        interior.add(new JPanel());
        interior.add(this.drawShapesCheckBox);
    }
    general.add(interior, BorderLayout.NORTH);
    JPanel appearance = new JPanel(new BorderLayout());
    appearance.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
    appearance.add(general, BorderLayout.NORTH);
    JTabbedPane tabs = createPlotTabs(plot);
    tabs.add(localizationResources.getString("Appearance"), appearance);
    panel.add(tabs);
    return panel;
}
Also used : BasicStroke(java.awt.BasicStroke) LineAndShapeRenderer(org.jfree.chart.renderer.category.LineAndShapeRenderer) JPanel(javax.swing.JPanel) CategoryItemRenderer(org.jfree.chart.renderer.category.CategoryItemRenderer) JComboBox(javax.swing.JComboBox) JTabbedPane(javax.swing.JTabbedPane) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) CategoryPlot(org.jfree.chart.plot.CategoryPlot) Paint(java.awt.Paint) LCBLayout(org.jfree.layout.LCBLayout) JCheckBox(javax.swing.JCheckBox) XYPlot(org.jfree.chart.plot.XYPlot) BorderLayout(java.awt.BorderLayout) PaintSample(org.jfree.ui.PaintSample) StandardXYItemRenderer(org.jfree.chart.renderer.xy.StandardXYItemRenderer) StrokeSample(org.jfree.ui.StrokeSample) StandardXYItemRenderer(org.jfree.chart.renderer.xy.StandardXYItemRenderer) XYItemRenderer(org.jfree.chart.renderer.xy.XYItemRenderer)

Example 3 with LCBLayout

use of org.jfree.layout.LCBLayout in project SIMVA-SoS by SESoS.

the class DefaultNumberAxisEditor method createTickUnitPanel.

@Override
protected JPanel createTickUnitPanel() {
    JPanel tickUnitPanel = new JPanel(new LCBLayout(3));
    tickUnitPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
    tickUnitPanel.add(new JPanel());
    JCheckBox autoTickUnitSelectionCheckBox = new JCheckBox(localizationResources.getString("Auto-TickUnit_Selection"), isAutoTickUnitSelection());
    autoTickUnitSelectionCheckBox.setActionCommand("AutoTickOnOff");
    autoTickUnitSelectionCheckBox.addActionListener(this);
    setAutoTickUnitSelectionCheckBox(autoTickUnitSelectionCheckBox);
    tickUnitPanel.add(getAutoTickUnitSelectionCheckBox());
    tickUnitPanel.add(new JPanel());
    tickUnitPanel.add(new JLabel(localizationResources.getString("Manual_TickUnit_value")));
    this.manualTickUnit = new JTextField(Double.toString(this.manualTickUnitValue));
    this.manualTickUnit.setEnabled(!isAutoTickUnitSelection());
    this.manualTickUnit.setActionCommand("TickUnitValue");
    this.manualTickUnit.addActionListener(this);
    this.manualTickUnit.addFocusListener(this);
    tickUnitPanel.add(this.manualTickUnit);
    tickUnitPanel.add(new JPanel());
    return tickUnitPanel;
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) LCBLayout(org.jfree.layout.LCBLayout)

Example 4 with LCBLayout

use of org.jfree.layout.LCBLayout in project SIMVA-SoS by SESoS.

the class DefaultPolarPlotEditor method createPlotPanel.

private JPanel createPlotPanel() {
    JPanel plotPanel = new JPanel(new LCBLayout(3));
    plotPanel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
    plotPanel.add(new JLabel(localizationResources.getString("AngleOffset")));
    this.angleOffset = new JTextField(Double.toString(this.angleOffsetValue));
    this.angleOffset.setActionCommand("AngleOffsetValue");
    this.angleOffset.addActionListener(this);
    this.angleOffset.addFocusListener(this);
    plotPanel.add(this.angleOffset);
    plotPanel.add(new JPanel());
    plotPanel.add(new JLabel(localizationResources.getString("Manual_TickUnit_value")));
    this.manualTickUnit = new JTextField(Double.toString(this.manualTickUnitValue));
    this.manualTickUnit.setActionCommand("TickUnitValue");
    this.manualTickUnit.addActionListener(this);
    this.manualTickUnit.addFocusListener(this);
    plotPanel.add(this.manualTickUnit);
    plotPanel.add(new JPanel());
    return plotPanel;
}
Also used : JPanel(javax.swing.JPanel) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) LCBLayout(org.jfree.layout.LCBLayout)

Aggregations

JPanel (javax.swing.JPanel)4 LCBLayout (org.jfree.layout.LCBLayout)4 JCheckBox (javax.swing.JCheckBox)3 JLabel (javax.swing.JLabel)3 JTextField (javax.swing.JTextField)2 BasicStroke (java.awt.BasicStroke)1 BorderLayout (java.awt.BorderLayout)1 Paint (java.awt.Paint)1 JButton (javax.swing.JButton)1 JComboBox (javax.swing.JComboBox)1 JTabbedPane (javax.swing.JTabbedPane)1 CategoryPlot (org.jfree.chart.plot.CategoryPlot)1 XYPlot (org.jfree.chart.plot.XYPlot)1 CategoryItemRenderer (org.jfree.chart.renderer.category.CategoryItemRenderer)1 LineAndShapeRenderer (org.jfree.chart.renderer.category.LineAndShapeRenderer)1 StandardXYItemRenderer (org.jfree.chart.renderer.xy.StandardXYItemRenderer)1 XYItemRenderer (org.jfree.chart.renderer.xy.XYItemRenderer)1 PaintSample (org.jfree.ui.PaintSample)1 StrokeSample (org.jfree.ui.StrokeSample)1