|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jidesoft.chart.IntervalMarker
public class IntervalMarker
A Drawable object that can be added to a Chart to mark an interval on one of the axes. The orientation determines whether the interval applies to the x or y axis. By default, the orientation is vertical.
Note that if an IntervalMarker 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 used to indicate whether the marker is at the front or behind the chart 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 used for the label of the IntervalMarker |
static String |
PROPERTY_LABEL_COLOR
The name of the property used for the color of the label |
static String |
PROPERTY_LABEL_FONT
The name of the property used for the font of the label |
static String |
PROPERTY_LABEL_PLACEMENT
The name of the property used for the placement of the label |
static String |
PROPERTY_MAX
The name of the property used for the upper limit of the interval marker |
static String |
PROPERTY_MIN
The name of the property used for the lower limit of the interval marker |
static String |
PROPERTY_ORIENTATION
The name of the property that indicates the orientation of the IntervalMarker |
static String |
PROPERTY_OUTLINE_COLOR
The name of the property used for the outline color |
static String |
PROPERTY_OUTLINE_STROKE
The name of the property used for the outline |
static String |
PROPERTY_PAINT
The name of the property used for the paint of the marker |
static String |
PROPERTY_SHADOW_VISIBLE
The name of the property used for the shadow visibility |
static String |
PROPERTY_VISIBLE
The name of the property to indicate whether the IntervalMarker is visible |
protected PropertyChangeSupport |
support
|
Constructor Summary | |
---|---|
IntervalMarker()
Zero-argument Constructor. |
|
IntervalMarker(Chart newChart)
Create a marker and set the Chart object to which this marker applies |
|
IntervalMarker(Chart newChart,
double min,
double max,
Paint paint)
Create an IntervalMarker and set some properties |
|
IntervalMarker(Chart newChart,
Orientation orientation,
double min,
double max,
Paint paint)
Create an IntervalMarker and set properties |
Method Summary | |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Registers the interest of an object in the property changes of this object |
protected Paint |
createHorizontalPaint(Chart chart,
int pixelYMin,
int pixelYMax)
By default simply returns the paint property, but this protected method gives you an opportunity to override this behaviour and, if required, create a Paint that varies depending on the IntervalMarker's pixel height. |
protected Paint |
createVerticalPaint(Chart chart,
int pixelXMin,
int pixelXMax)
By default simply returns the paint property, but this protected method gives you an opportunity to override this behaviour and, if required, create a Paint that varies depending on the IntervalMarker's pixel width. |
void |
draw(Graphics g)
The callback method to draw the object. |
Chart |
getChart()
Returns the Chart object with which this Interval marker is associated |
Color |
getColor()
Returns the color of the marker object. |
String |
getLabel()
Returns the text label associated with this marker, if any |
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 |
double |
getMax()
Returns the maximum value of the range |
double |
getMin()
Returns the minimum value of the range |
Orientation |
getOrientation()
Returns the orientation of the interval |
Color |
getOutlineColor()
Returns the color used for the outline (if there is one). |
Stroke |
getOutlineStroke()
Returns the stroke used for the outline |
Paint |
getPaint()
Returns the paint used for the marker object |
int |
getZOrder()
|
boolean |
isAtFront()
A method of the Frontable interface. |
boolean |
isShadowVisible()
Whether the object is to drawn with a shadow |
boolean |
isVisible()
Returns whether the marker object is currently visible |
void |
removePropertyChangeListener(PropertyChangeListener listener)
De-register the interest of an object in the property changes of this object |
void |
setAtFront(boolean atFront)
Specify whether the marker should be drawn in front of the Chart Models in the chart |
void |
setChart(Chart chart)
Sets the chart object that this marker will be drawn on |
void |
setColor(Color color)
Specify the fill color of the marker object |
void |
setInterval(double min,
double max)
Sets the interval with minimum and maximum values |
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 |
setMax(double max)
Specify the maximum value for the interval |
void |
setMin(double min)
Specify the minimum value for the interval |
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 |
setOutlineColor(Color outlineColor)
Specify an outline color for the marker |
void |
setOutlineStroke(Stroke outlineStroke)
Specify a stroke to use for the outline of the marker. |
void |
setPaint(Paint paint)
Specify the paint to use for the marker object. |
void |
setShadowVisible(boolean shadowVisible)
Specify whether the object should be drawn with a shadow. |
void |
setVisible(boolean visible)
Specify whether this marker object should be drawn. |
void |
setZOrder(int zOrder)
|
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_ORIENTATION
public static final String PROPERTY_CHART
public static final String PROPERTY_COLOR
public static final String PROPERTY_PAINT
public static final String PROPERTY_MAX
public static final String PROPERTY_MIN
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
public static final String PROPERTY_OUTLINE_COLOR
public static final String PROPERTY_OUTLINE_STROKE
public static final String PROPERTY_SHADOW_VISIBLE
protected final PropertyChangeSupport support
Constructor Detail |
---|
public IntervalMarker()
public IntervalMarker(Chart newChart)
newChart
- the chart object to which this marker applies.public IntervalMarker(Chart newChart, double min, double max, Paint paint)
newChart
- the chart to which this marker appliesmin
- the minimum value for the intervalmax
- the maximum value for the intervalpaint
- the color or other paint for the intervalpublic IntervalMarker(Chart newChart, Orientation orientation, double min, double max, Paint paint)
newChart
- the chart to which this marker appliesorientation
- the orientation of the interval. Effectively this specifies whether the interval
applies to the x or the y axismin
- the minimum value for the intervalmax
- the maximum value for the intervalpaint
- the paint fill to use for the intervalMethod Detail |
---|
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- the interested objectpublic void removePropertyChangeListener(PropertyChangeListener listener)
listener
- the object that is no longer interested in property changespublic Chart getChart()
public void setChart(Chart chart)
chart
- sets the Chart object with which this Interval marker is associatedpublic boolean isVisible()
public void setVisible(boolean visible)
visible
- whether the marker should be drawnpublic Color getColor()
public void setColor(Color color)
color
- the fill color of the marker objectpublic Paint getPaint()
public void setPaint(Paint paint)
paint
- the new paint.public Orientation getOrientation()
public void setOrientation(Orientation orientation)
orientation
- the orientation of the intervalpublic int getZOrder()
getZOrder
in interface ZOrder
public void setZOrder(int zOrder)
setZOrder
in interface ZOrder
public double getMin()
public double getMax()
public void setMin(double min)
min
- the new minimumpublic void setMax(double max)
max
- the new maximumpublic void setInterval(double min, double max)
min
- the new minimum for the intervalmax
- the new maximum for the intervalpublic String getLabel()
public void setLabel(String label)
public LabelPlacement getLabelPlacement()
public void setLabelPlacement(LabelPlacement labelPlacement)
labelPlacement
- where to place the labelpublic Color getLabelColor()
public void setLabelColor(Color labelColor)
labelColor
- the color to use for the labelpublic Font getLabelFont()
public void setLabelFont(Font labelFont)
labelFont
- the font for the labelpublic Color getOutlineColor()
public void setOutlineColor(Color outlineColor)
outlineColor
- the color to be used for the outlinepublic Stroke getOutlineStroke()
public void setOutlineStroke(Stroke outlineStroke)
outlineStroke
- the stroke to use for the outlinepublic void draw(Graphics g)
draw
in interface Drawable
g
- the Graphics contextprotected Paint createHorizontalPaint(Chart chart, int pixelYMin, int pixelYMax)
chart
- the chart instancepixelYMin
- the pixel y value corresponding to the minimum value of the interval marker's rangepixelYMax
- the pixel y value corresponding to the maximum value of the interval marker's range
protected Paint createVerticalPaint(Chart chart, int pixelXMin, int pixelXMax)
chart
- the chart instancepixelXMin
- the pixel x value corresponding to the minimum value of the interval marker's rangepixelXMax
- the pixel x value corresponding to the maximum value of the interval marker's range
public boolean isAtFront()
Frontable
interface. By default returns false so the filling is drawn behind any lines.
isAtFront
in interface Frontable
public void setAtFront(boolean atFront)
setAtFront
in interface Frontable
atFront
- whether the object is to be shown in front of ChartModels.public boolean isShadowVisible()
Shadowable
isShadowVisible
in interface Shadowable
public void setShadowVisible(boolean shadowVisible)
Shadowable
setShadowVisible
in interface Shadowable
shadowVisible
- whether the object should have a shadow
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |