|
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.DifferenceMarker
public class DifferenceMarker
A Drawable that fills in the gap between two models to generate a chart.
Here is an example of a chart that uses a DifferenceMarker:
Note that this class assumes the points of the model are already ordered by their x values.
| Field Summary | |
|---|---|
static String |
PROPERTY_AT_FRONT
|
static String |
PROPERTY_CHART
|
static String |
PROPERTY_MODEL1
|
static String |
PROPERTY_MODEL1_DOMINANT_FILL
|
static String |
PROPERTY_MODEL2
|
static String |
PROPERTY_MODEL2_DOMINANT_FILL
|
| Constructor Summary | |
|---|---|
DifferenceMarker()
If you use this constructor, don't forget that you will still have to call setChart()
before it will work. |
|
DifferenceMarker(Chart chart)
Constructs a DifferenceMarker for the supplied Chart instance |
|
DifferenceMarker(Chart chart,
ChartModel model1,
ChartModel model2)
Constructs a DifferenceMarker for the supplied Chart instance and using the two supplied ChartModels |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a listener to property changes on this object |
void |
draw(Graphics g)
The Drawable callback method |
Chart |
getChart()
Returns the Chart to which this marker is applied |
Shape |
getDifferenceShape()
Returns the Shape constructed by the DifferenceMarker |
ChartModel |
getModel1()
Returns the first ChartModel used by the marker |
Paint |
getModel1DominantFill()
Returns the paint filling used when model1 > model2 |
ChartModel |
getModel2()
Returns the second ChartModel used by the marker |
Paint |
getModel2DominantFill()
Returns the paint filling used when model1 < model2 |
double |
getSmoothness()
|
boolean |
isAtFront()
A method of the Frontable interface. |
boolean |
isShadowVisible()
Discover whether this object is being drawn with a shadow |
boolean |
isSmooth()
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Remove a previously-added PropertyChangeListener from this object |
void |
setAtFront(boolean atFront)
Specify whether the DifferenceMarker should be drawn in front or behind of the ChartModels |
void |
setChart(Chart chart)
Specify the chart to which this marker is applied |
void |
setFill(Paint fill)
Convenience method for setting the model1Dominant and model2Dominant fills to be the same |
void |
setModel1(ChartModel model1)
Specify the first ChartModel |
void |
setModel1DominantFill(Paint fill)
Specify the paint to use when model1 > model2. |
void |
setModel2(ChartModel model2)
Specify the second ChartModel |
void |
setModel2DominantFill(Paint fill)
Specify the paint to use when model1 < model2. |
void |
setShadowVisible(boolean shadowVisible)
Specify whether this object should be drawn with a shadow |
void |
setSmooth(boolean smooth)
|
void |
setSmoothness(double smoothness)
|
protected void |
update()
Recomputes the positions of the fill and clipping regions |
| 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_AT_FRONT
public static final String PROPERTY_MODEL1
public static final String PROPERTY_MODEL2
public static final String PROPERTY_CHART
public static final String PROPERTY_MODEL1_DOMINANT_FILL
public static final String PROPERTY_MODEL2_DOMINANT_FILL
| Constructor Detail |
|---|
public DifferenceMarker()
setChart()
before it will work.
public DifferenceMarker(Chart chart)
chart - the Chart instance to which the DifferenceMarker will be applied
public DifferenceMarker(Chart chart,
ChartModel model1,
ChartModel model2)
chart - the Chart instance to which the DifferenceMarker will be appliedmodel1 - a model used for constructing the DifferenceMarkermodel2 - a model used for constructing the DifferenceMarker| Method Detail |
|---|
public void addPropertyChangeListener(PropertyChangeListener listener)
listener - the PropertyChangeListenerpublic void removePropertyChangeListener(PropertyChangeListener listener)
listener - the PropertyChangeListenerpublic Chart getChart()
Chart to which this marker is applied
Chart objectpublic void setChart(Chart chart)
chart - the Chart objectpublic ChartModel getModel1()
ChartModel used by the marker
ChartModel objectpublic void setModel1(ChartModel model1)
model1 - the first ChartModelpublic ChartModel getModel2()
ChartModel used by the marker
ChartModel objectpublic void setModel2(ChartModel model2)
model2 - the second ChartModelpublic boolean isSmooth()
public void setSmooth(boolean smooth)
public double getSmoothness()
public void setSmoothness(double smoothness)
public Shape getDifferenceShape()
public Paint getModel1DominantFill()
Paint fillingpublic void setModel1DominantFill(Paint fill)
fill - the Paint (or Color) fillingpublic Paint getModel2DominantFill()
Paint fillingpublic void setModel2DominantFill(Paint fill)
fill - the Paint (or Color) fillingpublic void setFill(Paint fill)
fill - the new Paint to use for regions between model1 and model2protected void update()
public void draw(Graphics g)
Drawable callback method
draw in interface Drawableg - the Graphics contextpublic boolean isAtFront()
Frontable interface. By default returns false so the filling is drawn behind any lines.
isAtFront in interface Frontablepublic void setAtFront(boolean atFront)
setAtFront in interface FrontableatFront - whether the object is to be shown in front of ChartModels.public boolean isShadowVisible()
isShadowVisible in interface Shadowablepublic void setShadowVisible(boolean shadowVisible)
setShadowVisible in interface ShadowableshadowVisible - 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 | ||||||||