hades.models
Class FigObject

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

public class FigObject
extends SimObject
implements java.io.Serializable

FigObject: a passive SimObject used to include FIG drawings into design schematics.

See Also:
Serialized Form

Field Summary
(package private)  java.lang.String figresourcename
           
(package private)  FigWrapper figwrapper
           
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
FigObject()
          Construct an empty FigObject.
 
Method Summary
 void configure()
          configure: display a dialog that allows the user to change the name and the fig resource name of this FigObject.
 void constructDynamicSymbol()
          construct a Symbol for this FigObject.
 void elaborate(java.lang.Object arg)
          elaborate: do nothing because this is a passive SimObject.
 java.lang.String[] getExternalResources()
          return a String[] array of length 1 with our FIG file resource name
 java.lang.String getFigresourcename()
          return the name of our FIG file/resource.
 FigWrapper getFigWrapper()
          return a reference to our FigWrapper object with the FIG members
 boolean initialize(java.lang.String s)
          initialize a FigObject from a String.
 boolean needsDynamicSymbol()
          return true, because we need a dynamically create symbol
 boolean needsExternalResources()
          we use one external resource: the FIG file to initialize us.
 void setFigresourcename(java.lang.String s)
          set a new FIG file/resource called "s", then re-initialize this FigObject to load the new FIG file.
 java.lang.String toString()
          toString: generate a text description for this SimObject.
 void write(java.io.PrintWriter ps)
          write the versionId and the mangled unicode-escaped figresourcename.
 
Methods inherited from class hades.simulator.SimObject
copy, evaluate, getBindkey, getClassLoader, getDebug, getEditor, getFullName, getName, getParent, getPort, getPorts, getPropertySheet, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getToolTip, getVersionId, isVisible, keyPressed, message, mousePressed, 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
 

Field Detail

figwrapper

FigWrapper figwrapper

figresourcename

java.lang.String figresourcename
Constructor Detail

FigObject

public FigObject()
Construct an empty FigObject. The FIG file is later loaded from a file/resource/URL called "figresourcename" during initialize().

Method Detail

getFigresourcename

public java.lang.String getFigresourcename()
return the name of our FIG file/resource.


setFigresourcename

public void setFigresourcename(java.lang.String s)
set a new FIG file/resource called "s", then re-initialize this FigObject to load the new FIG file.


needsExternalResources

public boolean needsExternalResources()
we use one external resource: the FIG file to initialize us.

Overrides:
needsExternalResources in class SimObject

getExternalResources

public java.lang.String[] getExternalResources()
return a String[] array of length 1 with our FIG file resource name

Overrides:
getExternalResources in class SimObject

needsDynamicSymbol

public boolean needsDynamicSymbol()
return true, because we need a dynamically create symbol

Overrides:
needsDynamicSymbol in class SimObject

constructDynamicSymbol

public void constructDynamicSymbol()
construct a Symbol for this FigObject. If our figwrapper object is non-null, we add the figwrapper contents (the FIG file/resource data) to the symbol. Finally, change the layer of the Symbol with all member FIG objects to layer 85, to get this passive FigObject out of the way (=below) other interactive SimObjects in a Design schematic. This means that the FIG file/resource should be loaded before this method is first called.

Overrides:
constructDynamicSymbol in class SimObject

initialize

public boolean initialize(java.lang.String s)
initialize a FigObject from a String. Currently, the String should contain the following things: the FigObject versionId, and the Java resource-name of the FIG-file to parse, e.g.
       1002 /hades/examples/tutorial/welcome.fig
    

Overrides:
initialize in class SimObject

write

public void write(java.io.PrintWriter ps)
write the versionId and the mangled unicode-escaped figresourcename.

Overrides:
write in class SimObject

configure

public void configure()
configure: display a dialog that allows the user to change the name and the fig resource name of this FigObject.

Overrides:
configure in class SimObject

getFigWrapper

public FigWrapper getFigWrapper()
return a reference to our FigWrapper object with the FIG members


elaborate

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

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