|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectchart.Filter
public class Filter
Provides the possibility to filter the Designs on a Chart.
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
Chart
,
Axis
,
Parameter
,
Design
,
Serialized FormField Summary | |
---|---|
private Axis |
axis
The axis to which the Filter belongs. |
private DataSheet |
dataSheet
The data sheet. |
private int |
filterType
The filter type. |
static int |
LOWER_FILTER
Constant that described a lower filter. |
(package private) static boolean |
printLog
Flag to enable debug message printing for this class. |
(package private) static long |
serialVersionUID
The version tracking unique identifier for Serialization. |
static int |
UPPER_FILTER
Constant that describes an upper filter. |
private int |
xPos
The x position of the Filter on the Chart. |
private int |
yPos
The y position of the Filter on the Chart. |
Constructor Summary | |
---|---|
Filter(DataSheet dataSheet,
Axis axis,
int filterType)
Instantiates a new filter. |
Method Summary | |
---|---|
void |
applyToDesigns()
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. |
private void |
log(java.lang.String message)
Prints debug information to stdout when printLog is set to true. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final long serialVersionUID
static final boolean printLog
public static final int UPPER_FILTER
public static final int LOWER_FILTER
private DataSheet dataSheet
private int filterType
private Axis axis
private int xPos
private int yPos
Constructor Detail |
---|
public Filter(DataSheet dataSheet, Axis axis, int filterType)
dataSheet
- the data sheetaxis
- the axis to which the Filter belongsfilterType
- the filter type: UPPER_FILTER, LOWER_FILTERMethod Detail |
---|
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 applyToDesigns()
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.
private void log(java.lang.String message)
message
- the message
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |