sgtplot.beans
Class Legend
- java.lang.Object
-
- sgtplot.beans.Legend
-
- All Implemented Interfaces:
- java.io.Serializable
public class Legend extends java.lang.Object implements java.io.SerializableEncapsulates reference toSGTDataand key.- Since:
- 3.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static intCOLORColorKey legend typestatic intLINELineKey legend typestatic intNO_BORDERNo border line border style.static intPLAIN_LINEPlain line border style.static intPOINTPointCollectionKey legend typestatic intRAISEDRaised line border style.static intVECTORVectorKey legend type
-
Constructor Summary
Constructors Constructor and Description Legend()Default constructor.Legend(java.lang.String id, Rectangle2D.Double boundsP)Legend constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddChangeListener(javax.swing.event.ChangeListener l)Add change listener.intgetBorderStyle()Get legend border style.Rectangle2D.DoublegetBoundsP()Get Legend bounds.intgetColumns()Get number of columns.doublegetHeightP()Get legend height.java.lang.StringgetId()Get legend identifierdoublegetKeyLabelHeightP()Get key label height.doublegetLineLength()Get the legend line, or vector length in physical coordinages.Point2D.DoublegetLocationP()Get the location of the upper left corner.PanelHoldergetPanelHolder()GetPanelHolderparent.java.awt.ColorgetScaleColor()GetCOLORlegend scale color.java.awt.FontgetScaleLabelFont()GetCOLORlegend scale font.java.lang.StringgetScaleLabelFormat()GetCOLORlegend scale label format.doublegetScaleLabelHeightP()GetCOLORlegend scale label height in physical coordinates.intgetScaleLabelInterval()GetCOLORlegend scale label interval.doublegetScaleLargeTicHeightP()GetCOLORlegend scale large tick height.intgetScaleNumberSmallTics()GetCOLORlegend scale number of small tics.intgetScaleSignificantDigits()GetCOLORlegend scale significant digits.doublegetScaleSmallTicHeightP()GetCOLORlegend scale small tick height.intgetType()Get legend type.doublegetWidthP()Get legend widthbooleanisColor()Test if legend of type COLOR.booleanisInstantiated()Test if the key instantiated.booleanisScaleVisible()Test ifCOLORlegend scale visible.booleanisVisible()Test if legend visible.voidremoveAllChangeListeners()Remove all change listeners.voidremoveChangeListener(javax.swing.event.ChangeListener l)Remove change listener.voidremoveDesignChangeListeners()Remove change listeners that implementDesignListener.voidsetBorderStyle(int borderStyle)Set legend border style.voidsetBoundsP(Rectangle2D.Double boundsP)Set legend bounds.voidsetColumns(int columns)Set number of columns.voidsetHeightP(double heightP)Set legend height.voidsetId(java.lang.String id)Set legend identifier.voidsetInstantiated(boolean instantiated)Set legend state to instatiated.voidsetKeyLabelHeightP(double keyLabelHeightP)Set key label height in physical coordinates.voidsetLineLength(double lineLength)Set the legend line or vector lenght in physical units.voidsetLocationP(Point2D.Double locationP)Set the location of the TOP-LEFT cornervoidsetPanelHolder(PanelHolder pHolder)SetPanelHolderparent.voidsetScaleColor(java.awt.Color scaleColor)SetCOLORlegend scale color.voidsetScaleLabelFont(java.awt.Font scaleLabelFont)SetCOLORlegend scale font.voidsetScaleLabelFormat(java.lang.String scaleLabelFormat)SetCOLORlegend scale label format.voidsetScaleLabelHeightP(double scaleLabelHeightP)SetCOLORlegend scale label heigth.voidsetScaleLabelInterval(int scaleLabelInterval)SetCOLORlegend scale label interval.voidsetScaleLargeTicHeightP(double scaleLargeTicHeightP)SetCOLORlegend scale large tick height in physical coordinates.voidsetScaleNumberSmallTics(int scaleNumberSmallTics)SetCOLORlegend scale number of small tics.voidsetScaleSignificantDigits(int scaleSignificantDigits)SetCOLORlegend scale significant digits.voidsetScaleSmallTicHeightP(double scaleSmallTicHeightP)SetCOLORlegend scale small tick height in physical coordinates.voidsetScaleVisible(boolean scaleVisible)SetCOLORlegend scale visible.voidsetType(int type)Set legend type.voidsetVisible(boolean visible)Set visibility for legend.voidsetWidthP(double widthP)Set legend width
-
-
-
Field Detail
-
PLAIN_LINE
public static final int PLAIN_LINE
Plain line border style.- See Also:
- Constant Field Values
-
RAISED
public static final int RAISED
Raised line border style.- See Also:
- Constant Field Values
-
NO_BORDER
public static final int NO_BORDER
No border line border style.- See Also:
- Constant Field Values
-
LINE
public static final int LINE
LineKey legend type- See Also:
- Constant Field Values
-
COLOR
public static final int COLOR
ColorKey legend type- See Also:
- Constant Field Values
-
VECTOR
public static final int VECTOR
VectorKey legend type- See Also:
- Constant Field Values
-
POINT
public static final int POINT
PointCollectionKey legend type- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Legend
public Legend()
Default constructor. Legend id and bounds set tonull.
-
Legend
public Legend(java.lang.String id, Rectangle2D.Double boundsP)Legend constructor.- Parameters:
id- legend identifierboundsP- bounds in physical units
-
-
Method Detail
-
setId
public void setId(java.lang.String id)
Set legend identifier.- Parameters:
id- identifier
-
getId
public java.lang.String getId()
Get legend identifier- Returns:
- ident
-
setBoundsP
public void setBoundsP(Rectangle2D.Double boundsP)
Set legend bounds.- Parameters:
boundsP- bounds in physical coordinates
-
getBoundsP
public Rectangle2D.Double getBoundsP()
Get Legend bounds.- Returns:
- bounds
-
setLocationP
public void setLocationP(Point2D.Double locationP)
Set the location of the TOP-LEFT corner- Parameters:
locationP- upper left corner in physical coordinates
-
getLocationP
public Point2D.Double getLocationP()
Get the location of the upper left corner.- Returns:
- upper left corner
-
setHeightP
public void setHeightP(double heightP)
Set legend height.- Parameters:
heightP- height on physical coordinates
-
getHeightP
public double getHeightP()
Get legend height.- Returns:
- height
-
setWidthP
public void setWidthP(double widthP)
Set legend width- Parameters:
widthP- width in physcial coordinates
-
getWidthP
public double getWidthP()
Get legend width- Returns:
- width
-
removeChangeListener
public void removeChangeListener(javax.swing.event.ChangeListener l)
Remove change listener.- Parameters:
l- change listener
-
addChangeListener
public void addChangeListener(javax.swing.event.ChangeListener l)
Add change listener.- Parameters:
l- change listener
-
removeDesignChangeListeners
public void removeDesignChangeListeners()
Remove change listeners that implementDesignListener.
-
removeAllChangeListeners
public void removeAllChangeListeners()
Remove all change listeners.
-
setVisible
public void setVisible(boolean visible)
Set visibility for legend.- Parameters:
visible- visibility state
-
isVisible
public boolean isVisible()
Test if legend visible.- Returns:
- true, if legend is visible
-
setInstantiated
public void setInstantiated(boolean instantiated)
Set legend state to instatiated. This is called internally when the property Key has been instatiated.- Parameters:
instantiated- instatiation state
-
isInstantiated
public boolean isInstantiated()
Test if the key instantiated.- Returns:
- true, if key has been instantiated
-
isColor
public boolean isColor()
Test if legend of type COLOR.- Returns:
- true, if legend is COLOR
-
getType
public int getType()
Get legend type.- Returns:
- legend type.
-
setType
public void setType(int type)
Set legend type. Types includeCOLOR,LINE,POINT, andVECTOR.- Parameters:
type- legend type
-
getBorderStyle
public int getBorderStyle()
Get legend border style.- Returns:
- border style
-
setBorderStyle
public void setBorderStyle(int borderStyle)
Set legend border style. Border styles include:PLAIN_LINE,RAISED, andNO_BORDER. Default = NO_BORDER.- Parameters:
borderStyle- border style
-
getColumns
public int getColumns()
Get number of columns. Not used withCOLORlegends.- Returns:
- number of columns
-
setColumns
public void setColumns(int columns)
Set number of columns. Not used withCOLORlegends. Default = 1.- Parameters:
columns- number of columns
-
getLineLength
public double getLineLength()
Get the legend line, or vector length in physical coordinages. Not used withCOLORlegends.- Returns:
- line or vector length
-
setLineLength
public void setLineLength(double lineLength)
Set the legend line or vector lenght in physical units. Not used withCOLORlegends. Defautl = 0.3- Parameters:
lineLength- line or vector length
-
getScaleColor
public java.awt.Color getScaleColor()
GetCOLORlegend scale color. Only used withCOLORlegends.- Returns:
- scale color
-
setScaleColor
public void setScaleColor(java.awt.Color scaleColor)
SetCOLORlegend scale color. Only used withCOLORlegends. Deault = black.- Parameters:
scaleColor- scale color
-
getScaleLabelFont
public java.awt.Font getScaleLabelFont()
GetCOLORlegend scale font. Only used withCOLORlegends.- Returns:
- scale font
-
setScaleLabelFont
public void setScaleLabelFont(java.awt.Font scaleLabelFont)
SetCOLORlegend scale font. Only used withCOLORlegends. Deault = ("Helvetica", PLAIN, 10).- Parameters:
scaleLabelFont- scale font
-
getScaleLabelHeightP
public double getScaleLabelHeightP()
GetCOLORlegend scale label height in physical coordinates. Only used withCOLORlegends.- Returns:
- scale label height
-
setScaleLabelHeightP
public void setScaleLabelHeightP(double scaleLabelHeightP)
SetCOLORlegend scale label heigth. Only used withCOLORlegends. Deault = 0.2.- Parameters:
scaleLabelHeightP- scale label height
-
getScaleLabelInterval
public int getScaleLabelInterval()
GetCOLORlegend scale label interval. Only used withCOLORlegends.- Returns:
- scale label interval
-
setScaleLabelInterval
public void setScaleLabelInterval(int scaleLabelInterval)
SetCOLORlegend scale label interval. Only used withCOLORlegends. Deault = 2.- Parameters:
scaleLabelInterval- scale label interval
-
getScaleNumberSmallTics
public int getScaleNumberSmallTics()
GetCOLORlegend scale number of small tics. Only used withCOLORlegends.- Returns:
- scale number of small tics
-
setScaleNumberSmallTics
public void setScaleNumberSmallTics(int scaleNumberSmallTics)
SetCOLORlegend scale number of small tics. Only used withCOLORlegends. Deault = 0.- Parameters:
scaleNumberSmallTics- scale number of small tics
-
getScaleLabelFormat
public java.lang.String getScaleLabelFormat()
GetCOLORlegend scale label format. Only used withCOLORlegends.- Returns:
- scale label format
-
setScaleLabelFormat
public void setScaleLabelFormat(java.lang.String scaleLabelFormat)
SetCOLORlegend scale label format. Only used withCOLORlegends. Deault = "".- Parameters:
scaleLabelFormat- scale label format
-
getScaleLargeTicHeightP
public double getScaleLargeTicHeightP()
GetCOLORlegend scale large tick height. Only used withCOLORlegends.- Returns:
- scale large tick height
-
setScaleLargeTicHeightP
public void setScaleLargeTicHeightP(double scaleLargeTicHeightP)
SetCOLORlegend scale large tick height in physical coordinates. Only used withCOLORlegends. Deault = 0.1.- Parameters:
scaleLargeTicHeightP- scale large tick height
-
getScaleSignificantDigits
public int getScaleSignificantDigits()
GetCOLORlegend scale significant digits. Only used withCOLORlegends.- Returns:
- scale significant digits
-
setScaleSignificantDigits
public void setScaleSignificantDigits(int scaleSignificantDigits)
SetCOLORlegend scale significant digits. Only used withCOLORlegends. Deault = 2.- Parameters:
scaleSignificantDigits- scale significant digits
-
getScaleSmallTicHeightP
public double getScaleSmallTicHeightP()
GetCOLORlegend scale small tick height. Only used withCOLORlegends.- Returns:
- scale small tick height
-
setScaleSmallTicHeightP
public void setScaleSmallTicHeightP(double scaleSmallTicHeightP)
SetCOLORlegend scale small tick height in physical coordinates. Only used withCOLORlegends. Deault = 0.05.- Parameters:
scaleSmallTicHeightP- scale small tick height
-
isScaleVisible
public boolean isScaleVisible()
Test ifCOLORlegend scale visible. Only used withCOLORlegends.- Returns:
- true, if scale visible
-
setScaleVisible
public void setScaleVisible(boolean scaleVisible)
SetCOLORlegend scale visible. Only used withCOLORlegends. Deault = true.- Parameters:
scaleVisible- scale visible
-
getPanelHolder
public PanelHolder getPanelHolder()
GetPanelHolderparent.- Returns:
- panelholder
-
setPanelHolder
public void setPanelHolder(PanelHolder pHolder)
SetPanelHolderparent.- Parameters:
pHolder- panelholder
-
getKeyLabelHeightP
public double getKeyLabelHeightP()
Get key label height.- Returns:
- key label height
-
setKeyLabelHeightP
public void setKeyLabelHeightP(double keyLabelHeightP)
Set key label height in physical coordinates. Default = 0.16.- Parameters:
keyLabelHeightP- key label height
-
-
DMelt 3.0 © DataMelt by jWork.ORG