Class PreprocessTab
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.core.DetachablePanel
-
- All Implemented Interfaces:
adams.core.CleanUpHandler
,adams.core.StatusMessageHandler
,adams.gui.core.PopupMenuProvider
,adams.gui.event.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 String
KEY_BATCHFILTER
static String
KEY_FILTER
static String
KEY_KEEPNAME
static String
KEY_REPLACE
static String
KEY_SERIALIZE
static String
KEY_SERIALIZE_FILE
protected List<AbstractSelectedAttributesAction>
m_Actions
the available actions.protected adams.gui.core.BaseFlatButton
m_ButtonSelectedAttributes
the button for copying the selected attributes range.protected adams.gui.core.BaseSplitButton
m_ButtonSelectedAttributesAction
button for removing checked attributes.protected adams.gui.core.BaseButton
m_ButtonStart
the button for starting the filtering.protected adams.gui.core.BaseButton
m_ButtonStop
the button for stop the filtering.protected adams.gui.core.BaseCheckBox
m_CheckBoxBatchFilter
the checkbox for batch-filtering.protected adams.gui.core.BaseCheckBox
m_CheckBoxKeepName
the whether to keep the relation name.protected adams.gui.core.BaseCheckBox
m_CheckBoxReplace
the checkbox to replace the datasets.protected adams.gui.core.BaseCheckBox
m_CheckBoxSerialize
the whether to serialize the filter to a file.protected weka.filters.Filter
m_CurrentFilter
the current filter.protected adams.gui.chooser.FileChooserPanel
m_FileSerialize
the file to serialize the trained filter to.protected int[]
m_LastAttributesToVisualize
the last indices that were visualized.protected int
m_MaxAttributesToVisualize
the maximum number of attributes to visualize (summary table/histogram).protected AttributeSelectionPanel
m_PanelAttSelection
the attribute selection panel.protected MultiAttributeSummaryPanel
m_PanelAttSummary
the attribute summary panel.protected MultiAttributeVisualizationPanel
m_PanelAttVisualization
the attribute visualization panel.protected adams.gui.goe.GenericObjectEditorPanel
m_PanelGOE
the GOe with the filter.protected InstancesSummaryPanel
m_PanelInstSummary
the instances summary panel.protected JPanel
m_PanelMain
the panel for the preprocess panels.protected JPanel
m_PanelTop
the panel for the filter and the buttons.protected adams.gui.core.BaseTextField
m_TextSelectedAttributes
the currently selected attributes.protected Thread
m_Worker
whether 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_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 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 String
canFilter()
Checks whether data can be filtered.void
dataChanged(WekaInvestigatorDataEvent e)
Notifies the tab that the data changed.protected void
dataTableSelectionChanged()
Gets called when the user changes the selection.protected void
displayData()
Displays the data.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
fireDataChange(WekaInvestigatorDataEvent e)
Notifies all the tabs that the data has changed.AttributeSelectionPanel
getAttributeSelectionPanel()
Returns the attribute selection panel.adams.gui.core.BaseCheckBox
getCheckBoxBatchFilter()
Returns the batch filter checkbox.adams.gui.core.BaseCheckBox
getCheckBoxKeepName()
Returns the keep name checkbox.adams.gui.core.BaseCheckBox
getCheckBoxReplace()
Returns the replace checkbox.protected int
getDataTableListSelectionMode()
Returns the list selection mode to use.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.protected String
isCompatible(int[] indices)
Checks whether the selected datasets are compatible.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.protected void
startExecution()
Starts the filtering.boolean
submitJob(Runnable run)
Submits the job.protected void
updateAttributeSelection()
For updating the state of the selected attributes text field and button.void
updateButtons()
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, getData, getFileChooserParameters, getOwner, isBusy, loadParameters, logError, logError, logMessage, saveParameters, serialize, 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
-
-
-
-
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 adams.gui.goe.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 adams.gui.core.BaseCheckBox m_CheckBoxReplace
the checkbox to replace the datasets.
-
m_CheckBoxBatchFilter
protected adams.gui.core.BaseCheckBox m_CheckBoxBatchFilter
the checkbox for batch-filtering.
-
m_CheckBoxKeepName
protected adams.gui.core.BaseCheckBox m_CheckBoxKeepName
the whether to keep the relation name.
-
m_CheckBoxSerialize
protected adams.gui.core.BaseCheckBox m_CheckBoxSerialize
the whether to serialize the filter to a file.
-
m_FileSerialize
protected adams.gui.chooser.FileChooserPanel m_FileSerialize
the file to serialize the trained filter to.
-
m_ButtonStart
protected adams.gui.core.BaseButton m_ButtonStart
the button for starting the filtering.
-
m_ButtonStop
protected adams.gui.core.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 adams.gui.core.BaseTextField m_TextSelectedAttributes
the currently selected attributes.
-
m_ButtonSelectedAttributes
protected adams.gui.core.BaseFlatButton m_ButtonSelectedAttributes
the button for copying the selected attributes range.
-
m_ButtonSelectedAttributesAction
protected adams.gui.core.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:
initialize
in classAbstractInvestigatorTabWithEditableDataTable
-
initGUI
protected void initGUI()
Initializes the widgets.- Overrides:
initGUI
in 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:
postStartExecution
in classAbstractInvestigatorTab
- Parameters:
job
- the job that got started
-
postStopExecution
protected void postStopExecution()
Hook method that gets called after stopping a job.- Overrides:
postStopExecution
in classAbstractInvestigatorTab
-
postExecutionFinished
protected void postExecutionFinished()
Hook method that gets called after finishing a job.- Overrides:
postExecutionFinished
in 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:
updateButtons
in classAbstractInvestigatorTabWithEditableDataTable
-
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
-
getDataTableListSelectionMode
protected int getDataTableListSelectionMode()
Returns the list selection mode to use.- Specified by:
getDataTableListSelectionMode
in classAbstractInvestigatorTabWithDataTable
- Returns:
- the mode
- See Also:
ListSelectionModel
-
fireDataChange
public void fireDataChange(WekaInvestigatorDataEvent e)
Notifies all the tabs that the data has changed.- Overrides:
fireDataChange
in classAbstractInvestigatorTab
- Parameters:
e
- the event to send
-
dataTableSelectionChanged
protected void dataTableSelectionChanged()
Gets called when the user changes the selection.- Overrides:
dataTableSelectionChanged
in classAbstractInvestigatorTabWithEditableDataTable
-
dataChanged
public void dataChanged(WekaInvestigatorDataEvent e)
Notifies the tab that the data changed.- Specified by:
dataChanged
in interfaceWekaInvestigatorDataListener
- Overrides:
dataChanged
in 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 adams.gui.core.BaseCheckBox getCheckBoxReplace()
Returns the replace checkbox.- Returns:
- the checkbox
-
getCheckBoxBatchFilter
public adams.gui.core.BaseCheckBox getCheckBoxBatchFilter()
Returns the batch filter checkbox.- Returns:
- the checkbox
-
getCheckBoxKeepName
public adams.gui.core.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:
doSerialize
in classAbstractInvestigatorTabWithDataTable
- Parameters:
options
- what to serialize- Returns:
- the mapping of the objects to serialize
-
doDeserialize
protected void doDeserialize(Map<String,Object> data, adams.core.MessageCollection errors)
Restores the objects.- Overrides:
doDeserialize
in classAbstractInvestigatorTabWithDataTable
- Parameters:
data
- the data to restoreerrors
- for storing errors
-
-