hades.models.imaging
Class ImageSource

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

public class ImageSource
extends SimObject
implements Simulatable, Assignable, java.io.Serializable

ImageSource - a SimObject to load Images from files. Signals are expected to be ImageSignals.

See Also:
Serialized Form

Field Summary
protected  java.awt.Image image
           
protected  java.lang.String imageResourceName
           
protected  Port port_Y
           
protected  double t_delay
           
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
ImageSource()
           
 
Method Summary
 void applyValuesHook()
           
 void assign(java.lang.String name, double simTime)
          Load the image specified by 'name' (a filename or URL) right now, then schedule the new image to our output port at the given simulation time.
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
 void elaborate(java.lang.Object arg)
          elaborate(): This method is called by the simulation engine to initialize the simulation object.
 void evaluate(java.lang.Object arg)
          don't call this.
 java.lang.String[] getExternalResources()
          return a String[] array of length 1 with our Image file/resource name
 java.awt.Image getImage()
           
 java.lang.String getImageResourceName()
           
 java.lang.String[] getPropertySheetFieldNames()
           
 boolean initialize(java.lang.String s)
          initialize a ImageSource from a String that contains the integer version id of this gate and its propagation delay (in seconds), e.g.
 java.awt.Image loadImage(java.lang.String name)
           
 void mousePressed(java.awt.event.MouseEvent me)
          react to a MouseEvent.
 boolean needsExternalResources()
          we use one external resource: the Image file/resource
 void scheduleImage()
           
 void scheduleImage(double time)
           
 void selectFile()
           
 void setImageResourceName(java.lang.String s)
           
 java.lang.String toString()
          toString() - the usual info method
 void write(java.io.PrintWriter ps)
           
 
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, copy, getBindkey, getClassLoader, getDebug, getEditor, getFullName, getName, getParent, getPort, getPorts, getPropertySheet, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, getToolTip, getVersionId, isVisible, keyPressed, message, needsDynamicSymbol, 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

port_Y

protected Port port_Y

image

protected java.awt.Image image

imageResourceName

protected java.lang.String imageResourceName

t_delay

protected double t_delay
Constructor Detail

ImageSource

public ImageSource()
Method Detail

getImage

public java.awt.Image getImage()

getImageResourceName

public java.lang.String getImageResourceName()

setImageResourceName

public void setImageResourceName(java.lang.String s)

needsExternalResources

public boolean needsExternalResources()
we use one external resource: the Image file/resource

Overrides:
needsExternalResources in class SimObject

getExternalResources

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

Overrides:
getExternalResources in class SimObject

elaborate

public void elaborate(java.lang.Object arg)
Description copied from interface: Simulatable
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

evaluate

public void evaluate(java.lang.Object arg)
don't call this. We need to provide evaluate() to fulfil the SimObject contract, but as this component has no inputs it is an error if this method is ever called. This might change when we decide to use ImageSource as an InputConnector for hierarchical image-processing setups, but this is not yet ready.

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

selectFile

public void selectFile()

assign

public void assign(java.lang.String name,
                   double simTime)
Load the image specified by 'name' (a filename or URL) right now, then schedule the new image to our output port at the given simulation time. This method allows ImageSource to be remote-controlled from a stimuli file.

Specified by:
assign in interface Assignable

scheduleImage

public void scheduleImage()

scheduleImage

public void scheduleImage(double time)

mousePressed

public void mousePressed(java.awt.event.MouseEvent me)
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

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

getPropertySheetFieldNames

public java.lang.String[] getPropertySheetFieldNames()

applyValuesHook

public void applyValuesHook()

initialize

public boolean initialize(java.lang.String s)
initialize a ImageSource from a String that contains the integer version id of this gate and its propagation delay (in seconds), e.g. '1001 0.5E-8'.

Overrides:
initialize in class SimObject

loadImage

public java.awt.Image loadImage(java.lang.String name)

write

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

toString

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

Overrides:
toString in class SimObject