sgtplot
Class PointCollectionKey
- java.lang.Object
-
- sgtplot.PointCollectionKey
-
- All Implemented Interfaces:
- java.beans.PropertyChangeListener, java.lang.Cloneable, java.util.EventListener, DataKey, LayerChild, Moveable, Selectable
public class PointCollectionKey extends java.lang.Object implements java.lang.Cloneable, DataKey, Moveable, java.beans.PropertyChangeListener
PointCollectionKeyis used to create a key for thePointCartesianRenderer. Multiple lines can be included in the key.- Since:
- 2.0
-
-
Field Summary
Fields Modifier and Type Field and Description static intBOTTOMAlign to bottom of key.static intCENTERAlign to center of key.static intLEFTAlign to left of key.static intMIDDLEAlign to middle of key.static intNO_BORDERDo not draw a border.static intPLAIN_LINEUse plain line border.static intRAISEDUse raised border.static intRIGHTAlign to right of key.static intTOPAlign to top of key.
-
Constructor Summary
Constructors Constructor and Description PointCollectionKey()Default constructor.PointCollectionKey(Point2D.Double loc, int valign, int halign)CreatePointCollectionKey.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddGraph(CartesianRenderer rend, SGLabel label)Add a PointCartesianRenderer and label to the PointCollectionKey.voidaddPointGraph(PointCartesianRenderer points, SGLabel label)Add a PointCartesianRenderer and label to the PointCollectionKey.voidaddPropertyChangeListener(java.beans.PropertyChangeListener l)Add a new PropertyChangeListener.voidclear(java.lang.String data_id)Remove data from key by id.voidclearAll()Remove all lines from the PointCollectionKey.LayerChildcopy()Create of copy of PointCollectionKey.voiddraw(org.freehep.graphics2d.VectorGraphics g)Draw the Key.intgetBorderStyle()Get border style.java.awt.RectanglegetBounds()Get the bounding rectangle.Rectangle2D.DoublegetBoundsP()intgetColumns()Get the number of columns.intgetHAlign()Get horizontal alignmentjava.lang.StringgetId()Get PointCollectionKey identifierLayergetLayer()Get layer.doublegetLineLengthP()Get line lengthjava.awt.PointgetLocation()Gets the location in device coordinates.Point2D.DoublegetLocationP()Get location of key.AbstractPanegetPane()GetAbstractPaneof theLayerChild.intgetRowHeight()Return height of key row in pixels.intgetVAlign()Get vertical alignmentbooleanisMoveable()Returns true if the current state is moveablebooleanisSelectable()Returns true if the current state is selectable.booleanisSelected()Returns true if the object's selected property is set.booleanisVisible()Check ifLayerChildis visible.voidmodified(java.lang.String mess)Used by sgtplot internally.voidpropertyChange(java.beans.PropertyChangeEvent evt)voidremovePointGraph(SGLabel label)Remove a line from the PointCollectionKey.voidremovePointGraph(java.lang.String ident)Remove a line from the PointCollectionKey.voidremovePointRenderer(PointCartesianRenderer line)Remove a line from the PointCollectionKey.voidremovePropertyChangeListener(java.beans.PropertyChangeListener l)Remove a listener.voidsetAlign(int vert, int horz)Set alignment.voidsetBorderStyle(int style)Set border style.voidsetBounds(int x, int y, int width, int height)Set the bounds, in pixels, of thePointCollectionKey
Property Change:location.voidsetBounds(java.awt.Rectangle r)Set the bounds, in pixels, of thePointCollectionKeyvoidsetBoundsP(Rectangle2D.Double r)Set the bounds, in physical units, of thePointCollectionKeyvoidsetColumns(int col)Set the number of columns.voidsetHAlign(int horz)Set horizontal alignmentvoidsetId(java.lang.String id)Set PointCollectionKey identifier.voidsetLayer(Layer l)Set parent layer.voidsetLineLengthP(double len)Set line length.voidsetLocation(java.awt.Point loc)Sets the location in device coordinates.voidsetLocationP(Point2D.Double loc)Set location of key
Property Change:location.voidsetMoveable(boolean moveable)Set the moveable property.voidsetSelectable(boolean select)Set the Selectable property.voidsetSelected(boolean sel)Sets the selected property.voidsetVAlign(int vert)Set vertical alignmentvoidsetVisible(boolean visible)Set visibility for aLayerChild.java.lang.StringtoString()Return a string that represents theLayerChild.
-
-
-
Field Detail
-
PLAIN_LINE
public static final int PLAIN_LINE
Use plain line border.- See Also:
- Constant Field Values
-
RAISED
public static final int RAISED
Use raised border.- See Also:
- Constant Field Values
-
NO_BORDER
public static final int NO_BORDER
Do not draw a border.- See Also:
- Constant Field Values
-
TOP
public static final int TOP
Align to top of key.- See Also:
- Constant Field Values
-
MIDDLE
public static final int MIDDLE
Align to middle of key.- See Also:
- Constant Field Values
-
BOTTOM
public static final int BOTTOM
Align to bottom of key.- See Also:
- Constant Field Values
-
LEFT
public static final int LEFT
Align to left of key.- See Also:
- Constant Field Values
-
CENTER
public static final int CENTER
Align to center of key.- See Also:
- Constant Field Values
-
RIGHT
public static final int RIGHT
Align to right of key.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PointCollectionKey
public PointCollectionKey()
Default constructor.
-
PointCollectionKey
public PointCollectionKey(Point2D.Double loc, int valign, int halign)
CreatePointCollectionKey.
-
-
Method Detail
-
copy
public LayerChild copy()
Create of copy of PointCollectionKey.- Specified by:
copyin interfaceLayerChild- Returns:
- A copy of the
LayerChild.
-
setSelected
public void setSelected(boolean sel)
Description copied from interface:SelectableSets the selected property.- Specified by:
setSelectedin interfaceSelectable- Parameters:
sel- true if selected, false if not.
-
isSelected
public boolean isSelected()
Description copied from interface:SelectableReturns true if the object's selected property is set.- Specified by:
isSelectedin interfaceSelectable- Returns:
- true if selected, false if not.
-
setSelectable
public void setSelectable(boolean select)
Description copied from interface:SelectableSet the Selectable property.- Specified by:
setSelectablein interfaceSelectable- Parameters:
select- if true object is selectable
-
isSelectable
public boolean isSelectable()
Description copied from interface:SelectableReturns true if the current state is selectable.- Specified by:
isSelectablein interfaceSelectable- Returns:
- true if selectable
-
isMoveable
public boolean isMoveable()
Description copied from interface:MoveableReturns true if the current state is moveable- Specified by:
isMoveablein interfaceMoveable- Returns:
- true if moveable
-
setMoveable
public void setMoveable(boolean moveable)
Description copied from interface:MoveableSet the moveable property.- Specified by:
setMoveablein interfaceMoveable
-
setLayer
public void setLayer(Layer l)
Set parent layer.- Specified by:
setLayerin interfaceLayerChild- Parameters:
l- parent layer
-
getLayer
public Layer getLayer()
Get layer.- Specified by:
getLayerin interfaceLayerChild- Returns:
- layer
-
getPane
public AbstractPane getPane()
Description copied from interface:LayerChildGetAbstractPaneof theLayerChild.- Specified by:
getPanein interfaceLayerChild
-
modified
public void modified(java.lang.String mess)
Description copied from interface:LayerChildUsed by sgtplot internally.- Specified by:
modifiedin interfaceLayerChild
-
setId
public void setId(java.lang.String id)
Set PointCollectionKey identifier.- Specified by:
setIdin interfaceLayerChild- Parameters:
id- key identifier
-
getId
public java.lang.String getId()
Get PointCollectionKey identifier- Specified by:
getIdin interfaceLayerChild- Returns:
- identifier
-
setLineLengthP
public void setLineLengthP(double len)
Set line length.- Specified by:
setLineLengthPin interfaceDataKey- Parameters:
len- line length
-
getLineLengthP
public double getLineLengthP()
Get line length- Returns:
- line length
-
setColumns
public void setColumns(int col)
Set the number of columns.- Specified by:
setColumnsin interfaceDataKey- Parameters:
col- number of columns
-
getColumns
public int getColumns()
Get the number of columns.- Returns:
- number of columns
-
setBorderStyle
public void setBorderStyle(int style)
Set border style.- Specified by:
setBorderStylein interfaceDataKey- Parameters:
style- border style- See Also:
PLAIN_LINE,RAISED,NO_BORDER
-
getBorderStyle
public int getBorderStyle()
Get border style.- Returns:
- border style
-
setAlign
public void setAlign(int vert, int horz)Set alignment.
-
setVAlign
public void setVAlign(int vert)
Set vertical alignment
-
setHAlign
public void setHAlign(int horz)
Set horizontal alignment
-
getVAlign
public int getVAlign()
Get vertical alignment- Returns:
- vertical alignment
-
getHAlign
public int getHAlign()
Get horizontal alignment- Returns:
- horizontal alignment
-
setLocationP
public void setLocationP(Point2D.Double loc)
Set location of key
Property Change:location.- Specified by:
setLocationPin interfaceDataKey- Parameters:
loc- key location
-
setBoundsP
public void setBoundsP(Rectangle2D.Double r)
Set the bounds, in physical units, of thePointCollectionKey- Specified by:
setBoundsPin interfaceDataKey
-
getBoundsP
public Rectangle2D.Double getBoundsP()
-
getLocationP
public Point2D.Double getLocationP()
Get location of key.- Returns:
- Key location
-
addPointGraph
public void addPointGraph(PointCartesianRenderer points, SGLabel label)
Add a PointCartesianRenderer and label to the PointCollectionKey.- Parameters:
line- PointCartesianRenderer objectlabel- descriptive label
-
addGraph
public void addGraph(CartesianRenderer rend, SGLabel label) throws java.lang.IllegalArgumentException
Add a PointCartesianRenderer and label to the PointCollectionKey.
-
removePointGraph
public void removePointGraph(SGLabel label)
Remove a line from the PointCollectionKey.
-
removePointRenderer
public void removePointRenderer(PointCartesianRenderer line)
Remove a line from the PointCollectionKey.
-
removePointGraph
public void removePointGraph(java.lang.String ident)
Remove a line from the PointCollectionKey.
-
clearAll
public void clearAll()
Remove all lines from the PointCollectionKey.
-
clear
public void clear(java.lang.String data_id)
Remove data from key by id.
-
getRowHeight
public int getRowHeight()
Return height of key row in pixels.
-
draw
public void draw(org.freehep.graphics2d.VectorGraphics g)
Draw the Key.- Specified by:
drawin interfaceLayerChild- Parameters:
g- Graphics context
-
getBounds
public java.awt.Rectangle getBounds()
Get the bounding rectangle.- Specified by:
getBoundsin interfaceMoveable- Specified by:
getBoundsin interfaceSelectable- Returns:
- bounding rectangle
-
getLocation
public java.awt.Point getLocation()
Description copied from interface:MoveableGets the location in device coordinates.- Specified by:
getLocationin interfaceMoveable- Returns:
- location
-
setLocation
public void setLocation(java.awt.Point loc)
Description copied from interface:MoveableSets the location in device coordinates.- Specified by:
setLocationin interfaceMoveable
-
setBounds
public void setBounds(java.awt.Rectangle r)
Set the bounds, in pixels, of thePointCollectionKey
-
setBounds
public void setBounds(int x, int y, int width, int height)Set the bounds, in pixels, of thePointCollectionKey
Property Change:location.
-
toString
public java.lang.String toString()
Description copied from interface:LayerChildReturn a string that represents theLayerChild.- Specified by:
toStringin interfaceLayerChild- Overrides:
toStringin classjava.lang.Object- Returns:
- Stringified
LayerChildrepresentation.
-
isVisible
public boolean isVisible()
Description copied from interface:LayerChildCheck ifLayerChildis visible.- Specified by:
isVisiblein interfaceLayerChild- Returns:
- true if visible
-
setVisible
public void setVisible(boolean visible)
Description copied from interface:LayerChildSet visibility for aLayerChild.- Specified by:
setVisiblein interfaceLayerChild- Parameters:
visible- visible if true
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface:MoveableAdd a new PropertyChangeListener. Properties will include "moved". Implementation of the following two methods will normally be via the PropertyChangeSupport class.- Specified by:
addPropertyChangeListenerin interfaceMoveable
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Description copied from interface:MoveableRemove a listener.- Specified by:
removePropertyChangeListenerin interfaceMoveable
-
-
DMelt 3.0 © DataMelt by jWork.ORG