Version: 1.1.1

org.biomoby.service.dashboard.renderers
Class ICISPedigreeTree

java.lang.Object
  extended by org.biomoby.service.dashboard.renderers.AbstractRenderer
      extended by org.biomoby.service.dashboard.renderers.AbstractMobyRenderer
          extended by org.biomoby.service.dashboard.renderers.ICISPedigreeTree
All Implemented Interfaces:
Renderer

public class ICISPedigreeTree
extends AbstractMobyRenderer

This is a very specific viewer (it understands just one specific Biomoby type - GCP_GermplasmPedigreeTree). I have included here, however, because it shows how a viewer can further ask for additional data using the same Biomoby service that created the initial data for this viewer.

Version:
$Id: ICISPedigreeTree.java,v 1.2 2006/02/20 05:51:11 senger Exp $
Author:
Martin Senger

Field Summary
 
Fields inherited from interface org.biomoby.service.dashboard.renderers.Renderer
CLASS, CLASS_NAME, DATA, DATA_CONTAINER, MIME_TYPE, MOBY_TYPE
 
Constructor Summary
ICISPedigreeTree()
           
 
Method Summary
 boolean canHandle(String criterion, Object value)
          Return true if this SPI can handle (render) data whose type complies with given value within given criterion.
 JComponent getComponent(DataContainer data)
          Return a JComponent displaying (rendering) given data.
 boolean save2File(DataContainer data, File file)
          Does not provide any file saving facility.
 
Methods inherited from class org.biomoby.service.dashboard.renderers.AbstractRenderer
getIcon, getName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ICISPedigreeTree

public ICISPedigreeTree()
Method Detail

canHandle

public boolean canHandle(String criterion,
                         Object value)
Description copied from interface: Renderer
Return true if this SPI can handle (render) data whose type complies with given value within given criterion.

Any renderer should handle also a collection of objects that it can handle - see examples in Renderer.getComponent(org.biomoby.service.dashboard.data.DataContainer) and Renderer.save2File(org.biomoby.service.dashboard.data.DataContainer, java.io.File).

Specified by:
canHandle in interface Renderer
Specified by:
canHandle in class AbstractRenderer
Parameters:
criterion - is a category of the value, e.g. "MIME-TYPE"
value - is a value from the category criterion, e.g. "text/xml"

getComponent

public JComponent getComponent(DataContainer data)
                        throws MobyException
Description copied from interface: Renderer
Return a JComponent displaying (rendering) given data.

If it gets an array of data, it can always delegate their accumulation to the CollectionRenderer by saying:

   if (data.getData().getClass().isArray())
      return new BoxCollectionRenderer (this).getComponent (data);

Specified by:
getComponent in interface Renderer
Specified by:
getComponent in class AbstractRenderer
Parameters:
data - to be rendered
Returns:
a component for displaying data, or null if there is a problem with data
Throws:
MobyException - if called with wrong type of data

save2File

public boolean save2File(DataContainer data,
                         File file)
                  throws MobyException
Does not provide any file saving facility.

Specified by:
save2File in interface Renderer
Overrides:
save2File in class AbstractRenderer
Returns:
true on success, return false if you even did nt try to save data (probably because it does not make sense to store such data)
Throws:
MobyException - if saving was tried but failed

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010