Class DefaultValueAxisEditor

All Implemented Interfaces:
ActionListener, FocusListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible
Direct Known Subclasses:
DefaultLogAxisEditor, DefaultNumberAxisEditor

class DefaultValueAxisEditor extends DefaultAxisEditor implements FocusListener
A panel for editing properties of a ValueAxis.
  • Field Details

    • autoRange

      private boolean autoRange
      A flag that indicates whether or not the axis range is determined automatically.
    • autoTickUnitSelection

      private boolean autoTickUnitSelection
      Flag if auto-tickunit-selection is enabled.
    • minimumValue

      private double minimumValue
      The lowest value in the axis range.
    • maximumValue

      private double maximumValue
      The highest value in the axis range.
    • autoRangeCheckBox

      private JCheckBox autoRangeCheckBox
      A checkbox that indicates whether or not the axis range is determined automatically.
    • autoTickUnitSelectionCheckBox

      private JCheckBox autoTickUnitSelectionCheckBox
      A check-box enabling/disabling auto-tickunit-selection.
    • minimumRangeValue

      private JTextField minimumRangeValue
      A text field for entering the minimum value in the axis range.
    • maximumRangeValue

      private JTextField maximumRangeValue
      A text field for entering the maximum value in the axis range.
    • gridPaintSample

      private PaintSample gridPaintSample
      The paint selected for drawing the gridlines.
    • gridStrokeSample

      private StrokeSample gridStrokeSample
      The stroke selected for drawing the gridlines.
    • availableStrokeSamples

      private StrokeSample[] availableStrokeSamples
      An array of stroke samples to choose from (since I haven't written a decent StrokeChooser component yet).
    • localizationResources

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

    • DefaultValueAxisEditor

      public DefaultValueAxisEditor(ValueAxis axis)
      Standard constructor: builds a property panel for the specified axis.
      Parameters:
      axis - the axis, which should be changed.
  • Method Details

    • createTickUnitPanel

      protected JPanel createTickUnitPanel()
      Creates and returns a panel for displaying tick unit settings.
      Returns:
      A panel.
    • isAutoTickUnitSelection

      protected boolean isAutoTickUnitSelection()
      Getter for the autoTickUnitSelection flag.
      Returns:
      The value of the flag for enabling auto-tickunit-selection.
    • setAutoTickUnitSelection

      protected void setAutoTickUnitSelection(boolean autoTickUnitSelection)
      Setter for the autoTickUnitSelection flag.
      Parameters:
      autoTickUnitSelection - The new value for auto-tickunit-selection.
    • getAutoTickUnitSelectionCheckBox

      protected JCheckBox getAutoTickUnitSelectionCheckBox()
      Get the checkbox that enables/disables auto-tickunit-selection.
      Returns:
      The checkbox.
    • setAutoTickUnitSelectionCheckBox

      protected void setAutoTickUnitSelectionCheckBox(JCheckBox autoTickUnitSelectionCheckBox)
      Set the checkbox that enables/disables auto-tickunit-selection.
      Parameters:
      autoTickUnitSelectionCheckBox - The checkbox.
    • isAutoRange

      public boolean isAutoRange()
      Returns the current setting of the auto-range property.
      Returns:
      true if auto range is enabled.
    • getMinimumValue

      public double getMinimumValue()
      Returns the current setting of the minimum value in the axis range.
      Returns:
      The current setting of the minimum value in the axis range.
    • getMaximumValue

      public double getMaximumValue()
      Returns the current setting of the maximum value in the axis range.
      Returns:
      The current setting of the maximum value in the axis range.
    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Handles actions from within the property panel.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class DefaultAxisEditor
      Parameters:
      event - an event.
    • attemptGridStrokeSelection

      protected void attemptGridStrokeSelection()
      Handle a grid stroke selection.
    • attemptGridPaintSelection

      protected void attemptGridPaintSelection()
      Handle a grid paint selection.
    • focusGained

      public void focusGained(FocusEvent event)
      Does nothing.
      Specified by:
      focusGained in interface FocusListener
      Parameters:
      event - the event.
    • focusLost

      public void focusLost(FocusEvent event)
      Revalidates minimum/maximum range.
      Specified by:
      focusLost in interface FocusListener
      Parameters:
      event - the event.
    • toggleAutoRange

      public void toggleAutoRange()
      Toggle the auto range setting.
    • toggleAutoTick

      public void toggleAutoTick()
      Sets the autoTickUnitSelection flag to match the control.
    • validateMinimum

      public void validateMinimum()
      Revalidate the range minimum.
    • validateMaximum

      public void validateMaximum()
      Revalidate the range maximum.
    • setAxisProperties

      public void setAxisProperties(Axis axis)
      Sets the properties of the specified axis to match the properties defined on this panel.
      Overrides:
      setAxisProperties in class DefaultAxisEditor
      Parameters:
      axis - the axis.