Package adams.gui.visualization.heatmap
Class HeatmapViewerPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.visualization.heatmap.HeatmapViewerPanel
-
- All Implemented Interfaces:
adams.core.CleanUpHandler,adams.core.StatusMessageHandler,adams.gui.core.MenuBarProvider,adams.gui.event.FilterListener<Heatmap>,adams.gui.plugin.ToolPluginSupporter<HeatmapPanel>,adams.gui.sendto.SendToActionSupporter,ImageObserver,MenuContainer,Serializable,Accessible
public class HeatmapViewerPanel extends adams.gui.core.BasePanel implements adams.gui.core.MenuBarProvider, adams.core.StatusMessageHandler, adams.gui.event.FilterListener<Heatmap>, adams.gui.sendto.SendToActionSupporter, adams.core.CleanUpHandler, adams.gui.plugin.ToolPluginSupporter<HeatmapPanel>
Panel for viewing/processing heatmaps.- 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 protected adams.data.filter.Filter<Heatmap>m_CurrentFilterthe current filter.protected adams.gui.goe.GenericObjectEditorDialogm_DialogColorGeneratorthe dialog for selecting the color provider.protected adams.gui.visualization.container.FilterDialogm_DialogFilterthe filter dialog.protected adams.gui.chooser.BaseColorChooserm_DialogMissingValueColorthe dialog for selecting the missing value color.protected adams.gui.goe.GenericObjectEditorDialogm_DialogOverlaythe dialog for selecting an overlay.protected adams.gui.goe.GenericObjectEditorDialogm_DialogSelectionProcessorthe dialog for selecting an selection processor.protected HeatmapFileChooserm_FileChooserfor loading heatmaps from disk.protected booleanm_FilterAllindicates whether filter is applied to all heatmaps.protected booleanm_FilterOverlayOriginalDataindicates whether the filtered data was overlayed over the original.protected JMenuBarm_MenuBarthe menu bar.protected JMenuItemm_MenuItemFileCloseAllthe "close all" menu item.protected JMenuItemm_MenuItemFileCloseCurrentthe "close current" menu item.protected JMenum_MenuItemFileOpenRecentthe "load recent" submenu.protected JMenuItemm_MenuItemFileReloadAllthe "reload all" menu item.protected JMenuItemm_MenuItemFileReloadCurrentthe "reload current" menu item.protected JMenuItemm_MenuItemFileSaveAsthe "save as" menu item.protected JMenuItemm_MenuItemProcessFilterAllHeatmapsthe filter all menu item.protected JMenuItemm_MenuItemProcessFilterHeatmapthe filter menu item.protected JMenuItemm_MenuItemViewAddOverlaythe add overlay menu item.protected JMenuItemm_MenuItemViewAddSelectionProcessorthe selection processor menu item.protected JMenuItemm_MenuItemViewApplyAllwhether to apply overlay changes to all panels.protected JMenuItemm_MenuItemViewColorGeneratorthe color generator menu item.protected JMenuItemm_MenuItemViewMissingValueColorthe missing value color menu item.protected JMenuItemm_MenuItemViewRemoveOverlaysthe remove overlays menu item.protected JMenuItemm_MenuItemViewRemoveSelectionProcessorsthe remove selection processors menu item.protected JMenuItemm_MenuItemViewZoomInthe menu item "zoom in".protected JMenuItemm_MenuItemViewZoomOutthe menu item "zoom out".protected JMenum_MenuViewZoomthe menu "zoom".protected adams.gui.core.MultiPagePanem_MultiPagePanethe tabbed pane for the heatmaps.protected HeatmapViewerPluginManagerm_PluginManagermanages the plugins.protected static adams.core.Propertiesm_Propertiesthe setup for the panel.protected adams.gui.core.RecentFilesHandlerWithCommandline<JMenu>m_RecentFilesHandlerthe recent files handler.protected adams.gui.core.SearchPanelm_SearchPanelthe search panel for the heatmap report.protected adams.gui.core.BaseStatusBarm_StatusBarthe status bar.static StringSESSION_FILEthe 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 HeatmapViewerPanel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()Cleans up data structures, frees up memory.voidclose()closes the dialog/frame.voidcloseAll()Removes all the data.voidcloseCurrent()Removes the current tab.protected voidfilter()pops up GOE dialog for filter.voidfilter(adams.gui.event.FilterEvent<Heatmap> e)Filters the data.HeatmapPanel[]getAllPanels()Returns the all panels.HeatmapPanelgetCurrentPanel()Returns the currently selected heatmap panel.JMenuBargetMenuBar()Creates a menu bar (singleton per panel object).HeatmapPanelgetPanelAt(int index)Returns the specified heatmap panel.intgetPanelCount()Returns the number of panels open.adams.core.PropertiesgetProperties()Returns the properties for this panel.Class[]getSendToClasses()Returns the classes that the supporter generates.ObjectgetSendToItem(Class[] cls)Returns the object to send.booleanhasSendToItem(Class[] cls)Checks whether something to send is available.protected voidinitGUI()Initializes the widgets.protected voidinitialize()Initializes the members.voidload()Loads heatmaps from disk, popping up a file chooser dialog.voidload(File file)Loads the specified file from disk.voidload(File[] files, AbstractHeatmapReader reader)Loads heatmaps from disk, popping up a file chooser dialog.protected HeatmapPanelnewPanel(Heatmap map)Creates a new panel and configures it.voidnewTab(Heatmap map, String comment)Adds a new tab using the heatmap and adds the comment to the log.protected voidreloadAll()Reloads all heatmaps.protected voidreloadCurrent()Reloads the current panel's heatmap.protected voidsaveAs()Saves the current heatmap to disk.voidsearch(String text, boolean isRegExp)Performs a search.protected voidselectColorGenerator()Lets the user select a new color generator.protected voidselectMissingValueColor()Shows a color dialog for selecting the color representing missing values.protected AbstractHeatmapOverlayselectOverlay()Lets the user select an overlay from a dialog.protected AbstractSelectionProcessorselectSelectionProcessor()Lets the user select a selection processor from a dialog.voidshowStatus(String msg)Displays a message.protected voidupdateMenu()updates the enabled state of the menu items.protected voidzoom(int zoom)Zooms in/out.-
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
-
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 setup for the panel.
-
m_MultiPagePane
protected adams.gui.core.MultiPagePane m_MultiPagePane
the tabbed pane for the heatmaps.
-
m_StatusBar
protected adams.gui.core.BaseStatusBar m_StatusBar
the status bar.
-
m_MenuBar
protected JMenuBar m_MenuBar
the menu bar.
-
m_MenuItemFileOpenRecent
protected JMenu m_MenuItemFileOpenRecent
the "load recent" submenu.
-
m_MenuItemFileReloadCurrent
protected JMenuItem m_MenuItemFileReloadCurrent
the "reload current" menu item.
-
m_MenuItemFileReloadAll
protected JMenuItem m_MenuItemFileReloadAll
the "reload all" menu item.
-
m_MenuItemFileSaveAs
protected JMenuItem m_MenuItemFileSaveAs
the "save as" menu item.
-
m_MenuItemFileCloseCurrent
protected JMenuItem m_MenuItemFileCloseCurrent
the "close current" menu item.
-
m_MenuItemFileCloseAll
protected JMenuItem m_MenuItemFileCloseAll
the "close all" menu item.
-
m_MenuItemProcessFilterHeatmap
protected JMenuItem m_MenuItemProcessFilterHeatmap
the filter menu item.
-
m_MenuItemProcessFilterAllHeatmaps
protected JMenuItem m_MenuItemProcessFilterAllHeatmaps
the filter all menu item.
-
m_MenuItemViewApplyAll
protected JMenuItem m_MenuItemViewApplyAll
whether to apply overlay changes to all panels.
-
m_MenuItemViewRemoveOverlays
protected JMenuItem m_MenuItemViewRemoveOverlays
the remove overlays menu item.
-
m_MenuItemViewAddOverlay
protected JMenuItem m_MenuItemViewAddOverlay
the add overlay menu item.
-
m_MenuItemViewRemoveSelectionProcessors
protected JMenuItem m_MenuItemViewRemoveSelectionProcessors
the remove selection processors menu item.
-
m_MenuItemViewAddSelectionProcessor
protected JMenuItem m_MenuItemViewAddSelectionProcessor
the selection processor menu item.
-
m_MenuViewZoom
protected JMenu m_MenuViewZoom
the menu "zoom".
-
m_MenuItemViewZoomIn
protected JMenuItem m_MenuItemViewZoomIn
the menu item "zoom in".
-
m_MenuItemViewZoomOut
protected JMenuItem m_MenuItemViewZoomOut
the menu item "zoom out".
-
m_MenuItemViewColorGenerator
protected JMenuItem m_MenuItemViewColorGenerator
the color generator menu item.
-
m_MenuItemViewMissingValueColor
protected JMenuItem m_MenuItemViewMissingValueColor
the missing value color menu item.
-
m_PluginManager
protected HeatmapViewerPluginManager m_PluginManager
manages the plugins.
-
m_FileChooser
protected HeatmapFileChooser m_FileChooser
for loading heatmaps from disk.
-
m_CurrentFilter
protected adams.data.filter.Filter<Heatmap> m_CurrentFilter
the current filter.
-
m_DialogFilter
protected adams.gui.visualization.container.FilterDialog m_DialogFilter
the filter dialog.
-
m_FilterOverlayOriginalData
protected boolean m_FilterOverlayOriginalData
indicates whether the filtered data was overlayed over the original.
-
m_FilterAll
protected boolean m_FilterAll
indicates whether filter is applied to all heatmaps.
-
m_DialogOverlay
protected adams.gui.goe.GenericObjectEditorDialog m_DialogOverlay
the dialog for selecting an overlay.
-
m_DialogSelectionProcessor
protected adams.gui.goe.GenericObjectEditorDialog m_DialogSelectionProcessor
the dialog for selecting an selection processor.
-
m_SearchPanel
protected adams.gui.core.SearchPanel m_SearchPanel
the search panel for the heatmap report.
-
m_DialogColorGenerator
protected adams.gui.goe.GenericObjectEditorDialog m_DialogColorGenerator
the dialog for selecting the color provider.
-
m_DialogMissingValueColor
protected adams.gui.chooser.BaseColorChooser m_DialogMissingValueColor
the dialog for selecting the missing value color.
-
m_RecentFilesHandler
protected adams.gui.core.RecentFilesHandlerWithCommandline<JMenu> m_RecentFilesHandler
the recent files handler.
-
-
Method Detail
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classadams.gui.core.BasePanel
-
initGUI
protected void initGUI()
Initializes the widgets.- Overrides:
initGUIin classadams.gui.core.BasePanel
-
getMenuBar
public JMenuBar getMenuBar()
Creates a menu bar (singleton per panel object). Can be used in frames.- Specified by:
getMenuBarin interfaceadams.gui.core.MenuBarProvider- Returns:
- the menu bar
-
getPanelCount
public int getPanelCount()
Returns the number of panels open.- Returns:
- the number of panels
-
getPanelAt
public HeatmapPanel getPanelAt(int index)
Returns the specified heatmap panel.- Parameters:
index- the index of the panel- Returns:
- the panel, null if invalid index
-
getCurrentPanel
public HeatmapPanel getCurrentPanel()
Returns the currently selected heatmap panel.- Specified by:
getCurrentPanelin interfaceadams.gui.plugin.ToolPluginSupporter<HeatmapPanel>- Returns:
- the panel, null if none selected
-
getAllPanels
public HeatmapPanel[] getAllPanels()
Returns the all panels.- Returns:
- the panels
-
updateMenu
protected void updateMenu()
updates the enabled state of the menu items.
-
reloadCurrent
protected void reloadCurrent()
Reloads the current panel's heatmap.
-
reloadAll
protected void reloadAll()
Reloads all heatmaps.
-
closeCurrent
public void closeCurrent()
Removes the current tab.
-
closeAll
public void closeAll()
Removes all the data.
-
newPanel
protected HeatmapPanel newPanel(Heatmap map)
Creates a new panel and configures it.- Parameters:
map- the map to create the panel for- Returns:
- the panel
-
newTab
public void newTab(Heatmap map, String comment)
Adds a new tab using the heatmap and adds the comment to the log.- Parameters:
map- the map to add in a new tabcomment- the log comment
-
load
public void load(File[] files, AbstractHeatmapReader reader)
Loads heatmaps from disk, popping up a file chooser dialog.
-
load
public void load(File file)
Loads the specified file from disk. If no reader can be determined, the
-
load
public void load()
Loads heatmaps from disk, popping up a file chooser dialog.
-
saveAs
protected void saveAs()
Saves the current heatmap to disk.
-
close
public void close()
closes the dialog/frame.
-
filter
protected void filter()
pops up GOE dialog for filter.
-
filter
public void filter(adams.gui.event.FilterEvent<Heatmap> e)
Filters the data.- Specified by:
filterin interfaceadams.gui.event.FilterListener<Heatmap>- Parameters:
e- the event
-
search
public void search(String text, boolean isRegExp)
Performs a search.- Parameters:
text- the search textisRegExp- whether the search text is a regular expression
-
zoom
protected void zoom(int zoom)
Zooms in/out.- Parameters:
zoom- the zoom (in percent)
-
selectOverlay
protected AbstractHeatmapOverlay selectOverlay()
Lets the user select an overlay from a dialog. Returns the overlay if successfully selected (ie not dialog aborted).- Returns:
- the selected overlay, null if none selected
-
selectSelectionProcessor
protected AbstractSelectionProcessor selectSelectionProcessor()
Lets the user select a selection processor from a dialog. Returns the selection processor if successfully chosen (ie not dialog aborted).- Returns:
- the chosen selection processor, null if none selected
-
selectColorGenerator
protected void selectColorGenerator()
Lets the user select a new color generator.
-
selectMissingValueColor
protected void selectMissingValueColor()
Shows a color dialog for selecting the color representing missing values.
-
showStatus
public void showStatus(String msg)
Displays a message.- Specified by:
showStatusin interfaceadams.core.StatusMessageHandler- Parameters:
msg- the message to display
-
getSendToClasses
public Class[] getSendToClasses()
Returns the classes that the supporter generates.- Specified by:
getSendToClassesin interfaceadams.gui.sendto.SendToActionSupporter- Returns:
- the classes
-
hasSendToItem
public boolean hasSendToItem(Class[] cls)
Checks whether something to send is available.- Specified by:
hasSendToItemin 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:
getSendToItemin interfaceadams.gui.sendto.SendToActionSupporter- Parameters:
cls- the classes to retrieve the item for- Returns:
- the item to send
-
getProperties
public adams.core.Properties getProperties()
Returns the properties for this panel.- Returns:
- the properties file for this panel
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUpin interfaceadams.core.CleanUpHandler
-
-