chart
public class Filter extends java.lang.Object implements java.io.Serializable
ParallelCoordinatesChart
.
Filtered Designs are not displayed on he Chart anymore, or are displayed in a different color than the unfiltered Designs.
Each filter is a small triangular draggable symbol on an Axis. Each Axis has two filters, an upper Filter and a lower Filter. The upper Filter is used to filter out all Designs that have a larger value than the Filter value for the Parameter represented by the Filter's Axis. Accordingly, the lower Filter is used to filter out all Designs that have a lower value than the Filter value for the Parameter represented by the Filter's Axis.
The behavior described above changes when
ParallelCoordinatesChart
,
Axis
,
Parameter
,
Design
,
Serialized FormModifier and Type | Field and Description |
---|---|
static double |
FILTER_TOLERANCE
Filter tolerance to compensate round off errors and prevent filtering designs that are not supposed to be filtered.
|
static int |
LOWER_FILTER
Constant that described a lower filter.
|
static int |
UPPER_FILTER
Constant that describes an upper filter.
|
Constructor and Description |
---|
Filter(DataSheet dataSheet,
Axis axis,
int filterType)
Instantiates a new filter.
|
Modifier and Type | Method and Description |
---|---|
void |
apply()
Applies the Filter to all designs.
|
Axis |
getAxis()
Gets the axis to which the Filter belongs.
|
int |
getFilterType()
Gets the filter type.
|
int |
getHighestPos()
Gets the highest position that this Filter may reach.
|
int |
getLowestPos()
Gets the lowest position that this Filter may reach.
|
double |
getValue()
Gets the current value of this Filter.
|
int |
getXPos()
Gets the x position of this Filter on the Chart.
|
int |
getYPos()
Gets the y position of this Filter on the Chart.
|
void |
reset()
Resets the filter.
|
void |
setValue(double value)
Sets the current value of this Filter.
|
void |
setXPos(int pos)
Sets the x position of this Filter on the Chart.
|
void |
setYPos(int pos)
Sets the y position of this Filter on the Chart.
|
public static final int UPPER_FILTER
public static final int LOWER_FILTER
public static final double FILTER_TOLERANCE
public double getValue()
public void setValue(double value)
Also calls applyToDesigns in order to make sure that the modified Filter positions is accounted for in the Filter states of all Designs.
value
- the new current value of this Filter.public int getXPos()
public void setXPos(int pos)
pos
- the new x position of this Filter on the Chart.public int getYPos()
public void setYPos(int pos)
Also calls applyToDesigns in order to make sure that the modified Filter positions is accounted for in the Filter states of all Designs.
pos
- the new y position of this Filter on the Chart.public int getHighestPos()
Used to make sure that a lower Filter is not dragged to a position above the upper Filter or outside the Axis range.
public int getLowestPos()
Used to make sure that a upper Filter is not dragged to a position below the lower Filter or outside the Axis range.
public int getFilterType()
public Axis getAxis()
public void apply()
This method has to be called every time this Filter value is modified. This allows to check the Filtering state of a Design with respect to a Filter only when there is actually a reason for checking rather then upon every repaint.
This implementation was chosen because the check if a design is filtered would become to CPU expensive otherwise because each Filter would have to be checked for each design every time the Chart is repainted.
public void reset()