Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class ncsa.horizon.viewer.SimpleViewer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--ncsa.horizon.viewer.SimpleViewer

public class SimpleViewer
extends java.awt.Canvas
implements PaintingViewer, ViewerDelegater, NewViewEventSource
a Simple viewer that displays visualizations from a single Viewable.

This viewer is a canvas which paints its image onto itself.

See Also:
Viewer, Serialized Form

Field Summary
ViewerDelegate delegate
          the data-handling delegate
View2D vu
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
SimpleViewer()
          create a Viewer of default size
SimpleViewer(int w, int h)
          create a Viewer of a default size
 
Method Summary
void addNewViewListener(NewViewListener nvl)
          add a listener for NewViewEvents
void display(Slice sl)
          display a slice
void display(Slice sl, ViewableList vl)
          display a slice
void display(Slice sl, Viewable v)
          display a slice
void display(ViewStack view)
          display a stack of previously constructed images
void displayViews(ViewStack views)
          display the prepared visualizations.
java.awt.Component getDisplay()
          Return a reference to the component where the image will be painted.
java.awt.Dimension getDisplaySize()
          return the size of the Display area
java.lang.Object getLock()
          return an object that can be used to lock access to the Viewer.
java.awt.Dimension getPreferredSize()
          get the preferred size of this viewer
Slice getSlice()
          return the current slice being displayed.
ViewableList getViewableList()
          return the ViewableList currently associated with this Viewer
java.awt.Rectangle getViewBounds(int width, int height)
          Return a rectangle specifying the bounds within the display component that an image of a given size would be painted.
View2D getView()
          Deprecated. return the View2D object being displayed
boolean handleAccessException(DataAccessException ex, Viewable viewable, Slice slice)
          handle a DataAccessException.
boolean handleTransFuncException(BadTransferFunctionException ex, Viewable viewable)
          handle a BadTransferFunctionException.
boolean imageUpdate(java.awt.Image im, int flags, int x, int y, int w, int h)
           
void paint(java.awt.Graphics g)
          paint the image from the current view
void redisplay()
          display a slice
void removeNewViewListener(NewViewListener nvl)
          add a listener for NewViewEvents
void setPreferredSize(int w, int h)
          set the preferred size of this viewer
void setViewableList(ViewableList vl)
          set the ViewableList to be visualized by this Viewer
void setViewable(Viewable v)
          set the Viewable to be visualized by this Viewer
void update(java.awt.Graphics g)
           
 
Methods inherited from class java.awt.Canvas
addNotify, paint
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

vu

protected View2D vu

delegate

protected ViewerDelegate delegate
the data-handling delegate
Constructor Detail

SimpleViewer

public SimpleViewer()
create a Viewer of default size

SimpleViewer

public SimpleViewer(int w,
                    int h)
create a Viewer of a default size
Method Detail

setPreferredSize

protected void setPreferredSize(int w,
                                int h)
set the preferred size of this viewer

getPreferredSize

public java.awt.Dimension getPreferredSize()
get the preferred size of this viewer
Overrides:
getPreferredSize in class java.awt.Component

getDisplaySize

public java.awt.Dimension getDisplaySize()
return the size of the Display area
Specified by:
getDisplaySize in interface PaintingViewer

getView

public View2D getView()
Deprecated.  
return the View2D object being displayed

getSlice

public Slice getSlice()
return the current slice being displayed. Return null if no slice being displayed.

getViewableList

public ViewableList getViewableList()
return the ViewableList currently associated with this Viewer

setViewableList

public void setViewableList(ViewableList vl)
set the ViewableList to be visualized by this Viewer

setViewable

public void setViewable(Viewable v)
set the Viewable to be visualized by this Viewer

display

public void display(Slice sl)
display a slice

display

public void display(Slice sl,
                    ViewableList vl)
display a slice

display

public void display(Slice sl,
                    Viewable v)
display a slice

display

public void display(ViewStack view)
display a stack of previously constructed images
Specified by:
display in interface PaintingViewer

redisplay

public void redisplay()
display a slice

addNewViewListener

public void addNewViewListener(NewViewListener nvl)
add a listener for NewViewEvents
Specified by:
addNewViewListener in interface NewViewEventSource

removeNewViewListener

public void removeNewViewListener(NewViewListener nvl)
add a listener for NewViewEvents
Specified by:
removeNewViewListener in interface NewViewEventSource

displayViews

public void displayViews(ViewStack views)
display the prepared visualizations. Applications should not call this method directly
Specified by:
displayViews in interface ViewerDelegater

paint

public void paint(java.awt.Graphics g)
paint the image from the current view
Overrides:
paint in class java.awt.Canvas

update

public void update(java.awt.Graphics g)
Overrides:
update in class java.awt.Component

imageUpdate

public boolean imageUpdate(java.awt.Image im,
                           int flags,
                           int x,
                           int y,
                           int w,
                           int h)
Overrides:
imageUpdate in class java.awt.Component

handleAccessException

public boolean handleAccessException(DataAccessException ex,
                                     Viewable viewable,
                                     Slice slice)
handle a DataAccessException. Applications should not call this method directly.
Specified by:
handleAccessException in interface ViewerDelegater

handleTransFuncException

public boolean handleTransFuncException(BadTransferFunctionException ex,
                                        Viewable viewable)
handle a BadTransferFunctionException. Applications should not call this method directly.
Specified by:
handleTransFuncException in interface ViewerDelegater

getDisplay

public java.awt.Component getDisplay()
Return a reference to the component where the image will be painted.
Specified by:
getDisplay in interface PaintingViewer

getViewBounds

public java.awt.Rectangle getViewBounds(int width,
                               int height)
Return a rectangle specifying the bounds within the display component that an image of a given size would be painted.
Specified by:
getViewBounds in interface PaintingViewer

getLock

public java.lang.Object getLock()
return an object that can be used to lock access to the Viewer.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD