Class AxisPanelOptions

  • All Implemented Interfaces:
    Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, SizeOfHandler, PlotPanelAxisOptions, Serializable
    Direct Known Subclasses:
    AbstractTimeseriesXAxisPanelOptions, AbstractTimeseriesYAxisPanelOptions

    public class AxisPanelOptions
    extends AbstractOptionHandler
    implements PlotPanelAxisOptions
    Encapsulates options for an axis in a plot.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -label <java.lang.String> (property: label)
        The label of the axis.
        default: 
     
    -type <ABSOLUTE|PERCENTAGE|LOG10_ABSOLUTE|LOG10_PERCENTAGE|LOG_ABSOLUTE|LOG_PERCENTAGE|DATE|TIME|DATETIME> (property: type)
        The type of the axis.
        default: ABSOLUTE
     
    -hide-grid-lines <boolean> (property: showGridLines)
        If enabled, grid lines are plotted as well.
        default: true
     
    -tick-generator <adams.gui.visualization.core.axis.TickGenerator> (property: tickGenerator)
        Algorithm for generating the tick positions.
        default: adams.gui.visualization.core.axis.FancyTickGenerator
     
    -nth-value <int> (property: nthValueToShow)
        The count of ticks a value is shown, i.e., '3' means every third tick: 1,
         4, 7, ...
        default: 5
        minimum: 0
     
    -length-ticks <int> (property: lengthTicks)
        The length in pixels of the ticks to display.
        default: 4
        minimum: 1
     
    -width <int> (property: width)
        The width/height of the axis (>= 5).
        default: 20
        minimum: 5
     
    -top-margin <double> (property: topMargin)
        The factor for an extra margin on the top/left (eg 0.05 = 5%).
        default: 0.0
        minimum: 0.0
     
    -bottom-margin <double> (property: bottomMargin)
        The factor for an extra margin on the bottom/right (eg 0.05 = 5%).
        default: 0.0
        minimum: 0.0
     
    -custom-format <adams.data.DecimalFormatString> (property: customFormat)
        The custom format for displaying the tick labels on the axis.
        default: 
     
    Version:
    $Revision$
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Label

        protected String m_Label
        the label of the axis.
      • m_Type

        protected Type m_Type
        the type of the axis.
      • m_ShowGridLines

        protected boolean m_ShowGridLines
        whether to show gridlines or not.
      • m_TickGenerator

        protected TickGenerator m_TickGenerator
        the tick generator to use.
      • m_NthValueToShow

        protected int m_NthValueToShow
        every nth value to display.
      • m_LengthTicks

        protected int m_LengthTicks
        the length in pixles of ticks to use.
      • m_TopMargin

        protected double m_TopMargin
        the top margin.
      • m_BottomMargin

        protected double m_BottomMargin
        the bottom margin.
      • m_Width

        protected int m_Width
        the width of the axis (for HORIZONTAL axes, this is the height, of course).
    • Constructor Detail

      • AxisPanelOptions

        public AxisPanelOptions()
    • Method Detail

      • setLabel

        public void setLabel​(String value)
        Sets label of the axis.
        Parameters:
        value - the label
      • getLabel

        public String getLabel()
        Returns the label of the axis.
        Returns:
        the label
      • labelTipText

        public String labelTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setType

        public void setType​(Type value)
        Sets type of the axis.
        Parameters:
        value - the type
      • getType

        public Type getType()
        Returns the type of the axis.
        Returns:
        the type
      • typeTipText

        public String typeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setShowGridLines

        public void setShowGridLines​(boolean value)
        Sets whether to plot grid lines as well.
        Parameters:
        value - if true grid lines will be plotted
      • getShowGridLines

        public boolean getShowGridLines()
        Returns whether to plot grid lines as well.
        Returns:
        true if grid lines are plotted
      • showGridLinesTipText

        public String showGridLinesTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setTickGenerator

        public void setTickGenerator​(TickGenerator value)
        Sets tick generator to use.
        Parameters:
        value - the tick generator
      • getTickGenerator

        public TickGenerator getTickGenerator()
        Returns the current tick generator in use.
        Returns:
        the tick generator
      • tickGeneratorTipText

        public String tickGeneratorTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setNthValueToShow

        public void setNthValueToShow​(int value)
        Sets the count of ticks a value is shown, i.e., "3" means every third tick: 1, 4, 7, ...
        Parameters:
        value - the count
      • getNthValueToShow

        public int getNthValueToShow()
        Returns the count of ticks a value is shown, i.e., "3" means every third tick: 1, 4, 7, ...
        Returns:
        the count
      • nthValueToShowTipText

        public String nthValueToShowTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the gui
      • setLengthTicks

        public void setLengthTicks​(int value)
        Sets the length of ticks to display along the axis.
        Parameters:
        value - the length of ticks (in pixels)
      • getLengthTicks

        public int getLengthTicks()
        Returns the length of ticks currently displayed.
        Returns:
        the length of ticks (in pixles)
      • lengthTicksTipText

        public String lengthTicksTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setTopMargin

        public void setTopMargin​(double value)
        Sets the top margin factor (>= 0.0).
        Parameters:
        value - the top margin
      • getTopMargin

        public double getTopMargin()
        Returns the currently set top margin factor (>= 0.0).
        Returns:
        the top margin
      • topMarginTipText

        public String topMarginTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setBottomMargin

        public void setBottomMargin​(double value)
        Sets the bottom margin factor (>= 0.0).
        Parameters:
        value - the bottom margin
      • getBottomMargin

        public double getBottomMargin()
        Returns the currently set bottom margin factor (>= 0.0).
        Returns:
        the bottom margin
      • bottomMarginTipText

        public String bottomMarginTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setWidth

        public void setWidth​(int value)
        Sets the width of the axis (this is height for HORIZONTAL axes, of course), at least 5 pixel.
        Parameters:
        value - the new width
      • getWidth

        public int getWidth()
        Returns the current width of the axis.
        Returns:
        the width
      • widthTipText

        public String widthTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setCustomFormat

        public void setCustomFormat​(DecimalFormatString value)
        Sets the custom format for the tick labels.
        Parameters:
        value - the custom format
      • getCustomFormat

        public DecimalFormatString getCustomFormat()
        Returns the custom format for the tick labels.
        Returns:
        the custom format
      • customFormatTipText

        public String customFormatTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • configure

        public void configure​(PlotPanel plot,
                              Axis axis)
        Applies the options to the specified axis.
        Specified by:
        configure in interface PlotPanelAxisOptions
        Parameters:
        plot - the plot panel to update an axis for
        axis - the axis to configure