jsynoptic.builtin
Class Plot

java.lang.Object
  extended by simtools.shapes.AbstractShape
      extended by simtools.shapes.PlotShape
          extended by jsynoptic.builtin.Plot
All Implemented Interfaces:
java.awt.Shape, java.io.Serializable, java.lang.Cloneable, ContextualActionProvider, DataSourceConsumer, Linkable, SelectionContextualActionProvider, EndNotificationListener, DiagramComponent.ContextualDrawingProvider, Resizable, CurveShapeListener, ShapeListener, NamedProperties
Direct Known Subclasses:
TimePlot

public class Plot
extends PlotShape
implements SelectionContextualActionProvider, Linkable, DataSourceConsumer, DiagramComponent.ContextualDrawingProvider

A Plot shape to display curves using up to 2 pairs of axes X and Y primary and secondary axes are independent

Author:
Nicolas Brodu, Claude CAZENAVE
See Also:
Serialized Form

Nested Class Summary
protected  class Plot.AxeRange
          Class AxeRange.
 class Plot.PlotCompoundEdit
           
static class Plot.PlotPropertiesNames
           
 
Nested classes/interfaces inherited from class simtools.shapes.PlotShape
PlotShape.Curve, PlotShape.Limit
 
Nested classes/interfaces inherited from class simtools.shapes.AbstractShape
AbstractShape.AbstractShapePropertiesNames
 
Field Summary
protected  boolean autopx
          Deprecated. Do not use this attribute anymore, use axesRangeArray[PX].auto instead
protected  boolean autopy
          Deprecated. Do not use this attribute anymore, use axesRangeArray[PY].auto instead
protected  boolean autosx
          Deprecated. Do not use this attribute anymore, use axesRangeArray[SX].auto instead
protected  boolean autosy
          Deprecated. Do not use this attribute anymore, use axesRangeArray[PX].auto instead
protected static int AXE_NUMBER
          A constant to know the number of axes.
protected  Plot.AxeRange[] axesLimitsArray
          The array of AxeRange.
protected static java.lang.String[] AXIS_ID
          axes names for property managment
static boolean DEFAULT_DISPLAY_DATA_SOURCE_ID
           
protected static java.awt.Color[] defaultPalette
           
protected  boolean isNotifying
           
protected  boolean isPrimaryBounded
           
protected  boolean isSecondaryBounded
           
protected  java.lang.String link
           
protected  int nbXGraduation
           
protected  int nbYGraduation
           
protected  int paletteIndex
           
static int preferredXGraduation
          Prefered number of rows if the value is < 2 then the user don't want to fix a prefered number of rows
static int preferredYGraduation
          Prefered number of columns if the value is < 0 then the user don't want to fix a prefered number of colmuns
protected  java.util.Vector primaryCurves
           
protected  long primaryEndIndex
           
protected  long primaryStartIndex
           
protected  DataSource primaryX
           
protected static int PX
          Constant indexes to find PX, PY, SX and SY limits values and validity.
protected  java.lang.String pxlabel
          Deprecated. Do not use this attribute anymore, use axesRangeArray[PX].label instead
protected  double pxmax
          Deprecated. Do not use these attributes anymore, use axesRangeArray[PX].min, axesRangeArray[PX].max, axesRangeArray[PX].step instead.
protected  double pxmin
          Deprecated. Do not use these attributes anymore, use axesRangeArray[PX].min, axesRangeArray[PX].max, axesRangeArray[PX].step instead.
protected  double pxstep
          Deprecated. Do not use these attributes anymore, use axesRangeArray[PX].min, axesRangeArray[PX].max, axesRangeArray[PX].step instead.
protected  boolean pxvaluesOK
          Deprecated. Do not use these attributes anymore, use axesRangeArray[PX].validity, axesRangeArray[PY].validity, axesRangeArray[SX].validity, axesRangeArray[SY].validity instead.
protected static int PY
          Constant indexes to find PX, PY, SX and SY limits values and validity.
protected  java.lang.String pylabel
          Deprecated. Do not use this attribute anymore, use axesRangeArray[PY].label instead
protected  double pymax
          Deprecated. Do not use these attributes anymore, use axesRangeArray[PY].min, axesRangeArray[PY].max, axesRangeArray[PY].step instead.
protected  double pymin
          Deprecated. Do not use these attributes anymore, use axesRangeArray[PY].min, axesRangeArray[PY].max, axesRangeArray[PY].step instead.
protected  double pystep
          Deprecated. Do not use these attributes anymore, use axesRangeArray[PY].min, axesRangeArray[PY].max, axesRangeArray[PY].step instead.
protected  boolean pyvaluesOK
          Deprecated. Do not use these attributes anymore, use axesRangeArray[PX].validity, axesRangeArray[PY].validity, axesRangeArray[SX].validity, axesRangeArray[SY].validity instead.
static MenuResourceBundle resources
          Resources
protected  java.util.Vector secondaryCurves
           
protected  long secondaryEndIndex
           
protected  long secondaryStartIndex
           
protected  DataSource secondaryX
           
protected static int SX
          Constant indexes to find PX, PY, SX and SY limits values and validity.
protected  java.lang.String sxlabel
          Deprecated. Do not use this attribute anymore, use axesRangeArray[SX].label instead
protected  double sxmax
          Deprecated. Do not use these attributes anymore, use axesRangeArray[SX].min, axesRangeArray[SX].max, axesRangeArray[SX].step instead.
protected  double sxmin
          Deprecated. Do not use these attributes anymore, use axesRangeArray[SX].min, axesRangeArray[SX].max, axesRangeArray[SX].step instead.
protected  double sxstep
          Deprecated. Do not use these attributes anymore, use axesRangeArray[SX].min, axesRangeArray[SX].max, axesRangeArray[SX].step instead.
protected  boolean sxvaluesOK
          Deprecated. Do not use these attributes anymore, use axesRangeArray[PX].validity, axesRangeArray[PY].validity, axesRangeArray[SX].validity, axesRangeArray[SY].validity instead.
protected static int SY
          Constant indexes to find PX, PY, SX and SY limits values and validity.
protected  java.lang.String sylabel
          Deprecated. Do not use this attribute anymore, use axesRangeArray[SY].label instead
protected  double symax
          Deprecated. Do not use these attributes anymore, use axesRangeArray[SY].min, axesRangeArray[SY].max, axesRangeArray[SY].step instead.
protected  double symin
          Deprecated. Do not use these attributes anymore, use axesRangeArray[SY].min, axesRangeArray[SY].max, axesRangeArray[SY].step instead.
protected  double systep
          Deprecated. Do not use these attributes anymore, use axesRangeArray[SY].min, axesRangeArray[SY].max, axesRangeArray[SY].step instead.
protected  boolean syvaluesOK
          Deprecated. Do not use these attributes anymore, use axesRangeArray[PX].validity, axesRangeArray[PY].validity, axesRangeArray[SX].validity, axesRangeArray[SY].validity instead.
protected  DiagramComponent.ContextualDrawing translateDrawing
           
protected  DiagramComponent.ContextualDrawing zoomDrawing
           
 
Fields inherited from class simtools.shapes.PlotShape
_asx1, _asx2, _asy1, _asy2, _color, _curves, _font, _limits, _magnetizedCurve, curveInformationFont, curveInformationLabel, dirty, displayCurveInformation, hasLegend, image, imageGraphics, legendBounds, logpx, logpy, logsx, logsy, optimize, optimizeMode, pyformat, syformat, title, titleFont
 
Fields inherited from class simtools.shapes.AbstractShape
_h, _ox, _oy, _propertyNames, _w, _x, _y, ANTI_ALIASING, currentDialogBox, FONT_NAMES, listeners, REFRESH_PERIOD
 
Fields inherited from interface jsynoptic.base.ContextualActionProvider
EDITOR_CONTEXT, MOUSE_OUT_CONTEXT, MOUSE_OVER_CONTEXT, MOUSE_PRESSED_CONTEXT, SHAPELIST_CONTEXT, SOURCELIST_CONTEXT
 
Constructor Summary
Plot(int ox, int oy, int width, int height)
           
 
Method Summary
 boolean addDataSource(DataSource d)
           
 boolean addPrimaryY(DataSource ds, boolean background)
           
 boolean addPrimaryYForSecondaryX(DataSource ds, boolean background)
           
 boolean addSecondaryY(DataSource ds, boolean background)
           
 boolean addSecondaryYForSecondaryX(DataSource ds, boolean background)
           
