org.knime.base.node.viz.plotter.columns
Class TwoColumnProperties

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JTabbedPane
                  extended by org.knime.base.node.viz.plotter.AbstractPlotterProperties
                      extended by org.knime.base.node.viz.plotter.columns.TwoColumnProperties
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants
Direct Known Subclasses:
ScatterPlotterProperties

public class TwoColumnProperties
extends AbstractPlotterProperties

Provides functionality to select the x and the y column to display. Selects first and second column per default and allows the filtering of a certain DataType and to fix some column to a certain value. The information about the available columns and if they are compatible with the restricting DataValues is taken from a DataTableSpec which has to be provided in the update methods: update(DataTableSpec), update(DataTableSpec, int, int), and updateRangeSpinner(DataColumnSpec, DataColumnSpec).

In addition the ranges for the x and y axis can be adapted, i.e. the minimum and maximum for each column can be adapted. The registration of listeners is wrapped by this class, corresponding methods are provided.

Author:
Fabian Dill, University of Konstanz
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JTabbedPane
JTabbedPane.AccessibleJTabbedPane, JTabbedPane.ModelListener
 
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
static int COMPONENT_WIDTH
          Layout constant (combobox width, etc).
protected  ColumnSelectionComboxBox m_xSelector
          The x column selection box.
protected  ColumnSelectionComboxBox m_ySelector
          The y column selection box.
static int SMALL_SPACE
          Layout constant (space to the border).
static int SPACE
          Layout constant (space between elements).
 
Fields inherited from class javax.swing.JTabbedPane
changeEvent, changeListener, model, SCROLL_TAB_LAYOUT, tabPlacement, WRAP_TAB_LAYOUT
 
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 javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TwoColumnProperties()
          Creates a properties tab with the default properties (AbstractPlotterProperties) and a tab for the selection of two columns and the adjustment of their ranges.
TwoColumnProperties(Class<? extends DataValue>[] allowedXTypes, Class<? extends DataValue>[] allowedYTypes)
          Creates a properties tab with the default properties (AbstractPlotterProperties) and a tab for the selection of two columns and the adjustment of their ranges, in addition, each column selection can be restricted to display only columns which are compatible with certain DataValues.
 
Method Summary
 void addXColumnListener(ItemListener listener)
           
 void addXMaxListener(ChangeListener listener)
           
 void addXMinListener(ChangeListener listener)
           
 void addYColumnListener(ItemListener listener)
           
 void addYMaxListener(ChangeListener listener)
           
 void addYMinListener(ChangeListener listener)
           
 DataColumnSpec getSelectedXColumn()
           
 DataColumnSpec getSelectedYColumn()
           
 double getXMaxValue()
           
 double getXMinValue()
           
 double getYMaxValue()
           
 double getYMinValue()
           
 void update(DataTableSpec spec)
          Updates the selection boxes with the passed DataTableSpec and sets 0 and 1 as x and y.
 void update(DataTableSpec spec, int xPreSelect, int yPreSelect)
          Updates the selection boxes with the new DataTableSpec and selects the passed indices.
protected  void updateRangeSpinner(DataColumnSpec xColumn, DataColumnSpec yColumn)
          Updates the values of the range spinner acording to the current columns.
 
Methods inherited from class org.knime.base.node.viz.plotter.AbstractPlotterProperties
getAntialiasButton, getChooseBackgroundButton, getColorChooser, getFitToScreenButton, getMouseSelectionBox
 
