net.infonode.gui.draggable
Class DraggableComponent

java.lang.Object
  extended by net.infonode.gui.draggable.DraggableComponent

public class DraggableComponent
extends java.lang.Object


Field Summary
private  int abortDragKeyCode
           
private  java.awt.KeyEventDispatcher abortDragKeyDispatcher
           
private  javax.swing.JComponent component
           
private  boolean detectOuterAreaAsLine
           
private  boolean dragEventFired
           
private  int dragFromIndex
           
private  int dragIndex
           
private  boolean dragStarted
           
private  boolean enabled
           
private  boolean enableInsideDrag
           
private  javax.swing.JComponent[] eventComponents
           
private  boolean ignoreAddNotify
           
private  java.util.ArrayList layoutOrderList
           
private  java.util.ArrayList listeners
           
private static long MAX_EVENT_DELAY
           
private  javax.swing.event.MouseInputListener mouseInputListener
           
private  boolean mousePressed
           
private  javax.swing.JComponent outerParentArea
           
private  boolean reorderEnabled
           
private  boolean reorderRestoreOnDrag
           
private  boolean selectOnMousePress
           
 
Constructor Summary
DraggableComponent(javax.swing.JComponent component)
           
DraggableComponent(javax.swing.JComponent component, javax.swing.JComponent eventComponent)
           
DraggableComponent(javax.swing.JComponent component, javax.swing.JComponent[] eventComponents)
           
 
Method Summary
 void abortDrag()
           
private  void addComponent(java.awt.Container parent, java.awt.Component c, int index)
           
 void addListener(DraggableComponentListener l)
           
private  boolean checkParentContains(java.awt.Point p)
           
private  void doDrag(java.awt.Point p)
           
private  void doRevalidateComponentTree(javax.swing.JComponent c)
           
 void drag(java.awt.Point p)
           
private  void dragCompleted(java.awt.event.MouseEvent e)
           
private  void dragged(java.awt.event.MouseEvent e)
           
private  void fireChangedEvent(int type)
           
private  void fireDraggedEvent(java.awt.event.MouseEvent mouseEvent)
           
private  void fireDroppedEvent(java.awt.event.MouseEvent mouseEvent)
           
private  void fireNotDroppedEvent()
           
private  void fireSelectedEvent()
           
 int getAbortDragKeyCode()
           
 javax.swing.JComponent getComponent()
           
private  javax.swing.JComponent getComponent(java.awt.Container parent, int index)
           
private  int getComponentIndex(java.awt.Component c)
           
 javax.swing.JComponent[] getEventComponents()
           
private  int getMoveComponentIndex(java.awt.Point p)
           
 boolean isDetectOuterAreaAsLine()
           
 boolean isEnabled()
           
 boolean isEnableInsideDrag()
           
 boolean isIgnoreAddNotify()
           
 boolean isReorderEnabled()
           
 boolean isReorderRestoreOnDrag()
           
 boolean isSelectOnMousePress()
           
private  boolean isVerticalDrag()
           
private  void pressed(java.awt.event.MouseEvent e)
           
private  void released(java.awt.event.MouseEvent e)
           
private  void removeComponent(java.awt.Container parent, java.awt.Component c, int index)
           
 void removeListener(DraggableComponentListener l)
           
private  void restoreComponentOrder()
           
private  void revalidateComponentTree(javax.swing.JComponent c)
           
 void select()
           
 void setAbortDragKeyCode(int abortDragKeyCode)
           
 void setDetectOuterAreaAsLine(boolean detectOuterAreaAsLine)
           
 void setEnabled(boolean enabled)
           
 void setEnableInsideDrag(boolean enableInsideDrag)
           
 void setEventComponents(javax.swing.JComponent[] eventComponents)
           
 void setIgnoreAddNotify(boolean ignoreAddNotify)
           
 void setLayoutOrderList(java.util.ArrayList layoutOrderList)
           
 void setOuterParentArea(javax.swing.JComponent outerParentArea)
           
 void setReorderEnabled(boolean reorderEnabled)
           
 void setReorderRestoreOnDrag(boolean reorderRestoreOnDrag)
           
 void setSelectOnMousePress(boolean selectOnMousePress)
           
private  void updateParent()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_EVENT_DELAY

private static long MAX_EVENT_DELAY

component

private javax.swing.JComponent component

eventComponents

private javax.swing.JComponent[] eventComponents

reorderEnabled

private boolean reorderEnabled

enabled

private boolean enabled

reorderRestoreOnDrag

private boolean reorderRestoreOnDrag

detectOuterAreaAsLine

private boolean detectOuterAreaAsLine

enableInsideDrag