protected  boolean addY(DataSource ds, boolean primary, boolean usePrimaryX, boolean background)
           
 boolean canAddDataSource(DataSource d)
           
 boolean canDoAction(double x, double y, java.lang.Object o, java.lang.String action, int context)
          Returns true if, and only if, it is possible to do the action right now
protected  AbstractShape cloneShape()
          Performs a copy of the shape This method has to be overriden to deal with concrete shapes
protected  void computeHorizontalAxeRange(Plot.AxeRange axeRange, AxisShape axe, boolean log, double x1, double x2)
          Computes a zoom for an horizontal axis (PX or SX).
static double computeStep(double min, double max, int averageNbGrad)
          Computes the "best" step to go from min to max Average number of graduations is set to 10 Algo from simgo/util/geom/WaveAxis.java
protected  void computeTranslationAxeRange(Plot.AxeRange axeRange, AxisShape axe, boolean log, double x)
          Computes a translation for an axis (PX or SX).
protected  void computeVerticalAxeRange(Plot.AxeRange axeRange, AxisShape axe, boolean log, double y1, double y2)
          Computes a zoom for an vertical axis (PY or SY).
protected  void computeVerticalBoundAndStep(Plot.AxeRange yAxeRange, java.util.Vector curves)
          Auto-scale a vertical axe regarding values on
protected  void computeZoomWheelHorizontalAxeRange(Plot.AxeRange axeRange, AxisShape axe, boolean log, double x, boolean zoomIn, double zoomWheelFactor)
           
protected  void computeZoomWheelVerticalAxeRange(Plot.AxeRange axeRange, AxisShape axe, boolean log, double y, boolean zoomIn, double zoomWheelFactor)
           
 JPropertiesPanel createPanel()
           
 void displayCursorLocation(double x, double y)
           
 boolean doAction(double x, double y, java.lang.Object o, java.lang.String action, javax.swing.undo.CompoundEdit undoableEdit)
          Do one of the actions previously declared by getAction.
protected  LimitShape doAddLimitAction(boolean isVertical, boolean useSecondary, double position, java.lang.String name)
           
protected  CurveShape doAddYAction(java.lang.Object[] obar)
           
 boolean doCollectiveAction(DiagramSelection sel, double x, double y, java.lang.Object o, java.lang.String action, javax.swing.undo.CompoundEdit undoableEdit)
          Do one of the collective actions previously declared by getCollectiveActions.
 java.lang.String[] getActions(double x, double y, java.lang.Object o, int context)
          Return list of possible actions the contect information may be used, or not.
 java.util.HashMap getAxesProperties(java.util.HashMap map, int axeNumber)
           
 java.lang.Double getAxeValue(int axeIndex, int x)
          Computes an axis coordinate from a mouse position in plot shape
 java.util.LinkedHashMap getCollectiveActions(DiagramSelection sel, double x, double y, java.lang.Object o, int context)
          Return list of possible collective actions
 DiagramComponent.ContextualDrawing getContextualDrawing(DiagramSelection s)
           
protected  java.util.Vector getCurveParameters(java.util.Vector curves)
           
 java.util.HashMap getCurvesProperties(java.util.HashMap map)
           
protected  java.util.Vector getLimitParameters(java.util.ArrayList al)
           
 java.lang.String getLink()
           
 DataSource getPrimaryX()
           
 java.lang.String[] getPropertyNames()
          Get the list of property names
 java.lang.Object getPropertyValue(java.lang.String name)
          Get the value of the property named name
 DataSource getSecondaryX()
           
 void notificationEnd(java.lang.Object referer)
          This callback is called after all notifications were processed.
protected  void notifyChange()
          Notify listeners that this shape has changed.
 void refresh()
          Reload all shape properties.
 void removeCurve(CurveShape curveShape)
           
 void repaintDiagram(java.awt.Rectangle oldBounds)
           
 void setCurveParameters(java.util.Vector l)
           
 void setLimitParamters(java.util.Vector l)
           
 void setLink(java.lang.String link)
           
 boolean setPrimaryX(DataSource ds, boolean background)
           
 void setPropertyValue(java.lang.String name, java.lang.Object value)
          Assigns value to the property named name
 boolean setSecondaryX(DataSource ds, boolean background)
           
 void setX(DataSource ds, boolean primary)
           
