|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.knime.base.node.viz.histogram.datamodel.BinDataModel
public class BinDataModel
This class represents one bin in the histogram. A bin represents a value of
the selected x column and contains one or more BarDataModel objects
depending on the number of aggregation columns.
| Constructor Summary | |
|---|---|
BinDataModel(String xAxisCaption,
double lowerBound,
double upperBound)
Constructor for class BinDataModel. |
|
| Method Summary | |
|---|---|
void |
addDataRow(RowKey id,
Color rowColor,
Collection<ColorColumn> aggrCols,
DataCell... aggrVals)
|
void |
clear()
Clears all bars and rows from this bin. |
protected BinDataModel |
clone()
|
protected BarDataModel |
createBar(String barName,
Color color)
Creates a new BarDataModel with the given color. |
BarDataModel |
getBar(Color color)
|
Collection<BarDataModel> |
getBars()
|
Rectangle2D |
getBinRectangle()
|
int |
getBinRowCount()
|
Double |
getLowerBound()
|
double |
getMaxAggregationValue(AggregationMethod method,
HistogramLayout layout)
|
int |
getMaxBarRowCount()
|
double |
getMinAggregationValue(AggregationMethod method,
HistogramLayout layout)
|
int |
getMinRowCount()
|
int |
getNoOfBars()
|
List<BarDataModel> |
getSelectedBars()
|
Rectangle2D |
getSurroundingRectangle()
|
Double |
getUpperBound()
|
String |
getXAxisCaption()
|
DataCell |
getXAxisCaptionCell()
|
boolean |
isPresentable()
|
boolean |
isSelected()
|
static BinDataModel |
loadFromFile(ConfigRO config,
ExecutionMonitor exec)
|
void |
save2File(ConfigWO config,
ExecutionMonitor exec)
|
boolean |
selectElement(Point point)
Selects all elements which contain the given point. |
boolean |
selectElement(Rectangle rect)
Selects all elements which intersect with the given rectangle. |
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!!! |
boolean |
setSelected(boolean selected)
|
void |
updateBinWidth(int startX,
int binWidth,
List<Color> barElementColors,
Collection<ColorColumn> aggrColumns,
int baseLine,
AbstractHistogramVizModel.HistogramHiliteCalculator calculator)
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BinDataModel(String xAxisCaption,
double lowerBound,
double upperBound)
xAxisCaption - the caption of this bin on the x axislowerBound - the lower bound of the bin intervalupperBound - the higher bound of the bin interval| Method Detail |
|---|
public void addDataRow(RowKey id,
Color rowColor,
Collection<ColorColumn> aggrCols,
DataCell... aggrVals)
id - the row idrowColor - the row coloraggrCols - the ColorColumn objects in the same order
like the aggregation valuesaggrVals - the aggregation value in the same order like the
columnspublic String getXAxisCaption()
public DataCell getXAxisCaptionCell()
DataCell
protected BarDataModel createBar(String barName,
Color color)
BarDataModel with the given color.
barName - the name of this barcolor - the Color of the bar
public BarDataModel getBar(Color color)
color - the color of the bar of interest
null if no bar
exists for the given colorpublic Collection<BarDataModel> getBars()
BarDataModel objects of this binpublic List<BarDataModel> getSelectedBars()
public int getNoOfBars()
public double getMaxAggregationValue(AggregationMethod method,
HistogramLayout layout)
method - the AggregationMethod to uselayout - the histogram layout
public int getBinRowCount()
public int getMaxBarRowCount()
public double getMinAggregationValue(AggregationMethod method,
HistogramLayout layout)
method - the AggregationMethod to uselayout - the histogram layout
public int getMinRowCount()
public Double getLowerBound()
nullpublic Double getUpperBound()
nullpublic boolean isPresentable()
true if the number of bars fit in the binpublic Rectangle2D getBinRectangle()
Rectangle the bin should be drawn on the
screenpublic Rectangle2D getSurroundingRectangle()
public void setBinRectangle(Rectangle binRectangle,
int baseLine,
List<Color> barElementColors,
Collection<ColorColumn> aggrColumns,
AbstractHistogramVizModel.HistogramHiliteCalculator calculator)
binRectangle - the Rectangle the bin should be drawn on the
screenbaseLine - the x coordinate of the base line (0) on the screenbarElementColors - all element colors which define the order
the elements should be drawnaggrColumns - the aggregation column array which indicates
the order of the barscalculator - the hilite shape calculator
public void updateBinWidth(int startX,
int binWidth,
List<Color> barElementColors,
Collection<ColorColumn> aggrColumns,
int baseLine,
AbstractHistogramVizModel.HistogramHiliteCalculator calculator)
startX - new x coordinatebinWidth - new bin widthbarElementColors - all element colors which define the order
the elements should be drawnaggrColumns - the current aggregation columnsbaseLine - the base linecalculator - the hilite shape calculatorpublic void clear()
public boolean isSelected()
true if at least one bar is selectedpublic boolean setSelected(boolean selected)
selected - true to select the given bar otherwise
false
true if the parameter has changedpublic boolean selectElement(Point point)
point - the Point to check
true if at least one bar of the bin contains
the pointpublic boolean selectElement(Rectangle rect)
rect - the Rectangle to check
true if at least one bar of the bin contains
the rectangleprotected BinDataModel clone()
clone in class Object
public void save2File(ConfigWO config,
ExecutionMonitor exec)
throws CanceledExecutionException
config - the config object to useexec - the ExecutionMonitor to provide progress messages
CanceledExecutionException - if the operation is canceled
public static BinDataModel loadFromFile(ConfigRO config,
ExecutionMonitor exec)
throws CanceledExecutionException,
InvalidSettingsException
config - the config object to useexec - the ExecutionMonitor to provide progress messages
ColorColumn
CanceledExecutionException - if the operation is canceled
InvalidSettingsException - if the config object is invalid
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||