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

java.lang.Object
  extended by org.knime.base.node.viz.histogram.datamodel.BinDataModel
      extended by org.knime.base.node.viz.histogram.datamodel.InteractiveBinDataModel
All Implemented Interfaces:
Serializable

public class InteractiveBinDataModel
extends BinDataModel

This class extends the BinDataModel to support hiliting.

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

Constructor Summary
InteractiveBinDataModel(String xAxisCaption, double lowerBound, double upperBound)
          Constructor for class BinDataModel.
 
Method Summary
 void clearHilite()
          Clears the hilite information.
protected  BarDataModel createBar(String barName, Color color)
          Creates a new BarDataModel with the given color.
 Rectangle2D getHiliteRectangle()
          The proportional hilite rectangle of this bin which could be displayed if the bars of this bin can't be draw.
 int getNoOfHilitedRows()
           
protected  boolean removeHilitedKeys(Set<RowKey> hilited, AbstractHistogramVizModel.HistogramHiliteCalculator calculator)
           
 void setBinRectangle(Rectangle binRectangle, int baseLine, List<Color> barElementColors, Collection<ColorColumn> aggrColumns, AbstractHistogramVizModel.HistogramHiliteCalculator calculator)
          THE HEIGHT OF THE RECTANGLE SHOULD BE CALCULATED USING THE MIN AND MAX AGGREGATION VALUE TO HANDLES BINS WITH POSITIVE AND NEGATIVE BARS!!!
protected  boolean setHilitedKeys(Set<RowKey> hilited, AbstractHistogramVizModel.HistogramHiliteCalculator calculator)
           
 void updateBinWidth(int startX, int binWidth, List<Color> barElementColors, Collection<ColorColumn> aggrColumns, int baseLine, AbstractHistogramVizModel.HistogramHiliteCalculator calculator)
          
 
Methods inherited from class org.knime.base.node.viz.histogram.datamodel.BinDataModel
addDataRow, clear, clone, getBar, getBars, getBinRectangle, getBinRowCount, getLowerBound, getMaxAggregationValue, getMaxBarRowCount, getMinAggregationValue, getMinRowCount, getNoOfBars, getSelectedBars, getSurroundingRectangle, getUpperBound, getXAxisCaption, getXAxisCaptionCell, isPresentable, isSelected, loadFromFile, save2File, selectElement, selectElement, setSelected
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InteractiveBinDataModel

public InteractiveBinDataModel(String xAxisCaption,
                               double lowerBound,
                               double upperBound)
Constructor for class BinDataModel.

Parameters:
xAxisCaption - the caption of this bin on the x axis
lowerBound - the lower bound of the bin interval
upperBound - the higher bound of the bin interval
Method Detail

createBar

protected BarDataModel createBar(String barName,
                                 Color color)
Creates a new BarDataModel with the given color.

Overrides:
createBar in class BinDataModel
Parameters:
barName - the name of this bar
color - the Color of the bar
Returns:
the created bar

setBinRectangle

public void setBinRectangle(Rectangle binRectangle,
                            int baseLine,
                            List<Color> barElementColors,
                            Collection<ColorColumn> aggrColumns,
                            AbstractHistogramVizModel.HistogramHiliteCalculator calculator)
THE HEIGHT OF THE RECTANGLE SHOULD BE CALCULATED USING THE MIN AND MAX AGGREGATION VALUE TO HANDLES BINS WITH POSITIVE AND NEGATIVE BARS!!!

Overrides:
setBinRectangle in class BinDataModel
Parameters:
binRectangle - the Rectangle the bin should be drawn on the screen
baseLine - the x coordinate of the base line (0) on the screen
barElementColors - all element colors which define the order the elements should be drawn
aggrColumns - the aggregation column array which indicates the order of the bars
calculator - the hilite shape calculator

updateBinWidth

public void updateBinWidth(int startX,
                           int binWidth,
                           List<Color> barElementColors,
                           Collection<ColorColumn> aggrColumns,
                           int baseLine,
                           AbstractHistogramVizModel.HistogramHiliteCalculator calculator)

Overrides:
updateBinWidth in class BinDataModel
Parameters:
startX - new x coordinate
binWidth - new bin width
barElementColors - all element colors which define the order the elements should be drawn
aggrColumns - the current aggregation columns
baseLine - the base line
calculator - the hilite shape calculator

getNoOfHilitedRows

public int getNoOfHilitedRows()
Returns:
the number of hilited rows in this bin.

setHilitedKeys

protected boolean setHilitedKeys(Set<RowKey> hilited,
                                 AbstractHistogramVizModel.HistogramHiliteCalculator calculator)
Parameters:
hilited - the row keys to hilite
calculator - the hilite shape calculator
Returns:
if the hilite keys have changed

removeHilitedKeys

protected boolean removeHilitedKeys(Set<RowKey> hilited,
                                    AbstractHistogramVizModel.HistogramHiliteCalculator calculator)
Parameters:
hilited - the row keys to unhilite
calculator - the hilite shape calculator
Returns:
if the hilite keys have changed

clearHilite

public void clearHilite()
Clears the hilite information.


getHiliteRectangle

public Rectangle2D getHiliteRectangle()
The proportional hilite rectangle of this bin which could be displayed if the bars of this bin can't be draw.

Returns:
the proportional hilite rectangle


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.