|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.base.node.viz.aggregation.AggregationValModel<T,S,H>
T
- the type of the concrete sub model implementationS
- the basic shapeH
- the optional hilite shapepublic abstract class AggregationValModel<T extends AggregationValSubModel<S,H>,S extends Shape,H extends Shape>
This abstract class holds the data of a particular aggregation value and its
AggregationValSubModel
s.
Constructor Summary | |
---|---|
protected |
AggregationValModel(ConfigRO config,
ExecutionMonitor exec)
Constructor for class AggregationValModel. |
protected |
AggregationValModel(String name,
Color color,
boolean supportHiliting)
Constructor for class AttributeValModel. |
protected |
AggregationValModel(String name,
Color color,
Map<Color,T> elements,
int rowCounter,
int valueCounter,
double aggrSum,
boolean supportHiliting)
Constructor for class AttributeValModel. |
Method Summary | |
---|---|
void |
addDataRow(Color color,
RowKey rowKey,
DataCell cell)
Adds a new row to this element. |
protected void |
calculateHiliteShape(HiliteShapeCalculator<S,H> calculator)
Overwrite this method to support hiliting. |
void |
clearHilite()
Clears all hilite information. |
protected AggregationValModel<T,S,H> |
clone()
|
protected abstract T |
createElement(Color color)
|
double |
getAggregationSum()
|
double |
getAggregationValue(AggregationMethod method)
|
Color |
getColor()
|
T |
getElement(Color color)
|
Collection<T> |
getElements()
|
int |
getHiliteRowCount()
Call the AggregationModel.supportsHiliting() method to check if hiliting
is supported. |
H |
getHiliteShape()
Call the AggregationModel.supportsHiliting() method to check if hiliting
is supported. |
String |
getName()
|
int |
getNoOfElements()
|
int |
getRowCount()
|
List<T> |
getSelectedElements()
|
T |
getSelectedSubElement(Point p)
Returns the sub element of this element that contains the given point or null if none contains the point. |
S |
getShape()
|
int |
getValueCount()
|
boolean |
isEmpty()
|
boolean |
isHilited()
|
boolean |
isPresentable()
|
boolean |
isSelected()
|
protected abstract Collection<T> |
loadElements(ConfigRO config,
ExecutionMonitor exec)
|
boolean |
removeHilitedKeys(Collection<RowKey> hilited,
HiliteShapeCalculator<S,H> calculator)
|
void |
save2File(ConfigWO config,
ExecutionMonitor exec)
|
protected abstract void |
saveElements(Collection<T> elements,
ConfigWO config,
ExecutionMonitor exec)
|
boolean |
selectElement(Point point,
boolean detailed)
|
boolean |
selectElement(Rectangle2D rect,
boolean detailed)
Selects all sub element of this element which intersect the given rectangle. |
void |
setColor(Color color)
|
boolean |
setHilitedKeys(Collection<RowKey> hilited,
HiliteShapeCalculator<S,H> calculator)
|
protected void |
setHiliteShape(H shape)
|
protected void |
setPresentable(boolean presentable,
HiliteShapeCalculator<S,H> calculator)
|
boolean |
setSelected(boolean selected)
|
void |
setShape(S shape,
HiliteShapeCalculator<S,H> calculator)
|
boolean |
supportsHiliting()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AggregationValModel(String name, Color color, boolean supportHiliting)
name
- the name of this elementcolor
- the color to use for this elementsupportHiliting
- if hiliting should be supportedprotected AggregationValModel(String name, Color color, Map<Color,T> elements, int rowCounter, int valueCounter, double aggrSum, boolean supportHiliting)
name
- the name of this elementcolor
- the color of this elementelements
- the sub elementsrowCounter
- the number of rows including missing valuesvalueCounter
- the number of values exl. missing valuesaggrSum
- the aggregation sumsupportHiliting
- if hiliting should be supportedprotected AggregationValModel(ConfigRO config, ExecutionMonitor exec) throws InvalidSettingsException, CanceledExecutionException
config
- the config object to useexec
- the ExecutionMonitor
to provide progress information
InvalidSettingsException
- if the config object is invalid
CanceledExecutionException
- if the operation is canceledMethod Detail |
---|
protected abstract Collection<T> loadElements(ConfigRO config, ExecutionMonitor exec) throws CanceledExecutionException, InvalidSettingsException
config
- the config object to useexec
- the ExecutionMonitor
to provide progress information
CanceledExecutionException
- if the operation is canceled
InvalidSettingsException
- if the config object is invalidpublic void addDataRow(Color color, RowKey rowKey, DataCell cell)
color
- the color of the data rowrowKey
- the row keycell
- the optional aggregation value cellprotected abstract T createElement(Color color)
color
- the color of the new sub element
public String getName()
getName
in interface AggregationModel<S extends Shape,H extends Shape>
null
)public void setColor(Color color)
color
- the new color of this aggregation value modelpublic Color getColor()
getColor
in interface AggregationModel<S extends Shape,H extends Shape>
public T getElement(Color color)
color
- the color of the sub element
null
if none
sub element with the given color existspublic Collection<T> getElements()
public List<T> getSelectedElements()
public T getSelectedSubElement(Point p)
null
if none contains the point.
p
- the point to select
null
public int getNoOfElements()
public int getRowCount()
getRowCount
in interface AggregationModel<S extends Shape,H extends Shape>
public double getAggregationSum()
getAggregationSum
in interface AggregationModel<S extends Shape,H extends Shape>
public int getValueCount()
getValueCount
in interface AggregationModel<S extends Shape,H extends Shape>
public double getAggregationValue(AggregationMethod method)
getAggregationValue
in interface AggregationModel<S extends Shape,H extends Shape>
method
- the AggregationMethod
to use
public S getShape()
getShape
in interface AggregationModel<S extends Shape,H extends Shape>
public void setShape(S shape, HiliteShapeCalculator<S,H> calculator)
shape
- the shape check for selection and drawingcalculator
- the hilite shape calculatorpublic H getHiliteShape()
AggregationModel.supportsHiliting()
method to check if hiliting
is supported.
getHiliteShape
in interface AggregationModel<S extends Shape,H extends Shape>
protected void setHiliteShape(H shape)
shape
- the hilite shape to drawprotected void setPresentable(boolean presentable, HiliteShapeCalculator<S,H> calculator)
presentable
- true
if this element is presentablecalculator
- the hilite shape calculatorpublic boolean isPresentable()
isPresentable
in interface AggregationModel<S extends Shape,H extends Shape>
true
if the sub elements should be drawnpublic boolean isSelected()
isSelected
in interface AggregationModel<S extends Shape,H extends Shape>
true
if this element is selectedpublic boolean setSelected(boolean selected)
selected
- true
if this element is selected
true
if the parameter has changedpublic boolean selectElement(Point point, boolean detailed)
point
- the Point
to checkdetailed
- if also the sub sections should be checked
true
if at least one sub element of this element
contains the pointpublic boolean selectElement(Rectangle2D rect, boolean detailed)
rect
- the Rectangle2D
to checkdetailed
- if also the sub sections should be checked
true
if at least one sub element of this element
intersects the rectanglepublic boolean supportsHiliting()
supportsHiliting
in interface AggregationModel<S extends Shape,H extends Shape>
true
if hiliting is supportedpublic boolean isEmpty()
isEmpty
in interface AggregationModel<S extends Shape,H extends Shape>
true
if this model contains no rowspublic boolean isHilited()
isHilited
in interface AggregationModel<S extends Shape,H extends Shape>
true
if at least one row of this element is hilitedpublic int getHiliteRowCount()
AggregationModel.supportsHiliting()
method to check if hiliting
is supported.
getHiliteRowCount
in interface AggregationModel<S extends Shape,H extends Shape>
public boolean removeHilitedKeys(Collection<RowKey> hilited, HiliteShapeCalculator<S,H> calculator)
hilited
- the row keys to unhilitecalculator
- the hilite shape calculator
public boolean setHilitedKeys(Collection<RowKey> hilited, HiliteShapeCalculator<S,H> calculator)
hilited
- the row keys to hilitecalculator
- the hilite shape calculator
public void clearHilite()
protected void calculateHiliteShape(HiliteShapeCalculator<S,H> calculator)
calculator
- the optional hilite calculatorprotected AggregationValModel<T,S,H> clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
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 canceledprotected abstract void saveElements(Collection<T> elements, ConfigWO config, ExecutionMonitor exec) throws CanceledExecutionException
elements
- the elements to saveconfig
- the config object to useexec
- the ExecutionMonitor
to provide progress information
CanceledExecutionException
- if the operation is canceled
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |