|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.gui.swing.dnd.DragContext
The DragContext interface defines an object that provides
additional information during the drag and drop operation.
Such a class remembers the most recently dragged
VisualGraphObject in order to indicate the drag and drop action
not only with the mouse cursor but also with a visible feedback within the
view.
It is possible to define another representation for the recently dragged
VisualGraphObject in form of a BaseComposite.
If such a representation is defined it will be drawn instead of the
BaseComposite that is assigned to the
VisualGraphObject.
It is also possible to define a scale factor that is used to scale the
BaseComposite that is drawn while dragging takes place.
| Constructor Summary | |
DragContext()
Constructs a new DragContext instance with
a default scaling-factor of 1.0 |
|
| Method Summary | |
java.lang.Object[] |
getAdditionalRecentlyDraggedObjects()
|
VisualGraphObject[] |
getAdditionalRecentlyDraggedVGOS()
|
BaseComposite |
getDragRepresentation()
Returns the drag representation for the recently dragged VisualGraphObject. |
java.lang.Object |
getRecentlyDraggedObject()
Returns the most recently dragged VisualGraphObject. |
double |
getScaleFactor()
Returns the scale factor that is used to draw the recently dragged VisualGraphObject or its drag representation. |
void |
setAdditionalRecentlyDraggedObjects(java.lang.Object[] additional_objects)
|
void |
setDragRepresentation(BaseComposite dragRepresentation)
Sets the drag representation for the recently dragged VisualGraphObject to the value given by
dragRepresentation.
|
void |
setRecentlyDraggedObject(java.lang.Object recentlyDraggedObject)
Sets the most recently dragged VisualGraphObject. |
void |
setScaleFactor(double scalefactor)
Sets the scale factor to the value given by scalefactor.
|
void |
transformDrag(GraphPanel graphPanel,
BaseComposite basecomposite)
Invoked each time a dragEnter() occurs. |
void |
transformDrop(GraphPanel graphPanel,
BaseComposite basecomposite)
Invoked each time a dragEnter() occurs. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DragContext()
DragContext instance with
a default scaling-factor of 1.0
| Method Detail |
public java.lang.Object getRecentlyDraggedObject()
VisualGraphObject.
VisualGraphObject.public void setRecentlyDraggedObject(java.lang.Object recentlyDraggedObject)
VisualGraphObject.
recentlyDraggedObject - the most recently dragged
VisualGraphObject.public java.lang.Object[] getAdditionalRecentlyDraggedObjects()
public void setAdditionalRecentlyDraggedObjects(java.lang.Object[] additional_objects)
public VisualGraphObject[] getAdditionalRecentlyDraggedVGOS()
public double getScaleFactor()
VisualGraphObject or its drag representation.
public void setScaleFactor(double scalefactor)
scalefactor.
The scale factor is used to draw the recently dragged
VisualGraphObject or its drag representation.
scalefactor - the new scale factor to usepublic BaseComposite getDragRepresentation()
VisualGraphObject. The drag representation is drawn instead
of the VisualGraphObject itself while dragging.
If null is returned there is no drag representation defined.
VisualGraphObjectpublic void setDragRepresentation(BaseComposite dragRepresentation)
VisualGraphObject to the value given by
dragRepresentation.
If the value is null the BaseComposite assigned
to the recently dragged VisualGraphObject will be drawn
while dragging otherwise the BaseComposite given by
dragRepresentation will be drawn instead.
dragRepresentation - the representation of the recently dragged
VisualGraphObject that should drawn while dragging
public void transformDrag(GraphPanel graphPanel,
BaseComposite basecomposite)
BaseComposite to its custom needs.
graphPanel - the GraphPanel in which the
drag occured.basecomposite - the BaseComposite that is dragged.
public void transformDrop(GraphPanel graphPanel,
BaseComposite basecomposite)
BaseComposite to its custom needs.
graphPanel - the GraphPanel in which the
drop occured.basecomposite - the BaseComposite that was dropped.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||