bibliothek.gui.dock.station.split
Class DefaultSplitDividerStrategy.Handler

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by bibliothek.gui.dock.station.split.DefaultSplitDividerStrategy.Handler
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener
Enclosing class:
DefaultSplitDividerStrategy

public static class DefaultSplitDividerStrategy.Handler
extends java.awt.event.MouseAdapter
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

A DefaultSplitDividerStrategy.Handler is responsible for handling the needs of one SplitDockStation.

Author:
Benjamin Sigg

Constructor Summary
DefaultSplitDividerStrategy.Handler(SplitDockStation station)
          Creates a new strategy that will monitor station.
 
Method Summary
protected  void checkMousePositionAsync()
          Asynchronously checks the current position of the mouse and updates the cursor if necessary.
 void destroy()
          Disposes all resources that are used by this handler.
 java.awt.Component getContainer()
          Gets the Component with which this strategy was initialized.
 SplitDockStation getStation()
          Gets the station which is monitored by this strategy
 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.
 
Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseEntered
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered
 

Constructor Detail

DefaultSplitDividerStrategy.Handler

public DefaultSplitDividerStrategy.Handler(SplitDockStation station)
Creates a new strategy that will monitor station.

Parameters:
station - the station to monitor
Method Detail

getStation

public SplitDockStation getStation()
Gets the station which is monitored by this strategy

Returns:
the owner of this strategy

install

public void install(java.awt.Component container)

getContainer

public java.awt.Component getContainer()
Gets the Component with which this strategy was initialized.

Returns:
the argument from install(Component)

destroy

public void destroy()
Disposes all resources that are used by this handler.


setCursor

protected void setCursor(java.awt.Cursor cursor)
Changes the cursor of the base component. Subclasses may override this method to use custom cursors.

Parameters:
cursor - the cursor to set, may be null

repaint

protected void repaint(int x,
                       int y,
                       int width,
                       int height)
Repaints parts of the base component.

Parameters:
x - x coordinate
y - y coordinate
width - the width of the are to repaint
height - the height of the are to repaint

checkMousePositionAsync

protected void checkMousePositionAsync()
Asynchronously checks the current position of the mouse and updates the cursor if necessary.


mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class java.awt.event.MouseAdapter

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class java.awt.event.MouseAdapter

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener
Overrides:
mouseExited in class java.awt.event.MouseAdapter

paint

public void paint(java.awt.Graphics g)
Paints a line at the current location of the divider.

Parameters:
g - the Graphics used to paint