org.knime.base.node.viz.pie.datamodel.interactive
Class InteractivePieDataModel

java.lang.Object
  extended by org.knime.base.node.viz.pie.datamodel.PieDataModel
      extended by org.knime.base.node.viz.pie.datamodel.interactive.InteractivePieDataModel
All Implemented Interfaces:
Iterable<DataRow>

public class InteractivePieDataModel
extends PieDataModel
implements Iterable<DataRow>

This is the interactive implementation of the PieDataModel which allows hiliting and column changing.

Author:
Tobias Koetter, University of Konstanz

Constructor Summary
InteractivePieDataModel(ExecutionMonitor exec, DataTable table, int noOfRows, boolean detailsAvailable)
          Constructor for class InteractivePieDataModel.
 
Method Summary
 int getColIndex(String colName)
           
 DataColumnSpec getColSpec(String colName)
           
 Iterator<DataRow> getDataRows()
           
 DataTableSpec getDataTableSpec()
           
 Color getRowColor(DataRow row)
           
 Iterator<DataRow> iterator()
          
static InteractivePieDataModel loadFromFile(File dataDir, ExecutionMonitor exec)
           
 void save2File(File dataDir, ExecutionMonitor exec)
           
 
Methods inherited from class org.knime.base.node.viz.pie.datamodel.PieDataModel
createDefaultMissingSection, detailsAvailable, setSectionColor, sortSections, supportsHiliting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InteractivePieDataModel

public InteractivePieDataModel(ExecutionMonitor exec,
                               DataTable table,
                               int noOfRows,
                               boolean detailsAvailable)
                        throws CanceledExecutionException
Constructor for class InteractivePieDataModel.

Parameters:
exec - the ExecutionMonitor
table - the data table
noOfRows - the optional number of rows to initialize the row array
detailsAvailable - true if details are available
Throws:
CanceledExecutionException - if the progress was canceled
Method Detail

save2File

public void save2File(File dataDir,
                      ExecutionMonitor exec)
               throws IOException,
                      CanceledExecutionException
Parameters:
dataDir - the data directory to write to
exec - the ExecutionMonitor
Throws:
IOException - if the output file could not be created
CanceledExecutionException - if the saving was canceled

loadFromFile

public static InteractivePieDataModel loadFromFile(File dataDir,
                                                   ExecutionMonitor exec)
                                            throws IOException,
                                                   InvalidSettingsException,
                                                   CanceledExecutionException
Parameters:
dataDir - the data directory to read from
exec - ExecutionMonitor
Returns:
the InteractivePieDataModel
Throws:
IOException - if the file could not be read
InvalidSettingsException - if a setting wasn't present
CanceledExecutionException - if the operation was canceled

getDataRows

public Iterator<DataRow> getDataRows()
Returns:
all data rows

iterator

public Iterator<DataRow> iterator()

Specified by:
iterator in interface Iterable<DataRow>

getDataTableSpec

public DataTableSpec getDataTableSpec()
Returns:
the DataTableSpec

getColSpec

public DataColumnSpec getColSpec(String colName)
Parameters:
colName - the column name to get the spec for
Returns:
the DataColumnSpec or null if the name is not in the spec

getColIndex

public int getColIndex(String colName)
Parameters:
colName - the column name to get the index for
Returns:
the index of the given column name

getRowColor

public Color getRowColor(DataRow row)
Parameters:
row - the row to get the color for
Returns:
the color of this row


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.