sgtplot
Class LineAttribute
- java.lang.Object
-
- sgtplot.LineAttribute
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, Attribute
- Direct Known Subclasses:
- ContourLineAttribute, DefaultContourLineAttribute
public class LineAttribute extends java.lang.Object implements Attribute, java.lang.Cloneable
Sets the rendering style for line data.Color, width, and dash characteristics areLineAttributeproperties.- Since:
- 1.0
- See Also:
LineCartesianRenderer,ContourLevels, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static intCAP_BUTTCap stylesstatic intCAP_ROUNDstatic intCAP_SQUAREstatic intDASHEDDashed line style.static intHEAVYHeavy line stylestatic intHIGHLIGHTHighlighted line style.static intJOIN_BEVELstatic intJOIN_MITERJoin stylesstatic intJOIN_ROUNDstatic intMARKMark line style.static intMARK_LINEMark with connecting lines style.static intSOLIDSolid line style.static intSTROKEStroke.
-
Constructor Summary
Constructors Constructor and Description LineAttribute()Default constructor.LineAttribute(int style)ConstructLineAttributewithColor.black.LineAttribute(int style, java.awt.Color color)LineAttributeconstructor.LineAttribute(int style, int mark, java.awt.Color color)LineAttributeconstructor for plot marks.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddPropertyChangeListener(java.beans.PropertyChangeListener listener)Add listener to changes inLineAttributeproperties.java.lang.Objectcopy()Copy theLineAttribute.booleanequals(java.lang.Object obj)intgetCapStyle()Get the current line cap style.java.awt.ColorgetColor()Get lineColor.float[]getDashArray()Get line dash array.floatgetDashPhase()Get line dash phase.java.lang.StringgetId()Get attribute id.intgetMark()Get plot markdoublegetMarkHeightP()Get mark heightfloatgetMiterLimit()Get the current miter limit.intgetMiterStyle()Get the current miter sytle.intgetStyle()Get line style.floatgetWidth()Get line width.booleanisBatch()Is the attribute in batch mode?voidremovePropertyChangeListener(java.beans.PropertyChangeListener listener)Remove change listener.voidsetBatch(boolean batch)Batch the changes to the attribute.voidsetBatch(boolean batch, boolean local)Batch the changes to the attribute and set local flag.voidsetCapStyle(int style)Set the current line cap style.voidsetColor(java.awt.Color c)Set the lineColor.voidsetDashArray(float[] dashes)Set the dash characteristics.voidsetDashPhase(float phase)Set line dash phase.voidsetId(java.lang.String id)Set attribute id.voidsetMark(int mark)Set plot mark
Property Change:mark.voidsetMarkHeightP(double markh)Set mark height.voidsetMiterLimit(float limit)Set the miter limit.voidsetMiterStyle(int style)Set the current miter style.voidsetStyle(int st)Set the line style.voidsetWidth(float t)Set the line width in physical units.java.lang.StringtoString()Get aStringrepresentation of theLineAttribute.
-
-
-
Field Detail
-
SOLID
public static final int SOLID
Solid line style.- See Also:
- Constant Field Values
-
DASHED
public static final int DASHED
Dashed line style.- See Also:
- Constant Field Values
-
HEAVY
public static final int HEAVY
Heavy line style- Since:
- 2.0
- See Also:
- Constant Field Values
-
HIGHLIGHT
public static final int HIGHLIGHT
Highlighted line style. Accomplished by drawing the line over a contrasting polygon of the same shape.- See Also:
- Constant Field Values
-
MARK
public static final int MARK
Mark line style.- See Also:
PlotMark, Constant Field Values
-
MARK_LINE
public static final int MARK_LINE
Mark with connecting lines style.- See Also:
- Constant Field Values
-
STROKE
public static final int STROKE
Stroke.- See Also:
- Constant Field Values
-
CAP_BUTT
public static final int CAP_BUTT
Cap styles- See Also:
- Constant Field Values
-
CAP_ROUND
public static final int CAP_ROUND
- See Also:
- Constant Field Values
-
CAP_SQUARE
public static final int CAP_SQUARE
- See Also:
- Constant Field Values
-
JOIN_MITER
public static final int JOIN_MITER
Join styles- See Also:
- Constant Field Values
-
JOIN_ROUND
public static final int JOIN_ROUND
- See Also:
- Constant Field Values
-
JOIN_BEVEL
public static final int JOIN_BEVEL
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LineAttribute
public LineAttribute()
Default constructor. Default style is SOLID and default color is red.
-
LineAttribute
public LineAttribute(int style)
ConstructLineAttributewithColor.black.
-
LineAttribute
public LineAttribute(int style, java.awt.Color color)LineAttributeconstructor.- Parameters:
style- line stylecolor- lineColor- See Also:
Color
-
LineAttribute
public LineAttribute(int style, int mark, java.awt.Color color)LineAttributeconstructor for plot marks.- Parameters:
style- line sytlemark- plot markcolor- lineColor
-
-
Method Detail
-
copy
public java.lang.Object copy()
Copy theLineAttribute.- Returns:
- new
LineAttribute
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object- Since:
- 3.0
-
setMarkHeightP
public void setMarkHeightP(double markh)
Set mark height.
Property Change:markHeightP.- Parameters:
markh- mark height
-
getMarkHeightP
public double getMarkHeightP()
Get mark height- Returns:
- mark height
-
setStyle
public void setStyle(int st)
Set the line style.
Property Change:style.- Parameters:
st- line style
-
setColor
public void setColor(java.awt.Color c)
Set the lineColor.
Property Change:color.- Parameters:
c- lineColor
-
setWidth
public void setWidth(float t)
Set the line width in physical units.
Property Change:width.- Parameters:
t- line width
-
setDashArray
public void setDashArray(float[] dashes)
Set the dash characteristics. Lengths are in physical units.
Property Change:dashArray.
-
getDashArray
public float[] getDashArray()
Get line dash array.- Since:
- 2.0
-
setDashPhase
public void setDashPhase(float phase)
Set line dash phase.
Property Change:dashPhase.- Since:
- 2.0
-
getDashPhase
public float getDashPhase()
Get line dash phase.- Since:
- 2.0
-
getStyle
public int getStyle()
Get line style.- Returns:
- line style
-
getColor
public java.awt.Color getColor()
Get lineColor.- Returns:
- line
Color
-
getWidth
public float getWidth()
Get line width.- Returns:
- line width in physcial coordinates.
-
setMark
public void setMark(int mark)
Set plot mark
Property Change:mark.- Parameters:
mark- the plot mark
-
getMark
public int getMark()
Get plot mark- Returns:
- plot mark
-
setCapStyle
public void setCapStyle(int style)
Set the current line cap style. Cap styles includeCAP_BUTT,CAP_ROUND, andCAP_SQUARE.
Property Change:capStyle.
-
getCapStyle
public int getCapStyle()
Get the current line cap style.
-
setMiterStyle
public void setMiterStyle(int style)
Set the current miter style. Styles includeJOIN_MITER,JOIN_ROUND, andJOIN_BEVEL.
Property Change:miterStyle.
-
getMiterStyle
public int getMiterStyle()
Get the current miter sytle.
-
setMiterLimit
public void setMiterLimit(float limit)
Set the miter limit.
Property Change:miterLimit.
-
getMiterLimit
public float getMiterLimit()
Get the current miter limit.
-
toString
public java.lang.String toString()
Get aStringrepresentation of theLineAttribute.
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add listener to changes inLineAttributeproperties.- Specified by:
addPropertyChangeListenerin interfaceAttribute
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface:AttributeRemove change listener.- Specified by:
removePropertyChangeListenerin interfaceAttribute
-
setId
public void setId(java.lang.String id)
Description copied from interface:AttributeSet attribute id.
-
getId
public java.lang.String getId()
Description copied from interface:AttributeGet attribute id.
-
setBatch
public void setBatch(boolean batch)
Description copied from interface:AttributeBatch the changes to the attribute.
-
setBatch
public void setBatch(boolean batch, boolean local)Description copied from interface:AttributeBatch the changes to the attribute and set local flag. Determines whetherAttributeChangeEventwill be set local.
-
-
DMelt 3.0 © DataMelt by jWork.ORG