org.knime.base.node.viz.histogram.datamodel
Class BarElementDataModel

java.lang.Object
  extended by org.knime.base.node.viz.aggregation.AggregationValSubModel<Rectangle2D,Rectangle2D>
      extended by org.knime.base.node.viz.histogram.datamodel.BarElementDataModel
All Implemented Interfaces:
Serializable, AggregationModel<Rectangle2D,Rectangle2D>
Direct Known Subclasses:
InteractiveBarElementDataModel

public class BarElementDataModel
extends AggregationValSubModel<Rectangle2D,Rectangle2D>
implements Serializable

This class represents the smallest element of a histogram and corresponds to the color in which the rows of this element are colored. The BarElements belong to one BarDataModel.

Author:
Tobias Koetter, University of Konstanz
See Also:
Serialized Form

Constructor Summary
protected BarElementDataModel(Color color)
          Constructor for class BarElementDataModel.
protected BarElementDataModel(Color color, boolean supportHiliting)
          Constructor for class BarElementDataModel.
 
Method Summary
protected  BarElementDataModel clone()
          
 Rectangle2D getElementRectangle()
           
static BarElementDataModel loadFromFile(Config config, ExecutionMonitor exec)
           
protected  void setRectangle(Rectangle2D rect, AbstractHistogramVizModel.HistogramHiliteCalculator calculator)
           
 void updateElementWidth(int xCoord, int elementWidth, AbstractHistogramVizModel.HistogramHiliteCalculator calculator)
           
 
Methods inherited from class org.knime.base.node.viz.aggregation.AggregationValSubModel
addDataRow, calculateHilitedShape, clearHilite, getAggregationSum, getAggregationValue, getColor, getHilitedKeys, getHiliteRowCount, getHiliteShape, getKeys, getName, getRowCount, getShape, getValueCount, isEmpty, isHilited, isPresentable, isSelected, removeHilitedKeys, save2File, selectElement, selectElement, setHilitedKeys, setHiliteShape, setPresentable, setSelected, setShape, supportsHiliting
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BarElementDataModel

protected BarElementDataModel(Color color)
Constructor for class BarElementDataModel.

Parameters:
color - the color of this element

BarElementDataModel

protected BarElementDataModel(Color color,
                              boolean supportHiliting)
Constructor for class BarElementDataModel.

Parameters:
color - the color to use for this bar element
supportHiliting - if hiliting should be supported
Method Detail

getElementRectangle

public Rectangle2D getElementRectangle()
Returns:
the Rectangle the element should be drawn on the screen

setRectangle

protected void setRectangle(Rectangle2D rect,
                            AbstractHistogramVizModel.HistogramHiliteCalculator calculator)
Parameters:
rect - the Rectangle to set or null
calculator - the hilite shape calculator

updateElementWidth

public void updateElementWidth(int xCoord,
                               int elementWidth,
                               AbstractHistogramVizModel.HistogramHiliteCalculator calculator)
Parameters:
xCoord - the new x coordinate
elementWidth - the new element width
calculator - the hilite shape calculator

clone

protected BarElementDataModel clone()

Overrides:
clone in class AggregationValSubModel<Rectangle2D,Rectangle2D>

loadFromFile

public static BarElementDataModel loadFromFile(Config config,
                                               ExecutionMonitor exec)
                                        throws CanceledExecutionException,
                                               InvalidSettingsException
Parameters:
config - the config object to use
exec - the ExecutionMonitor to provide progress messages
Returns:
the loaded BarElementDataModel
Throws:
CanceledExecutionException - if the operation is canceled
InvalidSettingsException - if the config object 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.