apollo.dataadapter.sample
Class SampleAdapter

java.lang.Object
  extended by org.bdgp.io.AbstractDataAdapter
      extended by apollo.dataadapter.AbstractApolloAdapter
          extended by apollo.dataadapter.sample.SampleAdapter
All Implemented Interfaces:
ApolloDataAdapterI, org.bdgp.io.DataAdapter, org.bdgp.io.VisualDataAdapter

public class SampleAdapter
extends AbstractApolloAdapter

I am a simple adapter gui that serves as a minimal sample that people can use to understand how a data adapter works, and cut-and-paste from, if neccessary.


Field Summary
static java.lang.String NUMBER_OF_FEATURES
           
 
Fields inherited from class apollo.dataadapter.AbstractApolloAdapter
curation_set, logger, region, style
 
Fields inherited from class org.bdgp.io.AbstractDataAdapter
listeners
 
Fields inherited from interface apollo.dataadapter.ApolloDataAdapterI
OP_APPEND_DATA, OP_READ_DATA, OP_READ_RAW_ANALYSIS, OP_READ_SEQUENCE, OP_WRITE_DATA
 
Constructor Summary
SampleAdapter()
           
 
Method Summary
 CurationSet getCurationSet()
          This is the main method: we create some fake features, add them to the CurationSet's results, and create a fake sequence for them.
 DataInputType getInputType()
          This is queried by Apollo's FileMenu
 java.util.Properties getStateInformation()
          When the data load is done, this adapter is queried for any state information: this information is then written to a text file which stores a history of this adapter's state (see ApolloRunner.writeAdapterHistory).
 org.bdgp.io.IOOperation[] getSupportedOperations()
          From bdgp DataAdapter.
 java.lang.String getType()
          From bdgp DataAdapter.
 org.bdgp.io.DataAdapterUI getUI(org.bdgp.io.IOOperation op)
          From bdgp DataAdapter.
 void init()
          From org.bdgp.DataAdapter interface.
 void setStateInformation(java.util.Properties properties)
          This is a convenient way of passing in the adapter's state: each part of the state is a key-value pair in the input Properties.
 
Methods inherited from class apollo.dataadapter.AbstractApolloAdapter
addToCurationSet, cacheUI, canWriteData, clearOldData, clearStateInformation, commitChanges, commitChanges, commitChanges, commitChanges, commitChanges, commitChanges, getAdapters, getCachedUI, getChildAdapter, getChildAdapter, getCurationState, getDatabase, getDataInput, getDefaultStyle, getFilename, getInput, getName, getNameAdapter, getNumberOfChildAdapters, getRawAnalysisResults, getSequence, getSequence, getSequence, getSequences, getSequences, getSpecies, getStyle, hasLinkData, isComposite, loadNewSpeciesFromLink, operationIsSupported, rollbackAnnotations, rollbackAnnotations, setCuration, setCurationNumber, setCurationState, setDatabase, setDataInput, setDataLoadListener, setInput, setInputType, setLocation, setName, setPadLeft, setPadRight, setRegion, setSpecies, setStyle
 
Methods inherited from class org.bdgp.io.AbstractDataAdapter
addProgressListener, fireProgressEvent, removeProgressListener, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.bdgp.io.VisualDataAdapter
addProgressListener, fireProgressEvent, removeProgressListener
 

Field Detail

NUMBER_OF_FEATURES

public static final java.lang.String NUMBER_OF_FEATURES
See Also:
Constant Field Values
Constructor Detail

SampleAdapter

public SampleAdapter()
Method Detail

getType

public java.lang.String getType()
From bdgp DataAdapter. No idea where this is used.

Specified by:
getType in interface org.bdgp.io.DataAdapter
Overrides:
getType in class AbstractApolloAdapter

getSupportedOperations

public org.bdgp.io.IOOperation[] getSupportedOperations()
From bdgp DataAdapter. If you want the adapter to WRITE stuff, it needs to add OP_WRITE_DATA to the list.


getUI

public org.bdgp.io.DataAdapterUI getUI(org.bdgp.io.IOOperation op)
From bdgp DataAdapter. This method traditionally creates a new UI for the adapter, based on the operation - read or write (each creates a different UI instance).


setStateInformation

public void setStateInformation(java.util.Properties properties)
This is a convenient way of passing in the adapter's state: each part of the state is a key-value pair in the input Properties. Use the static constant(s) on this dataadapter for the keys - it's just safer!

Specified by:
setStateInformation in interface ApolloDataAdapterI
Overrides:
setStateInformation in class AbstractApolloAdapter

init

public void init()
From org.bdgp.DataAdapter interface. This is called when the adapter is created and added to the registry (see org.bdgp.io.DataAdapterChooser).

Specified by:
init in interface org.bdgp.io.DataAdapter
Overrides:
init in class AbstractApolloAdapter

getCurationSet

public CurationSet getCurationSet()
                           throws ApolloAdapterException
This is the main method: we create some fake features, add them to the CurationSet's results, and create a fake sequence for them.

Specified by:
getCurationSet in interface ApolloDataAdapterI
Overrides:
getCurationSet in class AbstractApolloAdapter
Throws:
ApolloAdapterException

getInputType

public DataInputType getInputType()
This is queried by Apollo's FileMenu

Specified by:
getInputType in interface ApolloDataAdapterI
Overrides:
getInputType in class AbstractApolloAdapter
See Also:
Should this go into org.bdgp.io.DataAdapter?

getStateInformation

public java.util.Properties getStateInformation()
When the data load is done, this adapter is queried for any state information: this information is then written to a text file which stores a history of this adapter's state (see ApolloRunner.writeAdapterHistory). HOWEVER the really useful information (that passed to the GUI to allow it to set up history lists etc) is gathered in the SampleAdapterGUI's getProperties() method. So I'm not sure what the information here actually achieves...

Specified by:
getStateInformation in interface ApolloDataAdapterI
Overrides:
getStateInformation in class AbstractApolloAdapter