|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Any item that wants to be displayed in the simulator has to implement this interface. 2001.11.13 Added methods to make sim items not draggable in the simulation area. Added methods to change and get action associated with this object. This action is performed when user double click on the object in the simulator.
| Method Summary | |
java.awt.Shape |
getBounds()
Returns the coordinate bounds of the simulated item. |
java.lang.String |
getName()
Returns the name of the simulated item. |
boolean |
isDraggable()
Checks whether this object can be dragged in the simulator. |
boolean |
isSelected()
Returs true if the item is currently selected in GUI. |
void |
paint(java.awt.Graphics g)
Painting routine for the item. |
void |
paintSelection(java.awt.Graphics g)
Painting routine for the item selection. |
void |
performAction()
Perform action associated with this object. |
void |
selectSubItem()
Called when a selection occurs to select any sub-items the item has. |
void |
setAction(javax.swing.Action action)
Change the action associated with this object. |
void |
setBounds(java.awt.Shape rect)
Sets the coordinate bounds of the simulated item. |
void |
setDraggable(boolean drag)
Set wether this object can be dragged in the simulator. |
void |
setName(java.lang.String name)
Sets the name of the simulated item. |
void |
setSelected(boolean selected)
Sets the status of the item selection in GUI. |
void |
setSelected(boolean selected,
java.awt.Point selectionPoint)
Composite components need to know where they have been clicked when selected, because their inner parts can be selected as well. |
| Method Detail |
public java.awt.Shape getBounds()
public void setBounds(java.awt.Shape rect)
rect - coordinate bounds.public java.lang.String getName()
public void setName(java.lang.String name)
name - the name of the item.public boolean isSelected()
public void setSelected(boolean selected)
selected - selection status.
public void setSelected(boolean selected,
java.awt.Point selectionPoint)
selected - selection status.selectionPoint - the mouse press event position.public void paint(java.awt.Graphics g)
g - drawing graphics context.public void paintSelection(java.awt.Graphics g)
g - drawing graphics context.public void selectSubItem()
public boolean isDraggable()
public void setDraggable(boolean drag)
drag - true, if boject can dragged, false otherwise.public void performAction()
public void setAction(javax.swing.Action action)
action - new action.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||