Documentation of 'jas2.plot.StringAxis' Java class
StringAxis
jas2.plot

Class StringAxis

  • All Implemented Interfaces:
    CoordinateTransformation, StringCoordinateTransformation, java.io.Externalizable, java.io.Serializable


    public final class StringAxis
    extends AxisType
    implements StringCoordinateTransformation
    This class simply displays a given array of strings. Use for a histogram with a string partition, or if there are very specific labels (numeric or other) you want on the axis. This class displays strings in two formats, represented by two static constants:
    • CENTER_TEXT_IN_DIVISION: a tick mark and label will be centered in a division
    • TEXT_BESIDE_DIVISION: a tick mark and label will be on either side of a division

    Use the method setLabelPlacementStyle(int) to change the setting.

    Labels are displayed in the order as they appear in the array given to the method setLabels(String[]) from left to right on a horizontal axis and from bottom to top on a vertical axis.

    See Also:
    CENTER_TEXT_IN_DIVISION, TEXT_BESIDE_DIVISION, setLabelPlacementStyle(int), setLabels(String[]), Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int CENTER_TEXT_IN_DIVISION
      Represents a display style where a tick and label are centered in a division.
      static int TEXT_BESIDE_DIVISION
      Represents a display style where a tick and label are on either side of a division.
    • Constructor Summary

      Constructors 
      Constructor and Description
      StringAxis()
      Creates a new string axis type object, with labels and ticks centered in a division.
      StringAxis(int labelPlacementStyle)
      Creates a new string axis type object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      double binWidth() 
      double convert(java.lang.String s) 
      int getLabelPlacementStyle()
      Returns the label placement style: either CENTER_TEXT_IN_DIVISION or TEXT_BESIDE_DIVISION.
      java.lang.String[] getLabels()
      Returns the labels used for this axis.
      void readExternal(java.io.ObjectInput in) 
      void setLabelPlacementStyle(int labelPlacementStyle)
      Sets the label placement style.
      void setLabels(java.lang.String[] labels)
      Sets the labels to display.
      void writeExternal(java.io.ObjectOutput out) 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • CENTER_TEXT_IN_DIVISION

        public static final int CENTER_TEXT_IN_DIVISION
        Represents a display style where a tick and label are centered in a division.
        See Also:
        Constant Field Values
      • TEXT_BESIDE_DIVISION

        public static final int TEXT_BESIDE_DIVISION
        Represents a display style where a tick and label are on either side of a division.
        See Also:
        Constant Field Values
    • Constructor Detail

      • StringAxis

        public StringAxis()
        Creates a new string axis type object, with labels and ticks centered in a division.
        See Also:
        CENTER_TEXT_IN_DIVISION
      • StringAxis

        public StringAxis(int labelPlacementStyle)
        Creates a new string axis type object.
        Parameters:
        labelPlacementStyle - how to place labels (supply either CENTER_TEXT_IN_DIVISION or TEXT_BESIDE_DIVISION)
        See Also:
        CENTER_TEXT_IN_DIVISION, TEXT_BESIDE_DIVISION
    • Method Detail

      • setLabelPlacementStyle

        public void setLabelPlacementStyle(int labelPlacementStyle)
        Sets the label placement style. Supply either CENTER_TEXT_IN_DIVISION or TEXT_BESIDE_DIVISION.
        See Also:
        CENTER_TEXT_IN_DIVISION, TEXT_BESIDE_DIVISION
      • setLabels

        public void setLabels(java.lang.String[] labels)
        Sets the labels to display.
      • getLabels

        public java.lang.String[] getLabels()
        Returns the labels used for this axis.
      • writeExternal

        public void writeExternal(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • readExternal

        public void readExternal(java.io.ObjectInput in)
                          throws java.io.IOException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.