adams.gui.visualization.heatmap
Class HeatmapViewerPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by adams.gui.core.BasePanel
                      extended by adams.gui.visualization.heatmap.HeatmapViewerPanel
All Implemented Interfaces:
StatusMessageHandler, MenuBarProvider, FilterListener<Heatmap>, SendToActionSupporter, ImageObserver, MenuContainer, Serializable, Accessible

public class HeatmapViewerPanel
extends BasePanel
implements MenuBarProvider, StatusMessageHandler, FilterListener<Heatmap>, SendToActionSupporter

Panel for viewing/processing heatmaps.

Version:
$Revision: 6167 $
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
protected  AbstractFilter<Heatmap> m_CurrentFilter
          the current filter.
protected  FilterDialog m_DialogFilter
          the filter dialog.
protected  HeatmapFileChooser m_FileChooser
          for loading heatmaps from disk.
protected  boolean m_FilterAll
          indicates whether filter is applied to all heatmaps.
protected  boolean m_FilterOverlayOriginalData
          indicates whether the filtered data was overlayed over the original.
protected  JMenuBar m_MenuBar
          the menu bar.
protected  JMenuItem m_MenuItemFileCloseAll
          the "close all" menu item.
protected  JMenuItem m_MenuItemFileCloseCurrent
          the "close current" menu item.
protected  JMenuItem m_MenuItemFileReloadAll
          the "reload all" menu item.
protected  JMenuItem m_MenuItemFileReloadCurrent
          the "reload current" menu item.
protected  JMenuItem m_MenuItemFileSaveAs
          the "save as" menu item.
protected  JMenuItem m_MenuItemProcessApplyImageJ
          the ImageJ menu item.
protected  JMenuItem m_MenuItemProcessApplyImageMagick
          the ImageMagick menu item.
protected  JMenuItem m_MenuItemProcessApplyJAI
          the JAI menu item.
protected  JMenuItem m_MenuItemProcessFilterAllHeatmaps
          the filter all menu item.
protected  JMenuItem m_MenuItemProcessFilterHeatmap
          the filter menu item.
protected  JMenuItem m_MenuItemViewShowCentroid
          the show centroid menu item.
protected  JMenuItem m_MenuItemViewShowNotes
          the show notes menu item.
protected  JMenuItem m_MenuItemViewShowSpreadsheet
          the show spreadhseet menu item.
protected  JMenuItem m_MenuItemViewShowStatistics
          the show statistics menu item.
protected static Properties m_Properties
          the setup for the panel.
protected  SearchPanel m_SearchPanel
          the search panel for the heatmap report.
protected  BaseStatusBar m_StatusBar
          the status bar.
protected  BaseTabbedPane m_TabbedPane
          the tabbed pane for the heatmaps.
static String SESSION_FILE
          the file to store the recent files in.
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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
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
HeatmapViewerPanel()
           
 
Method Summary
protected  void applyImageFilter(HeatmapPanel panel, AbstractImageFilter filter)
          Applies the image filter to the heatmap image.
protected  void applyImageJ(HeatmapPanel panel)
          Applies ImageJ to the heatmap images.
protected  void applyImageMagick(HeatmapPanel panel)
          Applies ImageMagick to the heatmap images.
protected  void applyJAI(HeatmapPanel panel)
          Applies JAI to the heatmap images.
 void close()
          closes the dialog/frame.
 void closeAll()
          Removes all the data.
 void closeCurrent()
          Removes the current tab.
protected  void filter()
          pops up GOE dialog for filter.
 void filter(FilterEvent<Heatmap> e)
          Filters the data.
 HeatmapPanel getCurrentPanel()
          Returns the currently selected heatmap panel.
 JMenuBar getMenuBar()
          Creates a menu bar (singleton per panel object).
 HeatmapPanel getPanelAt(int index)
          Returns the specified heatmap panel.
 Properties getProperties()
          Returns the properties for this panel.
 Class[] getSendToClasses()
          Returns the classes that the supporter generates.
 Object getSendToItem(Class[] cls)
          Returns the object to send.
 boolean hasSendToItem(Class[] cls)
          Checks whether something to send is available.
protected  void initGUI()
          Initializes the widgets.
protected  void initialize()
          Initializes the members.
 void load()
          Loads heatmaps from disk, popping up a file chooser dialog.
 void load(File file)
          Loads the specified file from disk.
 void load(File[] files, AbstractHeatmapReader reader)
          Loads heatmaps from disk, popping up a file chooser dialog.
protected  HeatmapPanel newPanel(Heatmap map)
          Creates a new panel and configures it.
protected  void reloadAll()
          Reloads all heatmaps.
protected  void reloadCurrent()
          Reloads the current panel's heatmap.
protected  void saveAs()
          Saves the current heatmap to disk.
 void search(String text, boolean isRegExp)
          Performs a search.
 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, main, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, transferFocusBackward, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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 Properties m_Properties
the setup for the panel.


m_TabbedPane

protected BaseTabbedPane m_TabbedPane
the tabbed pane for the heatmaps.


m_StatusBar

protected BaseStatusBar m_StatusBar
the status bar.


m_MenuBar

protected JMenuBar m_MenuBar
the menu bar.


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_MenuItemProcessApplyImageJ

protected JMenuItem m_MenuItemProcessApplyImageJ
the ImageJ menu item.


m_MenuItemProcessApplyJAI

protected JMenuItem m_MenuItemProcessApplyJAI
the JAI menu item.


m_MenuItemProcessApplyImageMagick

protected JMenuItem m_MenuItemProcessApplyImageMagick
the ImageMagick menu item.


m_MenuItemViewShowCentroid

protected JMenuItem m_MenuItemViewShowCentroid
the show centroid menu item.


m_MenuItemViewShowSpreadsheet

protected JMenuItem m_MenuItemViewShowSpreadsheet
the show spreadhseet menu item.


m_MenuItemViewShowStatistics

protected JMenuItem m_MenuItemViewShowStatistics
the show statistics menu item.


m_MenuItemViewShowNotes

protected JMenuItem m_MenuItemViewShowNotes
the show notes menu item.


m_FileChooser

protected HeatmapFileChooser m_FileChooser
for loading heatmaps from disk.


m_CurrentFilter

protected AbstractFilter<Heatmap> m_CurrentFilter
the current filter.


m_DialogFilter

protected 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_SearchPanel

protected SearchPanel m_SearchPanel
the search panel for the heatmap report.

Constructor Detail

HeatmapViewerPanel

public HeatmapViewerPanel()
Method Detail

initialize

protected void initialize()
Initializes the members.

Overrides:
initialize in class BasePanel

initGUI

protected void initGUI()
Initializes the widgets.

Overrides:
initGUI in class BasePanel

getMenuBar

public JMenuBar getMenuBar()
Creates a menu bar (singleton per panel object). Can be used in frames.

Specified by:
getMenuBar in interface MenuBarProvider
Returns:
the menu bar

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.

Returns:
the panel, null if none selected

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

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(FilterEvent<Heatmap> e)
Filters the data.

Specified by:
filter in interface FilterListener<Heatmap>
Parameters:
e - the event

applyImageFilter

protected void applyImageFilter(HeatmapPanel panel,
                                AbstractImageFilter filter)
Applies the image filter to the heatmap image.

Parameters:
panel - the panel's image to process
filter - the image filter to apply

applyImageJ

protected void applyImageJ(HeatmapPanel panel)
Applies ImageJ to the heatmap images.

Parameters:
panel - the heatmap image to process

applyJAI

protected void applyJAI(HeatmapPanel panel)
Applies JAI to the heatmap images.

Parameters:
panel - the heatmap image to process

applyImageMagick

protected void applyImageMagick(HeatmapPanel panel)
Applies ImageMagick to the heatmap images.

Parameters:
panel - the heatmap image to process

search

public void search(String text,
                   boolean isRegExp)
Performs a search.

Parameters:
text - the search text
isRegExp - whether the search text is a regular expression

showStatus

public void showStatus(String msg)
Displays a message.

Specified by:
showStatus in interface StatusMessageHandler
Parameters:
msg - the message to display

getSendToClasses

public Class[] getSendToClasses()
Returns the classes that the supporter generates.

Specified by:
getSendToClasses in interface SendToActionSupporter
Returns:
the classes

hasSendToItem

public boolean hasSendToItem(Class[] cls)
Checks whether something to send is available.

Specified by:
hasSendToItem in interface 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 interface SendToActionSupporter
Parameters:
cls - the classes to retrieve the item for
Returns:
the item to send

getProperties

public Properties getProperties()
Returns the properties for this panel.

Returns:
the properties file for this panel


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.