Package adams.gui.visualization.instance
Class InstanceExplorer
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.visualization.instance.InstanceExplorer
-
- All Implemented Interfaces:
adams.core.CleanUpHandler
,adams.core.StatusMessageHandler
,adams.gui.core.MenuBarProvider
,adams.gui.event.DataChangeListener
,adams.gui.sendto.SendToActionSupporter
,adams.gui.visualization.container.ContainerListManager<InstanceContainerManager>
,ImageObserver
,MenuContainer
,Serializable
,Accessible
public class InstanceExplorer extends adams.gui.core.BasePanel implements adams.gui.core.MenuBarProvider, adams.core.StatusMessageHandler, adams.gui.visualization.container.ContainerListManager<InstanceContainerManager>, adams.gui.event.DataChangeListener, adams.core.CleanUpHandler, adams.gui.sendto.SendToActionSupporter
A panel for exploring Instances visually.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
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
FILENAME
the name of the props file.protected adams.gui.goe.GenericObjectEditorDialog
m_DialogColorProvider
the dialog for selecting the color provider.protected adams.gui.goe.GenericObjectEditorDialog
m_DialogPaintlet
the dialog for selecting the paintlet.protected HistogramFactory.SetupDialog
m_HistogramSetup
the dialog for the histogram setup.protected weka.gui.sql.SqlViewerDialog
m_LoadFromDatabaseDialog
the SQL viewer dialog.protected LoadDatasetDialog
m_LoadFromDiskDialog
the dialog for loading datasets.protected JMenuBar
m_MenuBar
the menu bar, if used.protected JMenuItem
m_MenuItemClearData
the clear data menu item.protected JMenu
m_MenuItemLoadRecent
the "load recent" submenu.protected JMenuItem
m_MenuItemViewAntiAliasing
the toggle anti-aliasing menu item.protected JMenuItem
m_MenuItemViewColorProvider
the color provider menu item.protected JMenuItem
m_MenuItemViewPaintlet
the paintlet menu item.protected JMenuItem
m_MenuItemViewZoomOverview
the toggle zoom overview menu item.protected JMenu
m_MenuView
the menu item for view related stuff.protected InstancePanel
m_PanelInstance
the panel for displaying.protected static adams.core.Properties
m_Properties
the properties.protected adams.gui.core.RecentFilesHandler<JMenu>
m_RecentFilesHandler
the recent files handler.protected adams.gui.visualization.report.ReportFactory.Panel
m_Reports
the reports.protected adams.gui.core.SearchPanel
m_SearchPanel
for searching the fields in the reports.protected adams.gui.core.BaseStatusBar
m_StatusBar
the status bar.protected adams.gui.core.BaseTabbedPane
m_TabbedPane
the tabbed pane for the data to display.static String
SESSION_FILE
the file to store the recent files in.-
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 InstanceExplorer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanUp()
Cleans up data structures, frees up memory.void
clearData()
Removes all the data.void
close()
closes the dialog/frame.void
dataChanged(adams.gui.event.DataChangeEvent e)
Gets called if the data of the instance panel has changed.InstanceContainerManager
getContainerManager()
Returns the current container manager.InstanceContainerList
getInstanceContainerList()
Returns the panel listing the instances.InstancePanel
getInstancePanel()
Returns the panel for painting the instances.JMenuBar
getMenuBar()
Creates a menu bar (singleton per panel object).static adams.core.Properties
getProperties()
Returns the properties that define the editor.Class[]
getSendToClasses()
Returns the classes that the supporter generates.Object
getSendToItem(Class[] cls)
Returns the object to send.JPanel
getSidePanel()
Returns the side panel.boolean
hasSendToItem(Class[] cls)
Checks whether something to send is available.protected void
initGUI()
Initializes the widgets.protected void
initialize()
Initializes the members.boolean
isSidePanelVisible()
Returns whether the side panel is visible or not.boolean
isZoomOverviewPanelVisible()
Returns whether the zoom overview panel is visible or not.protected void
loadData(weka.core.Instances dataset, List<InstanceContainer> data)
Loads the given data into the container manager.void
loadDataFromDatabase()
pops up SQL Viewer for SQL statement.void
loadDataFromDisk()
pops up file dialog for loading dataset form disk.void
loadDataFromDisk(File file)
pops up file dialog for loading dataset form disk.protected InstanceReportFactory.Panel
newReportPanel()
Creates a new tabbed pane for the reports.protected void
selectColorProvider()
Lets the user select a new color provider.protected void
selectPaintlet()
Lets the user select a new paintlet.void
setContainerManager(InstanceContainerManager value)
Sets the manager for handling the containers.void
setSidePanelVisible(boolean visible)
Whether to display the side panel or not.void
setZoomOverviewPanelVisible(boolean value)
Sets the zoom overview panel visible or not.void
showStatus(String msg)
Displays a message.protected void
updateMenu()
updates the enabled state of the menu items.-
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
-
FILENAME
public static final String FILENAME
the name of the props file.- See Also:
- Constant Field Values
-
SESSION_FILE
public static final String SESSION_FILE
the file to store the recent files in.- See Also:
- Constant Field Values
-
m_Properties
protected static adams.core.Properties m_Properties
the properties.
-
m_PanelInstance
protected InstancePanel m_PanelInstance
the panel for displaying.
-
m_StatusBar
protected adams.gui.core.BaseStatusBar m_StatusBar
the status bar.
-
m_MenuBar
protected JMenuBar m_MenuBar
the menu bar, if used.
-
m_MenuItemLoadRecent
protected JMenu m_MenuItemLoadRecent
the "load recent" submenu.
-
m_MenuView
protected JMenu m_MenuView
the menu item for view related stuff.
-
m_MenuItemViewZoomOverview
protected JMenuItem m_MenuItemViewZoomOverview
the toggle zoom overview menu item.
-
m_MenuItemViewAntiAliasing
protected JMenuItem m_MenuItemViewAntiAliasing
the toggle anti-aliasing menu item.
-
m_MenuItemViewColorProvider
protected JMenuItem m_MenuItemViewColorProvider
the color provider menu item.
-
m_MenuItemViewPaintlet
protected JMenuItem m_MenuItemViewPaintlet
the paintlet menu item.
-
m_MenuItemClearData
protected JMenuItem m_MenuItemClearData
the clear data menu item.
-
m_TabbedPane
protected adams.gui.core.BaseTabbedPane m_TabbedPane
the tabbed pane for the data to display.
-
m_Reports
protected adams.gui.visualization.report.ReportFactory.Panel m_Reports
the reports.
-
m_SearchPanel
protected adams.gui.core.SearchPanel m_SearchPanel
for searching the fields in the reports.
-
m_LoadFromDiskDialog
protected LoadDatasetDialog m_LoadFromDiskDialog
the dialog for loading datasets.
-
m_LoadFromDatabaseDialog
protected weka.gui.sql.SqlViewerDialog m_LoadFromDatabaseDialog
the SQL viewer dialog.
-
m_RecentFilesHandler
protected adams.gui.core.RecentFilesHandler<JMenu> m_RecentFilesHandler
the recent files handler.
-
m_HistogramSetup
protected HistogramFactory.SetupDialog m_HistogramSetup
the dialog for the histogram setup.
-
m_DialogColorProvider
protected adams.gui.goe.GenericObjectEditorDialog m_DialogColorProvider
the dialog for selecting the color provider.
-
m_DialogPaintlet
protected adams.gui.goe.GenericObjectEditorDialog m_DialogPaintlet
the dialog for selecting the paintlet.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initialize
in classadams.gui.core.BasePanel
-
initGUI
protected void initGUI()
Initializes the widgets.- Overrides:
initGUI
in classadams.gui.core.BasePanel
-
getInstancePanel
public InstancePanel getInstancePanel()
Returns the panel for painting the instances.- Returns:
- the panel
-
getInstanceContainerList
public InstanceContainerList getInstanceContainerList()
Returns the panel listing the instances.- Returns:
- the panel
-
showStatus
public void showStatus(String msg)
Displays a message.- Specified by:
showStatus
in interfaceadams.core.StatusMessageHandler
- Parameters:
msg
- the message to display
-
newReportPanel
protected InstanceReportFactory.Panel newReportPanel()
Creates a new tabbed pane for the reports.- Returns:
- the tabbed pane
-
dataChanged
public void dataChanged(adams.gui.event.DataChangeEvent e)
Gets called if the data of the instance panel has changed.- Specified by:
dataChanged
in interfaceadams.gui.event.DataChangeListener
- Parameters:
e
- the event that the instance panel sent
-
getContainerManager
public InstanceContainerManager getContainerManager()
Returns the current container manager.- Specified by:
getContainerManager
in interfaceadams.gui.visualization.container.ContainerListManager<InstanceContainerManager>
- Returns:
- the manager
-
setContainerManager
public void setContainerManager(InstanceContainerManager value)
Sets the manager for handling the containers.- Specified by:
setContainerManager
in interfaceadams.gui.visualization.container.ContainerListManager<InstanceContainerManager>
- Parameters:
value
- the manager
-
updateMenu
protected void updateMenu()
updates the enabled state of the menu items.
-
getMenuBar
public JMenuBar getMenuBar()
Creates a menu bar (singleton per panel object). Can be used in frames.- Specified by:
getMenuBar
in interfaceadams.gui.core.MenuBarProvider
- Returns:
- the menu bar
-
clearData
public void clearData()
Removes all the data.
-
loadDataFromDatabase
public void loadDataFromDatabase()
pops up SQL Viewer for SQL statement.
-
loadDataFromDisk
public void loadDataFromDisk()
pops up file dialog for loading dataset form disk.
-
loadDataFromDisk
public void loadDataFromDisk(File file)
pops up file dialog for loading dataset form disk.- Parameters:
file
- an optional file, use null to ignore
-
loadData
protected void loadData(weka.core.Instances dataset, List<InstanceContainer> data)
Loads the given data into the container manager.- Parameters:
dataset
- the datasetdata
- the data to add to the manager
-
close
public void close()
closes the dialog/frame.
-
setSidePanelVisible
public void setSidePanelVisible(boolean visible)
Whether to display the side panel or not.- Parameters:
visible
- if true, then the side panel will be displayed
-
isSidePanelVisible
public boolean isSidePanelVisible()
Returns whether the side panel is visible or not.- Returns:
- true if the side panel is visible
-
getSidePanel
public JPanel getSidePanel()
Returns the side panel.- Returns:
- the side panel
-
setZoomOverviewPanelVisible
public void setZoomOverviewPanelVisible(boolean value)
Sets the zoom overview panel visible or not.- Parameters:
value
- if true then the panel is visible
-
isZoomOverviewPanelVisible
public boolean isZoomOverviewPanelVisible()
Returns whether the zoom overview panel is visible or not.- Returns:
- true if visible
-
selectColorProvider
protected void selectColorProvider()
Lets the user select a new color provider.
-
selectPaintlet
protected void selectPaintlet()
Lets the user select a new paintlet.
-
getSendToClasses
public Class[] getSendToClasses()
Returns the classes that the supporter generates.- Specified by:
getSendToClasses
in interfaceadams.gui.sendto.SendToActionSupporter
- Returns:
- the classes
-
hasSendToItem
public boolean hasSendToItem(Class[] cls)
Checks whether something to send is available.- Specified by:
hasSendToItem
in interfaceadams.gui.sendto.SendToActionSupporter
- Parameters:
cls
- the classes to retrieve an item for- Returns:
- true if an object is available for sending
-
getSendToItem
public Object getSendToItem(Class[] cls)
Returns the object to send.- Specified by:
getSendToItem
in interfaceadams.gui.sendto.SendToActionSupporter
- Parameters:
cls
- the classes to retrieve the item for- Returns:
- the item to send
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUp
in interfaceadams.core.CleanUpHandler
-
getProperties
public static adams.core.Properties getProperties()
Returns the properties that define the editor.- Returns:
- the properties
-
-