org.scijava.ui.viewer
Class AbstractDisplayViewer<T>

java.lang.Object
  extended by org.scijava.AbstractContextual
      extended by org.scijava.plugin.AbstractRichPlugin
          extended by org.scijava.ui.viewer.AbstractDisplayViewer<T>
All Implemented Interfaces:
Comparable<Prioritized>, Contextual, Disposable, HasPluginInfo, RichPlugin, SciJavaPlugin, Prioritized, DisplayViewer<T>
Direct Known Subclasses:
AbstractTextDisplayViewer

public abstract class AbstractDisplayViewer<T>
extends AbstractRichPlugin
implements DisplayViewer<T>

The AbstractDisplayViewer provides some basic generic implementations for a DisplayViewer such as storing and providing the display, window and panel for a DisplayViewer.

Author:
Lee Kamentsky, Curtis Rueden

Constructor Summary
AbstractDisplayViewer()
           
 
Method Summary
 void dispose()
          Performs any needed cleanup of the object's services, in preparation for the object being retired (e.g., to make garbage collection possible).
 Display<T> getDisplay()
          Gets the display being viewed.
 DisplayPanel getPanel()
          Gets the display panel that hosts the gui elements.
 DisplayWindow getWindow()
          Gets the window in which the view is displayed.
 void onDisplayActivatedEvent(DisplayActivatedEvent e)
          Handles a display activated event directed at this viewer's display.
 void onDisplayDeletedEvent(DisplayDeletedEvent e)
          Removes the user interface when the display is deleted.
 void onDisplayUpdatedEvent(DisplayUpdatedEvent e)
          Synchronizes the user interface appearance with the display model.
protected  void onEvent(DisplayCreatedEvent event)
           
protected  void onEvent(DisplayUpdatedEvent event)
           
 void setPanel(DisplayPanel panel)
          Installs the display panel.
protected  void updateTitle()
           
 void view(DisplayWindow w, Display<?> d)
          Begins viewing the given display.
 
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
compareTo, getInfo, getPriority, setInfo, setPriority, toString
 
Methods inherited from class org.scijava.AbstractContextual
context, getContext, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.scijava.ui.viewer.DisplayViewer
canView, isCompatible
 
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
 
Methods inherited from interface org.scijava.Prioritized
getPriority, setPriority
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
 

Constructor Detail

AbstractDisplayViewer

public AbstractDisplayViewer()
Method Detail

view

public void view(DisplayWindow w,
                 Display<?> d)
Description copied from interface: DisplayViewer
Begins viewing the given display.

Specified by:
view in interface DisplayViewer<T>
Parameters:
w - The frame / window that will contain the GUI elements
d - the model for the display to show.

getDisplay

public Display<T> getDisplay()
Description copied from interface: DisplayViewer
Gets the display being viewed.

Specified by:
getDisplay in interface DisplayViewer<T>

getWindow

public DisplayWindow getWindow()
Description copied from interface: DisplayViewer
Gets the window in which the view is displayed.

Specified by:
getWindow in interface DisplayViewer<T>

setPanel

public void setPanel(DisplayPanel panel)
Description copied from interface: DisplayViewer
Installs the display panel.

Specified by:
setPanel in interface DisplayViewer<T>
Parameters:
panel - the panel used to host the gui

getPanel

public DisplayPanel getPanel()
Description copied from interface: DisplayViewer
Gets the display panel that hosts the gui elements.

Specified by:
getPanel in interface DisplayViewer<T>

onDisplayDeletedEvent

public void onDisplayDeletedEvent(DisplayDeletedEvent e)
Description copied from interface: DisplayViewer
Removes the user interface when the display is deleted.

Specified by:
onDisplayDeletedEvent in interface DisplayViewer<T>

onDisplayUpdatedEvent

public void onDisplayUpdatedEvent(DisplayUpdatedEvent e)
Description copied from interface: DisplayViewer
Synchronizes the user interface appearance with the display model.

Specified by:
onDisplayUpdatedEvent in interface DisplayViewer<T>

onDisplayActivatedEvent

public void onDisplayActivatedEvent(DisplayActivatedEvent e)
Description copied from interface: DisplayViewer
Handles a display activated event directed at this viewer's display. Note that the event's display may not be the viewer's display, but the active display will always be the viewer's display.

Specified by:
onDisplayActivatedEvent in interface DisplayViewer<T>

dispose

public void dispose()
Description copied from interface: Disposable
Performs any needed cleanup of the object's services, in preparation for the object being retired (e.g., to make garbage collection possible).

Specified by:
dispose in interface Disposable

updateTitle

protected void updateTitle()

onEvent

protected void onEvent(DisplayCreatedEvent event)

onEvent

protected void onEvent(DisplayUpdatedEvent event)


Copyright © 2009–2015 SciJava. All rights reserved.