private boolean enableInsideDrag

selectOnMousePress

private boolean selectOnMousePress

mousePressed

private boolean mousePressed

dragEventFired

private boolean dragEventFired

dragStarted

private boolean dragStarted

ignoreAddNotify

private boolean ignoreAddNotify

dragIndex

private int dragIndex

dragFromIndex

private int dragFromIndex

abortDragKeyCode

private int abortDragKeyCode

layoutOrderList

private java.util.ArrayList layoutOrderList

listeners

private java.util.ArrayList listeners

outerParentArea

private javax.swing.JComponent outerParentArea

abortDragKeyDispatcher

private java.awt.KeyEventDispatcher abortDragKeyDispatcher

mouseInputListener

private javax.swing.event.MouseInputListener mouseInputListener
Constructor Detail

DraggableComponent

public DraggableComponent(javax.swing.JComponent component)

DraggableComponent

public DraggableComponent(javax.swing.JComponent component,
                          javax.swing.JComponent eventComponent)

DraggableComponent

public DraggableComponent(javax.swing.JComponent component,
                          javax.swing.JComponent[] eventComponents)
Method Detail

addListener

public void addListener(DraggableComponentListener l)

removeListener

public void removeListener(DraggableComponentListener l)

getComponent

public javax.swing.JComponent getComponent()

getEventComponents

public javax.swing.JComponent[] getEventComponents()

setEventComponents

public void setEventComponents(javax.swing.JComponent[] eventComponents)

getAbortDragKeyCode

public int getAbortDragKeyCode()

setAbortDragKeyCode

public void setAbortDragKeyCode(int abortDragKeyCode)

isEnabled

public boolean isEnabled()

setEnabled

public void setEnabled(boolean enabled)

isReorderEnabled

public boolean isReorderEnabled()

setReorderEnabled

public void setReorderEnabled(boolean reorderEnabled)

isReorderRestoreOnDrag

public boolean isReorderRestoreOnDrag()

setReorderRestoreOnDrag

public void setReorderRestoreOnDrag(boolean reorderRestoreOnDrag)

isDetectOuterAreaAsLine

public boolean isDetectOuterAreaAsLine()

setDetectOuterAreaAsLine

public void setDetectOuterAreaAsLine(boolean detectOuterAreaAsLine)

isEnableInsideDrag

public boolean isEnableInsideDrag()

setEnableInsideDrag

public void setEnableInsideDrag(boolean enableInsideDrag)

isSelectOnMousePress

public boolean isSelectOnMousePress()

setSelectOnMousePress

public void setSelectOnMousePress(boolean selectOnMousePress)

drag

public void drag(java.awt.Point p)

abortDrag

public void abortDrag()

setLayoutOrderList

public void setLayoutOrderList(java.util.ArrayList layoutOrderList)

select

public void select()

setOuterParentArea

public void setOuterParentArea(javax.swing.JComponent outerParentArea)

isIgnoreAddNotify

public boolean isIgnoreAddNotify()

setIgnoreAddNotify

public void setIgnoreAddNotify(boolean ignoreAddNotify)

pressed

private void pressed(java.awt.event.MouseEvent e)

released

private void released(java.awt.event.MouseEvent e)

dragged

private void dragged(java.awt.event.MouseEvent e)

dragCompleted

private void dragCompleted(java.awt.event.MouseEvent e)

updateParent

private void updateParent()

doDrag

private void doDrag(java.awt.Point p)

isVerticalDrag

private boolean isVerticalDrag()

checkParentContains

private boolean checkParentContains(java.awt.Point p)

getMoveComponentIndex

private int getMoveComponentIndex(java.awt.Point p)

getComponent

private javax.swing.JComponent getComponent(java.awt.Container parent,
                                            int index)

getComponentIndex

private int getComponentIndex(java.awt.Component c)

addComponent

private void addComponent(java.awt.Container parent,
                          java.awt.Component c,
                          int index)

removeComponent

private void removeComponent(java.awt.Container parent,
                             java.awt.Component c,
                             int index)

revalidateComponentTree

private void revalidateComponentTree(javax.swing.JComponent c)

doRevalidateComponentTree

private void doRevalidateComponentTree(javax.swing.JComponent c)

restoreComponentOrder

private void restoreComponentOrder()

fireChangedEvent

private void fireChangedEvent(int type)

fireSelectedEvent

private void fireSelectedEvent()

fireDraggedEvent

private void fireDraggedEvent(java.awt.event.MouseEvent mouseEvent)

fireDroppedEvent

private void fireDroppedEvent(java.awt.event.MouseEvent mouseEvent)

fireNotDroppedEvent

private void fireNotDroppedEvent()