|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.event.MouseInputAdapter
ca.sqlpower.architect.swingui.Relationship.RelationshipDecorationMover
protected static class Relationship.RelationshipDecorationMover
The RelationshipDecorationMover responds to mouse events on the relationship by moving either the PK or FK connection point so it is near the mouse's current position. It ceases this activity when a mouse button is released.
The normal way to create a RelationshipDecorationMover is like this:
new RelationshipDecorationMover(myRelationship, <true|false>);note that no reference to the object is saved; it will cleanly dispose itself when a mouse button is lifted and hence become eligible for garbage collection.
| Field Summary | |
|---|---|
protected boolean |
movingPk
|
protected Relationship |
r
|
protected java.awt.Point |
startingFk
|
protected java.awt.Point |
startingPk
|
| Constructor Summary | |
|---|---|
Relationship.RelationshipDecorationMover(Relationship r,
boolean movePk)
|
|
| Method Summary | |
|---|---|
protected void |
cleanup()
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Forwards to mouseMoved(java.awt.event.MouseEvent). |
void |
mouseMoved(java.awt.event.MouseEvent e)
Moves either the PK or FK decoration (depending on the movingPk flag) so it is as close to the mouse
pointer as possible, while still being attached to an edge
of the parent (for PK) or child (for FK) table. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Cleans up this mover (it will no longer track mouse motion, and will become eligible for garbage collection unless this instance's creator saved a reference). |
protected java.awt.Point |
translatePoint(java.awt.Point p)
Translates the given point from Relationship coordinates into PKTable or FKTable coordinates, with the help of the Relationship's UI delegate (which ensures the decoration still lines up with the table's edge, and that it faces the right way, and that it snaps to a straight line when close). |
| 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 |
| Field Detail |
|---|
protected Relationship r
protected java.awt.Point startingPk
protected java.awt.Point startingFk
protected boolean movingPk
| Constructor Detail |
|---|
public Relationship.RelationshipDecorationMover(Relationship r,
boolean movePk)
| Method Detail |
|---|
public void mouseMoved(java.awt.event.MouseEvent e)
movingPk flag) so it is as close to the mouse
pointer as possible, while still being attached to an edge
of the parent (for PK) or child (for FK) table.
mouseMoved in interface java.awt.event.MouseMotionListenermouseMoved in class javax.swing.event.MouseInputAdapterpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseMoved(java.awt.event.MouseEvent).
mouseDragged in interface java.awt.event.MouseMotionListenermouseDragged in class javax.swing.event.MouseInputAdapterprotected java.awt.Point translatePoint(java.awt.Point p)
movingPk property.
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenermouseReleased in class javax.swing.event.MouseInputAdapterprotected void cleanup()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||