gov.noaa.pmel.sgt
Class LineAttribute

java.lang.Object
  extended by gov.noaa.pmel.sgt.LineAttribute
All Implemented Interfaces:
Attribute, java.io.Serializable, java.lang.Cloneable
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 are LineAttribute properties.

Since:
1.0
Version:
$Revision$, $Date$
Author:
Donald Denbo
See Also:
LineCartesianRenderer, ContourLevels, Serialized Form

Field Summary
static int CAP_BUTT
          Cap styles
static int CAP_ROUND
           
static int CAP_SQUARE
           
protected  java.beans.PropertyChangeSupport changes_
           
static int DASHED
          Dashed line style.
static int HEAVY
          Heavy line style
static int HIGHLIGHT
          Highlighted line style.
static int JOIN_BEVEL
           
static int JOIN_MITER
          Join styles
static int JOIN_ROUND
           
static int MARK
          Mark line style.
static int MARK_LINE
          Mark with connecting lines style.
static int SOLID
          Solid line style.
static int STROKE
          Stroke.
 
Constructor Summary
LineAttribute()
          Default constructor.
LineAttribute(int style)
          Construct LineAttribute with Color.black.
LineAttribute(int style, java.awt.Color color)
          LineAttribute constructor.
LineAttribute(int style, int mark, java.awt.Color color)
          LineAttribute constructor for plot marks.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Add listener to changes in LineAttribute properties.
 java.lang.Object copy()
          Copy the LineAttribute.
 boolean equals(java.lang.Object obj)
           
protected  void firePropertyChange(java.lang.String name, java.lang.Object oldValue, java.lang.Object newValue)
           
 int getCapStyle()
          Get the current line cap style.
 java.awt.Color getColor()
          Get line Color.
 float[] getDashArray()
          Get line dash array.
 float getDashPhase()
          Get line dash phase.
 java.lang.String getId()
          Get attribute id.
 int getMark()
          Get plot mark
 double getMarkHeightP()
          Get mark height
 float getMiterLimit()
          Get the current miter limit.
 int getMiterStyle()
          Get the current miter sytle.
 int getStyle()
          Get line style.
 float getWidth()
          Get line width.
 boolean isBatch()
          Is the attribute in batch mode?
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Remove change listener.
 void setBatch(boolean batch)
          Batch the changes to the attribute.
 void setBatch(boolean batch, boolean local)
          Batch the changes to the attribute and set local flag.
 void setCapStyle(int style)
          Set the current line cap style.
 void setColor(java.awt.Color c)
          Set the line Color.
 void setDashArray(float[] dashes)
          Set the dash characteristics.
 void setDashPhase(float phase)
          Set line dash phase.
 void setId(java.lang.String id)
          Set attribute id.
 void setMark(int mark)
          Set plot mark
Property Change: mark.
 void setMarkHeightP(double markh)
          Set mark height.
 void setMiterLimit(float limit)
          Set the miter limit.
 void setMiterStyle(int style)
          Set the current miter style.
 void setStyle(int st)
          Set the line style.
 void setWidth(float t)
          Set the line width in physical units.
 java.lang.String toString()
          Get a String representation of the LineAttribute.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

changes_

protected transient java.beans.PropertyChangeSupport changes_

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)
Construct LineAttribute with Color.black.


LineAttribute

public LineAttribute(int style,
                     java.awt.Color color)
LineAttribute constructor.

Parameters:
style - line style
color - line Color
See Also:
Color

LineAttribute

public LineAttribute(int style,
                     int mark,
                     java.awt.Color color)
LineAttribute constructor for plot marks.

Parameters:
style - line sytle
mark - plot mark
color - line Color
Method Detail

copy

public java.lang.Object copy()
Copy the LineAttribute.

Returns:
new LineAttribute

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.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 line Color.
Property Change: color.

Parameters:
c - line Color

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 line Color.

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 include CAP_BUTT, CAP_ROUND, and CAP_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 include JOIN_MITER, JOIN_ROUND, and JOIN_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 a String representation of the LineAttribute.

Specified by:
toString in interface Attribute
Overrides:
toString in class java.lang.Object
Returns:
String representation

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add listener to changes in LineAttribute properties.

Specified by:
addPropertyChangeListener in interface Attribute

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Description copied from interface: Attribute
Remove change listener.

Specified by:
removePropertyChangeListener in interface Attribute

setId

public void setId(java.lang.String id)
Description copied from interface: Attribute
Set attribute id.

Specified by:
setId in interface Attribute
Since:
3.0

getId

public java.lang.String getId()
Description copied from interface: Attribute
Get attribute id.

Specified by:
getId in interface Attribute
Since:
3.0

firePropertyChange

protected void firePropertyChange(java.lang.String name,
                                  java.lang.Object oldValue,
                                  java.lang.Object newValue)

setBatch

public void setBatch(boolean batch)
Description copied from interface: Attribute
Batch the changes to the attribute.

Specified by:
setBatch in interface Attribute
Since:
3.0

setBatch

public void setBatch(boolean batch,
                     boolean local)
Description copied from interface: Attribute
Batch the changes to the attribute and set local flag. Determines whether AttributeChangeEvent will be set local.

Specified by:
setBatch in interface Attribute
Since:
3.0

isBatch

public boolean isBatch()
Description copied from interface: Attribute
Is the attribute in batch mode?

Specified by:
isBatch in interface Attribute
Since:
3.0