org.jplot2d.element.impl
Class AxisTransformImpl
- java.lang.Object
-
- org.jplot2d.element.impl.ElementImpl
-
- org.jplot2d.element.impl.AxisTransformImpl
-
- All Implemented Interfaces:
- AxisTransform, Element, AxisTransformEx, ElementEx, Joinable
public class AxisTransformImpl extends ElementImpl implements AxisTransformEx
-
-
Field Summary
Fields Modifier and Type Field and Description static doubleDEFAULT_MARGIN_FACTORThe default margin factor (used for both lower and upper margins)
-
Constructor Summary
Constructors Constructor and Description AxisTransformImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddLayer(LayerEx layer)Called when a layer attach to this viewport axisvoidaddTickManager(AxisTickManagerEx tickManager)voidchangeTransformType(TransformType txfType)voidcopyFrom(ElementEx src)Copies all properties from given src to this element.AxisTransformExcopyStructure(java.util.Map<ElementEx,ElementEx> orig2copyMap)Create a structural copy of this element and put them into orig2copyMap.RangeexpandRangeToTick(Range ur)RangegetCoreRange()Return the core range of the AxisTransform.java.lang.StringgetFullId()Returns the full id of this component.java.lang.StringgetId()Returns the id string of this elementInvokeStepgetInvokeStepFormParent()Return the invoke step to get this object from its parent.LayerEx[]getLayers()Returns all layers attaching to this AxisTransform.AxisRangeLockGroupExgetLockGroup()Returns the lock group to that this AxisTransform belongs.doublegetMarginFactor()Returns the factor that the margin will be appended to rangeNormalTransformgetNormalTransform()Returns the normal transform of this AxisTransformAxisTickManagerExgetParent()Gets the parent of this component.ElementExgetPrim()Returns the primary referencer.RangegetRange()Return the range of the AxisTransform.AxisTickManagerEx[]getTickManagers()Returns all axis tick managers belongs to this range manager.TransformTypegetTransform()Returns the transform typeAxisTypegetType()Return the type of this axis.intindexOfTickManager(AxisTickManagerEx tickManager)booleanisAutoMargin()Returnstrueif the margin is extended to an axis major tick automatically.booleanisInverted()Returnstrueif this AxisTransform is inverted.voidlinkLayer(LayerEx layer)voidnotify(Notice msg)Element call this method to notify message to its parent.voidremoveLayer(LayerEx layer)Called when a layer detach from this viewport axisvoidremoveTickManager(AxisTickManagerEx tickManager)voidsetAutoMargin(boolean autoMargin)Controls if the the margin is extended to an axis major tick automatically.voidsetCoreRange(Range crange)Set the core range of the AxisTransform.voidsetInverted(boolean flag)Setsfalseto make this AxisTransform have "normal" displaying, ortrueto have "inverted" displaying.voidsetLockGroup(AxisRangeLockGroup group)Join an axis lock group.voidsetMarginFactor(double factor)Sets the factor that the margin will be appended to rangevoidsetNormalTransfrom(NormalTransform ntf)Sets the normal transform of this axisvoidsetRange(Range urange)Set the actual range displayed in the AxisTransform.voidsetTransform(TransformType txfType)Sets the transform typevoidsetType(AxisType type)Set the type of the axis.-
Methods inherited from class org.jplot2d.element.impl.ElementImpl
getEnvironment, setParent, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jplot2d.element.Element
getEnvironment
-
-
-
-
Field Detail
-
DEFAULT_MARGIN_FACTOR
public static final double DEFAULT_MARGIN_FACTOR
The default margin factor (used for both lower and upper margins)- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public java.lang.String getId()
Description copied from interface:ElementReturns the id string of this element
-
getFullId
public java.lang.String getFullId()
Description copied from interface:ElementExReturns the full id of this component. The full 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 the root plot.- Specified by:
getFullIdin interfaceElementEx- Overrides:
getFullIdin classElementImpl- Returns:
- the full id of this component
-
getInvokeStepFormParent
public InvokeStep getInvokeStepFormParent()
Description copied from interface:ElementExReturn the invoke step to get this object from its parent.- Specified by:
getInvokeStepFormParentin interfaceElementEx- Returns:
- the invoke step
-
getParent
public AxisTickManagerEx getParent()
Description copied from interface:ElementGets the parent of this component.- Specified by:
getParentin interfaceElement- Specified by:
getParentin interfaceAxisTransformEx- Specified by:
getParentin interfaceElementEx- Overrides:
getParentin classElementImpl- Returns:
- the parent of this component
-
getPrim
public ElementEx getPrim()
Description copied from interface:JoinableReturns the primary referencer.
-
notify
public void notify(Notice msg)
Description copied from interface:ElementExElement call this method to notify message to its parent.- Specified by:
notifyin interfaceElementEx- Overrides:
notifyin classElementImpl- Parameters:
msg- the notice message
-
isInverted
public boolean isInverted()
Description copied from interface:AxisTransformReturnstrueif this AxisTransform is inverted.- Specified by:
isInvertedin interfaceAxisTransform- Returns:
trueif this AxisTransform is inverted
-
setInverted
public void setInverted(boolean flag)
Description copied from interface:AxisTransformSetsfalseto make this AxisTransform have "normal" displaying, ortrueto have "inverted" displaying.- Specified by:
setInvertedin interfaceAxisTransform- Parameters:
flag- if flag istruethis AxisTransform is inverted, if flag isfalsethis AxisTransform is normal
-
isAutoMargin
public boolean isAutoMargin()
Description copied from interface:AxisTransformReturnstrueif the margin is extended to an axis major tick automatically. The minimal margin is controlled byAxisTransform.getMarginFactor()- Specified by:
isAutoMarginin interfaceAxisTransform- Returns:
trueif the margin is auto-selected
-
setAutoMargin
public void setAutoMargin(boolean autoMargin)
Description copied from interface:AxisTransformControls if the the margin is extended to an axis major tick automatically.- Specified by:
setAutoMarginin interfaceAxisTransform- Parameters:
autoMargin- the switch
-
getMarginFactor
public double getMarginFactor()
Description copied from interface:AxisTransformReturns the factor that the margin will be appended to range- Specified by:
getMarginFactorin interfaceAxisTransform- Returns:
- the margin factor
-
setMarginFactor
public void setMarginFactor(double factor)
Description copied from interface:AxisTransformSets the factor that the margin will be appended to range- Specified by:
setMarginFactorin interfaceAxisTransform- Parameters:
factor- the margin factor
-
getType
public AxisType getType()
Description copied from interface:AxisTransformReturn the type of this axis.- Specified by:
getTypein interfaceAxisTransform- Returns:
- the type of this axis
-
setType
public void setType(AxisType type)
Description copied from interface:AxisTransformSet the type of the axis. An axis type can only be changed when it dosn't lock with other axes.- Specified by:
setTypein interfaceAxisTransform- Parameters:
type- the axis type
-
getTransform
public TransformType getTransform()
Description copied from interface:AxisTransformReturns the transform type- Specified by:
getTransformin interfaceAxisTransform- Returns:
- the transform type
-
setTransform
public void setTransform(TransformType txfType)
Description copied from interface:AxisTransformSets the transform type- Specified by:
setTransformin interfaceAxisTransform- Parameters:
txfType- the transform type
-
changeTransformType
public void changeTransformType(TransformType txfType)
- Specified by:
changeTransformTypein interfaceAxisTransformEx
-
getLockGroup
public AxisRangeLockGroupEx getLockGroup()
Description copied from interface:AxisTransformReturns the lock group to that this AxisTransform belongs. A AxisTransform must has a lock group, which have this AxisTransform at least.- Specified by:
getLockGroupin interfaceAxisTransform- Specified by:
getLockGroupin interfaceAxisTransformEx- Returns:
-
setLockGroup
public void setLockGroup(AxisRangeLockGroup group)
Description copied from interface:AxisTransformJoin an axis lock group. The lock group must exist in the same environment, otherwise an exception will be thrown.- Specified by:
setLockGroupin interfaceAxisTransform- Parameters:
group- the lock group to join to.
-
getNormalTransform
public NormalTransform getNormalTransform()
Description copied from interface:AxisTransformReturns the normal transform of this AxisTransform- Specified by:
getNormalTransformin interfaceAxisTransform- Returns:
- the normal transform
-
setNormalTransfrom
public void setNormalTransfrom(NormalTransform ntf)
Description copied from interface:AxisTransformExSets the normal transform of this axis- Specified by:
setNormalTransfromin interfaceAxisTransformEx- Parameters:
ntf- the normal transform
-
getTickManagers
public AxisTickManagerEx[] getTickManagers()
Description copied from interface:AxisTransformReturns all axis tick managers belongs to this range manager.- Specified by:
getTickManagersin interfaceAxisTransform- Specified by:
getTickManagersin interfaceAxisTransformEx- Returns:
- all axes tick managers belongs to this range manager.
-
addTickManager
public void addTickManager(AxisTickManagerEx tickManager)
- Specified by:
addTickManagerin interfaceAxisTransformEx
-
removeTickManager
public void removeTickManager(AxisTickManagerEx tickManager)
- Specified by:
removeTickManagerin interfaceAxisTransformEx
-
indexOfTickManager
public int indexOfTickManager(AxisTickManagerEx tickManager)
- Specified by:
indexOfTickManagerin interfaceAxisTransformEx
-
getLayers
public LayerEx[] getLayers()
Description copied from interface:AxisTransformReturns all layers attaching to this AxisTransform.- Specified by:
getLayersin interfaceAxisTransform- Specified by:
getLayersin interfaceAxisTransformEx- Returns:
-
addLayer
public void addLayer(LayerEx layer)
Description copied from interface:AxisTransformExCalled when a layer attach to this viewport axis- Specified by:
addLayerin interfaceAxisTransformEx- Parameters:
layer- the layer
-
removeLayer
public void removeLayer(LayerEx layer)
Description copied from interface:AxisTransformExCalled when a layer detach from this viewport axis- Specified by:
removeLayerin interfaceAxisTransformEx- Parameters:
layer- the layer
-
linkLayer
public void linkLayer(LayerEx layer)
- Specified by:
linkLayerin interfaceAxisTransformEx
-
getCoreRange
public Range getCoreRange()
Description copied from interface:AxisTransformReturn the core range of the AxisTransform. The returned range will be negative (start > end) if this AxisTransform is inverted.- Specified by:
getCoreRangein interfaceAxisTransform- Returns:
- the core range
-
setCoreRange
public void setCoreRange(Range crange)
Description copied from interface:AxisTransformSet the core range of the AxisTransform. The range will expand according to the settings of autoMargin and marginFactor, and derive an actual range. The given range can be positive (start < end) or negative (start > end). It has not effect on the inverted property. All locked axes will follow the change of this axis.If user want set actual range directly by
AxisTransform.setRange(Range), The coreRange will be set tonullautomatically.- Specified by:
setCoreRangein interfaceAxisTransform- Parameters:
crange- the core range to be set
-
getRange
public Range getRange()
Description copied from interface:AxisTransformReturn the range of the AxisTransform. The returned range will be negative (start > end) if this AxisTransform is inverted.- Specified by:
getRangein interfaceAxisTransform- Returns:
- the actual range displayed
-
setRange
public void setRange(Range urange)
Description copied from interface:AxisTransformSet the actual range displayed in the AxisTransform. The given range can be positive (start < end) or negative (start > end). It has not effect on the inverted property. All locked axes will follow the change of this axis.The coreRange is set to
nullafter calling this method.- Specified by:
setRangein interfaceAxisTransform- Parameters:
urange- the actual range to be set.
-
expandRangeToTick
public Range expandRangeToTick(Range ur)
- Specified by:
expandRangeToTickin interfaceAxisTransformEx
-
copyStructure
public AxisTransformEx copyStructure(java.util.Map<ElementEx,ElementEx> orig2copyMap)
Description copied from interface:ElementExCreate 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:
copyStructurein interfaceElementEx- Overrides:
copyStructurein classElementImpl- Parameters:
orig2copyMap- original element to copy map- Returns:
- the structural copy of this element
-
copyFrom
public void copyFrom(ElementEx src)
Description copied from interface:ElementExCopies all properties from given src to this element. Notice properties of sub-elements are not copied over.- Specified by:
copyFromin interfaceElementEx- Overrides:
copyFromin classElementImpl- Parameters:
src- the src
-
-
DMelt 3.0 © DataMelt by jWork.ORG