public abstract class Device extends java.lang.Object implements GraphicalElement, Dimensioned
Modifier and Type | Class and Description |
---|---|
protected static class |
Device.ActionSet |
Modifier and Type | Field and Description |
---|---|
protected IController |
controller |
protected Unit |
unit |
Constructor and Description |
---|
Device() |
Device(IController controller) |
Modifier and Type | Method and Description |
---|---|
protected void |
doAction(IAction action)
Method called by subclasses to execute the action of the device.
|
IController |
getController() |
Dimension |
getDimension() |
IAction |
getPostAction() |
IAction |
getPreAction()
Returns the action to be performed before the primary action executed
by the device.
|
Unit |
getUnit() |
java.awt.Component |
graphic()
Same as graphic method with a null argument.
|
abstract java.awt.Component |
graphic(java.lang.Object obj)
Interface for a Simulation element that would be used in a simulation graphical user interface (GUI)
|
void |
setController(IController controller) |
void |
setPostAction(IAction action)
Sets an action to be performed after the primary action executed
by the device.
|
void |
setPreAction(IAction action)
Sets an action to be performed before the primary action executed
by the device.
|
void |
setUnit(Unit u) |
protected Unit unit
protected IController controller
public Device()
public Device(IController controller)
protected void doAction(IAction action)
public void setPreAction(IAction action)
public IAction getPreAction()
public void setPostAction(IAction action)
public IAction getPostAction()
public IController getController()
public void setController(IController controller)
controller
- The controller to set.public abstract java.awt.Component graphic(java.lang.Object obj)
GraphicalElement
graphic
in interface GraphicalElement
obj
- An object that might be used to specify the graphic that the GraphicalElement is to return.
In most cases the GraphicalElement ignores this parameter, and it can be set to null.Device
,
Display
public final java.awt.Component graphic()
public void setUnit(Unit u)
setUnit
in interface Dimensioned
public Unit getUnit()
getUnit
in interface Dimensioned
public Dimension getDimension()
getDimension
in interface Dimensioned