Class DefaultTitleEditor

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

class DefaultTitleEditor extends JPanel implements ActionListener
A panel for editing the properties of a chart title.
  • Field Details

    • showTitle

      private boolean showTitle
      Whether or not to display the title on the chart.
    • showTitleCheckBox

      private JCheckBox showTitleCheckBox
      The checkbox to indicate whether or not to display the title.
    • titleField

      private JTextField titleField
      A field for displaying/editing the title text.
    • titleFont

      private Font titleFont
      The font used to draw the title.
    • fontfield

      private JTextField fontfield
      A field for displaying a description of the title font.
    • selectFontButton

      private JButton selectFontButton
      The button to use to select a new title font.
    • titlePaint

      private PaintSample titlePaint
      The paint (color) used to draw the title.
    • selectPaintButton

      private JButton selectPaintButton
      The button to use to select a new paint (color) to draw the title.
    • localizationResources

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

    • DefaultTitleEditor

      public DefaultTitleEditor(Title title)
      Standard constructor: builds a panel for displaying/editing the properties of the specified title.
      Parameters:
      title - the title, which should be changed.
  • Method Details

    • getTitleText

      public String getTitleText()
      Returns the title text entered in the panel.
      Returns:
      The title text entered in the panel.
    • getTitleFont

      public Font getTitleFont()
      Returns the font selected in the panel.
      Returns:
      The font selected in the panel.
    • getTitlePaint

      public Paint getTitlePaint()
      Returns the paint selected in the panel.
      Returns:
      The paint selected in the panel.
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Handles button clicks by passing control to an appropriate handler method.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      event - the event
    • attemptFontSelection

      public void attemptFontSelection()
      Presents a font selection dialog to the user.
    • attemptPaintSelection

      public void attemptPaintSelection()
      Allow the user the opportunity to select a Paint object. For now, we just use the standard color chooser - all colors are Paint objects, but not all Paint objects are colors (later we can implement a more general Paint chooser).
    • attemptModifyShowTitle

      private void attemptModifyShowTitle()
      Allow the user the opportunity to change whether the title is displayed on the chart or not.
    • enableOrDisableControls

      private void enableOrDisableControls()
      If we are supposed to show the title, the controls are enabled. If we are not supposed to show the title, the controls are disabled.
    • setTitleProperties

      public void setTitleProperties(JFreeChart chart)
      Sets the properties of the specified title to match the properties defined on this panel.
      Parameters:
      chart - the chart whose title is to be modified.