protected  boolean setX(DataSource ds, boolean primary, boolean background)
           
 void shapeDataChanged(CurveShape csc, DataSource oldData, DataSource newData, boolean onX)
          This function is called when one of the data displayed by the curve is replaced
 void translate(double x1, double x2, double y1, double y2)
          Changes the axes defintion according to a translation defined with 2 points
 void zoom(double x1, double x2, double y1, double y2, boolean xOnly)
          Changes the axes defintion according to a zoom defined with 2 coordinates
 void zoomWheel(double x, double y, double zoomWheelFactor, boolean zoomIn)
          Make a zoom box around (x,y) position.
 
Methods inherited from class simtools.shapes.PlotShape
computeBounds, computeLegendBounds, draw, drawCurves, drawLegend, drawLegendAndGetBounds, drawLimits, drawMagnetizedCurve, getCurve, getCurve, getCurveNumber, getCurvesInformation, getLimit, getLimit, getLimitNumber, getPrimaryXAxis, getSecondaryXAxis, getTitle, insertCurve, insertCurve, insertCurve, insertCurve, insertLimit, insertLimit, insertLimit, isCurveInformationVisible, isLegendVisible, isOptimize, isSecondaryAxis, removeLimit, resize, set, setAnchor, setAnchor, setColor, setCurveColor, setCurveInformationVisible, setCurveLabel, setFont, setFormat, setLabel, setLegendVisible, setLimitColor, setLimitLabel, setOptimize, setSecondaryAxis, setSecondaryX, setSecondaryY, setTitle, setTitleFont, setX, setXLabel, setXLabel, setY, setYLabel, setYLabel, shapeChanged, shapeChanged, translate, updateBounds, updateCurveInformation
 
Methods inherited from class simtools.shapes.AbstractShape
addListener, contains, contains, contains, contains, getAnchor, getBounds, getBounds2D, getInnerProperties, getMax, getMaxTranslated, getMin, getPathIterator, getPathIterator, intersects, intersects, notifyChange, removeListener, setProperties, wipeOff
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

preferredXGraduation

public static int preferredXGraduation
Prefered number of rows if the value is < 2 then the user don't want to fix a prefered number of rows


preferredYGraduation

public static int preferredYGraduation
Prefered number of columns if the value is < 0 then the user don't want to fix a prefered number of colmuns


DEFAULT_DISPLAY_DATA_SOURCE_ID

public static boolean DEFAULT_DISPLAY_DATA_SOURCE_ID

link

protected java.lang.String link

zoomDrawing

protected transient DiagramComponent.ContextualDrawing zoomDrawing

translateDrawing

protected transient DiagramComponent.ContextualDrawing translateDrawing

resources

public static MenuResourceBundle resources
Resources


defaultPalette

protected static java.awt.Color[] defaultPalette

paletteIndex

protected int paletteIndex

primaryX

protected transient DataSource primaryX

secondaryX

protected transient DataSource secondaryX

primaryCurves

protected java.util.Vector primaryCurves

secondaryCurves

protected java.util.Vector secondaryCurves

isPrimaryBounded

protected boolean isPrimaryBounded

primaryStartIndex

protected long primaryStartIndex

primaryEndIndex

protected long primaryEndIndex

isSecondaryBounded

protected boolean isSecondaryBounded

secondaryStartIndex

protected long secondaryStartIndex

secondaryEndIndex

protected long secondaryEndIndex

nbXGraduation

protected transient int nbXGraduation

nbYGraduation

protected transient int nbYGraduation

pxmin

protected double pxmin
Deprecated. Do not use these attributes anymore, use axesRangeArray[PX].min, axesRangeArray[PX].max, axesRangeArray[PX].step instead.

pxmax

protected double pxmax
Deprecated. Do not use these attributes anymore, use axesRangeArray[PX].min, axesRangeArray[PX].max, axesRangeArray[PX].step instead.

pxstep

protected double pxstep
Deprecated. Do not use these attributes anymore, use axesRangeArray[PX].min, axesRangeArray[PX].max, axesRangeArray[PX].step instead.

pxlabel

protected java.lang.String pxlabel
Deprecated. Do not use this attribute anymore, use axesRangeArray[PX].label instead

