|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimtools.shapes.AbstractShape
simtools.shapes.PlotShape
public class PlotShape
Nested Class Summary | |
---|---|
class |
PlotShape.Curve
A class to put the curveShape, its label and the used axes |
class |
PlotShape.Limit
A class to put the curveShape, its label and the used axes |
Nested classes/interfaces inherited from class simtools.shapes.AbstractShape |
---|
AbstractShape.AbstractShapePropertiesNames |
Field Summary | |
---|---|
protected AxisShape |
_asx1
|
protected AxisShape |
_asx2
|
protected AxisShape |
_asy1
|
protected AxisShape |
_asy2
|
protected java.awt.Color |
_color
|
protected java.util.Vector |
_curves
|
protected java.awt.Font |
_font
|
protected java.util.ArrayList |
_limits
|
protected PlotShape.Curve |
_magnetizedCurve
The current magnetized curve |
protected java.awt.Font |
curveInformationFont
|
protected java.util.ArrayList |
curveInformationLabel
|
protected boolean |
dirty
|
protected java.lang.Boolean |
displayCurveInformation
When hasCurveInformation is true, display information about plot curves below the shape |
protected boolean |
hasLegend
|
protected java.awt.image.BufferedImage |
image
|
protected java.awt.Graphics2D |
imageGraphics
|
protected java.awt.Rectangle |
legendBounds
|
protected boolean |
logpx
The 4 booleans wich indicate if axes are under logarithmic mode. |
protected boolean |
logpy
The 4 booleans wich indicate if axes are under logarithmic mode. |
protected boolean |
logsx
The 4 booleans wich indicate if axes are under logarithmic mode. |
protected boolean |
logsy
The 4 booleans wich indicate if axes are under logarithmic mode. |
protected boolean |
optimize
|
protected int |
optimizeMode
|
protected java.text.ChoiceFormat |
pyformat
|
protected java.text.ChoiceFormat |
syformat
|
protected LabelShape |
title
|
protected java.awt.Font |
titleFont
|
Fields inherited from class simtools.shapes.AbstractShape |
---|
_h, _ox, _oy, _propertyNames, _w, _x, _y, ANTI_ALIASING, currentDialogBox, FONT_NAMES, listeners, REFRESH_PERIOD |
Constructor Summary | |
---|---|
PlotShape(int ox,
int oy,
int width,
int height)
|
Method Summary | |
---|---|
protected AbstractShape |
cloneShape()
Performs a copy of the shape This method has to be overriden to deal with concrete shapes |
protected void |
computeBounds()
|
void |
computeLegendBounds()
|
void |
draw(java.awt.Graphics2D g2)
Draws it |
protected void |
drawCurves(java.awt.Graphics2D g2)
|
void |
drawLegend(java.awt.Graphics2D g2)
|
protected java.awt.Rectangle |
drawLegendAndGetBounds(java.awt.Graphics2D g2,
java.awt.Rectangle reference)
|
protected void |
drawLimits(java.awt.Graphics2D g2)
|
protected void |
drawMagnetizedCurve(java.awt.Graphics2D g2)
Allow the magnetized curve to display some graphical information |
PlotShape.Curve |
getCurve(CurveShape cs)
|
PlotShape.Curve |
getCurve(int i)
|
int |
getCurveNumber()
|
protected java.util.ArrayList |
getCurvesInformation()
|
PlotShape.Limit |
getLimit(int i)
|
PlotShape.Limit |
getLimit(LimitShape cs)
|
int |
getLimitNumber()
|
AxisShape |
getPrimaryXAxis()
Method getPrimaryXAxis Summary: Get primary X axis |
AxisShape |
getSecondaryXAxis()
Method getSecondaryXAxis Summary: Get secondary X axis |
java.lang.String |
getTitle()
|
void |
insertCurve(CurveShape cs)
|
void |
insertCurve(CurveShape cs,
boolean secondaryXAxis)
|
void |
insertCurve(CurveShape cs,
boolean secondaryXAxis,
boolean secondaryYAxis)
|
void |
insertCurve(CurveShape cs,
boolean secondaryXAxis,
boolean secondaryYAxis,
int index)
Add a new curve to this plot |
void |
insertLimit(LimitShape cs)
|
void |
insertLimit(LimitShape cs,
boolean secondaryAxis)
|
void |
insertLimit(LimitShape cs,
boolean secondaryAxis,
int index)
Add a new limit to this plot |
java.lang.Boolean |
isCurveInformationVisible()
|
boolean |
isLegendVisible()
|
boolean |
isOptimize()
|
boolean |
isSecondaryAxis(boolean onX)
|
void |
notificationEnd(java.lang.Object referer)
This callback is called after all notifications were processed. |
void |
removeCurve(CurveShape cs)
|
void |
removeLimit(LimitShape cs)
|
void |
resize(int dx,
int dy)
Resizes the shape |
void |
set(double min,
double max,
double step,
boolean onX,
boolean secondary)
Set axis coordinates |
void |
setAnchor(int ox,
int oy)
Sets the anchor |
void |
setAnchor(java.awt.Point p)
Sets shape anchor |
void |
setColor(java.awt.Color c)
|
void |
setCurveColor(CurveShape cs,
java.awt.Color color)
|
void |
setCurveInformationVisible(java.lang.Boolean state)
|
void |
setCurveLabel(CurveShape cs,
java.lang.String s)
|
void |
setFont(java.awt.Font f)
|
void |
setFormat(java.text.Format f,
boolean onX,
boolean secondary)
|
void |
setLabel(java.lang.String s,
boolean onX,
boolean secondary)
Sets a label for an axis |
void |
setLegendVisible(boolean state)
|
void |
setLimitColor(LimitShape cs,
java.awt.Color color)
|
void |
setLimitLabel(LimitShape cs,
java.lang.String s)
|
void |
setOptimize(boolean optimize)
Sets the optimize. |
void |
setSecondaryAxis(boolean onX,
boolean enabled)
|
void |
setSecondaryX(double min,
double max,
double step)
|
void |
setSecondaryY(double min,
double max,
double step)
|
void |
setTitle(java.lang.String s)
|
void |
setTitleFont(java.awt.Font f)
|
void |
setX(double min,
double max,
double step)
|
void |
setXLabel(java.lang.String s)
|
void |
setXLabel(java.lang.String s,
boolean secondary)
Sets a label for an axis |
void |
setY(double min,
double max,
double step)
|
void |
setYLabel(java.lang.String s)
|
void |
setYLabel(java.lang.String s,
boolean secondary)
|
void |
shapeChanged(AbstractShape shape,
java.awt.Rectangle changedArea)
|
void |
shapeChanged(CurveShape cs)
This function is called when the shape changed. |
void |
shapeDataChanged(CurveShape cs,
DataSource oldData,
DataSource newData,
boolean onX)
This function is called when one of the data displayed by the curve is replaced |
void |
translate(int dx,
int dy)
Translates the shape |
protected void |
updateBounds()
|
void |
updateCurveInformation()
|
Methods inherited from class simtools.shapes.AbstractShape |
---|
addListener, contains, contains, contains, contains, getAnchor, getBounds, getBounds2D, getInnerProperties, getMax, getMaxTranslated, getMin, getPathIterator, getPathIterator, getPropertyNames, getPropertyValue, intersects, intersects, notifyChange, notifyChange, refresh, removeListener, setProperties, setPropertyValue, wipeOff |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.awt.Font _font
protected java.awt.Font titleFont
protected java.awt.Font curveInformationFont
protected java.awt.Color _color
protected AxisShape _asx1
protected AxisShape _asy1
protected AxisShape _asx2
protected AxisShape _asy2
protected boolean hasLegend
protected LabelShape title
protected java.lang.Boolean displayCurveInformation
protected java.util.ArrayList curveInformationLabel
protected java.util.Vector _curves
protected java.util.ArrayList _limits
protected transient boolean optimize
protected transient int optimizeMode
protected transient java.awt.image.BufferedImage image
protected transient java.awt.Graphics2D imageGraphics
protected transient boolean dirty
protected transient java.awt.Rectangle legendBounds
protected boolean logpx
protected boolean logpy
protected boolean logsx
protected boolean logsy
protected transient java.text.ChoiceFormat pyformat
protected transient java.text.ChoiceFormat syformat
protected transient PlotShape.Curve _magnetizedCurve
Constructor Detail |
---|
public PlotShape(int ox, int oy, int width, int height)
ox
- the anchor x positionoy
- the anchor y positionlength
- the axis length excluding the space
to display label and gridlines valuesMethod Detail |
---|
protected AbstractShape cloneShape()
AbstractShape
cloneShape
in class AbstractShape
public void setSecondaryAxis(boolean onX, boolean enabled)
public boolean isSecondaryAxis(boolean onX)
public AxisShape getPrimaryXAxis()
public AxisShape getSecondaryXAxis()
public PlotShape.Curve getCurve(int i)
public int getCurveNumber()
public PlotShape.Curve getCurve(CurveShape cs)
public void insertCurve(CurveShape cs, boolean secondaryXAxis, boolean secondaryYAxis, int index)
cs
- the curve (it can be shared with other plots)secondaryXAxis
- plot using secondary X axis if truesecondaryYAxis
- plot using secondary Y axis if trueindex
- curve index among the other curves to plot or -1 if latestpublic void insertCurve(CurveShape cs)
public void insertCurve(CurveShape cs, boolean secondaryXAxis)
public void insertCurve(CurveShape cs, boolean secondaryXAxis, boolean secondaryYAxis)
public void removeCurve(CurveShape cs)
public void setCurveColor(CurveShape cs, java.awt.Color color)
public void setCurveLabel(CurveShape cs, java.lang.String s)
public PlotShape.Limit getLimit(int i)
public int getLimitNumber()
public PlotShape.Limit getLimit(LimitShape cs)
public void insertLimit(LimitShape cs, boolean secondaryAxis, int index)
cs
- the limit (it can be shared with other plots)secondaryXAxis
- plot using secondary X axis if truesecondaryYAxis
- plot using secondary Y axis if trueindex
- limit index among the other limits to plot or -1 if latestpublic void insertLimit(LimitShape cs)
public void insertLimit(LimitShape cs, boolean secondaryAxis)
public void removeLimit(LimitShape cs)
public void setLimitColor(LimitShape cs, java.awt.Color color)
public void setLimitLabel(LimitShape cs, java.lang.String s)
public void setFont(java.awt.Font f)
public void setTitleFont(java.awt.Font f)
public boolean isLegendVisible()
public void setLegendVisible(boolean state)
public void setCurveInformationVisible(java.lang.Boolean state)
public java.lang.Boolean isCurveInformationVisible()
public java.lang.String getTitle()
public void setTitle(java.lang.String s)
protected java.util.ArrayList getCurvesInformation()
public void set(double min, double max, double step, boolean onX, boolean secondary)
public void setX(double min, double max, double step)
public void setSecondaryX(double min, double max, double step)
public void setY(double min, double max, double step)
public void setSecondaryY(double min, double max, double step)
public void setLabel(java.lang.String s, boolean onX, boolean secondary)
s
- The string to display as the labelonX
- Axis selector: true => x, false => ysecondary
- Axis selector: true => secondary, false => primarypublic void setXLabel(java.lang.String s, boolean secondary)
public void setXLabel(java.lang.String s)
public void setYLabel(java.lang.String s, boolean secondary)
public void setYLabel(java.lang.String s)
public void setFormat(java.text.Format f, boolean onX, boolean secondary)
public void setColor(java.awt.Color c)
public void setAnchor(java.awt.Point p)
setAnchor
in class AbstractShape
p
- the originpublic void resize(int dx, int dy)
resize
in interface Resizable
dx
- value on x axisdy
- value on y axispublic void translate(int dx, int dy)
translate
in class AbstractShape
public void setAnchor(int ox, int oy)
setAnchor
in class AbstractShape
public void draw(java.awt.Graphics2D g2)
draw
in class AbstractShape
g2
- the current graphicsprotected java.awt.Rectangle drawLegendAndGetBounds(java.awt.Graphics2D g2, java.awt.Rectangle reference)
public void drawLegend(java.awt.Graphics2D g2)
public void computeLegendBounds()
protected void drawMagnetizedCurve(java.awt.Graphics2D g2)
g2
- protected void drawCurves(java.awt.Graphics2D g2)
protected void drawLimits(java.awt.Graphics2D g2)
protected void computeBounds()
protected void updateBounds()
public void shapeChanged(CurveShape cs)
CurveShapeListener
shapeChanged
in interface CurveShapeListener
cs
- the curvepublic void shapeDataChanged(CurveShape cs, DataSource oldData, DataSource newData, boolean onX)
CurveShapeListener
shapeDataChanged
in interface CurveShapeListener
cs
- the curveoldData
- the old datanewData
- the new datapublic void shapeChanged(AbstractShape shape, java.awt.Rectangle changedArea)
shapeChanged
in interface ShapeListener
public void updateCurveInformation()
public boolean isOptimize()
public void setOptimize(boolean optimize)
optimize
- The optimize to setpublic void notificationEnd(java.lang.Object referer)
EndNotificationListener
notificationEnd
in interface EndNotificationListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |