Class DefaultChartEditor

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChartEditor

class DefaultChartEditor extends JPanel implements ActionListener, ChartEditor
A panel for editing chart properties (includes subpanels for the title, legend and plot).
  • Field Details

    • titleEditor

      private DefaultTitleEditor titleEditor
      A panel for displaying/editing the properties of the title.
    • plotEditor

      private DefaultPlotEditor plotEditor
      A panel for displaying/editing the properties of the plot.
    • antialias

      private JCheckBox antialias
      A checkbox indicating whether or not the chart is drawn with anti-aliasing.
    • background

      private PaintSample background
      The chart background color.
    • localizationResources

      protected static ResourceBundle localizationResources
      The resourceBundle for the localization.
  • Constructor Details

    • DefaultChartEditor

      public DefaultChartEditor(JFreeChart chart)
      Standard constructor - the property panel is made up of a number of sub-panels that are displayed in the tabbed pane.
      Parameters:
      chart - the chart, whichs properties should be changed.
  • Method Details

    • getTitleEditor

      public DefaultTitleEditor getTitleEditor()
      Returns a reference to the title editor.
      Returns:
      A panel for editing the title.
    • getPlotEditor

      public DefaultPlotEditor getPlotEditor()
      Returns a reference to the plot property sub-panel.
      Returns:
      A panel for editing the plot properties.
    • getAntiAlias

      public boolean getAntiAlias()
      Returns the current setting of the anti-alias flag.
      Returns:
      true if anti-aliasing is enabled.
    • getBackgroundPaint

      public Paint getBackgroundPaint()
      Returns the current background paint.
      Returns:
      The current background paint.
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Handles user interactions with the panel.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      event - a BackgroundPaint action.
    • attemptModifyBackgroundPaint

      private void attemptModifyBackgroundPaint()
      Allows the user the opportunity to select a new background paint. Uses JColorChooser, so we are only allowing a subset of all Paint objects to be selected (fix later).
    • updateChart

      public void updateChart(JFreeChart chart)
      Updates the properties of a chart to match the properties defined on the panel.
      Specified by:
      updateChart in interface ChartEditor
      Parameters:
      chart - the chart.