Class ClassifyTab
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.core.DetachablePanel
-
- adams.gui.tools.wekainvestigator.tab.AbstractInvestigatorTab
-
- adams.gui.tools.wekainvestigator.tab.ClassifyTab
-
- All Implemented Interfaces:
CleanUpHandler
,StatusMessageHandler
,PopupMenuProvider
,WekaInvestigatorDataListener
,ImageObserver
,MenuContainer
,Serializable
,Accessible
public class ClassifyTab extends AbstractInvestigatorTab
Tab for classification.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClassifyTab.HistoryPanel
Customized history panel.-
Nested classes/interfaces inherited from class adams.gui.tools.wekainvestigator.tab.AbstractInvestigatorTab
AbstractInvestigatorTab.SerializationOption
-
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
Fields Modifier and Type Field Description static String
KEY_CLASSIFIER
static String
KEY_EVALUATION
static String
KEY_EVALUATION_PREFIX
static String
KEY_HISTORY
static String
KEY_LEFTPANELWIDTH
static String
KEY_OUTPUTGENERATORS
the key for the output generators.protected BaseButton
m_ButtonOutputGenerators
the button for editing the output generators.protected BaseButton
m_ButtonOutputGeneratorsFavorites
the button for the output generator favorites.protected BaseButton
m_ButtonStart
the start button.protected BaseButton
m_ButtonStop
the stop button.protected BaseComboBox<AbstractClassifierEvaluation>
m_ComboBoxEvaluations
the combobox with the available evaluations.protected weka.classifiers.Classifier
m_CurrentClassifier
the current classifier.protected AbstractClassifierEvaluation
m_CurrentEvaluation
the current evaluation.protected ClassifyTab.HistoryPanel
m_History
the history.protected DefaultComboBoxModel<AbstractClassifierEvaluation>
m_ModelEvaluations
the model with the available evaluations.protected AbstractOutputGenerator[]
m_OutputGenerators
the output generators to use.protected JPanel
m_PanelEvaluation
the panel with the evaluation.protected JPanel
m_PanelEvaluationSetup
the panel for the evaluation setup to be embedded in.protected JPanel
m_PanelExecutionButtons
the panel with the buttons.protected GenericObjectEditorPanel
m_PanelGOE
the GOe with the classifier.protected JPanel
m_PanelLeft
the panel on the left-hand side.protected JPanel
m_PanelRight
the panel on the right-hand side (displays results).protected BaseSplitPane
m_SplitPane
the split pane for left/right panels.protected BaseStatusBar
m_StatusBar
the status bar.protected boolean
m_Stopping
whether the execution is in the process of stopping.-
Fields inherited from class adams.gui.tools.wekainvestigator.tab.AbstractInvestigatorTab
m_ActualTitle, m_FileChooserParameters, m_Owner, m_Worker
-
Fields inherited from class adams.gui.core.DetachablePanel
DETACH_ICON, m_ButtonReattach, m_ContentPanel, m_DetachedFrame, m_DetachListeners, m_FrameTitle, m_LastFramePosition, m_LastFrameSize, m_PanelReattach, m_PopupMenuCustomizer, m_ReattachListeners, REATTACH_ICON
-
Fields inherited from class adams.gui.core.BasePanel
m_FileChooser
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
Constructor Summary
Constructors Constructor Description ClassifyTab()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanUp()
Cleans up data structures, frees up memory.void
dataChanged(WekaInvestigatorDataEvent e)
Notifies the tab that the data changed.protected void
doDeserialize(Map<String,Object> data, MessageCollection errors)
Restores the objects.protected Map<String,Object>
doSerialize(Set<AbstractInvestigatorTab.SerializationOption> options)
Returns the objects for serialization.protected void
editOutputGenerators()
Allows the user to modify the output generators.protected void
finishInit()
Finishes up the initialization.void
generateOutput(ResultItem item)
Generates the output from the item.AbstractOutputGenerator[]
getOutputGenerators()
Returns the current output generators.GenericObjectEditorPanel
getPanelGOE()
Returns the panel with the algorithm.JPanel
getPanelLeft()
Returns the left panel.JPanel
getPanelRight()
Returns the right panel.String
getTabIcon()
Returns the icon name for the tab icon.String
getTitle()
Returns the title of this table.protected void
initGUI()
Initializes the widgets.protected void
initialize()
Initializes the members.boolean
isBusy()
Returns whether the tab is busy.void
logError(String msg, String title)
Logs the error message and also displays an error dialog.void
logError(String msg, Throwable t, String title)
Logs the exception and also displays an error dialog.void
logMessage(String msg)
Logs the message.protected void
postExecutionFinished()
Hook method that gets called after finishing a job.protected void
postStartExecution(InvestigatorTabJob job)
Hook method that gets called after successfully starting a job.protected void
postStopExecution()
Hook method that gets called after stopping a job.void
setOutputGenerators(AbstractOutputGenerator[] value)
Sets the output generators to use.protected void
showOutputGeneratorsFavorites()
Shows the favorites popup menu for the output generators.void
showStatus(String msg)
Displays a message.protected void
startExecution()
Starts the evaluation.void
stopExecution()
Stops the evaluation.void
updateButtons()
Updates the buttons.-
Methods inherited from class adams.gui.tools.wekainvestigator.tab.AbstractInvestigatorTab
canStartExecution, createPopupMenu, deserialize, executionFinished, fireDataChange, getActualTitle, getData, getFileChooserParameters, getOwner, loadParameters, saveParameters, serialize, setActualTitle, setOwner, startExecution, toParamsArray
-
Methods inherited from class adams.gui.core.DetachablePanel
addDetachListener, addReattachListener, clearDetachListeners, clearReattachListeners, detach, getContentPanel, getFrameTitle, getPopupMenu, getPopupMenuCustomizer, isDetached, notifyDetachListeners, notifyReattachListeners, reattach, removeDetachListener, removeReattachListener, setFrameTitle, setPopupMenuCustomizer
-
Methods inherited from class adams.gui.core.BasePanel
afterHide, afterShow, beforeHide, beforeShow, closeParent, getParentChild, getParentDialog, getParentFrame, getParentInternalFrame, getParentTitle, initFileChooser, main, printErrorMessage, printException, saveComponent, setEnabledCascade, setEnabledCascade, setParentTitle, setVisible
-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
KEY_HISTORY
public static final String KEY_HISTORY
- See Also:
- Constant Field Values
-
KEY_OUTPUTGENERATORS
public static final String KEY_OUTPUTGENERATORS
the key for the output generators.- See Also:
- Constant Field Values
-
KEY_LEFTPANELWIDTH
public static final String KEY_LEFTPANELWIDTH
- See Also:
- Constant Field Values
-
KEY_CLASSIFIER
public static final String KEY_CLASSIFIER
- See Also:
- Constant Field Values
-
KEY_EVALUATION
public static final String KEY_EVALUATION
- See Also:
- Constant Field Values
-
KEY_EVALUATION_PREFIX
public static final String KEY_EVALUATION_PREFIX
- See Also:
- Constant Field Values
-
m_PanelGOE
protected GenericObjectEditorPanel m_PanelGOE
the GOe with the classifier.
-
m_SplitPane
protected BaseSplitPane m_SplitPane
the split pane for left/right panels.
-
m_PanelLeft
protected JPanel m_PanelLeft
the panel on the left-hand side.
-
m_PanelRight
protected JPanel m_PanelRight
the panel on the right-hand side (displays results).
-
m_PanelEvaluation
protected JPanel m_PanelEvaluation
the panel with the evaluation.
-
m_ComboBoxEvaluations
protected BaseComboBox<AbstractClassifierEvaluation> m_ComboBoxEvaluations
the combobox with the available evaluations.
-
m_ModelEvaluations
protected DefaultComboBoxModel<AbstractClassifierEvaluation> m_ModelEvaluations
the model with the available evaluations.
-
m_PanelEvaluationSetup
protected JPanel m_PanelEvaluationSetup
the panel for the evaluation setup to be embedded in.
-
m_CurrentEvaluation
protected AbstractClassifierEvaluation m_CurrentEvaluation
the current evaluation.
-
m_CurrentClassifier
protected weka.classifiers.Classifier m_CurrentClassifier
the current classifier.
-
m_ButtonOutputGenerators
protected BaseButton m_ButtonOutputGenerators
the button for editing the output generators.
-
m_ButtonOutputGeneratorsFavorites
protected BaseButton m_ButtonOutputGeneratorsFavorites
the button for the output generator favorites.
-
m_PanelExecutionButtons
protected JPanel m_PanelExecutionButtons
the panel with the buttons.
-
m_ButtonStart
protected BaseButton m_ButtonStart
the start button.
-
m_ButtonStop
protected BaseButton m_ButtonStop
the stop button.
-
m_History
protected ClassifyTab.HistoryPanel m_History
the history.
-
m_StatusBar
protected BaseStatusBar m_StatusBar
the status bar.
-
m_Stopping
protected boolean m_Stopping
whether the execution is in the process of stopping.
-
m_OutputGenerators
protected AbstractOutputGenerator[] m_OutputGenerators
the output generators to use.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classAbstractInvestigatorTab
-
initGUI
protected void initGUI()
Initializes the widgets.- Overrides:
initGUI
in classDetachablePanel
-
finishInit
protected void finishInit()
Finishes up the initialization.- Overrides:
finishInit
in classBasePanel
-
getTitle
public String getTitle()
Returns the title of this table.- Specified by:
getTitle
in classAbstractInvestigatorTab
- Returns:
- the title
-
getTabIcon
public String getTabIcon()
Returns the icon name for the tab icon.- Overrides:
getTabIcon
in classAbstractInvestigatorTab
- Returns:
- the icon name, null if not available
-
dataChanged
public void dataChanged(WekaInvestigatorDataEvent e)
Notifies the tab that the data changed.- Specified by:
dataChanged
in interfaceWekaInvestigatorDataListener
- Specified by:
dataChanged
in classAbstractInvestigatorTab
- Parameters:
e
- the event
-
editOutputGenerators
protected void editOutputGenerators()
Allows the user to modify the output generators.
-
showOutputGeneratorsFavorites
protected void showOutputGeneratorsFavorites()
Shows the favorites popup menu for the output generators.
-
postStartExecution
protected void postStartExecution(InvestigatorTabJob job)
Hook method that gets called after successfully starting a job.- Overrides:
postStartExecution
in classAbstractInvestigatorTab
- Parameters:
job
- the job that got started
-
startExecution
protected void startExecution()
Starts the evaluation.
-
postExecutionFinished
protected void postExecutionFinished()
Hook method that gets called after finishing a job.- Overrides:
postExecutionFinished
in classAbstractInvestigatorTab
-
postStopExecution
protected void postStopExecution()
Hook method that gets called after stopping a job.- Overrides:
postStopExecution
in classAbstractInvestigatorTab
-
stopExecution
public void stopExecution()
Stops the evaluation.- Overrides:
stopExecution
in classAbstractInvestigatorTab
-
generateOutput
public void generateOutput(ResultItem item)
Generates the output from the item.- Parameters:
item
- the item to process
-
isBusy
public boolean isBusy()
Returns whether the tab is busy.- Overrides:
isBusy
in classAbstractInvestigatorTab
- Returns:
- true if busy
-
updateButtons
public void updateButtons()
Updates the buttons.
-
logMessage
public void logMessage(String msg)
Logs the message.- Overrides:
logMessage
in classAbstractInvestigatorTab
- Parameters:
msg
- the log message
-
logError
public void logError(String msg, Throwable t, String title)
Logs the exception and also displays an error dialog.- Overrides:
logError
in classAbstractInvestigatorTab
- Parameters:
msg
- the log messaget
- the exceptiontitle
- the title for the dialog
-
logError
public void logError(String msg, String title)
Logs the error message and also displays an error dialog.- Overrides:
logError
in classAbstractInvestigatorTab
- Parameters:
msg
- the error messagetitle
- the title for the dialog
-
showStatus
public void showStatus(String msg)
Displays a message.- Specified by:
showStatus
in interfaceStatusMessageHandler
- Overrides:
showStatus
in classAbstractInvestigatorTab
- Parameters:
msg
- the message to display
-
getPanelLeft
public JPanel getPanelLeft()
Returns the left panel.- Returns:
- the left panel
-
getPanelRight
public JPanel getPanelRight()
Returns the right panel.- Returns:
- the right panel
-
getPanelGOE
public GenericObjectEditorPanel getPanelGOE()
Returns the panel with the algorithm.- Returns:
- the panel
-
getOutputGenerators
public AbstractOutputGenerator[] getOutputGenerators()
Returns the current output generators.- Returns:
- the generators
-
setOutputGenerators
public void setOutputGenerators(AbstractOutputGenerator[] value)
Sets the output generators to use.- Parameters:
value
- the generators
-
doSerialize
protected Map<String,Object> doSerialize(Set<AbstractInvestigatorTab.SerializationOption> options)
Returns the objects for serialization.- Overrides:
doSerialize
in classAbstractInvestigatorTab
- Parameters:
options
- what to serialize- Returns:
- the mapping of the objects to serialize
-
doDeserialize
protected void doDeserialize(Map<String,Object> data, MessageCollection errors)
Restores the objects.- Overrides:
doDeserialize
in classAbstractInvestigatorTab
- Parameters:
data
- the data to restoreerrors
- for storing errors
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUp
in interfaceCleanUpHandler
- Overrides:
cleanUp
in classDetachablePanel
-
-