Package adams.gui.visualization.weka
Class AbstractInstanceInfoFrame
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- javax.swing.JFrame
-
- weka.gui.visualize.InstanceInfoFrame
-
- adams.gui.visualization.weka.AbstractInstanceInfoFrame
-
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
,RootPaneContainer
,WindowConstants
,weka.gui.visualize.InstanceInfo
public abstract class AbstractInstanceInfoFrame extends weka.gui.visualize.InstanceInfoFrame
Ancestor for frames for displaying information on the displayed data, with some more domain-specific functionality.
Methods to implement:getActions()
- returns an array of String objects to display in the combobox that allows the user to choose an action. (m_ComboBoxActions
)getActionMethod(String)
- returns the Method object (no parameters allowed) that is associated with the given action string.locateMethod(String)
can be used to determine the reflection object.generateNumPointsLabel(int)
- generates the text to display in the label for the number of data points. (m_LabelNumPoints
)
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
-
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
-
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.Type
-
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 BaseButton
m_ButtonDataGo
the button for displaying the instances.protected BaseButton
m_ButtonTextGo
the button for displaying the instances.protected BaseComboBox
m_ComboBoxData
the combobox with all the datasets.protected BaseComboBox
m_ComboBoxDataActions
the combobox with all the actions.protected BaseComboBox
m_ComboBoxTextActions
the combobox with all the actions.protected BaseComboBox
m_ComboBoxTextInstances
the combobox with all the instances.protected JLabel
m_LabelTextNumPoints
the number of data points.protected BasePanel
m_PanelComboBoxData
the panel for the combobox listing the datasets.protected BasePanel
m_PanelData
the panel holding the table and buttons for the dataset.protected JPanel
m_PanelDataAction
the panel with buttons etc.protected JPanel
m_PanelTextAction
the panel with buttons etc.protected BasePanel
m_PanelTextAll
the panel for the text tab.protected BaseTabbedPane
m_TabbedPane
the tabbed pane for displaying the data.protected SortableAndSearchableTable
m_TableData
the table with the dataset.-
Fields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabled
-
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
-
Fields inherited from class java.awt.Component
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
-
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
-
Constructor Summary
Constructors Constructor Description AbstractInstanceInfoFrame()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected int
extractDatabaseID(String idStr)
Extracts the database ID from a string in the comboxbox.protected abstract String
generateNumPointsLabel(int numPoints)
Generates the string for the label displaying the number of points that are currently selected.protected abstract Method
getActionMethod(String action)
Returns the method associated with the specified action.protected abstract String[]
getActions()
Returns the available actions to list.protected int[]
getAllDatabaseIDs(int tabIndex)
Returns all database IDs.protected int
getDatabaseIDColumnIndex()
Returns the index of the column with the database ID.protected String
getDialogTitle()
Returns the title for the dialog.protected int
getSelectedDatabaseID(int tabIndex)
Returns the database ID of the currently selected item.protected int[]
getSelectedDatabaseIDs(int tabIndex)
Returns the database IDs of the currently selected items.protected void
initGUI()
Sets up the GUI components.protected Method
locateMethod(String name)
Locates the method with the specified name (method is expected to take no parameters).void
setInfoData(Vector<weka.core.Instances> data)
Sets the underlying data.protected void
updateDataTable()
Updates the data in the data table.-
Methods inherited from class weka.gui.visualize.InstanceInfoFrame
getInfoData, getInfoText, initFinished, initialize, setInfoText
-
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
-
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, 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 java.awt.MenuContainer
getFont, postEvent
-
-
-
-
Field Detail
-
m_TabbedPane
protected BaseTabbedPane m_TabbedPane
the tabbed pane for displaying the data.
-
m_PanelTextAll
protected BasePanel m_PanelTextAll
the panel for the text tab.
-
m_LabelTextNumPoints
protected JLabel m_LabelTextNumPoints
the number of data points.
-
m_ComboBoxTextInstances
protected BaseComboBox m_ComboBoxTextInstances
the combobox with all the instances.
-
m_ComboBoxTextActions
protected BaseComboBox m_ComboBoxTextActions
the combobox with all the actions.
-
m_ButtonTextGo
protected BaseButton m_ButtonTextGo
the button for displaying the instances.
-
m_PanelTextAction
protected JPanel m_PanelTextAction
the panel with buttons etc.
-
m_TableData
protected SortableAndSearchableTable m_TableData
the table with the dataset.
-
m_PanelData
protected BasePanel m_PanelData
the panel holding the table and buttons for the dataset.
-
m_ComboBoxData
protected BaseComboBox m_ComboBoxData
the combobox with all the datasets.
-
m_PanelComboBoxData
protected BasePanel m_PanelComboBoxData
the panel for the combobox listing the datasets.
-
m_ComboBoxDataActions
protected BaseComboBox m_ComboBoxDataActions
the combobox with all the actions.
-
m_ButtonDataGo
protected BaseButton m_ButtonDataGo
the button for displaying the instances.
-
m_PanelDataAction
protected JPanel m_PanelDataAction
the panel with buttons etc.
-
-
Method Detail
-
initGUI
protected void initGUI()
Sets up the GUI components.- Overrides:
initGUI
in classweka.gui.visualize.InstanceInfoFrame
-
getDialogTitle
protected String getDialogTitle()
Returns the title for the dialog.- Returns:
- the dialog
-
generateNumPointsLabel
protected abstract String generateNumPointsLabel(int numPoints)
Generates the string for the label displaying the number of points that are currently selected.- Parameters:
numPoints
- the number of points currently being displayed- Returns:
- the generated string
-
getActions
protected abstract String[] getActions()
Returns the available actions to list.- Returns:
- the names of the actions
- See Also:
m_ComboBoxTextActions
-
getActionMethod
protected abstract Method getActionMethod(String action)
Returns the method associated with the specified action.- Parameters:
action
- the action to retrieve the method for- Returns:
- the associated method, null if not available
- See Also:
locateMethod(String)
-
locateMethod
protected Method locateMethod(String name)
Locates the method with the specified name (method is expected to take no parameters).- Parameters:
name
- the name of the method- Returns:
- the method, null if none found
-
extractDatabaseID
protected int extractDatabaseID(String idStr)
Extracts the database ID from a string in the comboxbox.- Parameters:
idStr
- the string from the combobox- Returns:
- the ID
-
getDatabaseIDColumnIndex
protected int getDatabaseIDColumnIndex()
Returns the index of the column with the database ID.- Returns:
- the column index, -1 if not found
-
getSelectedDatabaseID
protected int getSelectedDatabaseID(int tabIndex)
Returns the database ID of the currently selected item.- Parameters:
tabIndex
- the currently selected tab- Returns:
- the database ID, NO_ID if none selected
- See Also:
Constants.NO_ID
-
getSelectedDatabaseIDs
protected int[] getSelectedDatabaseIDs(int tabIndex)
Returns the database IDs of the currently selected items.- Parameters:
tabIndex
- the currently selected tab- Returns:
- array of database IDs, length 0 if none selected
-
getAllDatabaseIDs
protected int[] getAllDatabaseIDs(int tabIndex)
Returns all database IDs.- Parameters:
tabIndex
- the currently selected tab- Returns:
- array of database IDs, length 0 if none available
-
setInfoData
public void setInfoData(Vector<weka.core.Instances> data)
Sets the underlying data.- Specified by:
setInfoData
in interfaceweka.gui.visualize.InstanceInfo
- Overrides:
setInfoData
in classweka.gui.visualize.InstanceInfoFrame
- Parameters:
data
- the data of the info text
-
updateDataTable
protected void updateDataTable()
Updates the data in the data table.
-
-