org.knime.base.node.viz.plotter.scattermatrix
Class ScatterMatrixDrawingPane

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 org.knime.base.node.viz.plotter.AbstractDrawingPane
                      extended by org.knime.base.node.viz.plotter.basic.BasicDrawingPane
                          extended by org.knime.base.node.viz.plotter.scatter.ScatterPlotterDrawingPane
                              extended by org.knime.base.node.viz.plotter.scattermatrix.ScatterMatrixDrawingPane
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ScatterMatrixDrawingPane
extends ScatterPlotterDrawingPane

Holds a matrix of ScatterMatrixElements. This class only paints the surrounding rectangles of the matrix elements, the painting of the actual dots is done by the ScatterPlotterDrawingPane. In addition to the scatter matrix elements the coordinates of the scatter matrix elements are plotted at the borders of the drawing pane. The setBackground(Color) is overriden, since it sets the color of the scatter matrix elements and not of the whole component. The ScatterMatrixElements know there associated dots. By setting them with the setScatterMatrixElements(ScatterMatrixElement[][]), the DotInfos are put into a DotInfoArray, which can then be painted with the inherited functionality of the ScatterPlotterDrawingPane.

Author:
Fabian Dill, University of Konstanz
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 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
ScatterMatrixDrawingPane()
          Sets the background color to white.
 
Method Summary
 ScatterMatrixElement[][] getMatrixElements()
           
 void paintContent(Graphics g)
          Paints the rectangles of the scatter matrix elements and the vertical and horizontal coordinates at the border of the drawing pane.
protected  void paintHorizontalCoordinate(Graphics g, ScatterMatrixElement element, int y, boolean top)
          Paints the horizontal coordinates of the matrix elements at the border of the drawing pane.
protected  void paintVerticalCoordinate(Graphics g, ScatterMatrixElement element, int x, boolean left)
          Paints the vertical coordinates at the border of the drawing pane.
 void setBackground(Color bg)
          
 void setHorizontalMargin(int hMargin)
           
 void setScatterMatrixElements(ScatterMatrixElement[][] elements)
           
 void setVerticalMargin(int vMargin)
           
 
Methods inherited from class org.knime.base.node.viz.plotter.scatter.ScatterPlotterDrawingPane
clearSelection, getDotInfoArray, getDotSize, getSelectedDots, getToolTipText, paintDot, selectClickedElement, selectElementsIn, setDotInfoArray, setDotSize, setFadeUnhilited, setSelectedDots
 
Methods inherited from class org.knime.base.node.viz.plotter.basic.BasicDrawingPane
addDrawingElement, clearPlot, getDrawingElements
 
Methods inherited from class org.knime.base.node.viz.plotter.AbstractDrawingPane
getDragStart, getSelectionRectangle, isMouseDown, paintComponent, paintSelectionRectangle, setAntialiasing, setDragEnd, setDragStart, setMouseDown
 
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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, 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, 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
 

Constructor Detail

ScatterMatrixDrawingPane

public ScatterMatrixDrawingPane()
Sets the background color to white.

Method Detail

setHorizontalMargin

public void setHorizontalMargin(int hMargin)
Parameters:
hMargin - sets the horizontal margin.

setVerticalMargin

public void setVerticalMargin(int vMargin)
Parameters:
vMargin - the vertical margin

setScatterMatrixElements

public void setScatterMatrixElements(ScatterMatrixElement[][] elements)
Parameters:
elements - the rectangles with the coordinates.

getMatrixElements

public ScatterMatrixElement[][] getMatrixElements()
Returns:
the scatter matrix elements.

setBackground

public void setBackground(Color bg)

Overrides:
setBackground in class JComponent

paintContent

public void paintContent(Graphics g)
Paints the rectangles of the scatter matrix elements and the vertical and horizontal coordinates at the border of the drawing pane. The painting of the dots is inherited from the ScatterPlotterDrawingPane. Paints all added BasicDrawingElements by calling their #paint(Graphics2D) method. If the BasicDrawingPane is extended this method have to be called with super.paintContent() in order to maintain the functionality of painting BasicDrawingElements.

Overrides:
paintContent in class ScatterPlotterDrawingPane
Parameters:
g - the graphics object
See Also:
AbstractDrawingPane.paintContent( java.awt.Graphics)

paintVerticalCoordinate

protected void paintVerticalCoordinate(Graphics g,
                                       ScatterMatrixElement element,
                                       int x,
                                       boolean left)
Paints the vertical coordinates at the border of the drawing pane.

Parameters:
g - graphics
element - element to provide position and coordinate
x - the x position
left - true if the coordinate is painted on the left side.

paintHorizontalCoordinate

protected void paintHorizontalCoordinate(Graphics g,
                                         ScatterMatrixElement element,
                                         int y,
                                         boolean top)
Paints the horizontal coordinates of the matrix elements at the border of the drawing pane.

Parameters:
g - graphics
element - the element to provide position and coordinate
y - y position
top - true if the coordinate is painted at the top.


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.