|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jstatcom.table.JSCMouseListenerTypes
public abstract class JSCMouseListenerTypes
A MouseListener
to be used with a JSCAbstractDataTable
that reacts to
mousePressed
events and double clicks
. Subclasses must override
the abstract methods clicked
and doubleClicked
to define the desired actions. It contains an extendable enumeration of
several listeners that are used in certain modeling contexts.
The mouseClicked
and mousePressed
methods are made
final to make sure that JSCMouseListenerTypes
have a
certain predictable behaviour.
The class implements the typesave enum pattern (Joshua Bloch, "Effective Java", Item 21).
If you compare JSCMouseListenerTypes
, always use the ==
operator. This is
save, because they are Singletons (Gamma et al., 1995).
Field Summary | |
---|---|
static JSCMouseListenerTypes |
DIAG_01NEGINF
A MouseListener that alternates an element between
0, 1 and -INF by repeatedly clicking on it. |
static JSCMouseListenerTypes |
DIAG_0NEGINF
A MouseListener that alternates an element between
0 and -INF by repeatedly clicking on it. |
static JSCMouseListenerTypes |
DIAGONAL_01
A MouseListener that alternates an element between
0 and 1 by repeatedly clicking on it. |
static JSCMouseListenerTypes |
SUBSET_01
A MouseListener that alternates an element between
0 and 1 by repeatedly clicking on it. |
static JSCMouseListenerTypes |
SUBSET_012
A MouseListener that alternates an element between
0, 1 and 2 by repeatedly clicking on it. |
static JSCMouseListenerTypes |
SUBSET_01M1
A MouseListener that alternates an element between
0, 1 and -1 by repeatedly clicking on it. |
static JSCMouseListenerTypes |
SUBSET_0NEGINF
A MouseListener that alternates an element between
0 and -INF by repeatedly clicking on it. |
Method Summary | |
---|---|
abstract void |
clicked(JSCAbstractDataTable table,
JSCData data,
int row,
int col)
Invoked by mouseClicked if a single click on the underlying
data table occured. |
abstract void |
doubleClicked(JSCAbstractDataTable table,
JSCData data,
int row,
int col)
Invoked by mouseClicked if a double click on the underlying
data table occured. |
boolean |
equals(java.lang.Object o)
Override prevention method to enforce a.equals(b) if and only if a==b . |
java.lang.String |
getName()
Gets the name of this type. |
int |
hashCode()
Override prevention method invokes super method. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Implementation of mouseClicked for double click events,
that gets the underlying the table model and the corresponding location. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Empty default implementation. |
void |
mouseExited(java.awt.event.MouseEvent e)
Empty default implementation. |
void |
mousePressed(java.awt.event.MouseEvent e)
Implementation of mousePressed , that gets the underlying the table model
and the corresponding location. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Empty default implementation. |
java.lang.String |
toString()
Gets a string representing this type, do not use for comparisons. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final JSCMouseListenerTypes SUBSET_01
MouseListener
that alternates an element between
0 and 1 by repeatedly clicking on it. If a corresponding
subset restriction is set, nothing is done on that element.
It can be used for setting a priori subset restrictions.
public static final JSCMouseListenerTypes SUBSET_012
MouseListener
that alternates an element between
0, 1 and 2 by repeatedly clicking on it. If a corresponding
subset restriction is set, nothing is done on that element.
It can be used for setting a priori subset restrictions to be used by
a search procedure.
public static final JSCMouseListenerTypes SUBSET_01M1
MouseListener
that alternates an element between
0, 1 and -1 by repeatedly clicking on it.
public static final JSCMouseListenerTypes DIAGONAL_01
MouseListener
that alternates an element between
0 and 1 by repeatedly clicking on it. In addition to that
it does nothing on the diagonal elements. If a corresponding
subset restriction is set, nothing is done on that element.
It can be used for the matrix of structural coefficients.
public static final JSCMouseListenerTypes DIAG_01NEGINF
MouseListener
that alternates an element between
0, 1 and -INF
by repeatedly clicking on it. It can be used for the
A and B matrices of an SVAR model.
Diagonal elements are not changed.
public static final JSCMouseListenerTypes SUBSET_0NEGINF
MouseListener
that alternates an element between
0 and -INF
by repeatedly clicking on it. It can be used for the
C and PSI matrices of an SVEC model.
public static final JSCMouseListenerTypes DIAG_0NEGINF
MouseListener
that alternates an element between
0 and -INF
by repeatedly clicking on it. It can be used for the
C and PSI matrices of an SVEC model.
Diagonal elements are not changed.
Method Detail |
---|
public abstract void clicked(JSCAbstractDataTable table, JSCData data, int row, int col)
mouseClicked
if a single click on the underlying
data table occured.
table
- the data table, where the event originatesdata
- the data model of the tablerow
- index for rowcol
- index for columnpublic abstract void doubleClicked(JSCAbstractDataTable table, JSCData data, int row, int col)
mouseClicked
if a double click on the underlying
data table occured.
table
- the data table, where the event originatesdata
- the data model of the tablerow
- index for rowcol
- index for columnpublic final boolean equals(java.lang.Object o)
a.equals(b)
if and only if a==b
.
equals
in class java.lang.Object
o
- object to compare with
true
if equal, false
otherwisepublic final java.lang.String getName()
public final int hashCode()
hashCode
in class java.lang.Object
public final void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
for double click events,
that gets the underlying the table model and the corresponding location.
It then calls the abstract method doubleClicked
that needs
to be overwritten by subclasses of JSCMouseListenerTypes
.
The method does nothing for single click events, because mousePressed
is
more appropriate for this.
mouseClicked
in interface java.awt.event.MouseListener
java.lang.RuntimeException
- if underlying model is not
JSCData
or table is not JSCAbstractDataTable
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
e
- a mouse eventpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
e
- eea mouse eventpublic final void mousePressed(java.awt.event.MouseEvent e)
mousePressed
, that gets the underlying the table model
and the corresponding location. It then calls the abstract method
clicked
that needs to be overwritten by subclasses of
JSCMouseListenerTypes
.
mousePressed
in interface java.awt.event.MouseListener
java.lang.RuntimeException
- if underlying model is not
JSCData
or table is not JSCAbstractDataTable
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
e
- a mouse eventpublic final java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |