Package weka.gui.explorer
Class AbstractExplorerPanelHandler
- java.lang.Object
-
- weka.gui.explorer.AbstractExplorerPanelHandler
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AssociationsHandler
,AttributeSelectionHandler
,ClassifierHandler
,ClustererHandler
,DefaultHandler
,ExperimentHandler
,ExplorerTSPanelHandler
,ForecastingHandler
,PreprocessHandler
public abstract class AbstractExplorerPanelHandler extends Object implements Serializable
Ancestor for handlers for specific Explorer panels.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
m_SkipHistory
whether to skip the history panels.
-
Constructor Summary
Constructors Constructor Description AbstractExplorerPanelHandler()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
deserialize(Object data, weka.gui.GenericObjectEditor editor)
Deserializes the data and configures theGenericObjectEditor
with it.protected void
deserialize(Object data, weka.gui.ResultHistoryPanel history)
Deserializes the data and configures theResultHistoryPanel
with it.abstract void
deserialize(weka.gui.explorer.Explorer.ExplorerPanel panel, Object data)
Deserializes the data and configures the panel.static String[]
getHandlers()
Returns a list with classnames of handlers.boolean
getSkipHistory()
Returns whether history panels are skipped.protected Object
getValue(Map map, String key, Object defValue)
Returns the specified default value if the map doesn't contain a value for the specified key.abstract boolean
handles(weka.gui.explorer.Explorer.ExplorerPanel panel)
Checks whether this handler can process the given panel.protected void
restoreGOE(Map map, String key, Object defValue, weka.gui.GenericObjectEditor goe)
Restores the value of the GenericObjectEditor.protected void
restoreSelectedIndex(Map map, String key, Integer defValue, JComboBox combo)
Restores the selected index of the BaseComboBox.protected void
restoreSelectedIndices(Map map, String key, int[] defValue, JList list)
Restores the selected indices of the JList.protected void
restoreSelectedState(Map map, String key, Boolean defValue, JCheckBox checkbox)
Sets the selected state of the checkbox.protected void
restoreSelectedState(JCheckBox checkbox, Boolean selected)
Sets the selected state of the checkbox.protected void
restoreSpinner(Map map, String key, Integer defValue, JSpinner spinner)
Restores the integer value of the JSpinner.protected void
restoreText(Map map, String key, String defValue, JTextComponent comp)
Restores the text of the text component, e.g., a BaseTextField.abstract Object
serialize(weka.gui.explorer.Explorer.ExplorerPanel panel)
Generates a view of the explorer panel that can be serialized.protected Object
serialize(weka.gui.GenericObjectEditor editor)
Serializes the content of aGenericObjectEditor
.protected Object
serialize(weka.gui.ResultHistoryPanel history)
Serializes aResultHistoryPanel
.void
setSkipHistory(boolean value)
Sets whether to skip history panels.
-
-
-
Method Detail
-
setSkipHistory
public void setSkipHistory(boolean value)
Sets whether to skip history panels.- Parameters:
value
- true if to skip
-
getSkipHistory
public boolean getSkipHistory()
Returns whether history panels are skipped.- Returns:
- true if skipped
-
handles
public abstract boolean handles(weka.gui.explorer.Explorer.ExplorerPanel panel)
Checks whether this handler can process the given panel.- Parameters:
panel
- the panel to check- Returns:
- true if it can be processed
-
serialize
protected Object serialize(weka.gui.GenericObjectEditor editor)
Serializes the content of aGenericObjectEditor
.- Parameters:
editor
- the editor to serialize- Returns:
- the serialized content
-
serialize
protected Object serialize(weka.gui.ResultHistoryPanel history)
Serializes aResultHistoryPanel
.- Parameters:
history
- the history to serialize- Returns:
- the serialized content
- See Also:
getSkipHistory()
-
serialize
public abstract Object serialize(weka.gui.explorer.Explorer.ExplorerPanel panel)
Generates a view of the explorer panel that can be serialized.- Parameters:
panel
- the panel to serialize- Returns:
- the data to serialize
-
deserialize
protected void deserialize(Object data, weka.gui.GenericObjectEditor editor)
Deserializes the data and configures theGenericObjectEditor
with it.- Parameters:
data
- the content for the GOEeditor
- the editor to configure
-
deserialize
protected void deserialize(Object data, weka.gui.ResultHistoryPanel history)
Deserializes the data and configures theResultHistoryPanel
with it.- Parameters:
data
- the content for the history panelhistory
- the history panel to configure
-
getValue
protected Object getValue(Map map, String key, Object defValue)
Returns the specified default value if the map doesn't contain a value for the specified key.- Parameters:
map
- the map to obtain the value fromkey
- the key to obtain the value fordefValue
- the default value in case the value is not present in map
-
restoreSelectedState
protected void restoreSelectedState(Map map, String key, Boolean defValue, JCheckBox checkbox)
Sets the selected state of the checkbox.- Parameters:
map
- the map to obtain the value fromkey
- the key to obtain the value fordefValue
- the default value in case the value is not present in mapcheckbox
- the checkbox to update
-
restoreSelectedState
protected void restoreSelectedState(JCheckBox checkbox, Boolean selected)
Sets the selected state of the checkbox.- Parameters:
selected
- the default value in case the value is not present in mapcheckbox
- the checkbox to update
-
restoreText
protected void restoreText(Map map, String key, String defValue, JTextComponent comp)
Restores the text of the text component, e.g., a BaseTextField.- Parameters:
map
- the map to obtain the value fromkey
- the key to obtain the value fordefValue
- the default value in case the value is not present in mapcomp
- the text component to update
-
restoreSpinner
protected void restoreSpinner(Map map, String key, Integer defValue, JSpinner spinner)
Restores the integer value of the JSpinner.- Parameters:
map
- the map to obtain the value fromkey
- the key to obtain the value fordefValue
- the default value in case the value is not present in mapspinner
- the spinner to update
-
restoreGOE
protected void restoreGOE(Map map, String key, Object defValue, weka.gui.GenericObjectEditor goe)
Restores the value of the GenericObjectEditor.- Parameters:
map
- the map to obtain the value fromkey
- the key to obtain the value fordefValue
- the default value in case the value is not present in mapgoe
- the GenericObjectEditor to update
-
restoreSelectedIndex
protected void restoreSelectedIndex(Map map, String key, Integer defValue, JComboBox combo)
Restores the selected index of the BaseComboBox.- Parameters:
map
- the map to obtain the index fromkey
- the key to obtain the index fordefValue
- the default index in case the index is not present in map, -1 means lastcombo
- the BaseComboBox to update
-
restoreSelectedIndices
protected void restoreSelectedIndices(Map map, String key, int[] defValue, JList list)
Restores the selected indices of the JList.- Parameters:
map
- the map to obtain the indices fromkey
- the key to obtain the indices fordefValue
- the default indices in case the index is not present in map, -1 means lastlist
- the JList to update
-
deserialize
public abstract void deserialize(weka.gui.explorer.Explorer.ExplorerPanel panel, Object data)
Deserializes the data and configures the panel.- Parameters:
panel
- the panel to updatedata
- the serialized data to restore the panel with
-
getHandlers
public static String[] getHandlers()
Returns a list with classnames of handlers.- Returns:
- the handler classnames
-
-