hades.models.meta
Class ActionButton

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.models.meta.ActionButton
All Implemented Interfaces:
java.lang.Cloneable, ContextToolTip, java.io.Serializable, Simulatable

public class ActionButton
extends SimObject

This class models a HADES simulation 'meta'-object. When clicked onto, the ActionButton will trigger a HADES action (command). In combination with the 'OpenDesign' and 'OpenDesignInNewEditor' commands, the ActionButton may be used to create hyperlinked HADES Designs.

Future versions of ActionButton may support additional Commands.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
ActionButton()
           
 
Method Summary
 void configure()
          construct and display the Dialog window to specify our parameters
 void elaborate(java.lang.Object arg)
          elaborate(): This method is called by the simulation engine to initialize the simulation object.
 java.lang.String getCommandName()
           
 java.lang.String getCommandParamString()
           
 int getCommandXpos()
           
 int getCommandYpos()
           
 java.lang.String getResourceName()
           
 java.lang.String getSymbolResourceName()
          return the value of our "resourceName" member variable.
 boolean initialize(java.lang.String s)
          initialize a ActionButton from a String.
 void mousePressed(java.awt.event.MouseEvent evt)
          react to a MouseEvent.
 void setCommandName(java.lang.String s)
           
 void setCommandParamString(java.lang.String s)
           
 void setCommandXpos(java.lang.String s)
           
 void setCommandYpos(java.lang.String s)
           
 void setResourceName(java.lang.String s)
           
 java.lang.String toString()
          toString: generate a text description for this SimObject.
 void write(java.io.PrintWriter ps)
           
 
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, copy, evaluate, getBindkey, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getPropertySheet, getResourceAsStream, getSimulator, getSymbol, getToolTip, getVersionId, isVisible, keyPressed, message, needsDynamicSymbol, needsExternalResources, setClassLoader, setConsole, setDebug, setEditor, setName, setParent, setPorts, setSimulator, setSymbol, setVersionId, setVisible, tearDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ActionButton

public ActionButton()
Method Detail

getSymbolResourceName

public java.lang.String getSymbolResourceName()
return the value of our "resourceName" member variable. We need to override the implementation in SimObject, to allow to customize the Symbol for this ActionButton.

Overrides:
getSymbolResourceName in class SimObject

getResourceName

public java.lang.String getResourceName()

getCommandName

public java.lang.String getCommandName()

getCommandParamString

public java.lang.String getCommandParamString()

getCommandXpos

public int getCommandXpos()

getCommandYpos

public int getCommandYpos()

setResourceName

public void setResourceName(java.lang.String s)

setCommandName

public void setCommandName(java.lang.String s)

setCommandParamString

public void setCommandParamString(java.lang.String s)

setCommandXpos

public void setCommandXpos(java.lang.String s)

setCommandYpos

public void setCommandYpos(java.lang.String s)

initialize

public boolean initialize(java.lang.String s)
initialize a ActionButton from a String. Currently, we expect the following format of the String:
    FigWrapperResourceName CommandClassName x y command parameters
 
, e.g.
    /hades/examples/tutorial/home.gif hades.gui.OpenDesignCommand 0 0 /hades/examples/tutorial/contents.hds
 

Overrides:
initialize in class SimObject

write

public void write(java.io.PrintWriter ps)
Overrides:
write in class SimObject

configure

public void configure()
construct and display the Dialog window to specify our parameters

Overrides:
configure in class SimObject

mousePressed

public void mousePressed(java.awt.event.MouseEvent evt)
Description copied from class: SimObject
react to a MouseEvent. The base SimObject ignores MouseEvents.

Note that the HADES schematic editor will also deliver jfig.canvas.FigCanvasEvent object, which also include the world-coordinates of the Event.

Overrides:
mousePressed in class SimObject

elaborate

public void elaborate(java.lang.Object arg)
Description copied from class: SimObject
elaborate(): This method is called by the simulation engine to initialize the simulation object.

Specified by:
elaborate in interface Simulatable
Overrides:
elaborate in class SimObject

toString

public java.lang.String toString()
Description copied from class: SimObject
toString: generate a text description for this SimObject. This method currently combines the class name for the SimObject (or subclass) and its full name in the current Hades Design, e.g. "hades.models.gates.And2: /uut/adder16/adder1/i3".

Overrides:
toString in class SimObject