|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimtools.shapes.AbstractShape
jsynoptic.builtin.TextArrayShape
public class TextArrayShape
An array of text shapes
Nested Class Summary | |
---|---|
static class |
TextArrayShape.TextArrayShapePropertiesNames
|
Nested classes/interfaces inherited from class simtools.shapes.AbstractShape |
---|
AbstractShape.AbstractShapePropertiesNames |
Field Summary | |
---|---|
protected java.util.Vector |
cells
The array cells are of type TextShape |
protected boolean |
forceSameFont
|
protected java.lang.String |
link
|
static java.util.ResourceBundle |
resources
|
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 | |
---|---|
protected |
TextArrayShape()
For subclasses to override. |
|
TextArrayShape(java.lang.String text,
int width,
int height)
|
|
TextArrayShape(java.lang.String text,
int ox,
int oy,
int width,
int height)
Construct a new text array with the given size, and only one cell with the given text. |
Method Summary | |
---|---|
boolean |
addDataSource(DataSource d)
|
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 |
JPropertiesPanel |
createPanel()
|
protected TextShape |
createTextShape(java.lang.String name,
int width,
int height)
By overwriting this method, it is possible to create different kind of text cells |
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. |
java.util.Vector |
getCells()
|
java.lang.String |
getLink()
|
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 |
notificationEnd(java.lang.Object referer)
This callback is called after all notifications were processed. |
protected void |
positionCells()
This function supposes dimensions are correct, it will not check that Also, it does not notify changes. |
void |
resize(int dx,
int dy)
Resize the component |
void |
setAnchor(int ox,
int oy)
|
void |
setCells(java.util.Vector cellsProperties)
|
void |
setLink(java.lang.String link)
|
void |
setPropertyValue(java.lang.String name,
java.lang.Object value)
Assigns value to the property named name |
void |
translate(int dx,
int dy)
Translates the shape |
void |
unifyFonts()
Unify the fonts of all the text shapes, so they have a common font. |
Methods inherited from class simtools.shapes.AbstractShape |
---|
addListener, contains, contains, contains, contains, getAnchor, getBounds, getBounds2D, getInnerProperties, getMax, getMaxTranslated, getMin, getPathIterator, getPathIterator, intersects, intersects, 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 |
Field Detail |
---|
public static java.util.ResourceBundle resources
protected java.lang.String link
protected java.util.Vector cells
protected boolean forceSameFont
Constructor Detail |
---|
protected TextArrayShape()
public TextArrayShape(java.lang.String text, int width, int height)
public TextArrayShape(java.lang.String text, int ox, int oy, int width, int height)
Method Detail |
---|
public java.lang.String getLink()
getLink
in interface Linkable
public void setLink(java.lang.String link)
setLink
in interface Linkable
public java.util.Vector getCells()
public void translate(int dx, int dy)
AbstractShape
translate
in class AbstractShape
public void setAnchor(int ox, int oy)
setAnchor
in class AbstractShape
public void draw(java.awt.Graphics2D g)
AbstractShape
draw
in class AbstractShape
g
- the graphics contextpublic void unifyFonts()
protected void positionCells()
public void resize(int dx, int dy)
Resizable
resize
in interface Resizable
dx
- value on x axisdy
- value on y axispublic java.lang.String[] getActions(double x, double y, java.lang.Object o, int context)
ContextualActionProvider
getActions
in interface ContextualActionProvider
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
public boolean doAction(double x, double y, java.lang.Object o, java.lang.String action, javax.swing.undo.CompoundEdit undoableEdit)
ContextualActionProvider
doAction
in interface ContextualActionProvider
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.
public JPropertiesPanel createPanel()
public boolean canDoAction(double x, double y, java.lang.Object o, java.lang.String action, int context)
ContextualActionProvider
canDoAction
in interface ContextualActionProvider
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.context
- one of the context defined in the ContextualActionProvider class
protected TextShape createTextShape(java.lang.String name, int width, int height)
name
- width
- height
-
public boolean addDataSource(DataSource d)
addDataSource
in interface DataSourceConsumer
d
- the data source to be added
public void setCells(java.util.Vector cellsProperties)
public boolean canAddDataSource(DataSource d)
canAddDataSource
in interface DataSourceConsumer
d
- the data source to be added
protected AbstractShape cloneShape()
AbstractShape
cloneShape
in class AbstractShape
public void setPropertyValue(java.lang.String name, java.lang.Object value)
AbstractShape
value
to the property named name
setPropertyValue
in interface NamedProperties
setPropertyValue
in class AbstractShape
name
- the name of the property to getvalue
- its new valueAbstractShape.setPropertyValue(String, Object)
public java.lang.Object getPropertyValue(java.lang.String name)
AbstractShape
name
getPropertyValue
in interface NamedProperties
getPropertyValue
in class AbstractShape
name
- the name of the property to get
AbstractShape.getPropertyValue(String)
public void notificationEnd(java.lang.Object referer)
EndNotificationListener
notificationEnd
in interface EndNotificationListener
public java.lang.String[] getPropertyNames()
NamedProperties
getPropertyNames
in interface NamedProperties
getPropertyNames
in class AbstractShape
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |