Class ThreeWayDataHeatmapPanel
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- adams.gui.core.BasePanel
-
- adams.gui.visualization.threewaydata.heatmapviewer.ThreeWayDataHeatmapPanel
-
- All Implemented Interfaces:
adams.core.CleanUpHandler
,ImageObserver
,MenuContainer
,Serializable
,Accessible
public class ThreeWayDataHeatmapPanel extends adams.gui.core.BasePanel implements adams.core.CleanUpHandler
Panel for displaying a single 3-way data structure.- 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.gui.visualization.core.ColorGradientGenerator
m_ColorGenerator
the color generator to use.protected File
m_CurrentFile
the current file.protected ThreeWayData
m_Data
the data on display.protected adams.gui.visualization.image.ImagePanel
m_DataImage
the panel for displaying the data as image.protected Map<Double,BufferedImage>
m_ImageCache
for caching the generated images.protected adams.gui.core.BaseList
m_ListX
the list for selecting the X layer.protected Color
m_MissingValueColor
the color to use for missing values.protected ThreeWayDataHeatmapViewerPanel
m_Owner
the owner.protected static adams.core.Properties
m_Properties
the setup for the panel.protected adams.gui.visualization.report.ReportFactory.Table
m_ReportTable
the report of the data.protected adams.gui.core.SearchPanel
m_SearchPanel
the search panel for the data report.protected adams.gui.core.BaseSplitPane
m_SplitPaneAll
the split pane for X-list and split pane on right.protected adams.gui.core.BaseSplitPane
m_SplitPaneRight
the split pane for image/spreadsheet and report.-
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 ThreeWayDataHeatmapPanel(ThreeWayDataHeatmapViewerPanel owner)
Initializes the panel.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addOverlay(AbstractThreeWayDataOverlay overlay)
Adds the heatmap overlay.void
cleanUp()
Cleans up data structures, frees up memory.protected void
clearImageCache()
Clears the image cache.adams.gui.visualization.core.ColorGradientGenerator
getColorGenerator()
Returns the generator for the color gradient.File
getCurrentFile()
Returns the current file.ThreeWayData
getData()
The current data on display.adams.gui.visualization.image.ImagePanel
getImagePanel()
Returns the underlying image panelColor
getMissingValueColor()
Returns the color to use for missing values.ThreeWayDataHeatmapViewerPanel
getOwner()
Returns the owner.static adams.core.Properties
getProperties()
Returns the properties for this panel.String
getTitle()
Returns the database ID or filename as title.double
getZoom()
Returns the zoom factor (0-16).protected void
initGUI()
Initializes the widgets.protected void
initialize()
Initializes the members.boolean
isReportVisible()
Returns whether the report table is visible.boolean
isSearchPanelVisible()
Returns whether the search panel is visible.protected String
refresh()
Regenerates the image of the current heatmap and redisplays it.void
removeOverlays()
Removes all overlays.void
search(String text, boolean isRegExp)
Performs a search.void
setColorGenerator(adams.gui.visualization.core.ColorGradientGenerator value)
Sets the generator for the color gradient.void
setCurrentFile(File value)
Sets the current file.void
setData(ThreeWayData value)
Sets the data to display.void
setMissingValueColor(Color value)
Sets the color to use for missing values.void
setReportVisible(boolean value)
Sets the visibility state of the report table.void
setSearchPanelVisible(boolean value)
Sets whether to display the search panel or not.void
setZoom(double zoom)
Sets the zoom factor (0-16).-
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
-
m_Properties
protected static adams.core.Properties m_Properties
the setup for the panel.
-
m_Owner
protected ThreeWayDataHeatmapViewerPanel m_Owner
the owner.
-
m_Data
protected ThreeWayData m_Data
the data on display.
-
m_DataImage
protected adams.gui.visualization.image.ImagePanel m_DataImage
the panel for displaying the data as image.
-
m_ReportTable
protected adams.gui.visualization.report.ReportFactory.Table m_ReportTable
the report of the data.
-
m_SearchPanel
protected adams.gui.core.SearchPanel m_SearchPanel
the search panel for the data report.
-
m_SplitPaneAll
protected adams.gui.core.BaseSplitPane m_SplitPaneAll
the split pane for X-list and split pane on right.
-
m_SplitPaneRight
protected adams.gui.core.BaseSplitPane m_SplitPaneRight
the split pane for image/spreadsheet and report.
-
m_ColorGenerator
protected adams.gui.visualization.core.ColorGradientGenerator m_ColorGenerator
the color generator to use.
-
m_MissingValueColor
protected Color m_MissingValueColor
the color to use for missing values.
-
m_ListX
protected adams.gui.core.BaseList m_ListX
the list for selecting the X layer.
-
m_CurrentFile
protected File m_CurrentFile
the current file.
-
m_ImageCache
protected Map<Double,BufferedImage> m_ImageCache
for caching the generated images.
-
-
Constructor Detail
-
ThreeWayDataHeatmapPanel
public ThreeWayDataHeatmapPanel(ThreeWayDataHeatmapViewerPanel owner)
Initializes the panel.- Parameters:
owner
- the owner
-
-
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
-
getOwner
public ThreeWayDataHeatmapViewerPanel getOwner()
Returns the owner.- Returns:
- the owner
-
refresh
protected String refresh()
Regenerates the image of the current heatmap and redisplays it.- Returns:
- null if everything OK, otherwise error message
-
setData
public void setData(ThreeWayData value)
Sets the data to display.- Parameters:
value
- the data to display
-
getData
public ThreeWayData getData()
The current data on display.- Returns:
- the data on display
-
setCurrentFile
public void setCurrentFile(File value)
Sets the current file.- Parameters:
value
- the file to use
-
getCurrentFile
public File getCurrentFile()
Returns the current file.- Returns:
- the file, null if none set
-
setColorGenerator
public void setColorGenerator(adams.gui.visualization.core.ColorGradientGenerator value)
Sets the generator for the color gradient.- Parameters:
value
- the generator
-
getColorGenerator
public adams.gui.visualization.core.ColorGradientGenerator getColorGenerator()
Returns the generator for the color gradient.- Returns:
- the generator
-
addOverlay
public void addOverlay(AbstractThreeWayDataOverlay overlay)
Adds the heatmap overlay.- Parameters:
overlay
- the overlay to add
-
removeOverlays
public void removeOverlays()
Removes all overlays.
-
setMissingValueColor
public void setMissingValueColor(Color value)
Sets the color to use for missing values.- Parameters:
value
- the color
-
getMissingValueColor
public Color getMissingValueColor()
Returns the color to use for missing values.- Returns:
- the color
-
getTitle
public String getTitle()
Returns the database ID or filename as title.- Returns:
- the title
-
getImagePanel
public adams.gui.visualization.image.ImagePanel getImagePanel()
Returns the underlying image panel- Returns:
- the panel
-
search
public void search(String text, boolean isRegExp)
Performs a search.- Parameters:
text
- the search textisRegExp
- whether the search text is a regular expression
-
setSearchPanelVisible
public void setSearchPanelVisible(boolean value)
Sets whether to display the search panel or not.- Parameters:
value
- if true then the search panel is displayed
-
isSearchPanelVisible
public boolean isSearchPanelVisible()
Returns whether the search panel is visible.- Returns:
- true if the search panel is visible
-
getProperties
public static adams.core.Properties getProperties()
Returns the properties for this panel.- Returns:
- the properties file for this panel
-
setZoom
public void setZoom(double zoom)
Sets the zoom factor (0-16). Use -1 to fit inside panel.- Parameters:
zoom
- the zoom factor
-
getZoom
public double getZoom()
Returns the zoom factor (0-16).- Returns:
- the zoom factor
-
isReportVisible
public boolean isReportVisible()
Returns whether the report table is visible.- Returns:
- true if visible
-
setReportVisible
public void setReportVisible(boolean value)
Sets the visibility state of the report table.- Parameters:
value
- true if visible
-
clearImageCache
protected void clearImageCache()
Clears the image cache.
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUp
in interfaceadams.core.CleanUpHandler
-
-