|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.base.node.viz.plotter.scatter.DotInfoArray
public class DotInfoArray
Class that holds all DotInfo
s. You can modify the DotInfos if
you need to. Just sort them after the modifications are done. Some functions
of this class depend on the fact that the Array is sorted.
Field Summary | |
---|---|
static int |
X_THEN_Y_SORT_POLICY
To be passed in the sort method to determine the first and second order criteria. |
static int |
Y_THEN_X_SORT_POLICY
To be passed in the sort method to determine the first and second order criteria. |
Constructor Summary | |
---|---|
DotInfoArray(DotInfo[] dots)
Creates a new array container for DotInfo s. |
|
DotInfoArray(int size)
Creates a new empty container for DotInfo s. |
Method Summary | |
---|---|
static int |
calculateDotSize(int basicSize,
double dotSize)
Returns one side of the square making up a dot. |
DotInfo[] |
getDots()
|
List<DotInfo> |
getDotsAt(int x,
int y,
int dotSize)
Returns a list of dots that sit on the specified coordinates. |
List<DotInfo> |
getDotsContainedIn(int x1,
int y1,
int x2,
int y2,
int dotSize)
Returns a list of dots that sit in the specified rectangle (including the boundaries of the rectangle). |
int |
length()
|
void |
sort(int sortPolicy)
Sorts (or re-sorts) the array of DotInfos by the X and Y coordinates. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int X_THEN_Y_SORT_POLICY
public static final int Y_THEN_X_SORT_POLICY
Constructor Detail |
---|
public DotInfoArray(int size)
DotInfo
s. Reserving
space for size elements (cannot be resized!)
size
- the number of elements to be stored in this array.public DotInfoArray(DotInfo[] dots)
DotInfo
s. The reference
to the array passed in will be taken over.
dots
- A reference to an array that will become part of this objectMethod Detail |
---|
public void sort(int sortPolicy)
sortPolicy
- determines which coordinate is the first and second
order cirteria. This results in two order criterias: first x
then y and vice versa. The following two policies are
available DotInfoArray.X_THEN_Y_SORT_POLICY
and
DotInfoArray.Y_THEN_X_SORT_POLICY
.public int length()
public DotInfo[] getDots()
public List<DotInfo> getDotsAt(int x, int y, int dotSize)
x
- the X coordinate.y
- the Y coordinate.dotSize
- the size (width and height) of one dot.
public List<DotInfo> getDotsContainedIn(int x1, int y1, int x2, int y2, int dotSize)
x1
- the X coordinate of one corner of the rectangley1
- the Y coordinate of one corner of the rectanglex2
- the X coordinate of the opposite cornery2
- the Y coordinate of the opposite cornerdotSize
- the width and height of each dot
public static final int calculateDotSize(int basicSize, double dotSize)
basicSize
- the user defined dot size.dotSize
- the individual and relative dot size [0,1].
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |