Class PreprocessTab
- java.lang.Object
-
- All Implemented Interfaces:
CleanUpHandler,StatusMessageHandler,PopupMenuProvider,UndoListener,WekaInvestigatorDataListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible,TableModelListener
public class PreprocessTab extends AbstractInvestigatorTabWithEditableDataTable
Preprocessing tab.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
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 StringKEY_BATCHFILTERstatic StringKEY_FILTERstatic StringKEY_KEEPNAMEstatic StringKEY_REPLACEstatic StringKEY_SERIALIZEstatic StringKEY_SERIALIZE_FILEprotected List<AbstractSelectedAttributesAction>m_Actionsthe available actions.protected BaseFlatButtonm_ButtonSelectedAttributesthe button for copying the selected attributes range.protected BaseSplitButtonm_ButtonSelectedAttributesActionbutton for removing checked attributes.protected BaseButtonm_ButtonStartthe button for starting the filtering.protected BaseButtonm_ButtonStopthe button for stop the filtering.protected BaseCheckBoxm_CheckBoxBatchFilterthe checkbox for batch-filtering.protected BaseCheckBoxm_CheckBoxKeepNamewhether to keep the relation name.protected BaseCheckBoxm_CheckBoxReplacethe checkbox to replace the datasets.protected BaseCheckBoxm_CheckBoxSerializewhether to serialize the filter to a file.protected weka.filters.Filterm_CurrentFilterthe current filter.protected FileChooserPanelm_FileSerializethe file to serialize the trained filter to.protected int[]m_LastAttributesToVisualizethe last indices that were visualized.protected intm_MaxAttributesToVisualizethe maximum number of attributes to visualize (summary table/histogram).protected AttributeSelectionPanelm_PanelAttSelectionthe attribute selection panel.protected MultiAttributeSummaryPanelm_PanelAttSummarythe attribute summary panel.protected MultiAttributeVisualizationPanelm_PanelAttVisualizationthe attribute visualization panel.protected GenericObjectEditorPanelm_PanelGOEthe GOe with the filter.protected InstancesSummaryPanelm_PanelInstSummarythe instances summary panel.protected JPanelm_PanelMainthe panel for the preprocess panels.protected JPanelm_PanelTopthe panel for the filter and the buttons.protected BaseTextFieldm_TextSelectedAttributesthe currently selected attributes.protected Threadm_Workerwhether the evaluation is currently running.-
Fields inherited from class adams.gui.tools.wekainvestigator.tab.AbstractInvestigatorTabWithEditableDataTable
m_ButtonAction, m_ButtonActivate, m_ButtonDown, m_ButtonRemove, m_ButtonSave, m_ButtonUndo, m_ButtonUp
-
Fields inherited from class adams.gui.tools.wekainvestigator.tab.AbstractInvestigatorTabWithDataTable
KEY_DATATABLE_HEIGHT, KEY_DATATABLE_SELECTEDROWS, m_DefaultDataTableHeight, m_FirstAdd, m_Model, m_PanelData, m_SplitPane, m_Table
-
Fields inherited from class adams.gui.tools.wekainvestigator.tab.AbstractInvestigatorTab
m_ActualTitle, m_FileChooserParameters, m_Owner
-
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 PreprocessTab()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcanFilter()Checks whether data can be filtered.voiddataChanged(WekaInvestigatorDataEvent e)Notifies the tab that the data changed.protected voiddataTableSelectionChanged()Gets called when the user changes the selection.protected voiddisplayData()Displays the data.protected voiddoDeserialize(Map<String,Object> data, MessageCollection errors)Restores the objects.protected Map<String,Object>doSerialize(Set<AbstractInvestigatorTab.SerializationOption> options)Returns the objects for serialization.voidfireDataChange(WekaInvestigatorDataEvent e)Notifies all the tabs that the data has changed.AttributeSelectionPanelgetAttributeSelectionPanel()Returns the attribute selection panel.BaseCheckBoxgetCheckBoxBatchFilter()Returns the batch filter checkbox.BaseCheckBoxgetCheckBoxKeepName()Returns the keep name checkbox.BaseCheckBoxgetCheckBoxReplace()Returns the replace checkbox.protected intgetDataTableListSelectionMode()Returns the list selection mode to use.StringgetTabIcon()Returns the icon name for the tab icon.StringgetTitle()Returns the title of this table.protected voidinitGUI()Initializes the widgets.protected voidinitialize()Initializes the members.protected StringisCompatible(int[] indices)Checks whether the selected datasets are compatible.protected voidpostExecutionFinished()Hook method that gets called after finishing a job.protected voidpostStartExecution(InvestigatorTabJob job)Hook method that gets called after successfully starting a job.protected voidpostStopExecution()Hook method that gets called after stopping a job.protected voidstartExecution()Starts the filtering.booleansubmitJob(Runnable run)Submits the job.protected voidupdateAttributeSelection()For updating the state of the selected attributes text field and button.voidupdateButtons()Updates the buttons.-
Methods inherited from class adams.gui.tools.wekainvestigator.tab.AbstractInvestigatorTabWithEditableDataTable
finishInit, hasReadOnlyTable, showDataTablePopup, undoOccurred
-
Methods inherited from class adams.gui.tools.wekainvestigator.tab.AbstractInvestigatorTabWithDataTable
activate, backupSelection, getSelectedRows, getTable, removeData, renameData, restoreSelection, tableChanged, undo
-
Methods inherited from class adams.gui.tools.wekainvestigator.tab.AbstractInvestigatorTab
canStartExecution, createPopupMenu, deserialize, executionFinished, getActualTitle, getData, getFileChooserParameters, getOwner, isBusy, loadParameters, logError, logError, logMessage, saveParameters, serialize, setActualTitle, setOwner, showStatus, startExecution, stopExecution, toParamsArray
-
Methods inherited from class adams.gui.core.DetachablePanel
addDetachListener, addReattachListener, cleanUp, 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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.CleanUpHandler
cleanUp
-
-
-
-
Field Detail
-
KEY_FILTER
public static final String KEY_FILTER
- See Also:
- Constant Field Values
-
KEY_BATCHFILTER
public static final String KEY_BATCHFILTER
- See Also:
- Constant Field Values
-
KEY_KEEPNAME
public static final String KEY_KEEPNAME
- See Also:
- Constant Field Values
-
KEY_REPLACE
public static final String KEY_REPLACE
- See Also:
- Constant Field Values
-
KEY_SERIALIZE
public static final String KEY_SERIALIZE
- See Also:
- Constant Field Values
-
KEY_SERIALIZE_FILE
public static final String KEY_SERIALIZE_FILE
- See Also:
- Constant Field Values
-
m_PanelGOE
protected GenericObjectEditorPanel m_PanelGOE
the GOe with the filter.
-
m_PanelTop
protected JPanel m_PanelTop
the panel for the filter and the buttons.
-
m_PanelMain
protected JPanel m_PanelMain
the panel for the preprocess panels.
-
m_CheckBoxReplace
protected BaseCheckBox m_CheckBoxReplace
the checkbox to replace the datasets.
-
m_CheckBoxBatchFilter
protected BaseCheckBox m_CheckBoxBatchFilter
the checkbox for batch-filtering.
-
m_CheckBoxKeepName
protected BaseCheckBox m_CheckBoxKeepName
whether to keep the relation name.
-
m_CheckBoxSerialize
protected BaseCheckBox m_CheckBoxSerialize
whether to serialize the filter to a file.
-
m_FileSerialize
protected FileChooserPanel m_FileSerialize
the file to serialize the trained filter to.
-
m_ButtonStart
protected BaseButton m_ButtonStart
the button for starting the filtering.
-
m_ButtonStop
protected BaseButton m_ButtonStop
the button for stop the filtering.
-
m_PanelInstSummary
protected InstancesSummaryPanel m_PanelInstSummary
the instances summary panel.
-
m_PanelAttSelection
protected AttributeSelectionPanel m_PanelAttSelection
the attribute selection panel.
-
m_PanelAttSummary
protected MultiAttributeSummaryPanel m_PanelAttSummary
the attribute summary panel.
-
m_PanelAttVisualization
protected MultiAttributeVisualizationPanel m_PanelAttVisualization
the attribute visualization panel.
-
m_TextSelectedAttributes
protected BaseTextField m_TextSelectedAttributes
the currently selected attributes.
-
m_ButtonSelectedAttributes
protected BaseFlatButton m_ButtonSelectedAttributes
the button for copying the selected attributes range.
-
m_ButtonSelectedAttributesAction
protected BaseSplitButton m_ButtonSelectedAttributesAction
button for removing checked attributes.
-
m_Worker
protected Thread m_Worker
whether the evaluation is currently running.
-
m_CurrentFilter
protected weka.filters.Filter m_CurrentFilter
the current filter.
-
m_Actions
protected List<AbstractSelectedAttributesAction> m_Actions
the available actions.
-
m_MaxAttributesToVisualize
protected int m_MaxAttributesToVisualize
the maximum number of attributes to visualize (summary table/histogram).
-
m_LastAttributesToVisualize
protected int[] m_LastAttributesToVisualize
the last indices that were visualized.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractInvestigatorTabWithEditableDataTable
-
initGUI
protected void initGUI()
Initializes the widgets.- Overrides:
initGUIin classAbstractInvestigatorTabWithEditableDataTable
-
updateAttributeSelection
protected void updateAttributeSelection()
For updating the state of the selected attributes text field and button.
-
isCompatible
protected String isCompatible(int[] indices)
Checks whether the selected datasets are compatible.- Parameters:
indices- the indices of the data containers to check- Returns:
- null if compatible, otherwise error message
-
startExecution
protected void startExecution()
Starts the filtering.
-
postStartExecution
protected void postStartExecution(InvestigatorTabJob job)
Hook method that gets called after successfully starting a job.- Overrides:
postStartExecutionin classAbstractInvestigatorTab- Parameters:
job- the job that got started
-
postStopExecution
protected void postStopExecution()
Hook method that gets called after stopping a job.- Overrides:
postStopExecutionin classAbstractInvestigatorTab
-
postExecutionFinished
protected void postExecutionFinished()
Hook method that gets called after finishing a job.- Overrides:
postExecutionFinishedin classAbstractInvestigatorTab
-
submitJob
public boolean submitJob(Runnable run)
Submits the job.- Parameters:
run- the job to submit- Returns:
- true if successfully submitted
-
canFilter
protected String canFilter()
Checks whether data can be filtered.- Returns:
- null if data can be filtered, otherwise error message
-
updateButtons
public void updateButtons()
Updates the buttons.- Overrides:
updateButtonsin classAbstractInvestigatorTabWithEditableDataTable
-
getTitle
public String getTitle()
Returns the title of this table.- Specified by:
getTitlein classAbstractInvestigatorTab- Returns:
- the title
-
getTabIcon
public String getTabIcon()
Returns the icon name for the tab icon.- Overrides:
getTabIconin classAbstractInvestigatorTab- Returns:
- the icon name, null if not available
-
getDataTableListSelectionMode
protected int getDataTableListSelectionMode()
Returns the list selection mode to use.- Specified by:
getDataTableListSelectionModein classAbstractInvestigatorTabWithDataTable- Returns:
- the mode
- See Also:
ListSelectionModel
-
fireDataChange
public void fireDataChange(WekaInvestigatorDataEvent e)
Notifies all the tabs that the data has changed.- Overrides:
fireDataChangein classAbstractInvestigatorTab- Parameters:
e- the event to send
-
dataTableSelectionChanged
protected void dataTableSelectionChanged()
Gets called when the user changes the selection.- Overrides:
dataTableSelectionChangedin classAbstractInvestigatorTabWithEditableDataTable
-
dataChanged
public void dataChanged(WekaInvestigatorDataEvent e)
Notifies the tab that the data changed.- Specified by:
dataChangedin interfaceWekaInvestigatorDataListener- Overrides:
dataChangedin classAbstractInvestigatorTabWithEditableDataTable- Parameters:
e- the event
-
displayData
protected void displayData()
Displays the data.
-
getAttributeSelectionPanel
public AttributeSelectionPanel getAttributeSelectionPanel()
Returns the attribute selection panel.- Returns:
- the panel
-
getCheckBoxReplace
public BaseCheckBox getCheckBoxReplace()
Returns the replace checkbox.- Returns:
- the checkbox
-
getCheckBoxBatchFilter
public BaseCheckBox getCheckBoxBatchFilter()
Returns the batch filter checkbox.- Returns:
- the checkbox
-
getCheckBoxKeepName
public BaseCheckBox getCheckBoxKeepName()
Returns the keep name checkbox.- Returns:
- the checkbox
-
doSerialize
protected Map<String,Object> doSerialize(Set<AbstractInvestigatorTab.SerializationOption> options)
Returns the objects for serialization.- Overrides:
doSerializein classAbstractInvestigatorTabWithDataTable- 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:
doDeserializein classAbstractInvestigatorTabWithDataTable- Parameters:
data- the data to restoreerrors- for storing errors
-
-