sgtplot.beans
Class AxisHolder
- java.lang.Object
-
- sgtplot.beans.AxisHolder
-
- All Implemented Interfaces:
- java.io.Serializable
public class AxisHolder extends java.lang.Object implements java.io.SerializableContains the data necessary to instantiate an axis. This class is used withDataGroup.- Since:
- 3.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description AxisHolder()Default constructor.AxisHolder(int type, int dir, DataGroup dataGroup)Construct a newAxisHolder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddChangeListener(javax.swing.event.ChangeListener l)Add aChangeListener.java.awt.ColorgetAxisColor()Get the axis color.intgetAxisOrientation()Get the axis orientation.Point2D.DoublegetAxisOriginP()Get axis origin.intgetAxisPosition()Get the axis positionintgetAxisType()Get the axis type.Rectangle2DgetBoundsP()Get axis bounds.DataGroupgetDataGroup()Get theDataGroupparent.java.awt.ColorgetLabelColor()Get the axis label color.java.awt.FontgetLabelFont()Get the axis label font.java.lang.StringgetLabelFormat()Get the label format.doublegetLabelHeightP()Get label height.intgetLabelInterval()Get the label interval.intgetLabelPosition()If labelPosition is AUTO then return computed labelPosition, otherwise return stored valueintgetLabelSignificantDigits()Get axis label significant digitsdoublegetLargeTicHeightP()Get large tic height.java.lang.StringgetMajorFormat()Get time axis major label formatintgetMajorInterval()Get time axis major label intervaljava.lang.StringgetMinorFormat()Get time axis minor label format.intgetMinorInterval()Get time axis minor label intervalintgetNumSmallTics()Get the number of small tics.Range2DgetRangeP()Get range of axis (long direction) in physical coordinates.doublegetSmallTicHeightP()Get small tic height.doublegetThickTicWidth()Get the thick tic width.intgetTicPosition()If ticPosition is AUTO then returns computed position, otherwise returns stored value.intgetTimeAxisStyle()Get the time axis style.SGLabelgetTitle()Get the axis title.java.lang.StringgetTransformGroup()Get transform group name.intgetTransformType()Get the axis transform type.SoTRangegetUserRange()Get the user range.booleanisAutoRange()Test if the axis in autoRange mode.booleanisLabelPositionAuto()Test if label position in auto mode.booleanisLocationAtOrigin()Test if the axis at the origin.booleanisSelectable()Test if the axis selectable.booleanisTicPositionAuto()Test if tic position in auto mode.booleanisTime()Test if the axis time.booleanisTitleAuto()Test if the title in auto mode.booleanisVisible()Test if the axis visible.voidremoveAllChangeListeners()Remove allChangeListeners.voidremoveChangeListener(javax.swing.event.ChangeListener l)Remove aChangeListener.voidremoveDesignChangeListeners()Remove allChangeListeners that implement theDesignListenerinterface.voidsetAutoRange(boolean autoRange)Set autoRange property.voidsetAxisColor(java.awt.Color axisColor)Set axis color.voidsetAxisOrientation(int dir)Set the axis orientation.voidsetAxisOriginP(Point2D.Double axisOriginP)Set the axis origin in physical coordinates.voidsetAxisPosition(int axisPosition)Set the axis position.voidsetAxisType(int axisType)Set the axis type.voidsetBoundsP(Rectangle2D boundsP)Set bounds of axis in physical coordinates.voidsetDataGroup(DataGroup dataGroup)Set the parentDataGroup.voidsetLabelColor(java.awt.Color labelColor)Set axis label color.voidsetLabelFont(java.awt.Font labelFont)Set the axis label font.voidsetLabelFormat(java.lang.String labelFormat)Set the axis label format.voidsetLabelHeightP(double labelHeightP)Set label height in physical coordinates (inches).voidsetLabelInterval(int labelInterval)Set the label interval.voidsetLabelPosition(int labelPosition)Set the label position.voidsetLabelSignificantDigits(int labelSignificantDigits)Set the axis label significant digits.voidsetLargeTicHeightP(double largeTicHeightP)Set large tic height in physical coordinates.voidsetLocationAtOrigin(boolean locationAtOrigin)Set axis at origin of perpendicular axis.voidsetMajorFormat(java.lang.String majorFormat)Get the time axis major label format.voidsetMajorInterval(int majorInterval)Set time axis major label interval.voidsetMinorFormat(java.lang.String minorFormat)Set the time axis minor label format.voidsetMinorInterval(int minorInterval)Set time axis minor label interval.voidsetNumSmallTics(int numSmallTics)Set the number of small tics between the large tics.voidsetSelectable(boolean selectable)Set the selecatability of the axis.voidsetSmallTicHeightP(double smallTicHeightP)Set small tic height in physical coordinates.voidsetThickTicWidth(double thickTicWidth)Set the thick tic width (for Time axes).voidsetTicPosition(int ticPosition)Set the tic position.voidsetTimeAxisStyle(int timeAxisStyle)Set the time axis style.voidsetTitle(SGLabel title)Set the axis title.voidsetTitleAuto(boolean titleAuto)Set the title auto property.voidsetTransformGroup(java.lang.String transformGroup)Set the transform group.voidsetTransformType(int transformType)Set the axis transform type.voidsetUserRange(SoTRange userRange)Set the user range.voidsetVisible(boolean visible)Set/unset the axis visibility.
-
-
-
Constructor Detail
-
AxisHolder
public AxisHolder()
Default constructor. The methods setAxisType, setAxisOrientation, and setDataGroup must be called.
-
AxisHolder
public AxisHolder(int type, int dir, DataGroup dataGroup)Construct a newAxisHolder. This constructor includes the necessary fields.- Parameters:
type- Type of axisdir- Direction of axisdataGroup- DataGroup parent- See Also:
setAxisType,setAxisOrientation,setDataGroup
-
-
Method Detail
-
getDataGroup
public DataGroup getDataGroup()
Get theDataGroupparent.- Returns:
- DataGroup parent
-
setDataGroup
public void setDataGroup(DataGroup dataGroup)
Set the parentDataGroup. No default.- Parameters:
dataGroup- Parent object to AxisHolder
-
isTime
public boolean isTime()
Test if the axis time.- Returns:
- True if axis is time.
-
removeChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener l)
Remove aChangeListener.- Parameters:
l- ChangeListener to remove
-
addChangeListener
public void addChangeListener(javax.swing.event.ChangeListener l)
Add aChangeListener. Listener will be notified if a change occurs.- Parameters:
l- ChangeListener to add.
-
removeDesignChangeListeners
public void removeDesignChangeListeners()
Remove allChangeListeners that implement theDesignListenerinterface.- See Also:
DesignListener
-
removeAllChangeListeners
public void removeAllChangeListeners()
Remove allChangeListeners.
-
setAxisType
public void setAxisType(int axisType)
Set the axis type. The possible types include:axisType = DataGroup.PLAIN, DataGroup.TIME, or DataGroup.LOG
No default.- Parameters:
axisType- (see above)
-
getAxisType
public int getAxisType()
Get the axis type.- Returns:
- axis type
-
getAxisOrientation
public int getAxisOrientation()
Get the axis orientation.- Returns:
- axis orientation.
-
setAxisOrientation
public void setAxisOrientation(int dir)
Set the axis orientation. Orientations are:axisOrientation = DataGroup.X_DIR or DataGroup.Y_DIR
No default.- Parameters:
dir- axis orientation
-
setAxisColor
public void setAxisColor(java.awt.Color axisColor)
Set axis color. Default = black.- Parameters:
axisColor- axis color
-
getAxisColor
public java.awt.Color getAxisColor()
Get the axis color.- Returns:
- axis color
-
setAutoRange
public void setAutoRange(boolean autoRange)
Set autoRange property. True to automatically compute the axis range from the data. Default = true.- Parameters:
autoRange- auto range
-
isAutoRange
public boolean isAutoRange()
Test if the axis in autoRange mode.- Returns:
- True, if in autoRange mode.
-
setUserRange
public void setUserRange(SoTRange userRange)
Set the user range. User range is only used if autoRange is false. Default = (1, 10, 1)- Parameters:
userRange- user supplied range
-
getUserRange
public SoTRange getUserRange()
Get the user range.- Returns:
- user range
-
setLabelColor
public void setLabelColor(java.awt.Color labelColor)
Set axis label color. Default = black.- Parameters:
labelColor- label color
-
getLabelColor
public java.awt.Color getLabelColor()
Get the axis label color.- Returns:
- axis label color
-
setLabelFont
public void setLabelFont(java.awt.Font labelFont)
Set the axis label font. Default = ("Helvetica", ITALIC, 10).- Parameters:
labelFont- label font
-
getLabelFont
public java.awt.Font getLabelFont()
Get the axis label font.- Returns:
- axis label font
-
setLabelHeightP
public void setLabelHeightP(double labelHeightP)
Set label height in physical coordinates (inches). Default = 0.15.- Parameters:
labelHeightP- label height
-
getLabelHeightP
public double getLabelHeightP()
Get label height.- Returns:
- label height in physical coordinates
-
setLabelPosition
public void setLabelPosition(int labelPosition)
Set the label position. Label position can be:labelPosition = Axis.AUTO, Axis.POSITIVE_SIDE, Axis.NEGATIVE_SIDE, Axis.NO_LABELDefault = AUTO.- Parameters:
labelPosition- label position
-
isLabelPositionAuto
public boolean isLabelPositionAuto()
Test if label position in auto mode.- Returns:
- true if in auto mode
-
getLabelPosition
public int getLabelPosition()
If labelPosition is AUTO then return computed labelPosition, otherwise return stored value- Returns:
- label position
-
setBoundsP
public void setBoundsP(Rectangle2D boundsP)
Set bounds of axis in physical coordinates. Default = (0, 0, 0, 0).- Parameters:
boundsP- axis bounds
-
getBoundsP
public Rectangle2D getBoundsP()
Get axis bounds.- Returns:
- axis bounds in physical coordinates.
-
getRangeP
public Range2D getRangeP()
Get range of axis (long direction) in physical coordinates. The bounds are used to determine the axis range.- Returns:
- axis range (long direction)
-
setLargeTicHeightP
public void setLargeTicHeightP(double largeTicHeightP)
Set large tic height in physical coordinates. Default = 0.1.- Parameters:
largeTicHeightP- large tic height
-
getLargeTicHeightP
public double getLargeTicHeightP()
Get large tic height.- Returns:
- large tic height in physical coordinates.
-
setSmallTicHeightP
public void setSmallTicHeightP(double smallTicHeightP)
Set small tic height in physical coordinates. Default = 0.05.- Parameters:
smallTicHeightP- small tic height
-
getSmallTicHeightP
public double getSmallTicHeightP()
Get small tic height.- Returns:
- small tic height in physical coordinates
-
setNumSmallTics
public void setNumSmallTics(int numSmallTics)
Set the number of small tics between the large tics. This should be one less than the number of intervals you want. Default = 0.- Parameters:
numSmallTics- number of small tics
-
getNumSmallTics
public int getNumSmallTics()
Get the number of small tics.- Returns:
- number of small tics between large tics
-
setThickTicWidth
public void setThickTicWidth(double thickTicWidth)
Set the thick tic width (for Time axes). Default = 0.025.- Parameters:
thickTicWidth- thick tic width
-
getThickTicWidth
public double getThickTicWidth()
Get the thick tic width. Valid for Time axes- Returns:
- thick tic width
-
setTicPosition
public void setTicPosition(int ticPosition)
Set the tic position. Tic position include:ticPosition = Axis.AUTO, Axis.POSITIVE_SIDE, Axis.NEGATIVE_SIDE, Axis.BOTH_SIDESDefault = AUTO.- Parameters:
ticPosition- tic position
-
isTicPositionAuto
public boolean isTicPositionAuto()
Test if tic position in auto mode.- Returns:
- true if in auto mode
-
getTicPosition
public int getTicPosition()
If ticPosition is AUTO then returns computed position, otherwise returns stored value.- Returns:
- tic position
-
setTitle
public void setTitle(SGLabel title)
Set the axis title. Axis title is aSGLabelenabling the Color, Font, size to be set.- Parameters:
title- axis title
-
getTitle
public SGLabel getTitle()
Get the axis title.- Returns:
- axis title
-
setSelectable
public void setSelectable(boolean selectable)
Set the selecatability of the axis. If true, axis can be selected with the mouse. Default = true.- Parameters:
selectable- selectable
-
isSelectable
public boolean isSelectable()
Test if the axis selectable.- Returns:
- true, if the axis can be selected
-
setVisible
public void setVisible(boolean visible)
Set/unset the axis visibility. If true, the axis will be displayed. Default = true.- Parameters:
visible- visible
-
isVisible
public boolean isVisible()
Test if the axis visible.- Returns:
- true, if axis is set visible
-
setLabelFormat
public void setLabelFormat(java.lang.String labelFormat)
Set the axis label format. Not used with time axes. Default = ""- Parameters:
labelFormat- axis label format
-
getLabelFormat
public java.lang.String getLabelFormat()
Get the label format.- Returns:
- label format.
-
setLabelInterval
public void setLabelInterval(int labelInterval)
Set the label interval. Not used with time axes. Default = 2.- Parameters:
labelInterval- axis label interval
-
getLabelInterval
public int getLabelInterval()
Get the label interval.- Returns:
- label interval
-
setLabelSignificantDigits
public void setLabelSignificantDigits(int labelSignificantDigits)
Set the axis label significant digits. Not used with time axes. Default = 2.- Parameters:
labelSignificantDigits- axis label significant digits
-
getLabelSignificantDigits
public int getLabelSignificantDigits()
Get axis label significant digits- Returns:
- significant digits
-
setMinorFormat
public void setMinorFormat(java.lang.String minorFormat)
Set the time axis minor label format. Default = "MMM", appropriate for MONTH_YEAR.- Parameters:
minorFormat- time axis minor format
-
getMinorFormat
public java.lang.String getMinorFormat()
Get time axis minor label format.- Returns:
- minor label format
-
setMajorFormat
public void setMajorFormat(java.lang.String majorFormat)
Get the time axis major label format. Default = "yyyy", appropriate for MONTH_YEAR.- Parameters:
majorFormat- time axis major format
-
getMajorFormat
public java.lang.String getMajorFormat()
Get time axis major label format- Returns:
- major label format
-
setMinorInterval
public void setMinorInterval(int minorInterval)
Set time axis minor label interval. Default = 2.- Parameters:
minorInterval- time axis minor interval
-
getMinorInterval
public int getMinorInterval()
Get time axis minor label interval- Returns:
- minor label interval
-
setMajorInterval
public void setMajorInterval(int majorInterval)
Set time axis major label interval. Default = 1.- Parameters:
majorInterval- time axis major interval
-
getMajorInterval
public int getMajorInterval()
Get time axis major label interval- Returns:
- major label interval
-
setTimeAxisStyle
public void setTimeAxisStyle(int timeAxisStyle)
Set the time axis style. Styles include:timeAxisStyle = TimeAxis.AUTO, TimeAxis.DAY_MONTH, TimeAxis.HOUR_DAY, TimeAxis.MINUTE_HOUR, TimeAxis.MONTH_YEAR, TimeAxis.YEAR_DECADEDefault = AUTO.- Parameters:
timeAxisStyle- time axis style
-
getTimeAxisStyle
public int getTimeAxisStyle()
Get the time axis style.- Returns:
- time axis style
-
setTransformType
public void setTransformType(int transformType)
Set the axis transform type. Transform types include:transformType = DataGroup.LINEAR, DataGroup.LOG, DataGroup.REFERENCE
Default = LINEAR.- Parameters:
transformType- axis transform type
-
getTransformType
public int getTransformType()
Get the axis transform type.- Returns:
- transform type
-
setTransformGroup
public void setTransformGroup(java.lang.String transformGroup)
Set the transform group. The transform group is used when the transformType = DataGroup.REFERENCE. The transformGroup is theDataGroupid containing the transform to be referenced. No default.- Parameters:
transformGroup- axis transform group name
-
getTransformGroup
public java.lang.String getTransformGroup()
Get transform group name.- Returns:
- transform group
-
setAxisPosition
public void setAxisPosition(int axisPosition)
Set the axis position. Axis positions include:axisPosition = DataGroup.TOP, DataGroup.BOTTOM, (for x axes) DataGroup.LEFT, DataGroup.RIGHT, (for y axes) DataGroup.MANUALNo default.- Parameters:
axisPosition- axis position
-
getAxisPosition
public int getAxisPosition()
Get the axis position- Returns:
- axis position
-
setAxisOriginP
public void setAxisOriginP(Point2D.Double axisOriginP)
Set the axis origin in physical coordinates. This is used when axisPosition = MANUAL. Default = (0, 0).- Parameters:
axisOriginP- axis origin
-
getAxisOriginP
public Point2D.Double getAxisOriginP()
Get axis origin.- Returns:
- axis origin
-
setLocationAtOrigin
public void setLocationAtOrigin(boolean locationAtOrigin)
Set axis at origin of perpendicular axis. Not implemented. Default = false.- Parameters:
locationAtOrigin- set location at origin
-
isLocationAtOrigin
public boolean isLocationAtOrigin()
Test if the axis at the origin. Not presently implemented.- Returns:
- true, if axis will be at origin
-
setTitleAuto
public void setTitleAuto(boolean titleAuto)
Set the title auto property. Set true to determine the title from the data. Default = true.- Parameters:
titleAuto- auto title property
-
isTitleAuto
public boolean isTitleAuto()
Test if the title in auto mode.- Returns:
- true, if title is automatically generated
-
-
DMelt 3.0 © DataMelt by jWork.ORG