hades.models.imaging
Class ImageViewer

java.lang.Object
  extended byhades.simulator.SimObject
      extended byhades.models.imaging.ImageViewer
All Implemented Interfaces:
java.awt.event.ActionListener, java.lang.Cloneable, ContextToolTip, java.util.EventListener, java.io.Serializable, Simulatable

public class ImageViewer
extends SimObject
implements Simulatable, java.io.Serializable, java.awt.event.ActionListener

ImageViewer - a SimObject to display an Image in an individual JFrame. Signals are expected to be ImageSignals.

See Also:
Serialized Form

Nested Class Summary
 class ImageViewer.JImageCanvas
           
 
Field Summary
protected  javax.swing.JComponent canvas
           
protected  javax.swing.JFileChooser fileChooser
           
protected  javax.swing.JFrame frame
           
protected  java.awt.Image image
           
protected  Port port_A
           
protected  javax.swing.JScrollPane scroller
           
protected  javax.swing.JLabel statusLabel
           
 
Fields inherited from class hades.simulator.SimObject
classloader, console, debug, editor, name, parent, ports, propertySheet, simulator, symbol, versionId, visible
 
Constructor Summary
ImageViewer()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
           
 void configure()
          create and display a 'ConfigDialog' to set the parameters for a SimObject.
 void createFrame()
           
 void doChangeName()
           
 void doClose()
           
 void doOpenImage()
           
 void doPrint()
           
 void doSaveAs()
           
 void doShowAbout()
           
 void doShowUsage()
           
 void doZoom11()
           
 void doZoom21()
           
 void doZoom41()
           
 void evaluate(java.lang.Object arg)
          evaluate(): called by the simulation engine on all events that concern this object.
 java.awt.Component getPropertySheet()
          return a reference to the 'property sheet' or configuration window for this SimObject.
 boolean initialize(java.lang.String s)
          initialize a ImageViewer from a String that contains the integer version id of this gate and its propagation delay (in seconds), e.g.
 void mousePressed(java.awt.event.MouseEvent me)
          react to a MouseEvent.
 void NOTYET()
           
 void showImage()
           
 java.lang.String toString()
          toString() - the usual info method
 void updateImage(java.awt.Image tmp)
           
 void write(java.io.PrintWriter ps)
           
 
Methods inherited from class hades.simulator.SimObject
constructDynamicSymbol, copy, elaborate, getBindkey, getClassLoader, getDebug, getEditor, getExternalResources, getFullName, getName, getParent, getPort, getPorts, getResourceAsStream, getSimulator, getSymbol, getSymbolResourceName, 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
 
Methods inherited from interface hades.simulator.Simulatable
elaborate, message
 

Field Detail

port_A

protected Port port_A

image

protected java.awt.Image image

frame

protected javax.swing.JFrame frame

canvas

protected javax.swing.JComponent canvas

statusLabel

protected javax.swing.JLabel statusLabel

scroller

protected javax.swing.JScrollPane scroller

fileChooser

protected javax.swing.JFileChooser fileChooser
Constructor Detail

ImageViewer

public ImageViewer()
Method Detail

evaluate

public void evaluate(java.lang.Object arg)
Description copied from interface: Simulatable
evaluate(): called by the simulation engine on all events that concern this object. The object is responsible for updating its internal state and for scheduling all pending output events.

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

updateImage

public void updateImage(java.awt.Image tmp)

showImage

public void showImage()

createFrame

public void createFrame()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

doOpenImage

public void doOpenImage()

doPrint

public void doPrint()

doClose

public void doClose()

doZoom11

public void doZoom11()

doZoom21

public void doZoom21()

doZoom41

public void doZoom41()

NOTYET

public void NOTYET()

doChangeName

public void doChangeName()

doSaveAs

public void doSaveAs()

doShowAbout

public void doShowAbout()

doShowUsage

public void doShowUsage()

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

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

initialize

public boolean initialize(java.lang.String s)
initialize a ImageViewer 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

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