org.scijava.ui.viewer
Interface DisplayViewer<T>

All Superinterfaces:
Comparable<Prioritized>, Contextual, Disposable, HasPluginInfo, Prioritized, RichPlugin, SciJavaPlugin
All Known Subinterfaces:
TextDisplayViewer
All Known Implementing Classes:
AbstractDisplayViewer, AbstractTextDisplayViewer

public interface DisplayViewer<T>
extends RichPlugin, Disposable

A display viewer is a UI widget that shows a display to a user.

Display viewers discoverable at runtime must implement this interface and be annotated with @Plugin with attribute Plugin.type() = DisplayViewer.class. While it possible to create a display viewer merely by implementing this interface, it is encouraged to instead extend AbstractDisplayViewer, for convenience.

Author:
Lee Kamentsky, Curtis Rueden
See Also:
Plugin

Method Summary
 boolean canView(Display<?> d)
          Returns true if an instance of this display viewer can view the given display.
 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.
 boolean isCompatible(UserInterface ui)
          Returns true if this display viewer can be used with the given UI.
 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.
 void setPanel(DisplayPanel panel)
          Installs the display panel.
 void view(DisplayWindow w, Display<?> d)
          Begins viewing the given display.
 
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
 
Methods inherited from interface org.scijava.Disposable
dispose
 

Method Detail

isCompatible

boolean isCompatible(UserInterface ui)
Returns true if this display viewer can be used with the given UI.


canView

boolean canView(Display<?> d)
Returns true if an instance of this display viewer can view the given display.


view

void view(DisplayWindow w,
          Display<?> d)
Begins viewing the given display.

Parameters:
w - The frame / window that will contain the GUI elements
d - the model for the display to show.

getDisplay

Display<T> getDisplay()
Gets the display being viewed.


getWindow

DisplayWindow getWindow()
Gets the window in which the view is displayed.


setPanel

void setPanel(DisplayPanel panel)
Installs the display panel.

Parameters:
panel - the panel used to host the gui

getPanel

DisplayPanel getPanel()
Gets the display panel that hosts the gui elements.


onDisplayUpdatedEvent

void onDisplayUpdatedEvent(DisplayUpdatedEvent e)
Synchronizes the user interface appearance with the display model.


onDisplayDeletedEvent

void onDisplayDeletedEvent(DisplayDeletedEvent e)
Removes the user interface when the display is deleted.


onDisplayActivatedEvent

void onDisplayActivatedEvent(DisplayActivatedEvent e)
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.



Copyright © 2009–2015 SciJava. All rights reserved.