if this method returns true, the Viewer contains three buttons:
- Edit Selections
- pop up a Frame that contains a GUI for editing selections
(i.e.
-
update(Observable, Object)
-
-
updateDataLabel(double, double)
- update Data Lable.
-
updateDataValueLabel(double, double)
- update valueLable
-
updatePixelmap()
- update the ImageDisplayMap object, pixelMap (used to convert display
pixels into data pixels), to reflect changes in the currently viewed
slice.
-
updatePixelmap(Slice, Rectangle)
- update the ImageDisplayMap object, pixelMap (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)
- update worldlabel.
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 GraphicsSelectionImageCanvas display
- A canvas used to display the image and hanle the selection
events
selection
protected SelectionData selection
- SelectionDatas
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
butPanel
protected Panel butPanel
freeposBox
protected Checkbox freeposBox
onselectBox
protected Checkbox onselectBox
editselsBut
protected Button editselsBut
editselsWin
protected Window editselsWin
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
sliceData
protected NdArrayData sliceData
- the NdArrayData corresponding to current slice.
It is used to determine the data value for each pixel.
valueLabel
protected Label valueLabel
GraphicsSelectionViewer
public GraphicsSelectionViewer()
- create a viewer with a display of a default size (256 by 256).
GraphicsSelectionViewer
public GraphicsSelectionViewer(boolean showButtons)
- create a viewer with a display of a default size (256 by 256).
- Parameters:
- showButtons - if true, the Viewer will contain 3 buttons at the
bottom of its Panel; see showingButtons() for details
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
GraphicsSelectionViewer
public GraphicsSelectionViewer(int width,
int height,
boolean showButtons)
- create a viewer with a given display size
- Parameters:
- width - width of the display area
- height - height of the display area
- showButtons - if true, the Viewer will contain 3 buttons at the
bottom of its Panel; see showingButtons() for details
constructDisplay
protected void constructDisplay(int width,
int height)
- Set up the display area with the requested size.
Works only for constructors.
constructVariables
protected void constructVariables()
- Initialize member variables except display. This method works only for
constructors. It should be called after display has been constructed.
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 Slice createDefaultSlice(Viewable v)
- Given a concrete viewable, create a slice. This method
is used to create a default slice.
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.
- Parameters:
- sl - slice to be displayed. if sl== null, same as displaySlice()
- Overrides:
- displaySlice in class Viewer
displaySlicebyImpl
protected void displaySlicebyImpl()
- Delegate displaySlice action to viewerImpl.
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()
getGui
public Component[] getGui()
- Return the Selection Editing Panel associated with this panel. (This
method is part of the Guiedable interface.) The panel controls are
laid out in CardPanel.
If this Viewer was set to show buttons at the bottom of the viewer
(which is the default behavior)--that is,showingButtons() returns
true, it is recommended that the caller of this method also call
registerGUIWindow(). This will prevent the Viewer from displaying the
Editing Panel in its own window. It is not necessary to call
registerGUIWindow() if this Viewer was told at construction not to
show the buttons (via GraphicsSelectionViewer(boolean) or
GraphicsSelectionViewer(int, int, boolean)).
- Returns:
- s Component[] an array of length 1 where the first (and only)
element is the Selection Editing Panel.
registerGUIWindow
public synchronized boolean registerGUIWindow(Window container)
- This method tells the Viewer that another object will be managing the
Selection editing panel, returned by the getGui() method. This will
prevent the Viewer from popping up its own Frame containing the panel.
If there is already a window registered and is visible, that window
is disposed of, so that only one window will hold panel at any given
time.
- Parameters:
- container - the top-level container that will hold the Selecition
editing panel.
- Returns:
- s true if the frame currently holding the panel was visible
when this method was called. In such a case, the caller
may want to redisplay the panel in its own Frame.
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
imagePlacement
protected Rectangle imagePlacement(int width,
int height)
- Return a rectangle that describes where an image of a particular
size will be placed.
layoutComponents
protected void layoutComponents()
- Here is where the awt.compoents are layouted.
It was called only by constructors.
layoutPosPanel
protected void layoutPosPanel()
- Here is how posPanel is layouted.
It is called only by layoutComponents methods.
- See Also:
- layoutComponents
layoutButtonPanel
protected void layoutButtonPanel()
- layout the panel contain the buttons (actually one Button and
2 Checkboxes. This is meant to only be called by layoutComponents()
and only if showingButtons() returns true.
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()
- set the ImageDisplayMap object, pixelMap (used to convert display
pixels into data pixels), to reflect changes in the current Viewable
It's called at the change from state1 to (state2, state3).
setSlice
protected void setSlice(Slice slice)
- Set current slice.
setSliceData
protected void setSliceData(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
update
public void update(Observable o,
Object arg)
- Overrides:
- update in class Viewer
updateDataLabel
protected void updateDataLabel(double x,
double y)
- update Data Lable.
updateDataValueLabel
protected void updateDataValueLabel(double x,
double y)
- update valueLable
updatePixelmap
protected synchronized void updatePixelmap()
- update the ImageDisplayMap object, pixelMap (used to convert display
pixels into data pixels), to reflect changes in the currently viewed
slice.
This method should be called only in state 2 or state 3.
updatePixelmap
protected synchronized void updatePixelmap(Slice dataSlice,
Rectangle displayRegion)
- update the ImageDisplayMap object, pixelMap (used to convert display
pixels into data pixels), to reflect changes in the currently viewed
slice.
- Parameters:
- dataSlice - the slice to be displayed;
- displayRegion - the region of the display being used; if null,
assume that as much of the display as possible
will be used.
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)
- update worldlabel.
It should be called only at state4.
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
showingButtons
public boolean showingButtons()
- if this method returns true, the Viewer contains three buttons:
- Edit Selections
- pop up a Frame that contains a GUI for editing selections
(i.e. points, regions, and lines) and the graphics associated
with them. See getGui() method for details.
- Free Position (on/off)
- When this is function is turned on, the coordinates displayed
is associated with fractional pixels. This toggle calls the
setFreePosition() method.
- Position On Select (on/off)
- When this position is turned on, the coordinates display is only
updated when a point selection is made (by clicking on with
the mouse over the image).
positionIsFree
public boolean positionIsFree()
- if false, then the display coordinate position will correspond the
center of the data voxel beneath the mouse cursor; if true, the position
will correspond to a the fractional voxel position beneath the mouse
cursor.
setFreePosition
public void setFreePosition(boolean doFree)
- set whether displayed coordinate positions correspond to whole or
fractional positions. If the input is false, then the display
coordinate position will correspond the center of the data voxel
beneath the mouse cursor; if true, the position will correspond to a
the fractional voxel position beneath the mouse cursor.
positionOnSelect
public boolean positionOnSelect()
- if true, the coordinate display will only be updated if when a pixel
selection has been made; if false, it will be updated whenever the
mouse cursor moves over the image display.
setPositionOnSelect
public void setPositionOnSelect(boolean doOnSelect)
- set whether the coordinate display is updated whenever the mouse cursor
moves. If the input is true, it will be only be updated when a pixel
selection has been made (i.e. the user clicks on the image).
action
public boolean action(Event evt,
Object what)
- Overrides:
- action in class Component
All Packages Class Hierarchy This Package Previous Next Index