01: package jimm.datavision.gui;
02:
03: import jimm.datavision.Section;
04:
05: /**
06: * We save pre-stretch information so we have a place to hold information
07: * like original mouse click position and minimum legal mouse position.
08: *
09: * @author Jim Menard, <a href="mailto:jimm@io.com">jimm@io.com</a>
10: */
11: public class PreStretchInfo {
12:
13: public jimm.datavision.field.Rectangle origBounds;
14: public java.awt.Point startMouseScreenPos;
15: public java.awt.Rectangle sectionBounds;
16: public java.awt.Rectangle screenBounds;
17:
18: /**
19: * Constructor.
20: *
21: * @param fw a field widget
22: * @param mouseScreenPos the location of the mouse in screen coordinates
23: */
24: PreStretchInfo(FieldWidget fw, java.awt.Point mouseScreenPos) {
25: jimm.datavision.field.Rectangle b = fw.getField().getBounds();
26:
27: // Copy of field's bounds
28: origBounds = new jimm.datavision.field.Rectangle(b.x, b.y,
29: b.width, b.height);
30:
31: // Section's bounding rectangle
32: Section sect = fw.getSectionWidget().getSection();
33: sectionBounds = new java.awt.Rectangle(0, 0, (int) sect
34: .getWidth(), (int) sect.getMinHeight());
35:
36: // Field's bounds in screen coordinates
37: java.awt.Point screenPos = fw.getComponent()
38: .getLocationOnScreen();
39: screenBounds = new java.awt.Rectangle(screenPos.x, screenPos.y,
40: (int) b.width, (int) b.height);
41:
42: startMouseScreenPos = mouseScreenPos;
43: }
44: }
|