org.scijava.display
Class AbstractDisplay<T>

java.lang.Object
  extended by org.scijava.AbstractContextual
      extended by org.scijava.plugin.AbstractRichPlugin
          extended by org.scijava.display.AbstractDisplay<T>
All Implemented Interfaces:
Comparable<Prioritized>, Iterable<T>, Collection<T>, List<T>, Contextual, Display<T>, HasPluginInfo, RichPlugin, SciJavaPlugin, Prioritized
Direct Known Subclasses:
DefaultDisplay, DefaultTextDisplay

public abstract class AbstractDisplay<T>
extends AbstractRichPlugin
implements Display<T>

Abstract superclass of Display implementations.

Author:
Curtis Rueden

Field Summary
protected  boolean isClosed
           
 
Constructor Summary
AbstractDisplay(Class<T> type)
           
 
Method Summary
 void add(int index, T element)
           
 boolean add(T o)
           
 boolean addAll(Collection<? extends T> c)
           
 boolean addAll(int index, Collection<? extends T> c)
           
 boolean canDisplay(Class<?> c)
          Tests whether the display is capable of visualizing objects of the given class.
 boolean canDisplay(Object o)
          Tests whether the display is capable of visualizing the given object.
protected  void checkObject(Object o)
           
 void clear()
           
 void close()
          Closes the display and disposes its resources.
 boolean contains(Object o)
           
 boolean containsAll(Collection<?> c)
           
 void display(Object o)
          Displays the given object in this display.
 T get(int index)
           
 String getName()
          Gets the name of the display.
 int indexOf(Object o)
           
 boolean isDisplaying(Object o)
          Tests whether the display is currently visualizing the given object.
 boolean isEmpty()
           
 Iterator<T> iterator()
           
 int lastIndexOf(Object o)
           
 ListIterator<T> listIterator()
           
 ListIterator<T> listIterator(int index)
           
protected  void noteStructureChange()
           
protected  void rebuild()
           
 T remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection<?> c)
           
 boolean retainAll(Collection<?> c)
           
 T set(int index, T element)
           
 void setName(String name)
          Sets the name of the display.
 int size()
           
 List<T> subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
<U> U[]
toArray(U[] a)
           
 String toString()
           
 void update()
          Updates and redraws the display onscreen.
 
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
compareTo, getInfo, getPriority, setInfo, setPriority
 
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 java.util.List
equals, hashCode
 
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
 

Field Detail

isClosed

protected boolean isClosed
Constructor Detail

AbstractDisplay

public AbstractDisplay(Class<T> type)
Method Detail

rebuild

protected void rebuild()

toString

public String toString()
Overrides:
toString in class AbstractRichPlugin

canDisplay

public boolean canDisplay(Class<?> c)
Description copied from interface: Display
Tests whether the display is capable of visualizing objects of the given class.

Specified by:
canDisplay in interface Display<T>
Parameters:
c - The class to check for visualization capabilities.
Returns:
True if the display can handle certain objects of the given class; false if it cannot visualize any objects of that class.

canDisplay

public boolean canDisplay(Object o)
Description copied from interface: Display
Tests whether the display is capable of visualizing the given object.

Specified by:
canDisplay in interface Display<T>

display

public void display(Object o)
Description copied from interface: Display
Displays the given object in this display.

This method is essentially the same as List.add(E) except that it accepts any Object regardless of type.

Specified by:
display in interface Display<T>

isDisplaying

public boolean isDisplaying(Object o)
Description copied from interface: Display
Tests whether the display is currently visualizing the given object.

Note that this method may behave differently than List.contains(java.lang.Object); in general, any time List.contains(java.lang.Object) returns true, this method will also return true, but not vice versa. For example, in ImageJ, an ImageDisplay is a Display<DataView> but calling isDisplaying on a Dataset (which is not a DataView) will return true if the ImageDisplay currently contains a DatasetView that wraps that Dataset.

Specified by:
isDisplaying in interface Display<T>

update

public void update()
Description copied from interface: Display
Updates and redraws the display onscreen.

Specified by:
update in interface Display<T>

close

public void close()
Description copied from interface: Display
Closes the display and disposes its resources.

Specified by:
close in interface Display<T>

getName

public String getName()
Description copied from interface: Display
Gets the name of the display.

Specified by:
getName in interface Display<T>

setName

public void setName(String name)
Description copied from interface: Display
Sets the name of the display.

Specified by:
setName in interface Display<T>

add

public void add(int index,
                T element)
Specified by:
add in interface List<T>

addAll

public boolean addAll(int index,
                      Collection<? extends T> c)
Specified by:
addAll in interface List<T>

get

public T get(int index)
Specified by:
get in interface List<T>

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List<T>

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List<T>

listIterator

public ListIterator<T> listIterator()
Specified by:
listIterator in interface List<T>

listIterator

public ListIterator<T> listIterator(int index)
Specified by:
listIterator in interface List<T>

remove

public T remove(int index)
Specified by:
remove in interface List<T>

set

public T set(int index,
             T element)
Specified by:
set in interface List<T>

subList

public List<T> subList(int fromIndex,
                       int toIndex)
Specified by:
subList in interface List<T>

add

public boolean add(T o)
Specified by:
add in interface Collection<T>
Specified by:
add in interface List<T>

addAll

public boolean addAll(Collection<? extends T> c)
Specified by:
addAll in interface Collection<T>
Specified by:
addAll in interface List<T>

clear

public void clear()
Specified by:
clear in interface Collection<T>
Specified by:
clear in interface List<T>

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<T>
Specified by:
contains in interface List<T>

containsAll

public boolean containsAll(Collection<?> c)
Specified by:
containsAll in interface Collection<T>
Specified by:
containsAll in interface List<T>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection<T>
Specified by:
isEmpty in interface List<T>

iterator

public Iterator<T> iterator()
Specified by:
iterator in interface Iterable<T>
Specified by:
iterator in interface Collection<T>
Specified by:
iterator in interface List<T>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<T>
Specified by:
remove in interface List<T>

removeAll

public boolean removeAll(Collection<?> c)
Specified by:
removeAll in interface Collection<T>
Specified by:
removeAll in interface List<T>

retainAll

public boolean retainAll(Collection<?> c)
Specified by:
retainAll in interface Collection<T>
Specified by:
retainAll in interface List<T>

size

public int size()
Specified by:
size in interface Collection<T>
Specified by:
size in interface List<T>

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<T>
Specified by:
toArray in interface List<T>

toArray

public <U> U[] toArray(U[] a)
Specified by:
toArray in interface Collection<T>
Specified by:
toArray in interface List<T>

checkObject

protected void checkObject(Object o)

noteStructureChange

protected void noteStructureChange()


Copyright © 2009–2014 SciJava. All rights reserved.