Documentation of 'org.jplot2d.element.impl.AxisImpl' Java class
AxisImpl
org.jplot2d.element.impl

Class AxisImpl

    • Constructor Detail

      • AxisImpl

        public AxisImpl()
    • Method Detail

      • getId

        public java.lang.String getId()
        Description copied from interface: Element
        Returns the id string of this element
        Specified by:
        getId in interface Element
        Returns:
        the id string
      • getShortId

        public java.lang.String getShortId()
        Description copied from interface: AxisEx
        Returns the short id of this axis. The short id is composed of series of ids concatenated with dots. The 1st id is the id of this element, the 2nd id is the id of the parent of this element, etc, until but not include the root plot.
        Specified by:
        getShortId in interface AxisEx
        Returns:
        the short id of this axis.
      • getInvokeStepFormParent

        public InvokeStep getInvokeStepFormParent()
        Description copied from interface: ElementEx
        Return the invoke step to get this object from its parent.
        Specified by:
        getInvokeStepFormParent in interface ElementEx
        Returns:
        the invoke step
      • getMooringMap

        public java.util.Map<Element,Element> getMooringMap()
        Description copied from interface: ComponentEx
        Returns a map to tell why this component cannot be removed from its container. The key is the moored element, required by its value.
        Specified by:
        getMooringMap in interface ComponentEx
        Overrides:
        getMooringMap in class ComponentImpl
        Returns:
        a map. The key is the element required by its value.
      • thisEffectiveColorChanged

        public void thisEffectiveColorChanged()
        Description copied from interface: ComponentEx
        Called when setColor() or parentEffectiveColorChanged() change the effective color of this component.
        Specified by:
        thisEffectiveColorChanged in interface ComponentEx
      • thisEffectiveFontChanged

        public void thisEffectiveFontChanged()
        Description copied from interface: ComponentEx
        Called when setFontXxx() or parentEffectiveFontChanged() change the effective font of this component.
        Specified by:
        thisEffectiveFontChanged in interface ComponentEx
      • getLocation

        public java.awt.geom.Point2D getLocation()
        Description copied from interface: PComponent
        Returns the location of this component.
        Specified by:
        getLocation in interface PComponent
        Returns:
        the base point in its parent's paper coordinate space
      • setLocation

        public void setLocation(double locX,
                                double locY)
        Description copied from interface: AxisEx
        Moves this plot component to a new location. The origin of the new location is specified by point p. Point2D p is given in the parent's paper coordinate space.
        Specified by:
        setLocation in interface AxisEx
      • getOrientation

        public AxisOrientation getOrientation()
        Description copied from interface: Axis
        Orientation is a read-only property. It just show the orientation of this axis after it has been add as a X/Y axis.
        Specified by:
        getOrientation in interface Axis
        Returns:
        orientation of this axis
      • getSize

        public java.awt.geom.Dimension2D getSize()
        Description copied from interface: PComponent
        Returns the paper size of this component.
        Specified by:
        getSize in interface PComponent
        Returns:
      • getBounds

        public java.awt.geom.Rectangle2D getBounds()
        Description copied from interface: PComponent
        Returns the paper bounds relative to its location. The units of bounds is pt (1/72 inch)
        Specified by:
        getBounds in interface PComponent
        Overrides:
        getBounds in class ComponentImpl
        Returns:
        the paper bounds of this component.
      • getPaperTransform

        public PaperTransform getPaperTransform()
        Description copied from interface: PComponent
        Returns the paper transform of this component, which can be used to convert between device coordinate and paper coordinate of this component. The original point of paper coordinate is the location point of this component.

        Returns null if the component is not added to a plot or not laid out

        Specified by:
        getPaperTransform in interface AxisEx
        Specified by:
        getPaperTransform in interface PComponent
        Overrides:
        getPaperTransform in class ComponentImpl
        Returns:
        the paper transform of this component
      • setVisible

        public void setVisible(boolean visible)
        Description copied from interface: PComponent
        Shows or hides this component depending on the value of parameter b.
        Specified by:
        setVisible in interface PComponent
        Overrides:
        setVisible in class ComponentImpl
        Parameters:
        visible - if true, shows this component; otherwise, hides this component
        See Also:
        PComponent.isVisible()
      • getLength

        public double getLength()
        Description copied from interface: Axis
        Returns the paper length of this axis.
        Specified by:
        getLength in interface Axis
        Returns:
        the paper length
      • setLength

        public void setLength(double length)
        Description copied from interface: AxisEx
        Set the length for this axis.
        Specified by:
        setLength in interface AxisEx
      • getPosition

        public AxisPosition getPosition()
        Description copied from interface: Axis
        Return the position of the axis: NEGATIVE_SIDE, POSITIVE_SIDE.
        Specified by:
        getPosition in interface Axis
        Returns:
        the position of the axis in the plot.
      • setPosition

        public void setPosition(AxisPosition position)
        Description copied from interface: Axis
        Set the position of the axis: NEGATIVE_SIDE, POSITIVE_SIDE.
        Specified by:
        setPosition in interface Axis
        Parameters:
        position - the position of the axis in the plot.
      • getAxisLineWidth

        public float getAxisLineWidth()
        Description copied from interface: Axis
        Returns the axis line width is pt(1/72 inch)
        Specified by:
        getAxisLineWidth in interface Axis
        Returns:
        the axis line width
      • setAxisLineWidth

        public void setAxisLineWidth(float width)
        Description copied from interface: Axis
        Sets the axis line width is pt(1/72 inch). The default line width is 1.0 pt.
        Specified by:
        setAxisLineWidth in interface Axis
        Parameters:
        width - the axis line width
      • isGridLines

        public boolean isGridLines()
        Description copied from interface: Axis
        Return if the grid line is displayed or not.
        Specified by:
        isGridLines in interface Axis
        Returns:
        true if the grid line is displayed
      • setGridLines

        public void setGridLines(boolean showGridLines)
        Description copied from interface: Axis
        Sets grid lines of grey lines in corresponding of major ticks of the axis.
        Specified by:
        setGridLines in interface Axis
        Parameters:
        showGridLines - if true show the grid lines.
      • isMinorGridLines

        public boolean isMinorGridLines()
        Description copied from interface: Axis
        Return if the minor grid line is displayed or not.
        Specified by:
        isMinorGridLines in interface Axis
        Returns:
        true if the minor grid line is displayed
      • setMinorGridLines

        public void setMinorGridLines(boolean showGridLines)
        Description copied from interface: Axis
        Sets grid lines of grey lines in corresponding of minor ticks of the axis.
        Specified by:
        setMinorGridLines in interface Axis
        Parameters:
        showGridLines - if true show the grid lines.
      • isTickVisible

        public boolean isTickVisible()
        Description copied from interface: Axis
        Returns if the tick mark is shown or not
        Specified by:
        isTickVisible in interface Axis
        Returns:
        if the tick mark is shown or not
      • setTickVisible

        public void setTickVisible(boolean visible)
        Description copied from interface: Axis
        Sets if the tick mark is shown or not
        Specified by:
        setTickVisible in interface Axis
      • getTickSide

        public AxisTickSide getTickSide()
        Description copied from interface: Axis
        Return the direction of the ticks
        Specified by:
        getTickSide in interface Axis
      • setTickSide

        public void setTickSide(AxisTickSide side)
        Description copied from interface: Axis
        Set the side position of the ticks
        Specified by:
        setTickSide in interface Axis
      • getTickHeight

        public double getTickHeight()
        Description copied from interface: Axis
        Returns the height of the major ticks of the axis
        Specified by:
        getTickHeight in interface Axis
        Returns:
        the height of the ticks
      • setTickHeight

        public void setTickHeight(double height)
        Description copied from interface: Axis
        Set the height of the major ticks of the axis.
        Specified by:
        setTickHeight in interface Axis
        Parameters:
        height - the new height of the ticks
      • getMinorTickHeight

        public double getMinorTickHeight()
        Description copied from interface: Axis
        Return the height of the minor ticks of the axis.
        Specified by:
        getMinorTickHeight in interface Axis
        Returns:
        the height of the minor ticks.
      • setMinorTickHeight

        public void setMinorTickHeight(double height)
        Description copied from interface: Axis
        Set the height of the minor ticks of the axis.
        Specified by:
        setMinorTickHeight in interface Axis
        Parameters:
        height - the height of the ticks
      • getTickLineWidth

        public float getTickLineWidth()
        Description copied from interface: Axis
        Returns the axis line width is pt(1/72 inch)
        Specified by:
        getTickLineWidth in interface Axis
        Returns:
        the axis line width
      • setTickLineWidth

        public void setTickLineWidth(float width)
        Description copied from interface: Axis
        Sets the axis line width is pt(1/72 inch). The default line width is 0.5 pt.
        Specified by:
        setTickLineWidth in interface Axis
        Parameters:
        width - the axis line width
      • isLabelVisible

        public boolean isLabelVisible()
        Description copied from interface: Axis
        Returns if the tick labels is shown or not
        Specified by:
        isLabelVisible in interface Axis
        Returns:
        if the tick mark is shown or not
      • setLabelVisible

        public void setLabelVisible(boolean visible)
        Description copied from interface: Axis
        Sets if the tick labels is shown or not
        Specified by:
        setLabelVisible in interface Axis
      • getLabelOrientation

        public AxisOrientation getLabelOrientation()
        Description copied from interface: Axis
        Get the Orientation of the labels.
        Specified by:
        getLabelOrientation in interface Axis
        Returns:
        label orientation:
        0 HORIZONTAL
        1 VERTICAL
      • setLabelOrientation

        public void setLabelOrientation(AxisOrientation orientation)
        Description copied from interface: Axis
        Set the orientation of the labels of the ticks
        Specified by:
        setLabelOrientation in interface Axis
        Parameters:
        orientation - HORIZONTAL/VERTICAL
      • getLabelSide

        public AxisLabelSide getLabelSide()
        Description copied from interface: Axis
        Return the position of the label of the ticks
        Specified by:
        getLabelSide in interface Axis
      • setLabelSide

        public void setLabelSide(AxisLabelSide side)
        Description copied from interface: Axis
        Set the position of the label of the ticks respect of the axis
        Specified by:
        setLabelSide in interface Axis
      • getLabelColor

        public java.awt.Color getLabelColor()
        Description copied from interface: Axis
        Return the color of the labels of the ticks
        Specified by:
        getLabelColor in interface Axis
        Returns:
        the color of the labels
      • setLabelColor

        public void setLabelColor(java.awt.Color color)
        Description copied from interface: Axis
        Set the color of the labels of the ticks
        Specified by:
        setLabelColor in interface Axis
        Parameters:
        color - the color of the labels
      • setActualFont

        public void setActualFont(java.awt.Font font)
        Description copied from interface: AxisEx
        Set shrunk font for displaying by tick manager.
        Specified by:
        setActualFont in interface AxisEx
        Parameters:
        font - the shrunk font
      • getTitle

        public AxisTitleEx getTitle()
        Description copied from interface: Axis
        Returns the title of this axis.
        Specified by:
        getTitle in interface Axis
        Returns:
        the title of this axis
      • getThickness

        public double getThickness()
        Specified by:
        getThickness in interface AxisEx
      • getAsc

        public double getAsc()
        Specified by:
        getAsc in interface AxisEx
      • getDesc

        public double getDesc()
        always negative
        Specified by:
        getDesc in interface AxisEx
      • invalidateThickness

        public void invalidateThickness()
        Mark the thickness is invalid. Changing tick height, label strings label font or orientation will call this method
        Specified by:
        invalidateThickness in interface AxisEx
      • calcThickness

        public void calcThickness()
        Description copied from interface: AxisEx
        calculate asc and desc of this axis.
        Specified by:
        calcThickness in interface AxisEx
      • getLabelsPaperSize

        public static java.awt.geom.Dimension2D[] getLabelsPaperSize(MathElement[] labels,
                                                                     java.awt.Font labelFont)
        Returns the labels normal size.
        Returns:
        the labels normal size.
      • copyStructure

        public ComponentEx copyStructure(java.util.Map<ElementEx,ElementEx> orig2copyMap)
        Description copied from interface: ElementEx
        Create a structural copy of this element and put them into orig2copyMap. All properties are not copied. The parent of the copy are not set by this method.
        Specified by:
        copyStructure in interface ComponentEx
        Specified by:
        copyStructure in interface ElementEx
        Overrides:
        copyStructure in class ComponentImpl
        Parameters:
        orig2copyMap - original element to copy map
        Returns:
        the structural copy of this element
      • copyFrom

        public void copyFrom(ElementEx src)
        Description copied from interface: ElementEx
        Copies all properties from given src to this element. Notice properties of sub-elements are not copied over.
        Specified by:
        copyFrom in interface ElementEx
        Overrides:
        copyFrom in class ComponentImpl
        Parameters:
        src - the src
      • draw

        public void draw(java.awt.Graphics2D graphics)
        Description copied from interface: ComponentEx
        Draw this component only. All its children is not drawn.
        Specified by:
        draw in interface ComponentEx
        Parameters:
        graphics - to the Graphics2D drawing. The transformation of this component is not applied.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.