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.Observer
A 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.Codec
ColorModelCodec
protected int
cx
protected int
cy
protected int
ih
protected java.awt.Image
img
protected ImageSourceBase
ip
protected int
iw
protected VMap
map
protected java.util.Observable
obs
-
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 void
attach()
void
detach()
void
execute(java.lang.String c, Environment env)
void
getCommands(Registry r)
IMap
getMap()
java.awt.Dimension
getPreferredSize()
VMap
getVMap()
void
paint(java.awt.Graphics g)
void
scale()
void
setCellSize(int w, int h)
void
setColorModel(java.awt.image.IndexColorModel cm)
void
setMap(IMap map)
void
update(java.awt.Graphics g)
void
update(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:
update
in 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()
-
-