Methods inherited from class javax.swing.JTabbedPane
add, add, add, add, add, addChangeListener, addTab, addTab, addTab, createChangeListener, fireStateChanged, getAccessibleContext, getBackgroundAt, getBoundsAt, getChangeListeners, getComponentAt, getDisabledIconAt, getDisplayedMnemonicIndexAt, getForegroundAt, getIconAt, getMnemonicAt, getModel, getSelectedComponent, getSelectedIndex, getTabComponentAt, getTabCount, getTabLayoutPolicy, getTabPlacement, getTabRunCount, getTitleAt, getToolTipText, getToolTipTextAt, getUI, getUIClassID, indexAtLocation, indexOfComponent, indexOfTab, indexOfTab, indexOfTabComponent, insertTab, isEnabledAt, paramString, remove, remove, removeAll, removeChangeListener, removeTabAt, setBackgroundAt, setComponentAt, setDisabledIconAt, setDisplayedMnemonicIndexAt, setEnabledAt, setForegroundAt, setIconAt, setMnemonicAt, setModel, setSelectedComponent, setSelectedIndex, setTabComponentAt, setTabLayoutPolicy, setTabPlacement, setTitleAt, setToolTipTextAt, 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, 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, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
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, 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

SPACE

public static final int SPACE
Layout constant (space between elements).

See Also:
Constant Field Values

SMALL_SPACE

public static final int SMALL_SPACE
Layout constant (space to the border).

See Also:
Constant Field Values

COMPONENT_WIDTH

public static final int COMPONENT_WIDTH
Layout constant (combobox width, etc).

See Also:
Constant Field Values

m_xSelector

protected ColumnSelectionComboxBox m_xSelector
The x column selection box.


m_ySelector

protected ColumnSelectionComboxBox m_ySelector
The y column selection box.

Constructor Detail

TwoColumnProperties

public TwoColumnProperties()
Creates a properties tab with the default properties (AbstractPlotterProperties) and a tab for the selection of two columns and the adjustment of their ranges. There is no restriction on the displayed DataValues.


TwoColumnProperties

public TwoColumnProperties(Class<? extends DataValue>[] allowedXTypes,
                           Class<? extends DataValue>[] allowedYTypes)
Creates a properties tab with the default properties (AbstractPlotterProperties) and a tab for the selection of two columns and the adjustment of their ranges, in addition, each column selection can be restricted to display only columns which are compatible with certain DataValues.

Parameters:
allowedXTypes - allowed data types to be selecteable for the x column.
allowedYTypes - allowed data types to be selectable for the y column
Method Detail

updateRangeSpinner

protected void updateRangeSpinner(DataColumnSpec xColumn,
                                  DataColumnSpec yColumn)
Updates the values of the range spinner acording to the current columns.

Parameters:
xColumn - selected x column
yColumn - selected y column

addXColumnListener

public void addXColumnListener(ItemListener listener)
Parameters:
listener - the item listener for the x column box.

addYColumnListener

public void addYColumnListener(ItemListener listener)
Parameters:
listener - the item listener for the y column box.

getSelectedXColumn

public DataColumnSpec getSelectedXColumn()
Returns:
the selected x column spec

getSelectedYColumn

public DataColumnSpec getSelectedYColumn()
Returns:
the selected y column spec

addXMinListener

public void addXMinListener(ChangeListener listener)
Parameters:
listener - for the x min value.

addXMaxListener

public void addXMaxListener(ChangeListener listener)
Parameters:
listener - for the x max value.

addYMinListener

public void addYMinListener(ChangeListener listener)
Parameters:
listener - for the y min value.

addYMaxListener

public void addYMaxListener(ChangeListener listener)
Parameters:
listener - for the y min value.

getXMinValue

public double getXMinValue()
Returns:
adjusted x min value.

getXMaxValue

public double getXMaxValue()
Returns:
adjusted x max value.

getYMinValue

public double getYMinValue()
Returns:
adjusted y min value.

getYMaxValue

public double getYMaxValue()
Returns:
adjusted y max value.

update

public void update(DataTableSpec spec)
Updates the selection boxes with the passed DataTableSpec and sets 0 and 1 as x and y.

Parameters:
spec - the new DataTableSpec

update

public void update(DataTableSpec spec,
                   int xPreSelect,
                   int yPreSelect)
Updates the selection boxes with the new DataTableSpec and selects the passed indices.

Parameters:
spec - the new data table spec.
xPreSelect - the x column index (-1 if unknown)
yPreSelect - the y column (-1 if unknown)


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.