Class Heatmap
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
cz.fidentis.analyst.gui.elements.heatmaptable.Heatmap
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
A colored interactive heatmap table
- See Also:
-
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
FieldsFields 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
ConstructorsConstructorDescriptionHeatmap
(ProjectPanel projectPanel, double panelHeight, double panelWidth, Task task, List<FaceNodeInfo> faceNodeInfoList, TaskService taskService, BatchDistanceHeatmapPanel distanceHeatmapPanel) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds dendrogramboolean
Checks if heatmap headers are visibleint
Gets column modelint
getCorrespondingColIndex
(int row) Get a column index of the corresponding row from the tableint
getCorrespondingRowIndex
(int col) Get a row index of the corresponding column from the tableGets dendrogramGets names of faces that were left (were not hidden) in the heatmapint
Gets number of pixels the longest cluster short nam takesGets mouse column handlerGets pop up menuGets row headerGets row header tableGets heatmap scroll paneldouble[][]
Gets distances of faces that are left (were not hidden) in the heatmapgetTable()
Gets tablevoid
initializeTable
(boolean createRowHeader) Initialise the table to default settings as after loading the databoolean
Gets an info if the heatmap table is visibleprotected void
openNewTask
(int clickedRow, int clickedCol, boolean openFirstFace, boolean openSecondFace) void
removeColumn
(TableColumnModel columnModel, TableColumn removedColumn, FaceNodeInfo colHeaderData) Removes clicked column, adds it to a list of removed rows/columns and resets the table sizevoid
Removes dendrogramvoid
removeRow
(int removedRow, FaceNodeInfo rowHeaderData) Removes clicked row, adds it to a list of removed rows/columns and resets the table sizevoid
Clears datasets about removed facesvoid
resort()
Resorts rows and columns as they were sorted by clustering algorithmvoid
returnColumnToTable
(String returningData) Returns wanted column to the heatmap tablevoid
returnRowToTable
(String returningData) Returns wanted row to the heatmap tablevoid
Saves values of their cells to corresponding cellvoid
setBiggestDistance
(double biggestDistance) Sets biggest distance value of the whole heatmap tablevoid
Resets the clicked column header index to -1void
Resets the clicked row and column index to -1void
setDistances
(double[][] distances) Sets distancesvoid
Sets heatmap table not visiblevoid
Sets heatmap table visiblevoid
Sets heatmap table visiblevoid
setNodeData
(List<FaceNodeInfo> faceNodeInfoList) Sets node datavoid
setOriginalNodeData
(List<FaceNodeInfo> faceNodeInfoList) Sets original node data to the same value as node data when createdvoid
setPanelHeightWidth
(int height, int width) Sets height and width to local valuesvoid
setRootNode
(ClusterNode rootNode) Sets rootvoid
Sets the table size according to its values - if values are overflowing the heatmap table, the scroll panes activatevoid
Sets text in headers invisiblevoid
Sets text in headers visibleMethods 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, paintComponent, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printComponent, printChildren, 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, setVisible, 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, 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, checkImage, checkImage, 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 Details
-
OUT_OF_RANGE_INDEX
public static final int OUT_OF_RANGE_INDEX- See Also:
-
-
Constructor Details
-
Heatmap
public Heatmap(ProjectPanel projectPanel, double panelHeight, double panelWidth, Task task, List<FaceNodeInfo> faceNodeInfoList, TaskService taskService, BatchDistanceHeatmapPanel distanceHeatmapPanel) Constructor- Parameters:
panelHeight
- height of the panel for the heatmap tablepanelWidth
- width of the panel for the heatmap tabletask
- Task with faces across multiple batch tabsfaceNodeInfoList
- list of faceNodeInfo to give to headersdistanceHeatmapPanel
- control panel for heatmap
-
-
Method Details
-
getLongestNameLengthInPx
public int getLongestNameLengthInPx()Gets number of pixels the longest cluster short nam takes- Returns:
- number of pixels the longest cluster short nam takes
-
areHeadersVisible
public boolean areHeadersVisible()Checks if heatmap headers are visible- Returns:
- headers are visible
-
getCellSize
public int getCellSize() -
getMouseColumnHandler
Gets mouse column handler- Returns:
- mouse column handler
-
removeDendrogram
public void removeDendrogram()Removes dendrogram -
addDendrogram
public void addDendrogram()Adds dendrogram -
getDendrogram
Gets dendrogram- Returns:
- dendrogram
-
setRootNode
Sets root- Parameters:
rootNode
- node that will become root node
-
setClickedRowColToMinusOne
public void setClickedRowColToMinusOne()Resets the clicked row and column index to -1 -
setClickedHeaderToMinusOne
public void setClickedHeaderToMinusOne()Resets the clicked column header index to -1 -
getRowHeaderTable
Gets row header table- Returns:
- row header table
-
getColumnModel
Gets column model- Returns:
- column model
-
getPopupMenu
Gets pop up menu- Returns:
- pop up menu
-
getRowHeader
Gets row header- Returns:
- row header
-
getTable
Gets table- Returns:
- table
-
getScrollPane
Gets heatmap scroll panel- Returns:
- scroll panel
-
setDistances
public void setDistances(double[][] distances) Sets distances- Parameters:
distances
- values to set
-
setTextInHeadersVisible
public void setTextInHeadersVisible()Sets text in headers visible -
setTextInHeadersInvisible
public void setTextInHeadersInvisible()Sets text in headers invisible -
setNodeData
Sets node data- Parameters:
faceNodeInfoList
- data to be set
-
setPanelHeightWidth
public void setPanelHeightWidth(int height, int width) Sets height and width to local values- Parameters:
height
- height of the heatmap tablewidth
- width of the heatmap table
-
setHeatmapVisible
public void setHeatmapVisible()Sets heatmap table visible -
setHeatmapVisibleIfNonVisible
public void setHeatmapVisibleIfNonVisible()Sets heatmap table visible -
setHeatmapNotVisible
public void setHeatmapNotVisible()Sets heatmap table not visible -
setBiggestDistance
public void setBiggestDistance(double biggestDistance) Sets biggest distance value of the whole heatmap table- Parameters:
biggestDistance
- the biggest distance between two faces
-
setOriginalNodeData
Sets original node data to the same value as node data when created- Parameters:
faceNodeInfoList
- list of faces names invalid input: '&' indexes
-
setTableSize
public void setTableSize()Sets the table size according to its values - if values are overflowing the heatmap table, the scroll panes activate -
getCorrespondingColIndex
public int getCorrespondingColIndex(int row) Get a column index of the corresponding row from the table- Parameters:
row
- index of row that we are working with- Returns:
- index of column that is same as the row
-
getCorrespondingRowIndex
public int getCorrespondingRowIndex(int col) Get a row index of the corresponding column from the table- Parameters:
col
- index of column that we are working with- Returns:
- index of row that is same as the row
-
getStrippedDistances
public double[][] getStrippedDistances()Gets distances of faces that are left (were not hidden) in the heatmap- Returns:
- 2D array of distances of kept faces
-
getLeftNames
Gets names of faces that were left (were not hidden) in the heatmap- Returns:
- list of kept face names
-
initializeTable
public void initializeTable(boolean createRowHeader) Initialise the table to default settings as after loading the data -
removeColumn
public void removeColumn(TableColumnModel columnModel, TableColumn removedColumn, FaceNodeInfo colHeaderData) Removes clicked column, adds it to a list of removed rows/columns and resets the table size- Parameters:
columnModel
- heatmap column modelremovedColumn
- clicked colum for removalcolHeaderData
- row header data of removed row
-
removeRow
Removes clicked row, adds it to a list of removed rows/columns and resets the table size- Parameters:
removedRow
- clicked row for removalrowHeaderData
- row header data of removed row
-
isHeatmapVisible
public boolean isHeatmapVisible()Gets an info if the heatmap table is visible- Returns:
- True if the heatmap is visible, false otherwise
-
returnColumnToTable
Returns wanted column to the heatmap table- Parameters:
returningData
- the column name that is returned
-
resetRemoved
public void resetRemoved()Clears datasets about removed faces -
saveValuesToCells
public void saveValuesToCells()Saves values of their cells to corresponding cell -
resort
public void resort()Resorts rows and columns as they were sorted by clustering algorithm -
returnRowToTable
Returns wanted row to the heatmap table- Parameters:
returningData
- the row name that is returned
-
openNewTask
protected void openNewTask(int clickedRow, int clickedCol, boolean openFirstFace, boolean openSecondFace)
-