|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.rosuda.ibase.Notifier org.rosuda.ibase.SMarker
public class SMarker
Maintains a fixed list of markers, i.e. an array of 0..xxx indices that can be marked each.
It uses both a fixed map and dynamic list of marked positions. Moreover it extends
Notifier
class to allow notification upon changes of state.
This marker class implements two independent ways of tagging individual cases: primary and secondary markings.
primary marks are binary only (i.e. on/off) and are implemented in a fashion that allows efficient access to both list of marked cases and fast query for a mark of a case. Main use is to implement highlighting.
secondary marks allow (almost) arbitrary integers to be associated with individual cases. This kind of mark is not specially efficient. Main use is to implement color brushing.
Field Summary | |
---|---|
static int |
MASK_PRIMARY
|
static int |
MASK_RAW
|
static int |
MASK_SECONDARY
|
Constructor Summary | |
---|---|
SMarker(int reqsize)
The only constructor, allocates a new marker |
Method Summary | |
---|---|
boolean |
at(int pos)
checks whether index pos has any mark |
java.util.Enumeration |
elements()
returns Enumeration of the marked indices. |
int |
get(int pos)
gets mark at index pos |
java.util.Vector |
getList()
returns a list of all marked indices |
int[] |
getMaskCopy(int maskType)
get mask of the mark entries (as a newly allocated copy) - that is an array of the same size as the data containing a mark for each case. |
SVarSet |
getMasterSet()
returns master dataset associated with this marker. |
int |
getMaxMark()
returns the highest secondary mark. |
int |
getSec(int pos)
gets secondary mask at insex pos |
int |
getSecCount()
returns the number of cases having a secondary mark (irrespective of any primary mark). |
int[] |
getSelectedIDs()
returns an array with all selected IDs |
int |
marked()
returns the number of marked cases |
void |
resetSec()
removes all secondary marks |
void |
resize(int newsize)
This methods allows to resize the marker. |
java.lang.Object |
run(java.lang.Object o,
java.lang.String cmd)
run command cmd issued by another object |
void |
selectAll()
marks all indices as marked with the specified mark |
void |
selectInverse()
|
void |
selectNone()
clears entire selection (i.e. sets all primary marks to 0) |
void |
set(int pos,
boolean pMark)
sets the primary mark at specified index |
void |
setSec(int pos,
int mark)
sets secondary mark |
void |
setSecBySelection(int markSel,
int markNonsel)
|
void |
setSelected(int mark)
sets secondary mark of all selected cases |
int |
size()
returns size of the marker array |
Methods inherited from class org.rosuda.ibase.Notifier |
---|
addDepend, beginBatch, delDepend, endBatch, NotifyAll, NotifyAll, NotifyAll, NotifyAll, startCascadedNotifyAll |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MASK_PRIMARY
public static final int MASK_SECONDARY
public static final int MASK_RAW
Constructor Detail |
---|
public SMarker(int reqsize)
reqsize
- desired size of the marker array (# of indices)Method Detail |
---|
public void resize(int newsize)
public int size()
public int marked()
public int get(int pos)
pos
pos
- desired index
pos
. primary mask always returns -1 regardless of secondary markpublic int getSec(int pos)
pos
public boolean at(int pos)
pos
has any mark
pos
- desired index
true
if there is a primary mark at the index pos
public java.util.Vector getList()
Vector
of Integer
objectspublic int[] getSelectedIDs()
public int[] getMaskCopy(int maskType)
MASK_PRIMARY
: 0 - no mark, -1 - primary mark set (selection). secondary mark is ignored.MASK_SECONDARY
: any value 0,1,2,... corresponding to the secondary mark. primary mark is ignored.
maskType
- one of the constants MASK_PRIMARY
,MASK_SECONDARY
or MASK_RAW
, see abovepublic void set(int pos, boolean pMark)
pos
- desired indexpMark
- whether the primary mark is setpublic void setSec(int pos, int mark)
public void setSelected(int mark)
public int getMaxMark()
public int getSecCount()
public java.util.Enumeration elements()
Enumeration
of the marked indices.
Integer
objects). Analogous to emelents()
method of a Vector
public void selectNone()
public void selectAll()
mark
- mark to be used for the selection (passing 0 results in a call to selectNone()
method instead)public void selectInverse()
public void resetSec()
public SVarSet getMasterSet()
public java.lang.Object run(java.lang.Object o, java.lang.String cmd)
Commander
run
in interface Commander
o
- origin of the commandcmd
- command string
public void setSecBySelection(int markSel, int markNonsel)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |