KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jimm > datavision > gui > PreMoveInfo


1 package jimm.datavision.gui;
2 import jimm.datavision.field.Rectangle;
3 import java.awt.Point JavaDoc;
4
5 /**
6  * We save pre-move information because we need to know the original
7  * mouse position, we may need to the field's original position, and
8  * because we need to know our original position when finally moving.
9  *
10  * @author Jim Menard, <a HREF="mailto:jimm@io.com">jimm@io.com</a>
11  */

12 public class PreMoveInfo {
13
14 public Rectangle origBounds;
15 public Point JavaDoc startMouseScreenPos;
16 public Point JavaDoc screenPos;
17 public SectionWidget sectionWidget;
18
19 /**
20  * Constructor.
21  *
22  * @param fw a field widget
23  * @param mouseScreenPos the location of the mouse in screen coordinates
24  */

25 PreMoveInfo(FieldWidget fw, Point JavaDoc mouseScreenPos) {
26     origBounds = new Rectangle(fw.getField().getBounds());
27     sectionWidget = fw.getSectionWidget();
28     screenPos = fw.getComponent().getLocationOnScreen();
29     startMouseScreenPos = mouseScreenPos;
30 }
31 }
32
Popular Tags