Class AbstractInvestigatorTab
- 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
-
- All Implemented Interfaces:
adams.core.CleanUpHandler
,adams.core.StatusMessageHandler
,adams.gui.core.PopupMenuProvider
,WekaInvestigatorDataListener
,ImageObserver
,MenuContainer
,Serializable
,Accessible
- Direct Known Subclasses:
AbstractInvestigatorTabWithDataTable
,AssociateTab
,AttributeSelectionTab
,ClassifyTab
,ClusterTab
,CompareTab
,ExperimentTab
,IndependentComponentsTab
,InstanceTab
,LogTab
,PartialLeastSquaresTab
,PrincipalComponentsTab
public abstract class AbstractInvestigatorTab extends adams.gui.core.DetachablePanel implements WekaInvestigatorDataListener, adams.core.StatusMessageHandler, adams.core.CleanUpHandler
Ancestor for tabs in the Investigator.- 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
AbstractInvestigatorTab.SerializationOption
options for serialization.-
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 protected String
m_ActualTitle
the actual title.protected adams.gui.chooser.ParameterMapFileChooser
m_FileChooserParameters
the file chooser.protected InvestigatorPanel
m_Owner
the owner.protected Thread
m_Worker
whether the evaluation is currently running.-
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 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 AbstractInvestigatorTab()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
canStartExecution()
Returns whether a new job can be executed.JPopupMenu
createPopupMenu()
Creates and returns the popup menu.abstract void
dataChanged(WekaInvestigatorDataEvent e)
Notifies the tab that the data changed.void
deserialize(Object data, adams.core.MessageCollection errors)
Deserializes the data and configures the tab.protected void
doDeserialize(Map<String,Object> data, adams.core.MessageCollection errors)
Restores the objects.protected Map<String,Object>
doSerialize(Set<AbstractInvestigatorTab.SerializationOption> options)
Returns the objects for serialization.void
executionFinished()
Gets called when a job finishes.void
fireDataChange(WekaInvestigatorDataEvent e)
Notifies all the tabs that the data has changed.String
getActualTitle()
Returns the actual title in use.DataContainerList
getData()
Returns the currently loaded data.protected adams.gui.chooser.ParameterMapFileChooser
getFileChooserParameters()
Returns the file chooser for parameters.InvestigatorPanel
getOwner()
Returns the owner of this tab.String
getTabIcon()
Returns the icon name for the tab icon.abstract String
getTitle()
Returns the title of this tab.protected void
initialize()
Initializes the members.boolean
isBusy()
Returns whether the tab is busy.void
loadParameters()
Prompts the user to select a yaml file to load the parameters for this tab from.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
saveParameters()
Prompts the user to select a yaml file to store the parameters of the tab under.Object
serialize(Set<AbstractInvestigatorTab.SerializationOption> options)
Generates a view of the tab that can be serialized.void
setActualTitle(String value)
Sets the actual title to use.void
setOwner(InvestigatorPanel value)
Sets the owner for this tab.void
showStatus(String msg)
Displays a message.boolean
startExecution(InvestigatorTabJob job)
Starts the job.void
stopExecution()
Stops the evaluation.protected String[]
toParamsArray(Object params)
Turns a parameter object into a string array.-
Methods inherited from class adams.gui.core.DetachablePanel
addDetachListener, addReattachListener, cleanUp, clearDetachListeners, clearReattachListeners, detach, getContentPanel, getFrameTitle, getPopupMenu, getPopupMenuCustomizer, initGUI, isDetached, notifyDetachListeners, notifyReattachListeners, reattach, removeDetachListener, removeReattachListener, setFrameTitle, setPopupMenuCustomizer
-
Methods inherited from class adams.gui.core.BasePanel
afterHide, afterShow, beforeHide, beforeShow, closeParent, finishInit, 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
-
m_Owner
protected InvestigatorPanel m_Owner
the owner.
-
m_Worker
protected Thread m_Worker
whether the evaluation is currently running.
-
m_FileChooserParameters
protected adams.gui.chooser.ParameterMapFileChooser m_FileChooserParameters
the file chooser.
-
m_ActualTitle
protected String m_ActualTitle
the actual title.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classadams.gui.core.DetachablePanel
-
setOwner
public void setOwner(InvestigatorPanel value)
Sets the owner for this tab.- Parameters:
value
- the owner
-
getOwner
public InvestigatorPanel getOwner()
Returns the owner of this tab.- Returns:
- the owner, null if none set
-
getTitle
public abstract String getTitle()
Returns the title of this tab.- Returns:
- the title
-
setActualTitle
public void setActualTitle(String value)
Sets the actual title to use.- Parameters:
value
- the title
-
getActualTitle
public String getActualTitle()
Returns the actual title in use.- Returns:
- the title, null if not set
-
getTabIcon
public String getTabIcon()
Returns the icon name for the tab icon.
Default implementation returns null.- Returns:
- the icon name, null if not available
-
getFileChooserParameters
protected adams.gui.chooser.ParameterMapFileChooser getFileChooserParameters()
Returns the file chooser for parameters.- Returns:
- the chooser
-
createPopupMenu
public JPopupMenu createPopupMenu()
Creates and returns the popup menu.- Overrides:
createPopupMenu
in classadams.gui.core.DetachablePanel
- Returns:
- the menu
-
getData
public DataContainerList getData()
Returns the currently loaded data.- Returns:
- the data
-
isBusy
public boolean isBusy()
Returns whether the tab is busy.- Returns:
- true if busy
-
canStartExecution
public boolean canStartExecution()
Returns whether a new job can be executed.- Returns:
- true if job can get executed
-
postStartExecution
protected void postStartExecution(InvestigatorTabJob job)
Hook method that gets called after successfully starting a job.- Parameters:
job
- the job that got started
-
startExecution
public boolean startExecution(InvestigatorTabJob job)
Starts the job.- Parameters:
job
- the job to execute
-
postStopExecution
protected void postStopExecution()
Hook method that gets called after stopping a job.
-
stopExecution
public void stopExecution()
Stops the evaluation.
-
postExecutionFinished
protected void postExecutionFinished()
Hook method that gets called after finishing a job.
-
executionFinished
public void executionFinished()
Gets called when a job finishes.
-
dataChanged
public abstract void dataChanged(WekaInvestigatorDataEvent e)
Notifies the tab that the data changed.- Specified by:
dataChanged
in interfaceWekaInvestigatorDataListener
- Parameters:
e
- the event
-
fireDataChange
public void fireDataChange(WekaInvestigatorDataEvent e)
Notifies all the tabs that the data has changed.- Parameters:
e
- the event to send
-
toParamsArray
protected String[] toParamsArray(Object params)
Turns a parameter object into a string array.- Parameters:
params
- the parameters to convert- Returns:
- the string array
-
saveParameters
public void saveParameters()
Prompts the user to select a yaml file to store the parameters of the tab under.
-
loadParameters
public void loadParameters()
Prompts the user to select a yaml file to load the parameters for this tab from.
-
doSerialize
protected Map<String,Object> doSerialize(Set<AbstractInvestigatorTab.SerializationOption> options)
Returns the objects for serialization.
{ } Default implementation returns an empty map.- Parameters:
options
- what to serialize- Returns:
- the mapping of the objects to serialize
-
serialize
public Object serialize(Set<AbstractInvestigatorTab.SerializationOption> options)
Generates a view of the tab that can be serialized.- Parameters:
options
- what to serialize- Returns:
- the data to serialize
-
doDeserialize
protected void doDeserialize(Map<String,Object> data, adams.core.MessageCollection errors)
Restores the objects.
Default implementation does nothing.- Parameters:
data
- the data to restoreerrors
- for storing errors
-
deserialize
public void deserialize(Object data, adams.core.MessageCollection errors)
Deserializes the data and configures the tab.- Parameters:
data
- the serialized data to restore the tab witherrors
- for storing errors
-
logMessage
public void logMessage(String msg)
Logs the message.- Parameters:
msg
- the log message
-
logError
public void logError(String msg, Throwable t, String title)
Logs the exception and also displays an error dialog.- 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.- Parameters:
msg
- the error messagetitle
- the title for the dialog
-
showStatus
public void showStatus(String msg)
Displays a message.- Specified by:
showStatus
in interfaceadams.core.StatusMessageHandler
- Parameters:
msg
- the message to display
-
-