autopx

protected boolean autopx
Deprecated. Do not use this attribute anymore, use axesRangeArray[PX].auto instead

pymin

protected double pymin
Deprecated. Do not use these attributes anymore, use axesRangeArray[PY].min, axesRangeArray[PY].max, axesRangeArray[PY].step instead.

pymax

protected double pymax
Deprecated. Do not use these attributes anymore, use axesRangeArray[PY].min, axesRangeArray[PY].max, axesRangeArray[PY].step instead.

pystep

protected double pystep
Deprecated. Do not use these attributes anymore, use axesRangeArray[PY].min, axesRangeArray[PY].max, axesRangeArray[PY].step instead.

pylabel

protected java.lang.String pylabel
Deprecated. Do not use this attribute anymore, use axesRangeArray[PY].label instead

autopy

protected boolean autopy
Deprecated. Do not use this attribute anymore, use axesRangeArray[PY].auto instead

sxmin

protected double sxmin
Deprecated. Do not use these attributes anymore, use axesRangeArray[SX].min, axesRangeArray[SX].max, axesRangeArray[SX].step instead.

sxmax

protected double sxmax
Deprecated. Do not use these attributes anymore, use axesRangeArray[SX].min, axesRangeArray[SX].max, axesRangeArray[SX].step instead.

sxstep

protected double sxstep
Deprecated. Do not use these attributes anymore, use axesRangeArray[SX].min, axesRangeArray[SX].max, axesRangeArray[SX].step instead.

sxlabel

protected java.lang.String sxlabel
Deprecated. Do not use this attribute anymore, use axesRangeArray[SX].label instead

autosx

protected boolean autosx
Deprecated. Do not use this attribute anymore, use axesRangeArray[SX].auto instead

symin

protected double symin
Deprecated. Do not use these attributes anymore, use axesRangeArray[SY].min, axesRangeArray[SY].max, axesRangeArray[SY].step instead.

symax

protected double symax
Deprecated. Do not use these attributes anymore, use axesRangeArray[SY].min, axesRangeArray[SY].max, axesRangeArray[SY].step instead.

systep

protected double systep
Deprecated. Do not use these attributes anymore, use axesRangeArray[SY].min, axesRangeArray[SY].max, axesRangeArray[SY].step instead.

sylabel

protected java.lang.String sylabel
Deprecated. Do not use this attribute anymore, use axesRangeArray[SY].label instead

autosy

protected boolean autosy
Deprecated. Do not use this attribute anymore, use axesRangeArray[PX].auto instead

pxvaluesOK

protected boolean pxvaluesOK
Deprecated. Do not use these attributes anymore, use axesRangeArray[PX].validity, axesRangeArray[PY].validity, axesRangeArray[SX].validity, axesRangeArray[SY].validity instead.

pyvaluesOK

protected boolean pyvaluesOK
Deprecated. Do not use these attributes anymore, use axesRangeArray[PX].validity, axesRangeArray[PY].validity, axesRangeArray[SX].validity, axesRangeArray[SY].validity instead.

sxvaluesOK

protected boolean sxvaluesOK
Deprecated. Do not use these attributes anymore, use axesRangeArray[PX].validity, axesRangeArray[PY].validity, axesRangeArray[SX].validity, axesRangeArray[SY].validity instead.

syvaluesOK

protected boolean syvaluesOK
Deprecated. Do not use these attributes anymore, use axesRangeArray[PX].validity, axesRangeArray[PY].validity, axesRangeArray[SX].validity, axesRangeArray[SY].validity instead.

PX

protected static final int PX
Constant indexes to find PX, PY, SX and SY limits values and validity.

See Also:
Constant Field Values

PY

protected static final int PY
Constant indexes to find PX, PY, SX and SY limits values and validity.

See Also:
Constant Field Values

SX

protected static final int SX
Constant indexes to find PX, PY, SX and SY limits values and validity.

See Also:
Constant Field Values

SY

protected static final int SY
Constant indexes to find PX, PY, SX and SY limits values and validity.

See Also:
Constant Field Values

AXE_NUMBER

protected static final int AXE_NUMBER
A constant to know the number of axes.

See Also:
Constant Field Values

AXIS_ID

protected static final java.lang.String[] AXIS_ID
axes names for property managment


axesLimitsArray

