|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
baseCode.gui.JMatrixDisplay
Title: JMatrixDisplay
Description: a visual component for displaying a color matrix
Copyright: Copyright (c) 2004
Institution:: Columbia University
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
protected java.awt.Dimension |
m_cellSize
|
protected int |
m_columnLabelHeight
|
protected int |
m_defaultResolution
|
protected int |
m_fontGutter
|
protected int |
m_fontSize
|
protected java.awt.image.BufferedImage |
m_image
|
protected boolean |
m_isShowLabels
|
protected java.awt.Font |
m_labelFont
|
protected int |
m_labelGutter
|
protected int |
m_maxFontSize
|
protected int |
m_ratioWidth
|
protected int |
m_resolution
|
protected int |
m_rowLabelWidth
|
protected int |
m_textSize
|
| 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 | |
JMatrixDisplay(ColorMatrix matrix)
|
|
JMatrixDisplay(DenseDoubleMatrix2DNamed matrix)
|
|
JMatrixDisplay(java.lang.String filename)
|
|
| Method Summary | |
protected void |
drawColumnNames(java.awt.Graphics g)
Draws column names vertically (turned 90 degrees counter-clockwise) |
protected void |
drawMatrix(java.awt.Graphics g,
boolean leaveRoomForLabels)
Gets called from #paintComponent and #saveImage |
protected void |
drawRowNames(java.awt.Graphics g)
Draws row names (horizontally) |
java.awt.Color |
getColor(int row,
int column)
|
java.awt.Color[] |
getColorMap()
|
ColorMatrix |
getColorMatrix()
|
int |
getColumnCount()
|
java.lang.String |
getColumnName(int column)
|
java.lang.String[] |
getColumnNames()
|
double |
getDisplayMax()
|
double |
getDisplayMin()
|
double |
getDisplayRange()
|
AbstractNamedDoubleMatrix |
getMatrix()
|
double |
getMax()
|
double |
getMin()
|
java.awt.Color |
getMissingColor()
|
double[] |
getRow(int row)
|
double[] |
getRowByName(java.lang.String rowName)
|
int |
getRowCount()
|
int |
getRowHeight()
|
int |
getRowIndexByName(java.lang.String rowName)
|
java.lang.String |
getRowName(int row)
|
java.lang.String[] |
getRowNames()
|
protected java.awt.Dimension |
getSize(boolean withLabels)
|
boolean |
getStandardizedEnabled()
|
double |
getValue(int row,
int column)
|
void |
init(ColorMatrix matrix)
|
protected void |
initSize()
Sets the display size |
protected void |
paintComponent(java.awt.Graphics g)
JComponent method used to render this component |
void |
resetRowKeys()
|
void |
saveImage(java.lang.String outPngFilename)
Saves the image to a png file. |
void |
saveImage(java.lang.String outPngFilename,
boolean showLabels)
|
void |
saveImage(java.lang.String outPngFilename,
boolean showLabels,
boolean standardize)
|
void |
setCellSize(java.awt.Dimension d)
|
void |
setColorMap(java.awt.Color[] colorMap)
|
void |
setDisplayRange(double min,
double max)
|
void |
setLabelsVisible(boolean isShowLabels)
If this display component has already been added to the GUI, it will be resized to fit or exclude the row names |
void |
setMatrix(ColorMatrix matrix)
|
void |
setRowHeight(int height)
|
void |
setRowKeys(int[] rowKeys)
|
void |
setStandardizedEnabled(boolean showStandardizedMatrix)
|
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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 |
protected boolean m_isShowLabels
protected java.awt.image.BufferedImage m_image
protected int m_ratioWidth
protected int m_rowLabelWidth
protected int m_columnLabelHeight
protected int m_labelGutter
protected int m_fontGutter
protected java.awt.Font m_labelFont
protected int m_fontSize
protected final int m_maxFontSize
protected final int m_defaultResolution
protected int m_resolution
protected int m_textSize
protected java.awt.Dimension m_cellSize
| Constructor Detail |
public JMatrixDisplay(java.lang.String filename)
throws java.io.IOException
public JMatrixDisplay(DenseDoubleMatrix2DNamed matrix)
public JMatrixDisplay(ColorMatrix matrix)
| Method Detail |
public void init(ColorMatrix matrix)
protected void initSize()
protected java.awt.Dimension getSize(boolean withLabels)
protected void paintComponent(java.awt.Graphics g)
JComponent method used to render this component
g - Graphics used for paintingpublic void setStandardizedEnabled(boolean showStandardizedMatrix)
public boolean getStandardizedEnabled()
protected void drawMatrix(java.awt.Graphics g,
boolean leaveRoomForLabels)
g - GraphicsleaveRoomForLabels - booleanprotected void drawRowNames(java.awt.Graphics g)
g - Graphicsprotected void drawColumnNames(java.awt.Graphics g)
g - Graphics
public void saveImage(java.lang.String outPngFilename)
throws java.io.IOException
outPngFilename - String
java.io.IOException
public void saveImage(java.lang.String outPngFilename,
boolean showLabels)
throws java.io.IOException
java.io.IOException
public void saveImage(java.lang.String outPngFilename,
boolean showLabels,
boolean standardize)
throws java.io.IOException
outPngFilename - StringshowLabels - booleanstandardize - normalize to deviation 1, mean 0.
java.io.IOExceptionpublic void setLabelsVisible(boolean isShowLabels)
isShowLabels - booleanpublic ColorMatrix getColorMatrix()
public AbstractNamedDoubleMatrix getMatrix()
public void setMatrix(ColorMatrix matrix)
matrix - the new matrix to use; will resize this display component as necessarypublic void setCellSize(java.awt.Dimension d)
public void setRowHeight(int height)
public int getRowHeight()
public java.awt.Color getColor(int row,
int column)
public double getValue(int row,
int column)
public double[] getRow(int row)
public double[] getRowByName(java.lang.String rowName)
public int getRowCount()
public int getColumnCount()
public java.lang.String getColumnName(int column)
public java.lang.String getRowName(int row)
public java.lang.String[] getColumnNames()
public java.lang.String[] getRowNames()
public int getRowIndexByName(java.lang.String rowName)
public void setRowKeys(int[] rowKeys)
public void resetRowKeys()
public void setColorMap(java.awt.Color[] colorMap)
colorMap - an array of colors which define the midpoints in the color map; this can be one of the constants
defined in the ColorMap class, like ColorMap.REDGREEN_COLORMAP and ColorMap.BLACKBODY_COLORMAPpublic java.awt.Color[] getColorMap()
public double getMin()
public double getMax()
public double getDisplayMin()
public double getDisplayMax()
public double getDisplayRange()
public void setDisplayRange(double min,
double max)
public java.awt.Color getMissingColor()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||