bibliothek.gui.dock.station
Class SplitDockStation.DividerListener

java.lang.Object
  extended by javax.swing.event.MouseInputAdapter
      extended by bibliothek.gui.dock.station.SplitDockStation.DividerListener
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, javax.swing.event.MouseInputListener
Enclosing class:
SplitDockStation

private class SplitDockStation.DividerListener
extends javax.swing.event.MouseInputAdapter

This listener is added directly to the Component of this SplitDockStation. This listener reacts when a divider is grabbed by the mouse, and the listener will move the divider to a new position.

Author:
Benjamin Sigg

Field Summary
private  java.awt.Rectangle bounds
          the current bounds of the divider
private  Node current
          the node of the currently selected divider
private  int deltaX
          A small modification of the position of the mouse.
private  int deltaY
          A small modification of the position of the mouse.
private  double divider
          the current location of the divider
private  boolean pressed
          the current state of the mouse: pressed or not pressed
 
Constructor Summary
private SplitDockStation.DividerListener()
           
 
Method Summary
 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.
 
Methods inherited from class javax.swing.event.MouseInputAdapter
mouseClicked, mouseEntered
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

current

private Node current
the node of the currently selected divider


divider

private double divider
the current location of the divider


pressed

private boolean pressed
the current state of the mouse: pressed or not pressed


bounds

private java.awt.Rectangle bounds
the current bounds of the divider


deltaX

private int deltaX
A small modification of the position of the mouse. The modification is the distance to the center of the divider.


deltaY

private int deltaY
A small modification of the position of the mouse. The modification is the distance to the center of the divider.

Constructor Detail

SplitDockStation.DividerListener

private SplitDockStation.DividerListener()
Method Detail

mousePressed

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

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Overrides:
mouseDragged in class javax.swing.event.MouseInputAdapter

mouseReleased

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

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Overrides:
mouseMoved in class javax.swing.event.MouseInputAdapter

mouseExited

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

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