|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.chart.LineMarker
public class LineMarker
A marker that can be added to a chart and is drawn as either a horizontal or vertical line across the chart.
Note that if a LineMarker is used in a Chart that is embedded in a JViewport, the position of the label for the marker does not change under scrolling relative to the marker. In other words, the marker label always stays on screen as long as the marker itself is visible.
Field Summary | |
---|---|
static String |
PROPERTY_AT_FRONT
The name of the property that indicates whether the marker is in front of the models |
static String |
PROPERTY_CHART
The name of the property that holds the corresponding chart |
static String |
PROPERTY_COLOR
The name of the property used for the color of the marker (same as paint if the paint is a java.awt.Color) |
static String |
PROPERTY_LABEL
The name of the property for the text of the label |
static String |
PROPERTY_LABEL_COLOR
The name of the property for the color of the label |
static String |
PROPERTY_LABEL_FONT
The name of the property for the font of the label |
static String |
PROPERTY_LABEL_PLACEMENT
The name of the property for the placement of the label |
static String |
PROPERTY_ORIENTATION
The name of the property that indicates the orientation of the IntervalMarker |
static String |
PROPERTY_POSITION
The name of the property that indicates the position of the line. |
static String |
PROPERTY_STROKE
The name of the property describing the Stroke of the line |
static String |
PROPERTY_VISIBLE
The name of the property to indicate whether the IntervalMarker is visible |
protected PropertyChangeSupport |
support
|
Constructor Summary | |
---|---|
LineMarker()
Zero argument constructor. |
|
LineMarker(Chart newChart)
Create a marker and set the Chart object to which this marker applies |
|
LineMarker(Chart newChart,
Orientation orientation,
double position,
Color color)
Create a LineMarker and set some properties |
Method Summary | |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Registers the interest of an object in property changes of the LineMarker |
void |
draw(Graphics g)
The callback method to draw the object. |
Chart |
getChart()
Returns the chart object with which this marker is associated |
Color |
getColor()
Returns the color of the LineMarker |
String |
getLabel()
Returns the text of the label |
Color |
getLabelColor()
Returns the current color setting for the label |
Font |
getLabelFont()
Returns the font used for displaying the label |
LabelPlacement |
getLabelPlacement()
Returns the current positioning of the label |
Orientation |
getOrientation()
Returns the orientation of the LineMarker |
double |
getPosition()
Returns the position of the marker along the axis |
Stroke |
getStroke()
Returns the stroke used for drawing the line |
boolean |
isAtFront()
A method of the Frontable interface. |
boolean |
isVisible()
Returns whether the marker is currently painted onto the chart's Graphics context when an update occurs |
void |
removePropertyChangeListener(PropertyChangeListener listener)
De-registers the interest of an object that is already registered as a property listener |
void |
setAtFront(boolean atFront)
You can use this method to specify whether the line marker should be drawn at the front of the chart models or at the back. |
void |
setChart(Chart chart)
Specify the chart object with which this marker is associated |
void |
setColor(Color color)
Specify the color for the LineMarker |
void |
setLabel(String label)
Specify a text label for the marker |
void |
setLabelColor(Color labelColor)
Specify the color to use for the label. |
void |
setLabelFont(Font labelFont)
Specify the font used for displaying the label [optional] |
void |
setLabelPlacement(LabelPlacement labelPlacement)
Specify where to place the label, if one has been provided |
void |
setOrientation(Orientation orientation)
If the orientation of the interval is vertical it means it is applied to the x axis; if horizontal it is applied to the y axis. |
void |
setPosition(double pos)
Specify the position of the marker along the axis |
void |
setRenderingHint(RenderingHints.Key hint,
Object value)
|
void |
setStroke(Stroke stroke)
Specify the stroke for the line |
void |
setVisible(boolean visible)
Specify whether the marker should be painted |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROPERTY_VISIBLE
public static final String PROPERTY_CHART
public static final String PROPERTY_COLOR
public static final String PROPERTY_ORIENTATION
public static final String PROPERTY_POSITION
public static final String PROPERTY_STROKE
public static final String PROPERTY_LABEL
public static final String PROPERTY_LABEL_PLACEMENT
public static final String PROPERTY_LABEL_COLOR
public static final String PROPERTY_LABEL_FONT
public static final String PROPERTY_AT_FRONT
protected final PropertyChangeSupport support
Constructor Detail |
---|
public LineMarker()
public LineMarker(Chart newChart)
newChart
- the chart object to which this marker appliespublic LineMarker(Chart newChart, Orientation orientation, double position, Color color)
newChart
- the chart to which this marker appliesorientation
- the orientation of the lineposition
- the position on the appropriate axiscolor
- the color for the lineMethod Detail |
---|
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- the object interested interested in property changespublic void removePropertyChangeListener(PropertyChangeListener listener)
listener
- the object no longer interested in property changespublic String getLabel()
public void setLabel(String label)
label
- the text of the labelpublic LabelPlacement getLabelPlacement()
public void setLabelPlacement(LabelPlacement labelPlacement)
labelPlacement
- the parameter that specifies where to place the labelpublic Color getLabelColor()
public void setLabelColor(Color labelColor)
labelColor
- the color of the labelpublic Font getLabelFont()
public void setLabelFont(Font labelFont)
labelFont
- the font for the labelpublic Chart getChart()
public void setChart(Chart chart)
chart
- the chart objectpublic void setRenderingHint(RenderingHints.Key hint, Object value)
public boolean isVisible()
public void setVisible(boolean visible)
visible
- the visibility of the markerpublic Color getColor()
public void setColor(Color color)
color
- the new color for the line markerpublic Stroke getStroke()
public void setStroke(Stroke stroke)
stroke
- the new Strokepublic Orientation getOrientation()
public void setOrientation(Orientation orientation)
orientation
- the orientation of the linepublic double getPosition()
public void setPosition(double pos)
pos
- the new positionpublic void draw(Graphics g)
draw
in interface Drawable
g
- the Graphics contextpublic boolean isAtFront()
Frontable
interface. By default this returns false, unless you have set it
using the setAtFront() method.
isAtFront
in interface Frontable
public void setAtFront(boolean atFront)
setAtFront
in interface Frontable
atFront
- specify whether the marker should be drawn in front of the chart models
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |