de.uni_paderborn.fujaba.fsa.listener
Class DragMouseListener

java.lang.Object
  extended byjavax.swing.event.MouseInputAdapter
      extended byde.uni_paderborn.fujaba.fsa.listener.ComponentMouseListener
          extended byde.uni_paderborn.fujaba.fsa.listener.DragMouseListener
All Implemented Interfaces:
AscendDescendMouseHandler.Descend, java.util.EventListener, javax.swing.event.MouseInputListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public class DragMouseListener
extends ComponentMouseListener
implements AscendDescendMouseHandler.Descend

Standard mouselistener for Components displaying DiagramItems

Handles dragging and selecting of Objects as well as putting selected Objects on top of others

Version:
$Revision: 1.21.2.1 $
Author:
$Author: fklar $

Field Summary
protected  boolean dragging
          No comment provided by developer, please add a comment to improve documentation.
 
Fields inherited from class de.uni_paderborn.fujaba.fsa.listener.ComponentMouseListener
DISTANCE, EAST, INNER, lastComponent, NORTH, SOUTH, UNKNOWN, WEST
 
Constructor Summary
protected DragMouseListener()
          The default constructor is empty.
 
Method Summary
protected  void dragByDelta(FSAObject fsaObject, int deltaX, int deltaY)
          Drag FSAObject by specified amount.
protected  void dragByDelta(javax.swing.JComponent comp, int deltaX, int deltaY)
          No comment provided by developer, please add a comment to improve documentation.
static DragMouseListener get()
          No comment provided by developer, please add a comment to improve documentation.
 void mouseClicked(java.awt.event.MouseEvent event)
          Overwrites the mouseClicked method of ComponentMouseListener.
 void mouseDragged(java.awt.event.MouseEvent event)
          Overwrites the mouseClicked method of ComponentMouseListener.
 void mousePressed(java.awt.event.MouseEvent event)
          Overwrites the mousePressed method of ComponentMouseListener.
 void mouseReleased(java.awt.event.MouseEvent event)
          Overwrites the mouseReleased method of ComponentMouseListener.
protected  void saveLocationInPolyLine(FSAObject object)
          No comment provided by developer, please add a comment to improve documentation.
protected  void setDragging(boolean drag)
          If drag is true move all selected components to the drag layer.
protected  void setOrientation(java.awt.Component comp, java.awt.event.MouseEvent event)
          Sets the orientation attribute of the DragMouseListener object
 
Methods inherited from class de.uni_paderborn.fujaba.fsa.listener.ComponentMouseListener
getOrientation, setOrientation
 
Methods inherited from class javax.swing.event.MouseInputAdapter
mouseEntered, mouseExited, mouseMoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dragging

protected boolean dragging
No comment provided by developer, please add a comment to improve documentation.

Constructor Detail

DragMouseListener

protected DragMouseListener()
The default constructor is empty.

Method Detail

get

public static DragMouseListener get()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent event)
Overwrites the mouseClicked method of ComponentMouseListener. It sets the lastPoint attribute.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
event - No description provided

mousePressed

public void mousePressed(java.awt.event.MouseEvent event)
Overwrites the mousePressed method of ComponentMouseListener. It sets the lastPoint attribute.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
event - No description provided

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent event)
Overwrites the mouseReleased method of ComponentMouseListener. It sets the lastPoint attribute to null.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
event - No description provided

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent event)
Overwrites the mouseClicked method of ComponentMouseListener. It moves the event's source component to the new calculated position.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
event - No description provided

dragByDelta

protected void dragByDelta(FSAObject fsaObject,
                           int deltaX,
                           int deltaY)
Drag FSAObject by specified amount. Allows FSAObject to react on dragging.

Parameters:
fsaObject - FSAObject to be moved.
deltaX - x-amount
deltaY - y-amount

dragByDelta

protected void dragByDelta(javax.swing.JComponent comp,
                           int deltaX,
                           int deltaY)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
comp - No description provided
deltaX - No description provided
deltaY - No description provided

setDragging

protected void setDragging(boolean drag)
If drag is true move all selected components to the drag layer. If drag is false move all selected components to the default layer. Repaint all modified LayeredPanes afterwards.

Parameters:
drag - The new dragging value

setOrientation

protected void setOrientation(java.awt.Component comp,
                              java.awt.event.MouseEvent event)
Sets the orientation attribute of the DragMouseListener object

Overrides:
setOrientation in class ComponentMouseListener
Parameters:
comp - The new orientation value
event - The new orientation value

saveLocationInPolyLine

protected void saveLocationInPolyLine(FSAObject object)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
object - No description provided