auc.simulator.simitems
Interface SimItem

All Known Implementing Classes:
SimItemAdapter

public interface SimItem

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

getBounds

public java.awt.Shape getBounds()
Returns the coordinate bounds of the simulated item.
Returns:
coordinate bounds.

setBounds

public void setBounds(java.awt.Shape rect)
Sets the coordinate bounds of the simulated item.
Parameters:
rect - coordinate bounds.

getName

public java.lang.String getName()
Returns the name of the simulated item.
Returns:
the name of the item.

setName

public void setName(java.lang.String name)
Sets the name of the simulated item.
Parameters:
name - the name of the item.

isSelected

public boolean isSelected()
Returs true if the item is currently selected in GUI.
Returns:
selection status.

setSelected

public void setSelected(boolean selected)
Sets the status of the item selection in GUI.
Parameters:
selected - selection status.

setSelected

public 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.
Parameters:
selected - selection status.
selectionPoint - the mouse press event position.

paint

public void paint(java.awt.Graphics g)
Painting routine for the item.
Parameters:
g - drawing graphics context.

paintSelection

public void paintSelection(java.awt.Graphics g)
Painting routine for the item selection.
Parameters:
g - drawing graphics context.

selectSubItem

public void selectSubItem()
Called when a selection occurs to select any sub-items the item has.

isDraggable

public boolean isDraggable()
Checks whether this object can be dragged in the simulator.
Returns:
true, if this object can be dragged to another location; false otherwise.

setDraggable

public void setDraggable(boolean drag)
Set wether this object can be dragged in the simulator.
Parameters:
drag - true, if boject can dragged, false otherwise.

performAction

public void performAction()
Perform action associated with this object.

setAction

public void setAction(javax.swing.Action action)
Change the action associated with this object. Tha action is performed when user double clicks on the object in the simulator.
Parameters:
action - new action.