org.knime.base.data.aggregation.dialogutil
Class AggregationColumnPanel

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by org.knime.base.data.aggregation.dialogutil.AggregationColumnPanel
All Implemented Interfaces:
MouseListener, MouseMotionListener, MouseWheelListener, EventListener

public class AggregationColumnPanel
extends MouseAdapter

This class creates the aggregation column panel that allows the user to define the aggregation columns and their aggregation method.

Author:
Tobias Koetter, University of Konstanz

Field Summary
static Dimension PANEL_DIMENSION
          The initial dimension of this panel.
 
Constructor Summary
AggregationColumnPanel()
          Constructor for class AggregationColumnPanel.
 
Method Summary
protected  void changeAggregationMethod(String methodId)
          Changes the aggregation method of all selected rows to the method with the given label.
 void excludeColsChange(Collection<String> excludeCols)
           
protected  int getAggregationColumnCount()
           
 Collection<Class<? extends DataValue>> getAllPresentTypes()
           
 JPanel getComponentPanel()
           
protected  List<Map.Entry<String,List<AggregationMethod>>> getMethods4SelectedItems()
           
 void initialize(DataTableSpec spec, List<ColumnAggregator> colAggrs)
          Initializes the panel.
 void loadSettingsFrom(NodeSettingsRO settings, DataTableSpec spec)
           
(package private)  int noOfCompatibleRows(Class<? extends DataValue> type)
          Returns the number of rows that are compatible to the given type.
protected  void onAddAll()
          Adds all columns to the aggregation column table.
protected  void onAddIt()
          Adds all selected columns to the aggregation column table.
protected  void onRemAll()
          Removes all columns from the aggregation column table.
protected  void onRemIt()
          Removes the selected columns from the aggregation column table.
(package private)  boolean rowsSelected()
           
 void saveSettingsTo(NodeSettingsWO settings)
           
protected  void selectAllRows()
          Selects all rows.
protected  void selectCompatibleRows(Class<? extends DataValue> type)
          Selects all rows that are compatible with the given type.
protected  void toggleMissingCellOption()
          Changes the include missing cell option for the selected rows.
 
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PANEL_DIMENSION

public static final Dimension PANEL_DIMENSION
The initial dimension of this panel.

Constructor Detail

AggregationColumnPanel

public AggregationColumnPanel()
Constructor for class AggregationColumnPanel.

Method Detail

getAllPresentTypes

public Collection<Class<? extends DataValue>> getAllPresentTypes()
Returns:
all supported types with at least one row in the table

onRemAll

protected void onRemAll()
Removes all columns from the aggregation column table.


onRemIt

protected void onRemIt()
Removes the selected columns from the aggregation column table.


onAddAll

protected void onAddAll()
Adds all columns to the aggregation column table.


onAddIt

protected void onAddIt()
Adds all selected columns to the aggregation column table.


changeAggregationMethod

protected void changeAggregationMethod(String methodId)
Changes the aggregation method of all selected rows to the method with the given label.

Parameters:
methodId - the label of the aggregation method

toggleMissingCellOption

protected void toggleMissingCellOption()
Changes the include missing cell option for the selected rows.


selectAllRows

protected void selectAllRows()
Selects all rows.


selectCompatibleRows

protected void selectCompatibleRows(Class<? extends DataValue> type)
Selects all rows that are compatible with the given type.

Parameters:
type - the type to check for compatibility

noOfCompatibleRows

int noOfCompatibleRows(Class<? extends DataValue> type)
Returns the number of rows that are compatible to the given type.

Parameters:
type - the type to check for
Returns:
the number of compatible rows

rowsSelected

boolean rowsSelected()
Returns:
true if at least one row is selected

getAggregationColumnCount

protected int getAggregationColumnCount()
Returns:
the number of aggregation columns

getComponentPanel

public JPanel getComponentPanel()
Returns:
the panel in which all sub-components of this component are arranged. This panel can be added to the dialog pane.

excludeColsChange

public void excludeColsChange(Collection<String> excludeCols)
Parameters:
excludeCols - the name of all columns that should be excluded from the aggregation panel

saveSettingsTo

public void saveSettingsTo(NodeSettingsWO settings)
Parameters:
settings - the settings object to write to

loadSettingsFrom

public void loadSettingsFrom(NodeSettingsRO settings,
                             DataTableSpec spec)
                      throws InvalidSettingsException
Parameters:
settings - the settings to read from
spec - initializes the component
Throws:
InvalidSettingsException - if the settings are invalid

initialize

public void initialize(DataTableSpec spec,
                       List<ColumnAggregator> colAggrs)
Initializes the panel.

Parameters:
spec - the DataTableSpec of the input table
colAggrs - the List of ColumnAggregators that are initially used

getMethods4SelectedItems

protected List<Map.Entry<String,List<AggregationMethod>>> getMethods4SelectedItems()
Returns:
a label list of all supported methods for the currently selected rows


Copyright, 2003 - 2012. 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.