jsynoptic.builtin
Class LinesShape
java.lang.Object
simtools.shapes.AbstractShape
jsynoptic.builtin.Abstract1DShape
jsynoptic.builtin.LinesShape
- All Implemented Interfaces:
- java.awt.Shape, java.io.Serializable, java.lang.Cloneable, ContextualActionProvider, Linkable, SelectionContextualActionProvider, AffineTransformData.Listener, DataSourceListener, EndNotificationListener, Resizable, NamedProperties
public class LinesShape
- extends Abstract1DShape
The lines shape consists in one or more line segments
- See Also:
- Serialized Form
Field Summary |
protected boolean |
closed
|
static java.util.ResourceBundle |
resources
|
protected boolean |
selecting
|
protected double[] |
x
|
protected double[] |
y
|
Fields inherited from class jsynoptic.builtin.Abstract1DShape |
allowResize, bounds2D, delegateEndNotificationListener, dirty, dirtyDrawColor, dirtyRectangle, drawColor, drawDynamicColor, drawMapper, drawMapperIndex, drawMapperSource, fixedRatio, link, MIN_SIZE, ratio, stroke, strokeParams, transform |
Fields inherited from class simtools.shapes.AbstractShape |
_h, _ox, _oy, _propertyNames, _w, _x, _y, ANTI_ALIASING, currentDialogBox, FONT_NAMES, listeners, REFRESH_PERIOD |
Constructor Summary |
LinesShape(int ox,
int oy,
int width,
int height)
|
LinesShape(int ox,
int oy,
int width,
int height,
double[] x,
double[] y,
boolean allowResize,
boolean fixedRatio,
double ratio)
|
Method Summary |
JPropertiesPanel |
createPanel()
|
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. |
void |
draw(java.awt.Graphics2D g)
Draws the shape |
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. |
protected java.awt.Shape |
getDelegateShape()
|
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at)
|
java.awt.geom.PathIterator |
getPathIterator(java.awt.geom.AffineTransform at,
double flatness)
|
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 |
void |
setPropertyValue(java.lang.String name,
java.lang.Object value)
Assigns value to the property named name |
Methods inherited from class jsynoptic.builtin.Abstract1DShape |
canDoAction, canResize, cloneShape, contains, contains, contains, contains, createPanel, DataSourceIndexRangeChanged, DataSourceInfoChanged, DataSourceOrderChanged, DataSourceReplaced, DataSourceValueChanged, DataSourceValueRangeChanged, doCollectiveAction, drawHook, getBounds, getBounds2D, getCollectiveActions, getDelegateEndNotificationListener, getDrawColor, getDx, getDy, getLink, intersects, intersects, notificationEnd, resize, setAnchor, setDelegateEndNotificationListener, setLink, translate, updateBounds, updateTransform |
Methods inherited from class simtools.shapes.AbstractShape |
addListener, getAnchor, getInnerProperties, getMax, getMaxTranslated, getMin, notifyChange, notifyChange, refresh, removeListener, setAnchor, setProperties, wipeOff |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
resources
public static java.util.ResourceBundle resources
x
protected double[] x
y
protected double[] y
closed
protected boolean closed
selecting
protected boolean selecting
LinesShape
public LinesShape(int ox,
int oy,
int width,
int height)
LinesShape
public LinesShape(int ox,
int oy,
int width,
int height,
double[] x,
double[] y,
boolean allowResize,
boolean fixedRatio,
double ratio)
- Parameters:
_ox
- _oy
- _w
- _h
- ds
- ds2
- allowResize
- fixedRatio
- ratio
-
getDelegateShape
protected java.awt.Shape getDelegateShape()
- Specified by:
getDelegateShape
in class Abstract1DShape
getPathIterator
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
- Specified by:
getPathIterator
in interface java.awt.Shape
- Overrides:
getPathIterator
in class Abstract1DShape
getPathIterator
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at,
double flatness)
- Specified by:
getPathIterator
in interface java.awt.Shape
- Overrides:
getPathIterator
in class Abstract1DShape
createPanel
public JPropertiesPanel createPanel()
- Overrides:
createPanel
in class Abstract1DShape
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
- Overrides:
getActions
in class Abstract1DShape
- 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 actionscontext
- one of the context defined in the ContextualActionProvider class
- Returns:
- The list of possible actions, possibly null or an empty array
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
- Overrides:
doAction
in class Abstract1DShape
- Parameters:
x
- Coordinate, for example mouse positiony
- Coordinate, for example mouse positiono
- 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
draw
public void draw(java.awt.Graphics2D g)
- Description copied from class:
AbstractShape
- Draws the shape
- Overrides:
draw
in class Abstract1DShape
- Parameters:
g
- the graphics context
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 Abstract1DShape
- Parameters:
name
- the name of the property to get
- Returns:
- the property value
- See Also:
AbstractShape.getPropertyValue(String)
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 Abstract1DShape
- Parameters:
name
- the name of the property to getvalue
- its new value- See Also:
AbstractShape.setPropertyValue(String, Object)
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 Abstract1DShape