org.knime.base.node.viz.pie.datamodel.fixed
Class FixedPieDataModel

java.lang.Object
  extended by org.knime.base.node.viz.pie.datamodel.PieDataModel
      extended by org.knime.base.node.viz.pie.datamodel.fixed.FixedPieDataModel

public class FixedPieDataModel
extends PieDataModel

This class represents a pie chart which consists of several PieSectionDataModels.

Author:
Tobias Koetter, University of Konstanz

Constructor Summary
  FixedPieDataModel(DataColumnSpec pieColSpec, DataColumnSpec aggrColSpec, boolean containsColorHandler)
          Constructor for class PieDataModel.
protected FixedPieDataModel(String pieCol, boolean numericPieCol, String aggrCol, List<PieSectionDataModel> sections, PieSectionDataModel missingSection, boolean supportHiliting, boolean containsColorHandler, boolean isColorColumn)
          Constructor for class PieDataModel.
 
Method Summary
 void addDataRow(DataRow row, Color rowColor, DataCell pieCell, DataCell aggrCell)
           
 String getAggrColName()
           
 PieSectionDataModel getClonedMissingSection()
           
 List<PieSectionDataModel> getClonedSections()
           
 PieSectionDataModel getMissingSection()
           
 String getPieColName()
           
static FixedPieDataModel loadFromFile(File directory, ExecutionMonitor exec)
           
 void save2File(File directory, 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

FixedPieDataModel

public FixedPieDataModel(DataColumnSpec pieColSpec,
                         DataColumnSpec aggrColSpec,
                         boolean containsColorHandler)
Constructor for class PieDataModel.

Parameters:
pieColSpec - the DataColumnSpec of the pie column
aggrColSpec - the optional DataColumnSpec of the aggregation column
containsColorHandler - true if a color handler is set

FixedPieDataModel

protected FixedPieDataModel(String pieCol,
                            boolean numericPieCol,
                            String aggrCol,
                            List<PieSectionDataModel> sections,
                            PieSectionDataModel missingSection,
                            boolean supportHiliting,
                            boolean containsColorHandler,
                            boolean isColorColumn)
Constructor for class PieDataModel.

Parameters:
pieCol - the name of the pie column
numericPieCol - true if the pie column is numerical
aggrCol - the name of the aggregation column
sections - the sections
missingSection - the missing section
supportHiliting - if hiliting is supported
containsColorHandler - true if a color handler is set
isColorColumn - true if the aggregation column is also the one with the color handler
Method Detail

addDataRow

public void addDataRow(DataRow row,
                       Color rowColor,
                       DataCell pieCell,
                       DataCell aggrCell)
                throws TooManySectionsException
Parameters:
row - the row to add
rowColor - the color of the roe
pieCell - the cell with the pie value
aggrCell - the cell with the aggregation value
Throws:
TooManySectionsException - if more sections are created than supported

getPieColName

public String getPieColName()
Returns:
the name of the pie column

getAggrColName

public String getAggrColName()
Returns:
the name of the pie column

getMissingSection

public PieSectionDataModel getMissingSection()
Returns:
the missing PieSectionDataModel

getClonedSections

public List<PieSectionDataModel> getClonedSections()
Returns:
a real copy of all sections

getClonedMissingSection

public PieSectionDataModel getClonedMissingSection()
Returns:
a real copy of the missing section

save2File

public void save2File(File directory,
                      ExecutionMonitor exec)
               throws IOException,
                      CanceledExecutionException
Parameters:
directory - the directory to write to
exec - the ExecutionMonitor to provide progress messages
Throws:
IOException - if a file exception occurs
CanceledExecutionException - if the operation was canceled

loadFromFile

public static FixedPieDataModel loadFromFile(File directory,
                                             ExecutionMonitor exec)
                                      throws IOException,
                                             CanceledExecutionException,
                                             InvalidSettingsException
Parameters:
directory - the directory to write to
exec - the ExecutionMonitor to provide progress messages
Returns:
the data model wasn't valid
Throws:
IOException - if a file exception occurs
CanceledExecutionException - if the operation was canceled
InvalidSettingsException - if the file is invalid


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.