Package samer.tools
Class ImageViewer
- java.lang.Object
-
- samer.core.util.heavy.VCanvas
-
- samer.tools.ImageViewer
-
- All Implemented Interfaces:
- java.util.Observer
- Direct Known Subclasses:
- ImageTraceBase, MatrixImage
public class ImageViewer extends samer.core.util.heavy.VCanvas implements java.util.ObserverA base class for displaying images of real values. All that is needed is an ImageSource that implements ImageSourceBase. The ImageViewer provides a VMap for the IMap in the ImageSourceBase, and exposes the VMaps commands in a popup menu.
-
-
Field Summary
Fields Modifier and Type Field and Description static Environment.CodecColorModelCodecprotected intcxprotected intcyprotected intihprotected java.awt.Imageimgprotected ImageSourceBaseipprotected intiwprotected VMapmapprotected java.util.Observableobs
-
Constructor Summary
Constructors Constructor and Description ImageViewer(ImageSourceBase source, java.util.Observable o)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidattach()voiddetach()voidexecute(java.lang.String c, Environment env)voidgetCommands(Registry r)IMapgetMap()java.awt.DimensiongetPreferredSize()VMapgetVMap()voidpaint(java.awt.Graphics g)voidscale()voidsetCellSize(int w, int h)voidsetColorModel(java.awt.image.IndexColorModel cm)voidsetMap(IMap map)voidupdate(java.awt.Graphics g)voidupdate(java.util.Observable o, java.lang.Object s)
-
-
-
Field Detail
-
ColorModelCodec
public static Environment.Codec ColorModelCodec
-
cx
protected int cx
-
cy
protected int cy
-
ih
protected int ih
-
img
protected java.awt.Image img
-
ip
protected ImageSourceBase ip
-
iw
protected int iw
-
map
protected VMap map
-
obs
protected java.util.Observable obs
-
-
Constructor Detail
-
ImageViewer
public ImageViewer(ImageSourceBase source, java.util.Observable o)
-
-
Method Detail
-
scale
public void scale()
-
update
public void update(java.util.Observable o, java.lang.Object s)- Specified by:
updatein interfacejava.util.Observer
-
attach
public void attach()
-
detach
public void detach()
-
getCommands
public void getCommands(Registry r)
-
execute
public void execute(java.lang.String c, Environment env) throws java.lang.Exception- Throws:
java.lang.Exception
-
getVMap
public VMap getVMap()
-
getMap
public IMap getMap()
-
setMap
public void setMap(IMap map)
-
setColorModel
public void setColorModel(java.awt.image.IndexColorModel cm)
-
update
public void update(java.awt.Graphics g)
-
paint
public void paint(java.awt.Graphics g)
-
setCellSize
public void setCellSize(int w, int h)
-
getPreferredSize
public java.awt.Dimension getPreferredSize()
-
-