source: TI03-DataExtractor/trunk/web_extras/map_applet/tmap/map/MapCanvas.new @ 794

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI03-DataExtractor/trunk/web_extras/map_applet/tmap/map/MapCanvas.new@794
Revision 794, 21.1 KB checked in by astephen, 13 years ago (diff)

Unstable but latest version with multi-variable support and split hooks
for CDML and CSML.

  • Property svn:executable set to *
Line 
1/*
2 * @(#)MapCanvas.java
3 *
4 */
5
6package tmap.map;
7
8import java.awt.*;
9
10/**
11 * An extensible Canvas class for obtaining/displaying 2D coordinates.
12 * <p>
13 * This canvas has a base image and uses a tool to get/set coordinates
14 * on the base image.
15 * <p>
16 * This is the second official release (version 2.0) of the MapCanvas.
17 * It includes zoom/pan/scroll and snap-to-grid capabilities.
18 *
19 * @version     2.0, 23 Jan 1997
20 * @author      Jonathan Callahan
21 */
22
23public class MapCanvas extends Canvas implements MapConstants {
24
25  MapScroller scroller;
26  Image base_image;
27
28  Dimension offDimension;
29  Image offImage;
30  Graphics offGraphics;
31
32  int width, height;
33  Rectangle img_rect = new Rectangle(0, 0, 0, 0);
34  double image_scaling = 1.0;
35  int clip_width, clip_height;
36
37  /**
38   * Flag to indicate movement of the base image is desired.
39   */
40  public boolean pan_down = false;
41  /**
42   * Flag to indicate movement of the base image is desired.
43   */
44  public boolean pan_down_fast = false;
45  /**
46   * Flag to indicate movement of the base image is desired.
47   */
48  public boolean pan_left = false;
49  /**
50   * Flag to indicate movement of the base image is desired.
51   */
52  public boolean pan_left_fast = false;
53  /**
54   * Flag to indicate movement of the base image is desired.
55   */
56  public boolean pan_right = false;
57  /**
58   * Flag to indicate movement of the base image is desired.
59   */
60  public boolean pan_right_fast = false;
61  /**
62   * Flag to indicate movement of the base image is desired.
63   */
64  public boolean pan_up = false;
65  /**
66   * Flag to indicate movement of the base image is desired.
67   */
68  public boolean pan_up_fast = false;
69
70  /**
71   * Flag determining whether the X axis is modulo or not (eg. longitude).
72   */
73  public boolean img_modulo_X = true;
74
75  /**
76   * Flag determining whether scrolling is controlled by the active MapTool
77   * or externally by the application programmer.
78   */
79  public boolean tool_driven = true;
80
81  /**
82   * Flag determining whether MapTools will "snap" to the grid.
83   */
84  public boolean snap_to_grid = false;
85
86  /**
87   * The zoom factor to be applied when using the methods zoom_in() and zoom_out().
88   */
89public double zoom_factor;
90
91  /**
92   * The maximum image scaling to be allowed.
93   * It doesn't make sense to scale more than 2X the original image
94   */
95public double max_img_scaling = 2.0;
96
97  /**
98   * The minimum image scaling to be allowed.
99   * This will be set automatically when the MapCanvas is created.
100   * The initial min_img_scaling will be such that the map cannot be made
101   * smaller than the MapCanvas area in both the X and Y dimensions.
102   */
103public double min_img_scaling = 0.5;
104
105  /**
106   * Current "user" values for the left, middle and right edges of the current tool.
107   * <p>
108   * Access these values with <code>LO</code>, <code>MID</code> or <code>HI</code> as in: <code>user_x[LO]</code>.<br>
109   * <b>DO NOT SET THESE VALUES.</b>  They should only be read.
110   */
111public double [] user_x = new double[3];
112
113  /**
114   * Current "user" values for the bottom, middle and top edges of the current tool.
115   * <p>
116   * Access these values with <code>LO</code>, <code>MID</code> or <code>HI</code> as in: <code>user_y[LO]</code>.<br>
117   * <b>DO NOT SET THESE VALUES.</b>  They should only be read.
118   */
119public double [] user_y = new double[3];
120
121  /**
122   * The current tool being used on the map.
123   */
124protected MapTool tool;
125
126  /**
127   * The current grid being used by the map.
128   */
129protected MapGrid grid;
130
131
132  /**
133   * Constructs and initializes a MapCanvas with the specified parameters.
134   * @param base_image the image over which the tool will be drawn
135   * @param width the width in pixels of the MapCanvas
136   * @param height the height in pixels of the MapCanvas
137   * @param tool the tool for user interaction
138   * @param grid the grid associated with the underlying basemap.
139   */
140public MapCanvas(Image base_image, int width, int height, MapTool tool, MapGrid grid) {
141  this.base_image = base_image;
142  this.width = width;
143  this.height = height;
144  this.tool = tool;
145  this.grid = grid;
146  this.tool.set_grid(this.grid);
147
148  scale_image_to_fit();
149
150  scroller = new MapScroller(this);
151  try {
152    scroller.setPriority(Thread.MIN_PRIORITY);
153  } catch (IllegalArgumentException e) {
154    System.out.println("Scroller threw IllegalArgumentException.");
155  }
156  scroller.start();
157}
158 
159  /**
160   * Paints the canvas with the base image and the current tool.
161   * @param g the specified Graphics window
162   */
163public synchronized void paint(Graphics g) {
164  update(g);
165}
166
167  /**
168   * Paints the canvas with the base image and the current tool.
169   * @param g the specified Graphics window
170   */
171public synchronized void update(Graphics g) {
172  Dimension d = size();
173
174  //Create the offscreen graphics context, if no good one exists.
175 
176  if ( (offGraphics == null)
177       || (d.width != offDimension.width)
178       || (d.height != offDimension.height) ) {
179    offDimension = d;
180    offImage = createImage(d.width, d.height);
181    offGraphics = offImage.getGraphics();
182  }
183
184 
185  offGraphics.setColor(Color.gray);
186  offGraphics.fillRect(0, 0, width, height);
187 
188  offGraphics.clipRect(0, 0, clip_width, clip_height);
189  offGraphics.drawImage(base_image, img_rect.x, img_rect.y, img_rect.width, img_rect.height, this);
190  offGraphics.drawImage(base_image, img_rect.x+img_rect.width, img_rect.y, img_rect.width, img_rect.height, this);
191  tool.draw(offGraphics);
192
193  g.clipRect(0, 0, width, height);
194  g.drawImage(offImage, 0, 0, this);
195
196}
197
198  /**
199   * Causes the map to scroll an amount in the X direction.
200   * @param delta the number of pixels to scroll.
201   */
202public synchronized void scroll_X(int delta) {
203  img_rect.x += delta;
204
205  /*
206   * The starting coordinates of the base image are always:
207   *
208   *   -img_rect.width < x <= 0  (for modulo_X)
209   *   width - img_rect.width < x <= 0
210   *   height - img_rect.height < y <=0
211   */
212
213  if ( img_modulo_X ) {
214
215    if ( img_rect.x <= -img_rect.width )
216      img_rect.x = img_rect.x + img_rect.width;
217    else if ( img_rect.x > 0 )
218      img_rect.x = img_rect.x - img_rect.width;
219
220  } else {
221
222    if ( (img_rect.x+img_rect.width) < width )
223      img_rect.x = width - img_rect.width;
224
225    if ( img_rect.x > 0 )
226      img_rect.x = 0;
227
228  }
229
230}
231
232  /**
233   * Causes the map to scroll an amount in the Y direction.
234   * @param delta the number of pixels to scroll.
235   */
236public synchronized void scroll_Y(int delta) {
237  img_rect.y += delta;
238
239  if ( (img_rect.y+img_rect.height) < height )
240    img_rect.y = height - img_rect.height;
241
242  if ( img_rect.y > 0 )
243    img_rect.y = 0;
244
245}
246
247  /**
248   * Suspends scrolling.
249   * <p>
250   * Scrolling can be resumed with <code>resume_scrolling()</code>.
251   */
252public synchronized void suspend_scrolling() {
253   scroller.suspend();
254}
255
256  /**
257   * Resumes scrolling.
258   * <p>
259   * Scrolling can be suspended with <code>suspend_scrolling()</code>.
260   */
261public synchronized void resume_scrolling() {
262   scroller.resume();
263}
264
265  /**
266   * Passes the event to the current tool.
267   * <p>
268   * If the tool is active, the user values are updated.
269   * This method returns <code>false</code> so the interface can be updated if desired.
270   */
271public synchronized boolean mouseDown(Event evt, int mouse_x, int mouse_y) {
272  tool.mouseDown(mouse_x, mouse_y);
273  if ( tool.is_active() ) {
274    set_user_values();
275    paint(this.getGraphics());
276  }
277  return false; // The user interface can update a textField at this point
278}
279
280 
281  /**
282   * Passes the event to the current tool.
283   * <p>
284   * If the tool is active, the user values are updated.
285   * This method returns <code>false</code> so the interface can be updated if desired.
286   */
287public synchronized boolean mouseDrag(Event evt, int mouse_x, int mouse_y) {
288  tool.mouseDrag(mouse_x, mouse_y);
289  if ( tool.is_active() ) {
290    set_user_values();
291    paint(this.getGraphics());
292  }
293  return false; // The user interface can update a textField at this point
294}
295 
296
297  /**
298   * Passes the event to the current tool.
299   * <p>
300   * If the tool is active, the user values are updated.
301   * This method returns <code>false</code> so the interface can be updated if desired.
302   */
303public synchronized boolean mouseUp(Event evt, int mouse_x, int mouse_y) {
304  tool.mouseUp(mouse_x, mouse_y);
305  set_user_values();
306  return false; // The user interface can update a textField at this point
307}
308 
309
310  /**
311   * Increases the base image size the internally maintained zoom factor.
312   */
313public synchronized void zoom_in() {
314  this.zoom(zoom_factor);
315}
316
317
318  /**
319   * Decreases the base image size the internally maintained zoom factor.
320   */
321public synchronized void zoom_out() {
322  this.zoom(1.0/zoom_factor);
323}
324
325
326  /**
327   * Increases/decreases the base image size by the specified zoom factor.
328   * @param zoom_factor.
329   */
330public synchronized void zoom(double zoom_factor) {
331
332  Graphics g = getGraphics();
333  int pixel_x_val = 0;
334  int pixel_y_val = 0;
335  double initial_scaling = image_scaling;
336
337  if ( zoom_factor > 1.0 ) {
338    /*
339     * We need to create a new off screen graphics context here
340     * because of the rather odd, yet documented behavior of the
341     * clipRect() method of a Graphics object:
342       *
343       * g.clipRect(Rectangle) generates a clipping region which is the
344       * INTERSECTION of the rectangle given and the PREVIOUS
345       * clipping region!!!
346       *
347       * This means there is no way to increase a clipping region
348       * for a particular graphics context.  You must instead
349       * create a new graphics context whenever you want the
350       * clipping region increased in size.
351       */
352    Dimension d = size();
353    offDimension = d;
354    offImage = createImage(d.width, d.height);
355    offGraphics = offImage.getGraphics();
356  }
357
358  if ( (image_scaling * zoom_factor) > max_img_scaling )
359    image_scaling = max_img_scaling;
360  else if ( (image_scaling * zoom_factor) < min_img_scaling - 0.01)
361    image_scaling = min_img_scaling;
362  else
363    image_scaling = image_scaling * zoom_factor;
364
365  zoom_factor = image_scaling / initial_scaling;
366
367  img_rect.width = (int)(base_image.getWidth(this)*image_scaling);
368  img_rect.height = (int)(base_image.getHeight(this)*image_scaling);
369  img_rect.x = (int) (width/2 - (tool.x + tool.width/2 - img_rect.x)*zoom_factor);
370  img_rect.y = (int) (height/2 - (tool.y + tool.height/2 - img_rect.y)*zoom_factor);
371
372  /*
373   * Check the image width/height and change image_rect.x/.y if appropriate.
374   */
375
376  if ( !img_modulo_X ) {
377    if ( img_rect.width >= width ) {
378      if ( (img_rect.width + img_rect.x) < width )
379        img_rect.x = width - img_rect.width;
380      img_rect.x = (img_rect.x > 0) ? 0 : img_rect.x;
381    } else
382      img_rect.x = 0;
383  }
384
385  if ( img_rect.height >= height ) {
386    if ( (img_rect.height + img_rect.y) < height )
387      img_rect.y = height - img_rect.height;
388    img_rect.y = (img_rect.y > 0) ? 0 : img_rect.y;
389  } else
390    img_rect.y = 0;
391
392  /*
393   * This fixes problems if we have moved it right or down of (0,0).
394   */
395  if ( img_rect.x > 0 )
396    this.scroll_X(0);
397
398  if ( img_rect.y > 0 )
399    this.scroll_Y(0);
400
401  /*
402   * Move the tool so it is still centered over the chosen spot.
403   */
404
405  if ( img_modulo_X ) {
406    pixel_x_val = (int)( (user_x[PT]-grid.x_start) * (img_rect.width/grid.x_factor) ) + img_rect.x;
407    if ( pixel_x_val < 0 )
408      pixel_x_val = pixel_x_val + img_rect.width;
409  } else {
410    pixel_x_val = (int)( (user_x[PT]-grid.x_start) * (img_rect.width/grid.x_factor) ) + img_rect.x;
411  }
412  pixel_y_val = (int)( -1.0 * (user_y[PT]-grid.y_start) * ((img_rect.height-1)/*HERE*//grid.y_factor) ) + (img_rect.height-0)/*HERE*/ + img_rect.y;
413
414  this.tool.width *= zoom_factor;
415  this.tool.height *= zoom_factor;
416  this.tool.move(pixel_x_val - this.tool.width/2, pixel_y_val - this.tool.height/2 - 1); //minus 1 is a hack fix
417
418System.out.println("zoom()");
419  set_user_values();
420  clip_width = (img_rect.width < width) ? img_rect.width : width;
421  clip_height = (img_rect.height < height) ? img_rect.height : height;
422  tool.set_boundary(0, 0, clip_width, clip_height);
423  paint(g);
424
425}
426 
427 
428  public void center_tool() {
429
430  Graphics g = getGraphics();
431  int pixel_x_val = 0;
432  int pixel_y_val = 0;
433
434
435  img_rect.x = (int) (width/2 - (tool.x + tool.width/2 - img_rect.x));
436  img_rect.y = (int) (height/2 - (tool.y + tool.height/2 - img_rect.y));
437
438    /*
439     * Check the image width/height and change image_rect.x/.y if appropriate.
440     */
441
442    if ( !img_modulo_X ) {
443      if ( img_rect.width >= width ) {
444        if ( (img_rect.width + img_rect.x) < width )
445          img_rect.x = width - img_rect.width;
446        img_rect.x = (img_rect.x > 0) ? 0 : img_rect.x;
447      } else
448        img_rect.x = 0;
449    }
450
451    if ( img_rect.height >= height ) {
452      if ( (img_rect.height + img_rect.y) < height )
453        img_rect.y = height - img_rect.height;
454      img_rect.y = (img_rect.y > 0) ? 0 : img_rect.y;
455    } else
456      img_rect.y = 0;
457
458    /*
459     * This fixes problems if we have moved it right or down of (0,0).
460     */
461    if ( img_rect.x > 0 )
462      this.scroll_X(0);
463
464    if ( img_rect.y > 0 )
465      this.scroll_Y(0);
466
467    /*
468     * Move the tool so it is still centered over the chosen spot.
469     */
470
471System.out.println("\n       center_tool");
472    if ( img_modulo_X ) {
473      pixel_x_val = (int)( (user_x[PT]-grid.x_start) * (img_rect.width/grid.x_factor) ) + img_rect.x;
474      if ( pixel_x_val < 0 )
475        pixel_x_val = pixel_x_val + img_rect.width;
476    } else {
477      pixel_x_val = (int)( (user_x[PT]-grid.x_start) * (img_rect.width/grid.x_factor) ) + img_rect.x;
478    }
479    pixel_y_val = (int)( -1.0 * (user_y[PT]-grid.y_start) * ((img_rect.height-1)/*HERE*//grid.y_factor) ) + (img_rect.height-0)/*HERE*/ + img_rect.y;
480
481System.out.println("user_y[PT] = " + user_y[LO] + ", pixel_y_val = " + pixel_y_val + ", tool.y = " + tool.y);
482//     this.tool.width *= zoom_factor;
483//     this.tool.height *= zoom_factor;
484    this.tool.move(pixel_x_val - this.tool.width/2, pixel_y_val - this.tool.height/2 - 2);
485
486System.out.println("this.tool.move(" + (pixel_y_val - this.tool.width/2) + ", " + (pixel_y_val - this.tool.height/2 - 2/*HERE*/) + ")");
487  set_user_values();
488//   clip_width = (img_rect.width < width) ? img_rect.width : width;
489//   clip_height = (img_rect.height < height) ? img_rect.height : height;
490//   tool.set_boundary(0, 0, clip_width, clip_height);
491  paint(g);
492
493  }
494
495
496  /**
497   * Sets the "snap to grid" state.
498   * When <code>true</code>, MapTools will snap to grid associated with the MapCanvas.
499   * @param snapping the flag which determines whether grid "snapping" is in effect.
500   */
501public void set_snapping(boolean snapping) {
502    snap_to_grid = snapping;
503    tool.set_snapping(snap_to_grid);
504}
505 
506
507  /**
508   * Changes the current tool.
509   * @param tool the new tool to use.
510   */
511public void set_tool(MapTool tool) {
512  this.tool = tool;
513  this.tool.set_grid(grid);
514  this.tool.set_snapping(snap_to_grid);
515  tool.set_boundary(0, 0, clip_width, clip_height);
516
517  Graphics g = getGraphics();
518  paint(g);
519}
520 
521  /**
522   * Returns the current tool.
523   */
524public MapTool get_tool() {
525  return tool;
526}
527 
528
529  /**
530   * Sets the current grid.
531   */
532public void set_grid(MapGrid grid) {
533  this.grid = grid;
534  this.grid.img_rect = this.img_rect;
535  this.tool.set_grid(this.grid);
536}
537
538  /**
539   * Returns the current grid.
540   */
541public MapGrid get_grid() {
542  return grid;
543}
544
545
546  /**
547   * Changes the current base_image.
548   * @param image the new image to use.
549   */
550public void set_image(Image image) {
551  this.base_image = image;
552
553  scale_image_to_fit();
554
555  {
556    /*
557     * We need to create a new off screen graphics context here
558     * because of the rather odd, yet documented behavior of the
559     * clipRect() method of a Graphics object:
560       *
561       * g.clipRect(Rectangle) generates a clipping region which is the
562       * INTERSECTION of the rectangle given and the PREVIOUS
563       * clipping region!!!
564       *
565       * This means there is no way to increase a clipping region
566       * for a particular graphics context.  You must instead
567       * create a new graphics context whenever you want the
568       * clipping region increased in size.
569       */
570    Dimension d = size();
571    offDimension = d;
572    offImage = createImage(d.width, d.height);
573    offGraphics = offImage.getGraphics();
574  }
575
576  Graphics g = getGraphics();
577  paint(g);
578}
579 
580  /**
581   * Returns the current base_image.
582   */
583public Image get_image() {
584  return base_image;
585}
586 
587  /**
588   * Sets values for conversion from canvas pixels to "user coordinates".
589   * <p>
590   * This method will typically be called immediately after the constructor for the MapCanvas.
591   * @param x_start the "user" value of the leftmost pixel in the base image
592   * @param y_start the "user" value of the topmost pixel in the base image
593   * @param x_factor the full "user" range of x in the base image
594   * @param y_factor the full "user" range of y in the base image
595   */
596public void set_user_coords(double x_start, double y_start, double x_factor, double y_factor) {
597  grid.set_user_coords(x_start, y_start, x_factor, y_factor);
598  set_user_values();
599}
600 
601
602  /**
603   * This method is necessary for layout managers.
604   */
605public Dimension minimumSize() {
606  return new Dimension(width, height);
607}
608
609
610  /**
611   * This method is necessary for layout managers.
612   */
613public Dimension preferredSize() {
614  return this.minimumSize();
615}
616 
617
618private void print_user_values() {
619  System.out.println("\tx[LO][PT][HI] = " + user_x[LO] + ", " + user_x[PT] + ", " + user_x[HI]);
620  System.out.println("\ty[LO][PT][HI] = " + user_y[LO] + ", " + user_y[PT] + ", " + user_y[HI]);
621}
622
623void set_user_values() {
624  user_x[LO] = grid.pixelX_to_user(tool.x);
625  user_x[HI] = grid.pixelX_to_user(tool.x+tool.width);
626  user_x[PT] = grid.pixelX_to_user(tool.x+tool.width/2+1);
627
628  /*
629   * We need to "invert" the user_y values because the tools consider
630   * the top of the screen to be "y=0" and we want to make the bottom
631   * of the map to be "y=0"
632   */
633  user_y[HI] = grid.pixelY_to_user(tool.y);
634System.out.println("set_user_values tool.y = " + tool.y + ", user_y[HI] = " + user_y[HI]);
635  user_y[LO] = grid.pixelY_to_user(tool.y+tool.height);
636  user_y[PT] = grid.pixelY_to_user(tool.y+tool.height/2+1);
637
638  if ( snap_to_grid ) {
639    user_x[LO] = grid.snap_userX(user_x[LO]);
640    user_x[HI] = grid.snap_userX(user_x[HI]);
641    user_x[PT] = grid.snap_userX(user_x[PT]);
642
643    user_y[LO] = grid.snap_userY(user_y[LO]);
644    user_y[HI] = grid.snap_userY(user_y[HI]);
645    user_y[PT] = grid.snap_userY(user_y[PT]);
646  }
647
648}
649 
650
651  /*
652   * Some intelligence to do initial sizing when a new image is received.
653   */
654  void scale_image_to_fit() {
655
656    double vert_scaling = 1.0;
657    double hor_scaling = 1.0;
658
659    vert_scaling = (double)this.height / (double)base_image.getHeight(this);
660    hor_scaling = (double)this.width / (double)base_image.getWidth(this);
661    image_scaling = (vert_scaling < hor_scaling) ? vert_scaling : hor_scaling;
662
663    if ( image_scaling < 0.1 ) {
664      image_scaling = 0.1;
665      System.out.println("image scaling = " + image_scaling + ", being reset to 0.1.");
666    }
667
668    min_img_scaling = image_scaling;
669
670    img_rect.x = 0;
671    img_rect.y = 0;
672    img_rect.width = (int)(base_image.getWidth(this)*image_scaling);
673    img_rect.height = (int)(base_image.getHeight(this)*image_scaling);
674
675    grid.img_rect = this.img_rect;
676
677    clip_width = (img_rect.width < width) ? img_rect.width : width;
678    clip_height = (img_rect.height < height) ? img_rect.height : height;
679
680    tool.set_boundary(0, 0, clip_width, clip_height);
681    set_user_values();
682
683  }
684
685
686  /**
687   * Reshapes the current tool to the specified user coordinates.
688   * @param top the top edge of the tool in user coordinates.
689   * @param bottom the bottom edge of the tool in user coordinates.
690   * @param left the left edge of the tool in user coordinates.
691   * @param right the right edge of the tool in user coordinates.
692   * <p>
693   * The image will be scrolled and/or zoomed out to make sure the tool
694   * is completely visible on the map.
695   * <p>
696   * This method returns <code>true</code> if a zoom_out occurred.
697   */
698  public synchronized boolean reshape_tool(double top, double bottom, double left, double right) {
699 
700    int x=0, y=0, width=0, height=0;
701 
702    // I need various checks in here.  What if the user coords are not lat-lon?
703    // I can do all this checking with elements of MapGrid.
704    while (left > 180.0) { left -= 360.0; }
705    while (left < -180.0) { left += 360.0; }
706    while (right > 180.0) { right -= 360.0; }
707    while (right < -180.0) { right +=360.0; }
708 
709    if ( right < left )
710      width = (int) ( (right-left+360) * (img_rect.width/grid.x_factor) );
711    else
712      width = (int) ( (right-left) * (img_rect.width/grid.x_factor) );
713 
714    height = (int) ( (top-bottom) * ((img_rect.height-1)/*HERE*//grid.y_factor) );
715//     y = (int) (  (img_rect.height/y_factor) * (y_start-top) + img_rect.height + img_rect.y );
716//     x = (int) (  (img_rect.width/x_factor) * (left-x_start) + img_rect.x );
717//     while ( img_modulo_X && (x < 0) ) { x += img_rect.width; }
718
719x = grid.user_to_pixelX(left);
720y = grid.user_to_pixelY(top);
721 
722/*
723    if ( width > this.width || height > this.height ) {
724      zoom_out();
725      this.reshape_tool(top, bottom, left, right);
726      return true;
727 
728    } else {
729 
730      if ( x < 0 ) {
731        scroll_X(x);
732        x=0;
733      }
734      */
735      if ( (x+width+2) > this.width ) {
736        scroll_X( this.width-(x+width+2) );
737        x += ( this.width-(x+width+2) );
738      }
739 
740      tool.reshape(x, y, width, height);
741System.out.println("reshape_tool");
742      set_user_values();
743      paint(this.getGraphics());
744      return false;
745    }
746  /*
747  }
748 
749  */
750
751
752}
753
754
Note: See TracBrowser for help on using the repository browser.