|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.rollover.RolloverController<T>
public abstract class RolloverController<T extends JComponent>
Controller for "live" behaviour of XXRenderers. Once installed on a component, it updates renderer's rollover state based on the component's rollover properties. Rollover client properties are Points with cell coordinates in the view coordinate system as approriate for the concrete component (Point.x == column, Point.y == row). Repaints effected component regions. Updates link cursor. Installs a click-action bound to space-released in the target's actionMap/inputMap.
Field Summary | |
---|---|
protected T |
component
|
static String |
EXECUTE_BUTTON_ACTIONCOMMAND
the key of the rollover click action which is installed in the component's actionMap. |
Constructor Summary | |
---|---|
RolloverController()
|
Method Summary | |
---|---|
protected void |
click(Point location)
called on change of client property Clicked_key. |
protected Action |
createExecuteButtonAction()
creates and returns the click action to install in the component's actionMap. |
protected abstract Point |
getFocusedCell()
The coordinates of the focused cell in view coordinates. |
protected abstract RolloverRenderer |
getRolloverRenderer(Point location,
boolean prepare)
Returns the rolloverRenderer at the given location. |
protected boolean |
hasRollover(Point location)
checks and returns if the cell at the given location has rollover effects. |
void |
install(T table)
Install this as controller for the given component. |
protected boolean |
isClickable(Point location)
checks and returns if the cell at the given location is clickable. |
void |
propertyChange(PropertyChangeEvent evt)
This method gets called when a bound property is changed. |
protected void |
registerExecuteButtonAction()
installs and registers the click action in the component's actionMap/inputMap. |
void |
release()
Uninstall this as controller from the component, if any. |
protected abstract void |
rollover(Point oldLocation,
Point newLocation)
called on change of client property Rollover_Key. |
protected void |
unregisterExecuteButtonAction()
uninstalls and deregisters the click action from the component's actionMap/inputMap. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String EXECUTE_BUTTON_ACTIONCOMMAND
protected T extends JComponent component
Constructor Detail |
---|
public RolloverController()
Method Detail |
---|
public void propertyChange(PropertyChangeEvent evt)
java.beans.PropertyChangeListener
propertyChange
in interface PropertyChangeListener
evt
- A PropertyChangeEvent object describing the event source
and the property that has changed.public void install(T table)
table
- the component which has renderers to control.public void release()
protected abstract void rollover(Point oldLocation, Point newLocation)
oldLocation
- the old value of the rollover location.newLocation
- the new value of the rollover location.protected void click(Point location)
location
- the new value of the clicked location.protected abstract RolloverRenderer getRolloverRenderer(Point location, boolean prepare)
The result may be null if there is none or if rollover is not enabled. If the prepare flag is true, the renderer will be prepared with value and state as appropriate for the given location. Note: PRE - the location must be valid in cell coordinate space.
location
- a valid location in cell coordinates, p.x == column, p.y == row.prepare
-
RolloverRenderer
at the given locationprotected boolean isClickable(Point location)
location
- in cell coordinates, p.x == column, p.y == row.
protected boolean hasRollover(Point location)
Always returns false if the location is not valid.
location
- in cell coordinates, p.x == column, p.y == row.
protected abstract Point getFocusedCell()
protected void unregisterExecuteButtonAction()
protected void registerExecuteButtonAction()
protected Action createExecuteButtonAction()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |