org.jplot2d.element.impl
Class LayerImpl
- java.lang.Object
-
- org.jplot2d.element.impl.ElementImpl
-
- org.jplot2d.element.impl.ComponentImpl
-
- org.jplot2d.element.impl.ContainerImpl
-
- org.jplot2d.element.impl.LayerImpl
-
- All Implemented Interfaces:
- Element, ComponentEx, ContainerEx, ElementEx, LayerEx, Layer, PComponent
public class LayerImpl extends ContainerImpl implements LayerEx
-
-
Constructor Summary
Constructors Constructor and Description LayerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddAnnotation(Annotation annotation)Add a new annotation to this layer.voidaddGraph(Graph graph)Adds a graph to this layer.booleancanContribute()Returnstrueif this component can contribute visible parts to plot rendering artifact when this component is visible.LayerExcopyStructure(java.util.Map<ElementEx,ElementEx> orig2copyMap)Create a structural copy of this element and put them into orig2copyMap.AnnotationgetAnnotation(int idx)Returns the annotation.AnnotationEx[]getAnnotations()Returns all the annotations in this layer.ComponentEx[]getComponents()Returns the components in this container.GraphgetGraph(int index)Returns the graph on the given index.GraphEx[]getGraphs()Returns all graph of this layer.java.lang.StringgetId()Returns the id string of this elementInvokeStepgetInvokeStepFormParent()Return the invoke step to get this object from its parent.java.awt.geom.Point2DgetLocation()Returns the location of this component.java.util.Map<Element,Element>getMooringMap()Returns a map to tell why this component cannot be removed from its container.PaperTransformgetPaperTransform()Returns the paper transform of this component, which can be used to convert between device coordinate and paper coordinate of this component.PlotExgetParent()Gets the parent of this component.java.lang.StringgetShortId()Returns the short id of this layer.java.awt.geom.Dimension2DgetSize()Returns the paper size of this component.AxisTransformExgetXAxisTransform()Returns the X axis to this layer attaching.AxisTransformExgetYAxisTransform()Returns the Y axis to this layer attaching.intindexOf(AnnotationEx annotation)intindexOf(GraphEx graph)voidlinkXAxisTransform(AxisTransformEx axt)voidlinkYAxisTransform(AxisTransformEx axt)voidremoveAnnotation(Annotation annotation)Remove the annotation from this layer.voidremoveGraph(Graph graph)Remove the graph from this layer.voidsetAxesTransform(AxisTransform xaxis, AxisTransform yaxis)Attach this layer to the given X/Y axis pair.voidsetXAxisTransform(AxisTransform axis)Attach this layer to the given X axis.voidsetYAxisTransform(AxisTransform axis)Attach this layer to the given Y axis.voidtransformChanged()Called byAxisTransformExto notify that x/y transform is changed.-
Methods inherited from class org.jplot2d.element.impl.ContainerImpl
draw, thisEffectiveColorChanged, thisEffectiveFontChanged
-
Methods inherited from class org.jplot2d.element.impl.ComponentImpl
addPropertyChangeListener, copyFrom, getBounds, getColor, getEffectiveColor, getEffectiveFont, getEffectiveFontName, getEffectiveFontSize, getEffectiveFontStyle, getFontName, getFontScale, getFontSize, getFontStyle, getSelectableBounds, getZOrder, isCacheable, isMovable, isRedrawNeeded, isSelectable, isVisible, parentEffectiveColorChanged, parentEffectiveFontChanged, removePropertyChangeListener, setCacheable, setColor, setFont, setFontName, setFontScale, setFontSize, setFontStyle, setMovable, setRedrawNeeded, setSelectable, setVisible, setZOrder
-
Methods inherited from class org.jplot2d.element.impl.ElementImpl
getEnvironment, getFullId, notify, setParent, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jplot2d.element.impl.ComponentEx
draw, getEffectiveColor, getEffectiveFontName, getEffectiveFontSize, getEffectiveFontStyle, isMovable, isRedrawNeeded, parentEffectiveColorChanged, parentEffectiveFontChanged, setMovable, setRedrawNeeded, thisEffectiveColorChanged, thisEffectiveFontChanged
-
Methods inherited from interface org.jplot2d.element.PComponent
getBounds, getColor, getEffectiveFont, getFontName, getFontScale, getFontSize, getFontStyle, getSelectableBounds, getZOrder, isCacheable, isSelectable, isVisible, setCacheable, setColor, setFont, setFontName, setFontScale, setFontSize, setFontStyle, setSelectable, setVisible, setZOrder
-
Methods inherited from interface org.jplot2d.element.impl.ElementEx
copyFrom, getFullId, notify, setParent
-
Methods inherited from interface org.jplot2d.element.Element
getEnvironment
-
-
-
-
Method Detail
-
getId
public java.lang.String getId()
Description copied from interface:ElementReturns the id string of this element
-
getShortId
public java.lang.String getShortId()
Description copied from interface:LayerExReturns the short id of this layer. 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:
getShortIdin interfaceLayerEx- Returns:
- the short id of this layer.
-
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 PlotEx getParent()
Description copied from interface:ElementGets the parent of this component.- Specified by:
getParentin interfaceElement- Specified by:
getParentin interfaceComponentEx- Specified by:
getParentin interfaceElementEx- Specified by:
getParentin interfaceLayerEx- Specified by:
getParentin interfaceLayer- Specified by:
getParentin interfacePComponent- Overrides:
getParentin classComponentImpl- Returns:
- the parent of this component
-
getMooringMap
public java.util.Map<Element,Element> getMooringMap()
Description copied from interface:ComponentExReturns 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:
getMooringMapin interfaceComponentEx- Overrides:
getMooringMapin classComponentImpl- Returns:
- a map. The key is the element required by its value.
-
getLocation
public java.awt.geom.Point2D getLocation()
Description copied from interface:PComponentReturns the location of this component.- Specified by:
getLocationin interfacePComponent- Returns:
- the base point in its parent's paper coordinate space
-
getSize
public java.awt.geom.Dimension2D getSize()
Description copied from interface:PComponentReturns the paper size of this component.- Specified by:
getSizein interfacePComponent- Returns:
-
getPaperTransform
public PaperTransform getPaperTransform()
Description copied from interface:PComponentReturns 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
nullif the component is not added to a plot or not laid out- Specified by:
getPaperTransformin interfacePComponent- Overrides:
getPaperTransformin classComponentImpl- Returns:
- the paper transform of this component
-
transformChanged
public void transformChanged()
Description copied from interface:LayerExCalled byAxisTransformExto notify that x/y transform is changed.- Specified by:
transformChangedin interfaceLayerEx
-
getComponents
public ComponentEx[] getComponents()
Description copied from interface:ContainerExReturns the components in this container.- Specified by:
getComponentsin interfaceContainerEx- Returns:
- an array of sub-components
-
getGraph
public Graph getGraph(int index)
Description copied from interface:LayerReturns the graph on the given index.
-
getGraphs
public GraphEx[] getGraphs()
Description copied from interface:LayerReturns all graph of this layer.
-
addGraph
public void addGraph(Graph graph)
Description copied from interface:LayerAdds a graph to this layer.
-
removeGraph
public void removeGraph(Graph graph)
Description copied from interface:LayerRemove the graph from this layer.- Specified by:
removeGraphin interfaceLayer- Parameters:
graph- the graph to be removed
-
getAnnotations
public AnnotationEx[] getAnnotations()
Description copied from interface:LayerReturns all the annotations in this layer.- Specified by:
getAnnotationsin interfaceLayerEx- Specified by:
getAnnotationsin interfaceLayer- Returns:
- all annotations in an array
-
getAnnotation
public Annotation getAnnotation(int idx)
Description copied from interface:LayerReturns the annotation.- Specified by:
getAnnotationin interfaceLayer- Returns:
- the annotation.
-
addAnnotation
public void addAnnotation(Annotation annotation)
Description copied from interface:LayerAdd a new annotation to this layer.- Specified by:
addAnnotationin interfaceLayer- Parameters:
annotation- the annotation to be added
-
removeAnnotation
public void removeAnnotation(Annotation annotation)
Description copied from interface:LayerRemove the annotation from this layer.- Specified by:
removeAnnotationin interfaceLayer- Parameters:
annotation- the annotation to be removed
-
indexOf
public int indexOf(AnnotationEx annotation)
-
canContribute
public boolean canContribute()
Description copied from interface:ComponentExReturnstrueif this component can contribute visible parts to plot rendering artifact when this component is visible. Subcomponents are not considered.- Specified by:
canContributein interfaceComponentEx- Overrides:
canContributein classComponentImpl- Returns:
- the indicator
-
getXAxisTransform
public AxisTransformEx getXAxisTransform()
Description copied from interface:LayerReturns the X axis to this layer attaching.- Specified by:
getXAxisTransformin interfaceLayerEx- Specified by:
getXAxisTransformin interfaceLayer- Returns:
-
getYAxisTransform
public AxisTransformEx getYAxisTransform()
Description copied from interface:LayerReturns the Y axis to this layer attaching.- Specified by:
getYAxisTransformin interfaceLayerEx- Specified by:
getYAxisTransformin interfaceLayer- Returns:
-
linkXAxisTransform
public void linkXAxisTransform(AxisTransformEx axt)
- Specified by:
linkXAxisTransformin interfaceLayerEx
-
linkYAxisTransform
public void linkYAxisTransform(AxisTransformEx axt)
- Specified by:
linkYAxisTransformin interfaceLayerEx
-
setXAxisTransform
public void setXAxisTransform(AxisTransform axis)
Description copied from interface:LayerAttach this layer to the given X axis. When adding a layer to a plot, the axis must exist in the destination environment, otherwise an exception will be thrown.- Specified by:
setXAxisTransformin interfaceLayer- Parameters:
axis- axis transform
-
setYAxisTransform
public void setYAxisTransform(AxisTransform axis)
Description copied from interface:LayerAttach this layer to the given Y axis. When adding a layer to a plot, the axis must exist in the destination environment, otherwise an exception will be thrown.- Specified by:
setYAxisTransformin interfaceLayer- Parameters:
axis- axis transform
-
setAxesTransform
public void setAxesTransform(AxisTransform xaxis, AxisTransform yaxis)
Description copied from interface:LayerAttach this layer to the given X/Y axis pair. When adding a layer to a plot, the X/Y axes must exist in the destination environment, otherwise an exception will be thrown.- Specified by:
setAxesTransformin interfaceLayer- Parameters:
xaxis- the x axis transformyaxis- the y axis transform
-
copyStructure
public LayerEx 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 interfaceComponentEx- Specified by:
copyStructurein interfaceElementEx- Overrides:
copyStructurein classComponentImpl- Parameters:
orig2copyMap- original element to copy map- Returns:
- the structural copy of this element
-
-
DMelt 3.0 © DataMelt by jWork.ORG