protected Plot.AxeRange[] axesLimitsArray
The array of AxeRange.


isNotifying

protected transient boolean isNotifying
Constructor Detail

Plot

public Plot(int ox,
            int oy,
            int width,
            int height)
Method Detail

getLink

public java.lang.String getLink()
Specified by:
getLink in interface Linkable

setLink

public void setLink(java.lang.String link)
Specified by:
setLink in interface Linkable

cloneShape

protected AbstractShape cloneShape()
Description copied from class: AbstractShape
Performs a copy of the shape This method has to be overriden to deal with concrete shapes

Overrides:
cloneShape in class PlotShape
Returns:
a copy of the shape

setPrimaryX

public boolean setPrimaryX(DataSource ds,
                           boolean background)

getPrimaryX

public DataSource getPrimaryX()

addPrimaryY

public boolean addPrimaryY(DataSource ds,
                           boolean background)

setSecondaryX

public boolean setSecondaryX(DataSource ds,
                             boolean background)

getSecondaryX

public DataSource getSecondaryX()

addSecondaryY

public boolean addSecondaryY(DataSource ds,
                             boolean background)

addSecondaryYForSecondaryX

public boolean addSecondaryYForSecondaryX(DataSource ds,
                                          boolean background)

addPrimaryYForSecondaryX

public boolean addPrimaryYForSecondaryX(DataSource ds,
                                        boolean background)

setX

public void setX(DataSource ds,
                 boolean primary)

setX

protected boolean setX(DataSource ds,
                       boolean primary,
                       boolean background)

doAddLimitAction

protected LimitShape doAddLimitAction(boolean isVertical,
                                      boolean useSecondary,
                                      double position,
                                      java.lang.String name)

doAddYAction

protected CurveShape doAddYAction(java.lang.Object[] obar)

addY

protected boolean addY(DataSource ds,
                       boolean primary,
                       boolean usePrimaryX,
                       boolean background)

computeStep

public static double computeStep(double min,
                                 double max,
                                 int averageNbGrad)
Computes the "best" step to go from min to max Average number of graduations is set to 10 Algo from simgo/util/geom/WaveAxis.java


repaintDiagram

public void repaintDiagram(java.awt.Rectangle oldBounds)

removeCurve

public void removeCurve(CurveShape curveShape)
Overrides:
removeCurve in class PlotShape

computeVerticalBoundAndStep

protected void computeVerticalBoundAndStep(Plot.AxeRange yAxeRange,
                                           java.util.Vector curves)
Auto-scale a vertical axe regarding values on

Parameters:
axeRange - - The range related to the axe to be scaled.
curves - - Curves that belong to that axe

getCollectiveActions

public java.util.LinkedHashMap getCollectiveActions(DiagramSelection sel,
                                                    double x,
                                                    double y,
                                                    java.lang.Object o,
                                                    int context)
Description copied from interface: SelectionContextualActionProvider
Return list of possible collective actions

Specified by:
getCollectiveActions in interface SelectionContextualActionProvider
Parameters:
sel - the current selection
x - Coordinate, mouse position in the same unit as contains(x,y)
y - Coordinate, mouse position in the same unit as contains(x,y)
o - Object the collective actions should work on. Possibly null => default or all actions
context - one of the context defined in the ContextualActionProvider class
Returns:
The list of possible actions, possibly empty.The map values contains when applicable parent sub menus and icons

getActions

public java.lang.String[] getActions(double x,
                                     double y,
                                     java.lang.Object o,
                                     int context)
Description copied from interface: ContextualActionProvider
Return list of possible actions the contect information may be used, or not.

Specified by:
getActions in interface ContextualActionProvider
Parameters:
x - Coordinate, mouse position in the same unit as contains(x,y)
y - Coordinate, mouse position in the same unit as contains(x,y)
o - Object the actions should work on. Possibly null => default or all actions
context - one of the context defined in the ContextualActionProvider class
Returns:
The list of possible actions, possibly null or an empty array

canDoAction

public boolean canDoAction(double x,
                           double y,
                           java.lang.Object o,
                           java.lang.String action,
                           int context)
Description copied from interface: ContextualActionProvider
Returns true if, and only if, it is possible to do the action right now

