hades.models.meta
Class Label

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

public class Label
extends SimObject
implements Simulatable, java.io.Serializable

Label - a passive text object useful as a label / annotation

See Also:
Serialized Form

Nested Class Summary
(package private)  class Label.EditTextDialog
           
(package private)  class Label.JEditTextDialog
           
 
Field Summary
(package private)  java.awt.Component editTextDialog
           
(package private)  java.awt.Frame frame
           
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
Label()
           
 
Method Summary
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
 void constructDynamicSymbol()
           
 SimObject copy()
          create a copy of the current Label.
 void elaborate(java.lang.Object arg)
          this is a passive object: do nothing
 void evaluate(java.lang.Object arg)
          this is a passive object: do nothing
 java.awt.Component getPropertySheet()
          return a reference to the 'property sheet' or configuration window for this SimObject.
 java.lang.String getText()
           
 boolean initialize(java.lang.String s)
          read a text represenation with the following data: versionId, FIG attributes, encoded text.
 boolean needsDynamicSymbol()
           
 void setText(java.lang.String s)
           
 java.lang.String toString()
          toString() - the usual info method
 void write(java.io.PrintWriter ps)
          write a text represenation with the following data: versionId, FIG attributes, encoded text.
 
Methods inherited from class hades.simulator.SimObject
getBindkey, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getToolTip, getVersionId, isVisible, keyPressed, message, mousePressed, 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
 
Methods inherited from interface hades.simulator.Simulatable
message
 

Field Detail

frame

java.awt.Frame frame

editTextDialog

java.awt.Component editTextDialog
Constructor Detail

Label

public Label()
Method Detail

setText

public void setText(java.lang.String s)

getText

public java.lang.String getText()

needsDynamicSymbol

public boolean needsDynamicSymbol()
Overrides:
needsDynamicSymbol in class SimObject

constructDynamicSymbol

public void constructDynamicSymbol()
Overrides:
constructDynamicSymbol in class SimObject

elaborate

public void elaborate(java.lang.Object arg)
this is a passive object: do nothing

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

evaluate

public void evaluate(java.lang.Object arg)
this is a passive object: do nothing

Specified by:
evaluate in interface Simulatable
Overrides:
evaluate in class SimObject
Parameters:
arg - an arbitrary object argument

initialize

public boolean initialize(java.lang.String s)
read a text represenation with the following data: versionId, FIG attributes, encoded text. See the FIG FORMAT3.2 specification for details.
 
        versionId      1001
        alignment      1 2 3
        color index    0 (black) .. 
        depth          0 .. 999 (layer)
        font index     0 .. 31 
        font size      12 (pt) 
        font angle     0.0
        font flags     0
        encoded string 
     

Overrides:
initialize in class SimObject

write

public void write(java.io.PrintWriter ps)
write a text represenation with the following data: versionId, FIG attributes, encoded text. See the FIG FORMAT3.2 specification for details.
 
        versionId      1001
        alignment      1 2 3
        color index    0 (black) .. 
        depth          0 .. 999 (layer)
        font index     0 .. 31 
        font size      12 (pt) 
        font angle     0.0
        font flags     0
        encoded string 
     

Overrides:
write in class SimObject

configure

public void configure()
Description copied from class: SimObject
create and display a 'ConfigDialog' to set the parameters for a SimObject. The default ConfigDialog for the base class (SimObject) itself is empty except for the 'instance name' of the SimObject.

Overrides:
configure in class SimObject

getPropertySheet

public java.awt.Component getPropertySheet()
Description copied from class: SimObject
return a reference to the 'property sheet' or configuration window for this SimObject. We cast the return value to an AWT Component, but typically you can expect either a hades.gui.PropertySheet or an java.awt.Window (Dialog or Frame).

Overrides:
getPropertySheet in class SimObject

copy

public SimObject copy()
create a copy of the current Label. Note that we want a "deep copy" of the Label symbol attributes, so that the attributes like font size and color are not shared between original and clone.

Overrides:
copy in class SimObject

toString

public java.lang.String toString()
toString() - the usual info method

Overrides:
toString in class SimObject