public static class DefaultSplitDividerStrategy.Handler extends java.awt.event.MouseAdapter implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.AWTEventListener, DockHierarchyListener
DefaultSplitDividerStrategy.Handler
is responsible for handling the needs of one SplitDockStation
.Constructor and Description |
---|
Handler(SplitDockStation station)
Creates a new strategy that will monitor
station . |
Modifier and Type | Method and Description |
---|---|
protected void |
checkMousePositionAsync()
Asynchronously checks the current position of the mouse and updates the cursor
if necessary.
|
void |
controllerChanged(DockHierarchyEvent event)
Invoked whenever the controller of
dockable has changed |
void |
destroy()
Disposes all resources that are used by this handler.
|
void |
eventDispatched(java.awt.AWTEvent event)
AWT event listener.
|
java.awt.Component |
getContainer()
Gets the
Component with which this strategy was initialized . |
protected Divideable |
getDividerNode(int x,
int y)
Gets the node whose divider contains
x, y . |
SplitDockStation |
getStation()
Gets the station which is monitored by this strategy
|
void |
hierarchyChanged(DockHierarchyEvent event)
Called when the path of the observed
Dockable has been changed. |
void |
install(java.awt.Component container) |
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mouseExited(java.awt.event.MouseEvent e) |
void |
mouseMoved(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
void |
paint(java.awt.Graphics g)
Paints a line at the current location of the divider.
|
protected void |
repaint(int x,
int y,
int width,
int height)
Repaints parts of the
base component . |
protected void |
setCursor(java.awt.Cursor cursor)
Changes the cursor of
the base component . |
protected void |
setDivider(Divideable node,
double divider)
Called if the divider of
node needs to be changed. |
mouseClicked, mouseEntered, mouseWheelMoved
public Handler(SplitDockStation station)
station
.station
- the station to monitorpublic SplitDockStation getStation()
public void install(java.awt.Component container)
public void hierarchyChanged(DockHierarchyEvent event)
DockHierarchyListener
Dockable
has been changed.hierarchyChanged
in interface DockHierarchyListener
event
- the new pathpublic void controllerChanged(DockHierarchyEvent event)
DockHierarchyListener
dockable
has changedcontrollerChanged
in interface DockHierarchyListener
event
- the current path and controllerpublic void eventDispatched(java.awt.AWTEvent event)
eventDispatched
in interface java.awt.event.AWTEventListener
event
- public java.awt.Component getContainer()
Component
with which this strategy was initialized
.install(Component)
public void destroy()
protected void setCursor(java.awt.Cursor cursor)
the base component
. Subclasses may override this
method to use custom cursors.cursor
- the cursor to set, may be null
protected void repaint(int x, int y, int width, int height)
base component
.x
- x coordinatey
- y coordinatewidth
- the width of the are to repaintheight
- the height of the are to repaintprotected Divideable getDividerNode(int x, int y)
x, y
.x
- the x coordinatey
- the y coordinatex, y
protected void checkMousePositionAsync()
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class java.awt.event.MouseAdapter
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class java.awt.event.MouseAdapter
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class java.awt.event.MouseAdapter
protected void setDivider(Divideable node, double divider)
node
needs to be changed.node
- the node whose divider changesdivider
- the new dividerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class java.awt.event.MouseAdapter
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
mouseExited
in class java.awt.event.MouseAdapter
public void paint(java.awt.Graphics g)
g
- the Graphics used to paint