Specified by:
canDoAction in interface ContextualActionProvider
Parameters:
x - Coordinate, for example mouse position
y - Coordinate, for example mouse position
o - Object the action should work on.
action - An action returned by a previous getActions call with the same x, y, o parameters It may be null, in which case the default action is requested for this x,y,o.
context - one of the context defined in the ContextualActionProvider class
Returns:
true if the action can be performed

displayCursorLocation

public void displayCursorLocation(double x,
                                  double y)

doCollectiveAction

public boolean doCollectiveAction(DiagramSelection sel,
                                  double x,
                                  double y,
                                  java.lang.Object o,
                                  java.lang.String action,
                                  javax.swing.undo.CompoundEdit undoableEdit)
Description copied from interface: SelectionContextualActionProvider
Do one of the collective actions previously declared by getCollectiveActions.

Specified by:
doCollectiveAction in interface SelectionContextualActionProvider
Parameters:
sel - sel the current selection
x - Coordinate, for example mouse position
y - Coordinate, for example mouse position
o - Object the action should work on.
action - action An action returned by a previous getCollectiveActions call with the same x, y, o parameters
undoableEdit - undoableEdit The current compound edit for undo/redo operation. If the action is undoable, the required edits shall be added to this current compound edit.
Returns:
true if the collectiveaction could be performed

doAction

public boolean doAction(double x,
                        double y,
                        java.lang.Object o,
                        java.lang.String action,
                        javax.swing.undo.CompoundEdit undoableEdit)
Description copied from interface: ContextualActionProvider
Do one of the actions previously declared by getAction.

Specified by:
doAction in interface ContextualActionProvider
Parameters:
x - Coordinate, for example mouse position
y - Coordinate, for example mouse position
o - Object the action should work on.
action - An action returned by a previous getActions call with the same x, y, o parameters It may be null, in which case the default action is requested for this x,y,o.
undoableEdit - current edit for undo/redo operation If not null, this action is undoable.
Returns:
true if the action could be performed

zoom

public void zoom(double x1,
                 double x2,
                 double y1,
                 double y2,
                 boolean xOnly)
Changes the axes defintion according to a zoom defined with 2 coordinates

Parameters:
x1 - The first zoom area x coordinate.
x2 - The second zoom area x coordinate.
y1 - The first zoom area y coordinate.
y2 - The second zoom area y coordinate.
xOnly - True zoom only the X axis

zoomWheel

public void zoomWheel(double x,
                      double y,
                      double zoomWheelFactor,
                      boolean zoomIn)
Make a zoom box around (x,y) position.

Parameters:
x -
y -
zoomWheelFactor -
zoomIn, - if true zoom in , otherwise zoom out

translate

public void translate(double x1,
                      double x2,
                      double y1,
                      double y2)
Changes the axes defintion according to a translation defined with 2 points

Parameters:
x1 - The first translation point x coordinate.
x2 - The second translation point x coordinate.
y1 - The first translation point y coordinate.
y2 - The second translation point y coordinate.

computeVerticalAxeRange

protected void computeVerticalAxeRange(Plot.AxeRange axeRange,
                                       AxisShape axe,
                                       boolean log,
                                       double y1,
                                       double y2)
Computes a zoom for an vertical axis (PY or SY).

Parameters:
axeRange - The AxeRange axeRange to compute.
axe - The AxisShape that use this AxeRange.
log - True if the axe is under log format, false otherwise.
y1 - The first zoom area y coordinate.
y2 - The second zoom area y coordinate.

computeHorizontalAxeRange

protected void computeHorizontalAxeRange(Plot.AxeRange axeRange,
                                         AxisShape axe,
                                         boolean log,
                                         double x1,
                                         double x2)
Computes a zoom for an horizontal axis (PX or SX). Parameters:

Parameters:
axeRange - The AxeRange axeRange to compute.
axe - The AxisShape that use this AxeRange.
log - True if the axe is under log format, false otherwise.
x1 - The first zoom area x coordinate.
x2 - The second zoom area x coordinate.

getAxeValue

public java.lang.Double getAxeValue(int axeIndex,
                                    int x)
Computes an axis coordinate from a mouse position in plot shape

Parameters:
axe - The AxisShape
x1 - A mouse position in plot hsape.
Returns:
computed axis coordinate

computeTranslationAxeRange

