Class ncsa.horizon.viewer.GraphicsSelectionViewer
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class ncsa.horizon.viewer.GraphicsSelectionViewer

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----ncsa.horizon.viewer.Viewer
                                   |
                                   +----ncsa.horizon.viewer.SelectionViewer
                                           |
                                           +----ncsa.horizon.viewer.GraphicsSelectionViewer

public class GraphicsSelectionViewer
extends SelectionViewer
This Viewer provides an implementation of the methods needed for a SelectionViewer.

Programmer's are encouraged to inspect this code for examples of how to implement the various Viewer methods.


Variable Index

 o coord
CoordinateSystem object for converting between data pixels and world coordinates
 o defaultDisplayHeight
default height of display area if not specified in constructor
 o defaultDisplayWidth
default width of display area if not specified in constructor
 o display
A canvas used to display the image and hanle the selection events
 o newViewable
a flag that is true if a new viewable has been attached
 o pixelMap
ImageDisplayMap object for converting between display pixels and data pixels
 o posPanel
A panel displaying current mouse data position and coordinates.
 o slice
the last slice requested from the current viewable
 o viewable
the current viewable
 o viewerImpl
 o xCoordPos
 o xDataPos
 o xLabel
 o yCoordPos
 o yDataPos
 o yLabel

Constructor Index

 o GraphicsSelectionViewer()
create a viewer with no argument
 o GraphicsSelectionViewer(int, int)
create a viewer with a given display size

Method Index

 o addViewable(Viewable)
replace the current Viewable object with a new one; the display will not be affected until displaySlice() is called.
 o createDefaultSlice(Viewable)
 o displaySlice()
Display a default slice of the current Viewable.
 o displaySlice(Slice)
display a slice from the current Viewable data, or do nothing if the current Viewable is not set.
 o getBoxSelection()
get the current selected display box.
 o getDisplaySize()
This method returns the size in display pixel units of the region that displays a Viewable
 o getLineSelection()
get the current selected display Line.
 o getPixelSelection()
get the current selected display pixel.
 o getSliceSelection()
return the current selected Slice, or null if there is no current Viewable;
 o getViewable()
Return a reference to the current Viewable object, or null if none are attached to this Viewer.
 o getViewSlice()
return a Slice object describing the data currently being viewed, or null if there is no Viewable currently being viewed.
 o getVoxelSelection()
return the current selected Voxel, or null if there is no current Viewable.
 o preferredSize()
return the preferred size of this Viewer Panel
 o reshape(int, int, int, int)
resize the viewer so that the display area takes up as much of the available space as possible.
 o setBoxSelection(int, int, int, int)
set the current selected display box.
 o setDisplaySize(Dimension)
set the size of the display area
 o setDisplaySize(int, int)
set the size of the display area
 o setLineSelection(int, int, int, int)
set the current selected display line.
 o setPixelmap(Slice, Rectangle)
set the ImageDisplayMap object, pixelMap (used to convert display pixels into data pixels), to reflect changes in the current Viewable
 o setPixelSelection(int, int)
set the current selected display pixel.
 o setSlice(Slice)
 o setSliceSelection(Volume)
set the current selected Slice to the given Volume as projected onto the currently displayed Slice, or do nothing if there is no current Viewable.
 o setVoxelSelection(Voxel)
set the current selected Voxel to the one given as projected onto the currently displayed Slice, or do nothing if there is no current Viewable.
 o updateDatalabel(double, double)
 o updatePixelMap()
update the ImageDisplayMap object, pixtrans (used to convert display pixels into data pixels), to reflect changes in the currently viewed slice.
 o updatePixelMap(Slice, Rectangle)
update the ImageDisplayMap object, pixtrans (used to convert display pixels into data pixels), to reflect changes in the currently viewed slice.
 o updatePosDisplay(int, int)
update the ImageDisplayMap object, pixelMap (used to convert display pixels into data pixels), to reflect changes in the currently viewed slice.
 o updateWorldlabel(String, String)

Variables

 o viewable
  protected Viewable viewable
the current viewable
 o slice
  protected Slice slice
the last slice requested from the current viewable
 o pixelMap
  protected ImageDisplayMap pixelMap
ImageDisplayMap object for converting between display pixels and data pixels
 o coord
  protected CoordinateSystem coord
CoordinateSystem object for converting between data pixels and world coordinates
 o viewerImpl
  protected ImageCanvasViewerImpl viewerImpl
 o newViewable
  protected boolean newViewable
a flag that is true if a new viewable has been attached
 o display
  protected GraphicsSelectionCanvas display
A canvas used to display the image and hanle the selection events
 o posPanel
  protected Panel posPanel
A panel displaying current mouse data position and coordinates.
 o xDataPos
  protected Label xDataPos
 o yDataPos
  protected Label yDataPos
 o xLabel
  protected Label xLabel
 o yLabel
  protected Label yLabel
 o xCoordPos
  protected Label xCoordPos
 o yCoordPos
  protected Label yCoordPos
 o defaultDisplayWidth
  public final static int defaultDisplayWidth
default width of display area if not specified in constructor
 o defaultDisplayHeight
  public final static int defaultDisplayHeight
default height of display area if not specified in constructor

Constructors

 o GraphicsSelectionViewer
  public GraphicsSelectionViewer()
create a viewer with no argument
 o GraphicsSelectionViewer
  public GraphicsSelectionViewer(int width,
                                 int height)
create a viewer with a given display size
Parameters:
width - width of the display area
height - height of the display area

Methods

 o addViewable
  public synchronized void addViewable(Viewable data)
