    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.

##

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

##

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

##

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

##

viewable

      protected Viewable viewable

  the current viewable

slice

      protected Slice slice

  the last slice requested from the current viewable

pixelMap

      protected ImageDisplayMap pixelMap

  ImageDisplayMap object for converting between display pixels and data pixels

coord

      protected CoordinateSystem coord

  CoordinateSystem object for converting between data pixels and world coordinates

viewerImpl

      protected ImageCanvasViewerImpl viewerImpl

newViewable

      protected boolean newViewable

  a flag that is true if a new viewable has been attached

display

      protected GraphicsSelectionCanvas display

  A canvas used to display the image and hanle the selection events

posPanel

      protected Panel posPanel

  A panel displaying current mouse data position and coordinates.

xDataPos

      protected Label xDataPos

yDataPos

      protected Label yDataPos

xLabel

      protected Label xLabel

yLabel

      protected Label yLabel

xCoordPos

      protected Label xCoordPos

yCoordPos

      protected Label yCoordPos

defaultDisplayWidth

      public final static int defaultDisplayWidth

  default width of display area if not specified in constructor

defaultDisplayHeight

      public final static int defaultDisplayHeight

  default height of display area if not specified in constructor

##

GraphicsSelectionViewer

      public GraphicsSelectionViewer()

  create a viewer with no argument

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

##

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

createDefaultSlice

      protected void createDefaultSlice(Viewable v)

displaySlice

      public void displaySlice()

  Display a default slice of the current Viewable.
  Overrides:
    displaySlice in class Viewer

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

getBoxSelection

      public Rectangle getBoxSelection()

  get the current selected display box.
  Overrides:
    getBoxSelection in class SelectionViewer

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()

setDisplaySize

      public synchronized void setDisplaySize(int width,
                                              int height)

  set the size of the display area

setDisplaySize

      public void setDisplaySize(Dimension sz)

  set the size of the display area

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

getLineSelection

      public Rectangle getLineSelection()

  get the current selected display Line.
  Overrides:
    getLineSelection in class SelectionViewer

getPixelSelection

      public Point getPixelSelection()

  get the current selected display pixel.
  Overrides:
    getPixelSelection in class SelectionViewer

getSliceSelection

      public Slice getSliceSelection()

  return the current selected Slice, or null if there is no current Viewable;
  Overrides:
    getSliceSelection in class SelectionViewer

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

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

getVoxelSelection

      public Voxel getVoxelSelection()

  return the current selected Voxel, or null if there is no current Viewable.
  Overrides:
    getVoxelSelection in class SelectionViewer

preferredSize

      public Dimension preferredSize()

  return the preferred size of this Viewer Panel
  Overrides:
    preferredSize in class Container

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

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

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

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).

setSlice

      protected void setSlice(Slice slice)

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

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

updateDatalabel

      protected void updateDatalabel(double x,
                                     double y)

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.

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).

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.

updateWorldlabel

      protected void updateWorldlabel(String x,
                                      String y)

    All Packages  Class Hierarchy  This Package  Previous  Next  Index