protected void computeTranslationAxeRange(Plot.AxeRange axeRange,
                                          AxisShape axe,
                                          boolean log,
                                          double x)
Computes a translation for an axis (PX or SX). Parameters:

Parameters:
axeRange - The AxeRange axeRange to compute.
axe - The AxisShape that use this AxeRange.
log - True if the axe is under log format, false otherwise.
x1 - The translation value

computeZoomWheelHorizontalAxeRange

protected void computeZoomWheelHorizontalAxeRange(Plot.AxeRange axeRange,
                                                  AxisShape axe,
                                                  boolean log,
                                                  double x,
                                                  boolean zoomIn,
                                                  double zoomWheelFactor)

computeZoomWheelVerticalAxeRange

protected void computeZoomWheelVerticalAxeRange(Plot.AxeRange axeRange,
                                                AxisShape axe,
                                                boolean log,
                                                double y,
                                                boolean zoomIn,
                                                double zoomWheelFactor)

addDataSource

public boolean addDataSource(DataSource d)
Specified by:
addDataSource in interface DataSourceConsumer
Parameters:
d - the data source to be added
Returns:
true if operation succeeds

canAddDataSource

public boolean canAddDataSource(DataSource d)
Specified by:
canAddDataSource in interface DataSourceConsumer
Parameters:
d - the data source to be added
Returns:
true if operation can be be performed

notificationEnd

public void notificationEnd(java.lang.Object referer)
Description copied from interface: EndNotificationListener
This callback is called after all notifications were processed. The referer object is the one to decide what the end means. For example, it may be a single data source notifying both a range change and a value change. Or it could be a collection notifying all its sources.

Specified by:
notificationEnd in interface EndNotificationListener
Overrides:
notificationEnd in class PlotShape

notifyChange

protected void notifyChange()
Description copied from class: AbstractShape
Notify listeners that this shape has changed. This is called by the various subclasses when necessary. For example, when connected to dynamic data sources.

Overrides:
notifyChange in class AbstractShape

shapeDataChanged

public void shapeDataChanged(CurveShape csc,
                             DataSource oldData,
                             DataSource newData,
                             boolean onX)
Description copied from interface: CurveShapeListener
This function is called when one of the data displayed by the curve is replaced

Specified by:
shapeDataChanged in interface CurveShapeListener
Overrides:
shapeDataChanged in class PlotShape
Parameters:
csc - the curve
oldData - the old data
newData - the new data

createPanel

public JPropertiesPanel createPanel()

getPropertyNames

public java.lang.String[] getPropertyNames()
Description copied from interface: NamedProperties
Get the list of property names

Specified by:
getPropertyNames in interface NamedProperties
Overrides:
getPropertyNames in class AbstractShape

getAxesProperties

public java.util.HashMap getAxesProperties(java.util.HashMap map,
                                           int axeNumber)

getCurvesProperties

public java.util.HashMap getCurvesProperties(java.util.HashMap map)

setPropertyValue

public void setPropertyValue(java.lang.String name,
                             java.lang.Object value)
Description copied from class: AbstractShape
Assigns value to the property named name

Specified by:
setPropertyValue in interface NamedProperties
Overrides:
setPropertyValue in class AbstractShape
Parameters:
name - the name of the property to get
value - its new value
See Also:
AbstractShape.setPropertyValue(String, Object)

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String name)
Description copied from class: AbstractShape
Get the value of the property named name

Specified by:
getPropertyValue in interface NamedProperties
Overrides:
getPropertyValue in class AbstractShape
Parameters:
name - the name of the property to get
Returns:
the property value
See Also:
AbstractShape.getPropertyValue(String)

getCurveParameters

protected java.util.Vector getCurveParameters(java.util.Vector curves)

getLimitParameters

protected java.util.Vector getLimitParameters(java.util.ArrayList al)

setCurveParameters

public void setCurveParameters(java.util.Vector l)

setLimitParamters

public void setLimitParamters(java.util.Vector l)

getContextualDrawing

public DiagramComponent.ContextualDrawing getContextualDrawing(DiagramSelection s)
Specified by:
getContextualDrawing in interface DiagramComponent.ContextualDrawingProvider

refresh

public void refresh()
Description copied from class: AbstractShape
Reload all shape properties.

Overrides:
refresh in class AbstractShape