edu.washington.biostr.sig.brainj3d.shwing.swing
Class CellExtractor

java.lang.Object
  extended by edu.washington.biostr.sig.brainj3d.shwing.swing.CellExtractor
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DirectoryNodeExtractor, FileGroupExtractor, TagSetExtractor, TreeExtractor

public class CellExtractor
extends Object
implements Serializable

The CellExtractor interface makes an icon and reveals the encapsulated data that needs to be displayed for an object. The CellRenderer then can format any supported data that is returned.

Author:
eider
See Also:
Serialized Form

Constructor Summary
CellExtractor()
           
 
Method Summary
 Object getEncapsulatedData(Object o)
          If o encapsulates some data that will be displayed and needs formatting, then return that data.
 Font getFont(Object value, Font defaultFont)
          Get a custom Font for the object
 Icon getIcon(Object o, boolean expanded)
          Return an icon for Object o.
 String getString(Object o)
           
 Class<?>[] getSupportedClass()
          Return a class that will not throw a ClassCastException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellExtractor

public CellExtractor()
Method Detail

getIcon

public Icon getIcon(Object o,
                    boolean expanded)
Return an icon for Object o. Throw a ClassCastException if it is not a supported class.

Parameters:
o -
expanded - true if it is expanded in a tree or selected in a list.
Returns:
null by default

getEncapsulatedData

public Object getEncapsulatedData(Object o)
If o encapsulates some data that will be displayed and needs formatting, then return that data.

Parameters:
o -
Returns:
o by default

getString

public String getString(Object o)

getSupportedClass

public Class<?>[] getSupportedClass()
Return a class that will not throw a ClassCastException.

Returns:
Object.class by default

getFont

public Font getFont(Object value,
                    Font defaultFont)
Get a custom Font for the object

Parameters:
value -
defaultFont - The defaultFont object.
Returns:


Copyright © 2006 University of Washington. All Rights Reserved.