01: package jimm.datavision.gui;
02:
03: import jimm.datavision.field.Rectangle;
04: import java.awt.Point;
05:
06: /**
07: * We save pre-move information because we need to know the original
08: * mouse position, we may need to the field's original position, and
09: * because we need to know our original position when finally moving.
10: *
11: * @author Jim Menard, <a href="mailto:jimm@io.com">jimm@io.com</a>
12: */
13: public class PreMoveInfo {
14:
15: public Rectangle origBounds;
16: public Point startMouseScreenPos;
17: public Point screenPos;
18: public SectionWidget sectionWidget;
19:
20: /**
21: * Constructor.
22: *
23: * @param fw a field widget
24: * @param mouseScreenPos the location of the mouse in screen coordinates
25: */
26: PreMoveInfo(FieldWidget fw, Point mouseScreenPos) {
27: origBounds = new Rectangle(fw.getField().getBounds());
28: sectionWidget = fw.getSectionWidget();
29: screenPos = fw.getComponent().getLocationOnScreen();
30: startMouseScreenPos = mouseScreenPos;
31: }
32: }
|