replace the current Viewable object with a new one; the display will not be affected until displaySlice() is called.
Overrides:
addViewable in class Viewer
 o createDefaultSlice
  protected void createDefaultSlice(Viewable v)
 o displaySlice
  public void displaySlice()
Display a default slice of the current Viewable.
Overrides:
displaySlice in class Viewer
 o displaySlice
  public synchronized void displaySlice(Slice sl)
display a slice from the current Viewable data, or do nothing if the current Viewable is not set.
Overrides:
displaySlice in class Viewer
 o getBoxSelection
  public Rectangle getBoxSelection()
get the current selected display box.
Overrides:
getBoxSelection in class SelectionViewer
 o getDisplaySize
  public Dimension getDisplaySize()
This method returns the size in display pixel units of the region that displays a Viewable
Returns:
Dimension of the compoonent
Overrides:
getDisplaySize in class Viewer
See Also:
Dimension, size()
 o setDisplaySize
  public synchronized void setDisplaySize(int width,
                                          int height)
set the size of the display area
 o setDisplaySize
  public void setDisplaySize(Dimension sz)
set the size of the display area
 o reshape
  public synchronized void reshape(int x,
                                   int y,
                                   int width,
                                   int height)
resize the viewer so that the display area takes up as much of the available space as possible.
Overrides:
reshape in class Component
 o getLineSelection
  public Rectangle getLineSelection()
get the current selected display Line.
Overrides:
getLineSelection in class SelectionViewer
 o getPixelSelection
  public Point getPixelSelection()
get the current selected display pixel.
Overrides:
getPixelSelection in class SelectionViewer
 o getSliceSelection
  public Slice getSliceSelection()
return the current selected Slice, or null if there is no current Viewable;
Overrides:
getSliceSelection in class SelectionViewer
 o getViewable
  public Viewable getViewable()
Return a reference to the current Viewable object, or null if none are attached to this Viewer.
Returns:
The current Viewable object; null if none present.
Overrides:
getViewable in class Viewer
 o getViewSlice
  public Slice getViewSlice()
return a Slice object describing the data currently being viewed, or null if there is no Viewable currently being viewed.
Overrides:
getViewSlice in class Viewer
 o getVoxelSelection
  public Voxel getVoxelSelection()
return the current selected Voxel, or null if there is no current Viewable.
Overrides:
getVoxelSelection in class SelectionViewer
 o preferredSize
  public Dimension preferredSize()
return the preferred size of this Viewer Panel
Overrides:
preferredSize in class Container
 o setBoxSelection
  public void setBoxSelection(int x1,
                              int y1,
                              int x2,
                              int y2)
set the current selected display box. The locations are measured in real display (i.e. screen) pixels relative to the upper left hand corner.
Parameters:
x1,y1 - the location of one vertex of the selected box
x2,y2 - the location of the vertex of the selected box opposite to the one given by x1,y1
Overrides:
setBoxSelection in class SelectionViewer
 o setLineSelection
  public void setLineSelection(int x1,
                               int y1,
                               int x2,
                               int y2)
set the current selected display line. The locations are measured in real display (i.e. screen) pixels relative to the upper left hand corner.
Parameters:
x1,y1 - the location of the start of the line
x2,y2 - the location of the end of the line
Overrides:
setLineSelection in class SelectionViewer
 o setPixelSelection
  public void setPixelSelection(int x,
                                int y)
set the current selected display pixel. The location is measured in real display (i.e. screen) pixels relative to the upper left hand corner.
Overrides:
setPixelSelection in class SelectionViewer
 o setPixelmap
  protected synchronized void setPixelmap(Slice dataSlice,
                                          Rectangle displayRegion)
set the ImageDisplayMap object, pixelMap (used to convert display pixels into data pixels), to reflect changes in the current Viewable
Parameters:
dataSlice - the slice to be displayed; if null, do not change the slice
displayRegion - the region of the display being used; if null, assume that as much of the display as possible will be used (unless dataSlice is also null, in which case, nothing is changed).
 o setSlice
  protected void setSlice(Slice slice)
 o setSliceSelection
  public synchronized void setSliceSelection(Volume vol)
set the current selected Slice to the given Volume as projected onto the currently displayed Slice, or do nothing if there is no current Viewable.
Overrides:
setSliceSelection in class SelectionViewer
 o setVoxelSelection
  public synchronized void setVoxelSelection(Voxel vox)
set the current selected Voxel to the one given as projected onto the currently displayed Slice, or do nothing if there is no current Viewable.
Overrides:
setVoxelSelection in class SelectionViewer
 o updateDatalabel
  protected void updateDatalabel(double x,
                                 double y)
 o updatePixelMap
  protected synchronized void updatePixelMap()
update the ImageDisplayMap object, pixtrans (used to convert display pixels into data pixels), to reflect changes in the currently viewed slice.
 o updatePixelMap
  protected synchronized void updatePixelMap(Slice dataSlice,
                                             Rectangle displayRegion)
update the ImageDisplayMap object, pixtrans (used to convert display pixels into data pixels), to reflect changes in the currently viewed slice.
Parameters:
dataSlice - the slice to be displayed; if null, do not change the slice
displayRegion - the region of the display being used; if null, assume that as much of the display as possible will be used (unless dataSlice is also null, in which case, nothing is changed).
 o updatePosDisplay
  protected void updatePosDisplay(int x,
                                  int y)
update the ImageDisplayMap object, pixelMap (used to convert display pixels into data pixels), to reflect changes in the currently viewed slice.
 o updateWorldlabel
  protected void updateWorldlabel(String x,
                                  String y)

All Packages  Class Hierarchy  This Package  Previous  Next  Index