|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--auc.simulator.simitems.SimItemAdapter
The base class for the simulated items.
| Field Summary | |
protected javax.swing.Action |
mAction
Action to be performed when user double clicks on the object in the simulator. |
protected java.awt.Shape |
mBounds
Bounding region of the simulated item. |
protected CoordManageable |
mCoordProvider
Component on which the simulator item has to be drawn. |
protected boolean |
mDraggable
Flag indicating whether this object can be dragged. |
protected java.lang.String |
mName
The title name of the item. |
protected java.awt.Point |
mSelectionPoint
If the item was selected with a mouse, the mouse press point is savded in this variable. |
| Constructor Summary | |
SimItemAdapter(CoordManageable coordProvider,
java.lang.String name,
java.awt.Shape bounds)
Construction. |
|
| Method Summary | |
java.awt.Shape |
getBounds()
Returns the region bounds of this item. |
protected java.awt.Point |
getCenterPoint()
Returns center point in absolute coordinates. |
CoordManager |
getCoordManager()
Returns the coordinate manager for drawing. |
java.lang.String |
getName()
Returns the title name of the item. |
protected java.awt.Rectangle |
getSelectionBounds()
Return bounds of selecting rectangle. |
boolean |
isDraggable()
Checks whether this object can be dragged in the simulator. |
boolean |
isSelected()
Status of item selection on GUI. |
abstract void |
paint(java.awt.Graphics g)
Painting of the item has to be overriden with subclasses. |
void |
paintSelection(java.awt.Graphics g)
Default selection painting for simulated items (draws a stroked rectangle over the bounds of the item). |
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 bounds)
Sets the region bounds of this item. |
void |
setDraggable(boolean drag)
Set wether this object can be dragged in the simulator. |
void |
setName(java.lang.String name)
Sets the title name of the item. |
void |
setSelected(boolean selected)
Sets the status of item selection on GUI. |
void |
setSelected(boolean mSelected,
java.awt.Point selectionPoint)
Sets the selection status (from the mouse). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.awt.Shape mBounds
protected CoordManageable mCoordProvider
protected java.lang.String mName
protected java.awt.Point mSelectionPoint
protected boolean mDraggable
protected javax.swing.Action mAction
| Constructor Detail |
public SimItemAdapter(CoordManageable coordProvider,
java.lang.String name,
java.awt.Shape bounds)
coordProvider - component on which this item has to be drawn.name - the title name of the item.bounds - bounding region of the item on the drawing area.| Method Detail |
public java.awt.Shape getBounds()
getBounds in interface SimItempublic void setBounds(java.awt.Shape bounds)
setBounds in interface SimItembounds - the shape bounding the region of the item.public java.lang.String getName()
getName in interface SimItempublic void setName(java.lang.String name)
setName in interface SimItemname - the title name of the item.public CoordManager getCoordManager()
public boolean isSelected()
isSelected in interface SimItempublic void setSelected(boolean selected)
setSelected in interface SimItemselected - selection status.
public void setSelected(boolean mSelected,
java.awt.Point selectionPoint)
setSelected in interface SimItemselectionPoint - the mouse press event point that selected this item.public abstract void paint(java.awt.Graphics g)
paint in interface SimItemg - the graphics context for drawing.public void paintSelection(java.awt.Graphics g)
paintSelection in interface SimItemg - the graphics context for drawing.protected java.awt.Rectangle getSelectionBounds()
protected java.awt.Point getCenterPoint()
public void selectSubItem()
selectSubItem in interface SimItempublic boolean isDraggable()
isDraggable in interface SimItempublic void setDraggable(boolean drag)
setDraggable in interface SimItemdrag - true, if boject can dragged, false otherwise.public void performAction()
performAction in interface SimItempublic void setAction(javax.swing.Action action)
setAction in interface SimItemaction - new action.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||