Package weka.knowledgeflow.steps
Class TextViewer
- java.lang.Object
-
- weka.knowledgeflow.steps.BaseStep
-
- weka.knowledgeflow.steps.TextViewer
-
- All Implemented Interfaces:
java.io.Serializable,BaseStepExtender,DataCollector,Step
@KFStep(name="TextViewer", category="Visualization", toolTipText="View textual output", iconPath="weka/gui/knowledgeflow/icons/DefaultText.gif") public class TextViewer extends BaseStep implements DataCollector
A step for collecting and viewing textual data- Version:
- $Revision: $
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceTextViewer.TextNotificationListenerInterface for listeners of textual results
-
Constructor Summary
Constructors Constructor Description TextViewer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>getIncomingConnectionTypes()Get a list of incoming connection types that this step can accept.java.util.Map<java.lang.String,java.lang.String>getInteractiveViewers()When running in a graphical execution environment a step can make one or more popup Viewer components available.java.util.List<java.lang.String>getOutgoingConnectionTypes()Get a list of outgoing connection types that this step can produce.java.util.Map<java.lang.String,java.lang.String>getResults()Get the textual results stored in this stepvoidprocessIncoming(Data data)Process an incoming data payload (if the step accepts incoming connections)voidremoveTextNotificationListener(TextViewer.TextNotificationListener l)Remove the listener for textual resultsvoidrestoreData(java.lang.Object data)Restore/set the data in this stepjava.lang.ObjectretrieveData()Get the results stored in this step.voidsetTextNotificationListener(TextViewer.TextNotificationListener l)Set the listener to be notified about new textual resultsvoidstepInit()Initialize the step-
Methods inherited from class weka.knowledgeflow.steps.BaseStep
environmentSubstitute, getCustomEditorForStep, getDefaultSettings, getInteractiveViewersImpls, getName, getStepManager, globalInfo, isResourceIntensive, isStopRequested, outputStructureForConnectionType, outputStructureForConnectionType, setName, setStepIsResourceIntensive, setStepManager, setStepMustRunSingleThreaded, start, stepMustRunSingleThreaded, stop
-
-
-
-
Method Detail
-
stepInit
public void stepInit()
Initialize the step- Specified by:
stepInitin interfaceBaseStepExtender- Specified by:
stepInitin interfaceStep
-
getIncomingConnectionTypes
public java.util.List<java.lang.String> getIncomingConnectionTypes()
Get a list of incoming connection types that this step can accept. Ideally (and if appropriate), this should take into account the state of the step and any existing incoming connections. E.g. a step might be able to accept one (and only one) incoming batch data connection.- Specified by:
getIncomingConnectionTypesin interfaceBaseStepExtender- Specified by:
getIncomingConnectionTypesin interfaceStep- Returns:
- a list of incoming connections that this step can accept given its current state
-
getOutgoingConnectionTypes
public java.util.List<java.lang.String> getOutgoingConnectionTypes()
Get a list of outgoing connection types that this step can produce. Ideally (and if appropriate), this should take into account the state of the step and the incoming connections. E.g. depending on what incoming connection is present, a step might be able to produce a trainingSet output, a testSet output or neither, but not both.- Specified by:
getOutgoingConnectionTypesin interfaceBaseStepExtender- Specified by:
getOutgoingConnectionTypesin interfaceStep- Returns:
- a list of outgoing connections that this step can produce
-
processIncoming
public void processIncoming(Data data) throws WekaException
Process an incoming data payload (if the step accepts incoming connections)- Specified by:
processIncomingin interfaceBaseStepExtender- Specified by:
processIncomingin interfaceStep- Overrides:
processIncomingin classBaseStep- Parameters:
data- the data to process- Throws:
WekaException- if a problem occurs
-
getInteractiveViewers
public java.util.Map<java.lang.String,java.lang.String> getInteractiveViewers()
When running in a graphical execution environment a step can make one or more popup Viewer components available. These might be used to display results, graphics etc. Returning null indicates that the step has no such additional graphical views. The map returned by this method should be keyed by action name (e.g. "View results"), and values should be fully qualified names of the corresponding StepInteractiveView implementation. Furthermore, the contents of this map can (and should) be dependent on whether a particular viewer should be made available - i.e. if execution hasn't occurred yet, or if a particular incoming connection type is not present, then it might not be possible to view certain results. Viewers can implement StepInteractiveView directly (in which case they need to extends JPanel), or extends the AbstractInteractiveViewer class. The later extends JPanel, uses a BorderLayout, provides a "Close" button and a method to add additional buttons.- Specified by:
getInteractiveViewersin interfaceStep- Overrides:
getInteractiveViewersin classBaseStep- Returns:
- a map of viewer component names, or null if this step has no graphical views
-
getResults
public java.util.Map<java.lang.String,java.lang.String> getResults()
Get the textual results stored in this step- Returns:
- a map of results
-
retrieveData
public java.lang.Object retrieveData()
Get the results stored in this step. CallsgetResults()- Specified by:
retrieveDatain interfaceDataCollector- Returns:
- the results (a map of named textual results) as an Object
-
restoreData
public void restoreData(java.lang.Object data)
Restore/set the data in this step- Specified by:
restoreDatain interfaceDataCollector- Parameters:
data- the data to set (is expected to be a map of Strings)
-
setTextNotificationListener
public void setTextNotificationListener(TextViewer.TextNotificationListener l)
Set the listener to be notified about new textual results- Parameters:
l- the listener to receive notifications
-
removeTextNotificationListener
public void removeTextNotificationListener(TextViewer.TextNotificationListener l)
Remove the listener for textual results- Parameters:
l- the listener to remove
-
-