ca.sqlpower.architect.swingui
Class PlayPen.FloatingContainerPaneListener

java.lang.Object
  extended by javax.swing.event.MouseInputAdapter
      extended by ca.sqlpower.architect.swingui.PlayPen.FloatingContainerPaneListener
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener, javax.swing.event.MouseInputListener
Enclosing class:
PlayPen

public static class PlayPen.FloatingContainerPaneListener
extends javax.swing.event.MouseInputAdapter

Listens to mouse motion and moves the given component so it follows the mouse. When the user lifts the mouse button, it stops moving the component, and unregisters itself as a listener.


Constructor Summary
PlayPen.FloatingContainerPaneListener(PlayPen pp, ContainerPane<?,?> cp, java.awt.Point handle)
          Creates a new mouse event handler that tracks mouse motion and moves a container pane around on the play pen accordingly.
 
Method Summary
protected  void cleanup()
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
          Anchors the tablepane and disposes this listener instance.
 
Methods inherited from class javax.swing.event.MouseInputAdapter
mouseClicked, mouseEntered, mouseExited, mousePressed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlayPen.FloatingContainerPaneListener

public PlayPen.FloatingContainerPaneListener(PlayPen pp,
                                             ContainerPane<?,?> cp,
                                             java.awt.Point handle)
Creates a new mouse event handler that tracks mouse motion and moves a container pane around on the play pen accordingly.

Parameters:
cp - The container pane that's going to be moved
handle - The position relative to the container pane's top left corner where the mouse pointer should be during the drag operation. For a single container pane drag, this will normally be inside the container pane's bounds, but for a multi-drag, this coordinate will often be a large and/or negative offset for all but one of the floating objects (because the user clicked and dragged one of the selected tables).
addToPP - A flag indicating whether the floating table has not yet been added to the playpen (i.e. it should be added when the user releases the mouse button). This is for "create table" type actions, and should be set to false for dragging existing objects.
Method Detail

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

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)
Anchors the tablepane and disposes this listener instance.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class javax.swing.event.MouseInputAdapter

cleanup

protected void cleanup()


Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca