Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: gef/src/org/tigris/gef/base Mode.java ModeBroom.java ModeCreate.java ModeCreateEdge.java ModeCreateFigCircle.java ModeCreateFigImage.java ModeCreateFigInk.java ModeCreateFigLine.java ModeCreateFigPoly.java ModeCreateFigRRect.java ModeCreateFigRect.java ModeCreateFigSpline.java ModeCreateFigText.java ModeCreatePolyEdge.java ModeDragScroll.java ModeImpl.java ModeManager.java ModeModify.java ModePlace.java ModePopup.java ModeSelect.java

gef
Discussion topic

Back to topic list

CVS update: gef/src/org/tigris/gef/base Mode.java ModeBroom.java ModeCreate.java ModeCreateEdge.java ModeCreateFigCircle.java ModeCreateFigImage.java ModeCreateFigInk.java ModeCreateFigLine.java ModeCreateFigPoly.java ModeCreateFigRRect.java ModeCreateFigRect.java ModeCreateFigSpline.java ModeCreateFigText.java ModeCreatePolyEdge.java ModeDragScroll.java ModeImpl.java ModeManager.java ModeModify.java ModePlace.java ModePopup.java ModeSelect.java

Reply

Author 1sturm
Full name Thorsten Sturm
Date 2000-10-16 05:04:49 PDT
Message User: 1sturm
  Date: 00/10/16 05:04:49

  Modified: src/org/tigris/gef/base Mode.java ModeBroom.java
                        ModeCreate.java ModeCreateEdge.java
                        ModeCreateFigCircle.java ModeCreateFigImage.java
                        ModeCreateFigInk.java ModeCreateFigLine.java
                        ModeCreateFigPoly.java ModeCreateFigRRect.java
                        ModeCreateFigRect.java ModeCreateFigSpline.java
                        ModeCreateFigText.java ModeCreatePolyEdge.java
                        ModeDragScroll.java ModeImpl.java ModeManager.java
                        ModeModify.java ModePlace.java ModePopup.java
                        ModeSelect.java
  Log:
  fixing inheritance for Modes
  
  Revision Changes Path
  1.3 +0 -0 gef/src/org/tigris/g​ef/base/Mode.java
  
  Index: Mode.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/Mode.ja​va,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Mode.java 2000/10/16 12:00:45 1.2
  +++ Mode.java 2000/10/16 12:04:47 1.3
  @@ -24,7 +24,7 @@
   // File: Mode.java
   // Classes: Mode
   // Original Author: thorsten Jun 2000
  -// $Id: Mode.java,v 1.2 2000/10/16 12:00:45 1sturm Exp $
  +// $Id: Mode.java,v 1.3 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  
  
  
  1.2 +14 -16 gef/src/org/tigris/g​ef/base/ModeBroom.ja​va
  
  Index: ModeBroom.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeBro​om.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModeBroom.java 2000/09/04 12:38:48 1.1
  +++ ModeBroom.java 2000/10/16 12:04:47 1.2
  @@ -21,12 +21,10 @@
   // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
   // UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   
  -
  -
   // File: ModeBroom.java
   // Classes: ModeBroom
   // Original Author: ics125 spring 1996
  -// $Id: ModeBroom.java,v 1.1 2000/09/04 12:38:48 1sturm Exp $
  +// $Id: ModeBroom.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  @@ -36,7 +34,7 @@
   
   import org.tigris.gef.presentation.*;
   
  -public class ModeBroom extends Mode {
  +public class ModeBroom extends FigModifyingModeImpl {
   
     ////////////////////​////////////////////​////////////////////​////
     // constants
  @@ -124,8 +122,8 @@
       _lastX1 = x1; _lastY1 = y1;
       _lastX2 = x2; _lastY2 = y2;
       _selectRect.setBounds(x1 - 14, y1 - 14, x2 - x1 + 28, y2 - y1 + 28);
  - _editor.damaged(_selectRect);
  - _editor.getSelection​Manager().deselectAl​l();
  + editor.damaged(_selectRect);
  + editor.getSelectionM​anager().deselectAll​();
       me.consume();
       _hint = null;
       start();
  @@ -139,14 +137,14 @@
       _lastMX = me.getX();
       _lastMY = me.getY();
       Point snapPt = new Point(me.getX(), me.getY());
  - _editor.snap(snapPt);
  + editor.snap(snapPt);
       int x = snapPt.x;
       int y = snapPt.y;
       int i;
       _selectRect.setBounds(x1 - 4, y1 - 4, x2 - x1 + 8, y2 - y1 + 8);
       _bigDamageRect.setLocation(x1 - 200, y1 - 200);
  - _editor.damaged(_big​DamageRect);
  - _editor.damaged(_selectRect);
  + editor.damaged(_bigDamageRect);
  + editor.damaged(_selectRect);
   
       if (_dir == UNDEFINED) {
         if (me.isShiftDown()) _broomMargin = SMALL_BROOM_WIDTH;
  @@ -269,7 +267,7 @@
       }
       }
       _selectRect.setBounds(x1 - 4, y1 - 4, x2 - x1 + 8, y2 - y1 + 8);
  - _editor.damaged(_selectRect);
  + editor.damaged(_selectRect);
       _hint = null;
       touching();
     }
  @@ -280,9 +278,9 @@
       if (me.isConsumed()) return;
       _selectRect.setBounds(x1 - 1, y1 - 1, x2 - x1 + 2, y2 - y1 + 20);
       _bigDamageRect.setLocation(x1 - 200, y1 - 200);
  - _editor.damaged(_big​DamageRect);
  - _editor.damaged(_selectRect);
  - _editor.getSelection​Manager().select(_La​stTouched);
  + editor.damaged(_bigDamageRect);
  + editor.damaged(_selectRect);
  + editor.getSelectionM​anager().select(_Las​tTouched);
       _draw = false;
       done();
       me.consume();
  @@ -295,7 +293,7 @@
       _addRect.setBounds(_lastX1, _lastY1, _lastX2 - _lastX1,
                  _lastY2 - _lastY1);
       _addRect.add(_selectRect);
  - Enumeration figs = _editor.figs();
  + Enumeration figs = editor.figs();
       while (figs.hasMoreElements()) {
         Fig f = (Fig) figs.nextElement();
         if (_addRect.intersects​(f.getBounds())) {
  @@ -332,8 +330,8 @@
         return;
       }
       _bigDamageRect.setLocation(x1 - 200, y1 - 200);
  - _editor.damaged(_big​DamageRect);
  - _editor.damaged(_selectRect);
  + editor.damaged(_bigDamageRect);
  + editor.damaged(_selectRect);
     }
   
     ////////////////////​////////////////////​////////////////////​////
  
  
  
  1.2 +11 -14 gef/src/org/tigris/g​ef/base/ModeCreate.j​ava
  
  Index: ModeCreate.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeCre​ate.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModeCreate.java 2000/09/04 12:38:48 1.1
  +++ ModeCreate.java 2000/10/16 12:04:47 1.2
  @@ -21,13 +21,10 @@
   // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
   // UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   
  -
  -
  -
   // File: ModeCreate.java
   // Classes: ModeCreate
   // Original Author: jrobbins at ics dot uci dot edu
  -// $Id: ModeCreate.java,v 1.1 2000/09/04 12:38:48 1sturm Exp $
  +// $Id: ModeCreate.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  @@ -58,7 +55,7 @@
    * @see ModeCreateFigImage
    */
   
  -public abstract class ModeCreate extends Mode {
  +public abstract class ModeCreate extends FigModifyingModeImpl {
     ////////////////////​////////////////////​////////////////////​////
     // static variables
   
  @@ -104,7 +101,7 @@
       start();
       synchronized (snapPt) {
         snapPt.setLocation(me.getX(), me.getY());
  - _editor.snap(snapPt);
  + editor.snap(snapPt);
         anchorX = snapPt.x;
         anchorY = snapPt.y;
       }
  @@ -120,15 +117,15 @@
      * not really the same thing as dragging after creation....<p>
      *
      * Note: _newItem has not been added to any Layer yet. So you cannot
  - * use _newItem.damage(), instead use _editor.damaged(_newItem). */
  + * use _newItem.damage(), instead use editor.damaged(_newItem). */
     public void mouseDragged(MouseEvent me) {
       if (me.isConsumed()) return;
       if (_newItem != null) {
  - _editor.damaged(_newItem);
  + editor.damaged(_newItem);
         creationDrag(me.getX(), me.getY());
  - _editor.damaged(_newItem);
  + editor.damaged(_newItem);
       }
  - _editor.scrollToShow(me.getX(), me.getY());
  + editor.scrollToShow(me.getX(), me.getY());
       me.consume();
     }
   
  @@ -137,10 +134,10 @@
     public void mouseReleased(MouseEvent me) {
       if (me.isConsumed()) return;
       if (_newItem != null) {
  - _editor.damaged(_newItem);
  + editor.damaged(_newItem);
         creationDrag(me.getX(), me.getY());
  - _editor.add(_newItem);
  - _editor.getSelection​Manager().select(_ne​wItem);
  + editor.add(_newItem);
  + editor.getSelectionM​anager().select(_new​Item);
         _newItem = null;
       }
       done();
  @@ -159,7 +156,7 @@
       int snapX, snapY;
       synchronized (snapPt) {
         snapPt.setLocation(x, y);
  - _editor.snap(snapPt);
  + editor.snap(snapPt);
         snapX = snapPt.x;
         snapY = snapPt.y;
       }
  
  
  
  1.2 +1 -1 gef/src/org/tigris/g​ef/base/ModeCreateEd​ge.java
  
  Index: ModeCreateEdge.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeCre​ateEdge.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModeCreateEdge.java 2000/09/04 12:38:48 1.1
  +++ ModeCreateEdge.java 2000/10/16 12:04:47 1.2
  @@ -26,7 +26,7 @@
   // File: ModeCreateEdge.java
   // Classes: ModeCreateEdge
   // Original Author: ics125 spring 1996
  -// $Id: ModeCreateEdge.java,v 1.1 2000/09/04 12:38:48 1sturm Exp $
  +// $Id: ModeCreateEdge.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  
  
  
  1.2 +1 -1 gef/src/org/tigris/g​ef/base/ModeCreateFi​gCircle.java
  
  Index: ModeCreateFigCircle.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeCre​ateFigCircle.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModeCreateFigCircle.java 2000/09/04 12:38:48 1.1
  +++ ModeCreateFigCircle.java 2000/10/16 12:04:47 1.2
  @@ -27,7 +27,7 @@
   // File: ModeCreateFigCircle.java
   // Classes: ModeCreateFigCircle
   // Original Author: ics125 spring 1996
  -// $Id: ModeCreateFigCircle.java,v 1.1 2000/09/04 12:38:48 1sturm Exp $
  +// $Id: ModeCreateFigCircle.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  
  
  
  1.2 +6 -6 gef/src/org/tigris/g​ef/base/ModeCreateFi​gImage.java
  
  Index: ModeCreateFigImage.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeCre​ateFigImage.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModeCreateFigImage.java 2000/09/04 12:38:48 1.1
  +++ ModeCreateFigImage.java 2000/10/16 12:04:47 1.2
  @@ -27,7 +27,7 @@
   // File: ModeCreateFigImage.java
   // Classes: ModeCreateFigImage
   // Original Author: jrobbins at ics dot uci dot edu
  -// $Id: ModeCreateFigImage.java,v 1.1 2000/09/04 12:38:48 1sturm Exp $
  +// $Id: ModeCreateFigImage.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  @@ -90,14 +90,14 @@
       anchorX = x;
       anchorY = y;
       Point snapPt = new Point(x, y);
  - _editor.snap(snapPt);
  + editor.snap(snapPt);
       if (null == _newItem) _newItem = createNewItem(me, snapPt.x, snapPt.y);
       me.consume();
     }
   
     /** When the mouse exits the editor, clean up the display a little. */
     public void mouseExited(MouseEvent me) {
  - _editor.damaged(_newItem);
  + editor.damaged(_newItem);
       me.consume();
     }
   
  @@ -115,11 +115,11 @@
         me.consume();
         return;
       }
  - _editor.damaged(_newItem);
  + editor.damaged(_newItem);
       Point snapPt = new Point(x, y);
  - _editor.snap(snapPt);
  + editor.snap(snapPt);
       _newItem.setLocation(snapPt.x, snapPt.y);
  - _editor.damaged(_newItem); /* needed? */
  + editor.damaged(_newItem); /* needed? */
       me.consume();
     }
   
  
  
  
  1.2 +3 -3 gef/src/org/tigris/g​ef/base/ModeCreateFi​gInk.java
  
  Index: ModeCreateFigInk.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeCre​ateFigInk.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModeCreateFigInk.java 2000/09/04 12:38:48 1.1
  +++ ModeCreateFigInk.java 2000/10/16 12:04:47 1.2
  @@ -26,7 +26,7 @@
   // File: ModeCreateFigInk.java
   // Classes: ModeCreateFigInk
   // Original Author: ics125 spring 1996
  -// $Id: ModeCreateFigInk.java,v 1.1 2000/09/04 12:38:48 1sturm Exp $
  +// $Id: ModeCreateFigInk.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  @@ -81,9 +81,9 @@
       int x = me.getX(), y = me.getY();
       FigInk ink = (FigInk)_newItem;
       if (!nearLast(x, y)) {
  - _editor.damaged(_newItem); // startTrans?
  + editor.damaged(_newItem); // startTrans?
         ink.addPoint(x, y);
  - _editor.damaged(_newItem); // endTrans?
  + editor.damaged(_newItem); // endTrans?
         _lastX = x; _lastY = y;
       }
       me.consume();
  
  
  
  1.2 +1 -1 gef/src/org/tigris/g​ef/base/ModeCreateFi​gLine.java
  
  Index: ModeCreateFigLine.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeCre​ateFigLine.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModeCreateFigLine.java 2000/09/04 12:38:48 1.1
  +++ ModeCreateFigLine.java 2000/10/16 12:04:47 1.2
  @@ -27,7 +27,7 @@
   // File: ModeCreateFigLine.java
   // Classes: ModeCreateFigLine
   // Original Author: ics125 spring 1996
  -// $Id: ModeCreateFigLine.java,v 1.1 2000/09/04 12:38:48 1sturm Exp $
  +// $Id: ModeCreateFigLine.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  
  
  
  1.2 +11 -11 gef/src/org/tigris/g​ef/base/ModeCreateFi​gPoly.java
  
  Index: ModeCreateFigPoly.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeCre​ateFigPoly.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModeCreateFigPoly.java 2000/09/04 12:38:48 1.1
  +++ ModeCreateFigPoly.java 2000/10/16 12:04:47 1.2
  @@ -26,7 +26,7 @@
   // File: ModeCreateFigPoly.java
   // Classes: ModeCreateFigPoly
   // Original Author: jrobbins at ics dot uci dot edu
  -// $Id: ModeCreateFigPoly.java,v 1.1 2000/09/04 12:38:48 1sturm Exp $
  +// $Id: ModeCreateFigPoly.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  @@ -78,12 +78,12 @@
       int x = me.getX(), y = me.getY();
       if (_npoints == 0) { super.mousePressed(me); }
       if (!nearLast(x, y)) {
  - _editor.damaged(_newItem);
  + editor.damaged(_newItem);
         Point snapPt = new Point(x, y);
  - _editor.snap(snapPt);
  + editor.snap(snapPt);
         ((FigPoly)_newItem).​addPoint(snapPt.x, snapPt.y);
         _npoints++;
  - _editor.damaged(_newItem);
  + editor.damaged(_newItem);
       }
       me.consume();
     }
  @@ -93,13 +93,13 @@
       int x = me.getX(), y = me.getY();
       if (_npoints > 2 && nearLast(x, y)) {
         FigPoly p = (FigPoly) _newItem;
  - _editor.damaged(_newItem);
  + editor.damaged(_newItem);
         _handle.index = p.getNumPoints() - 1;
         p.moveVertex(_handle, _startX, _startY, true);
         _npoints = 0;
  - _editor.damaged(p);
  - _editor.add(p);
  - _editor.getSelection​Manager().select(p);​
  + editor.damaged(p);
  + editor.add(p);
  + editor.getSelectionM​anager().select(p);
         _newItem = null;
         done();
         me.consume();
  @@ -118,12 +118,12 @@
       int x = me.getX(), y = me.getY();
       if (_npoints == 0) { me.consume(); return; }
       FigPoly p = (FigPoly)_newItem;
  - _editor.damaged(_newItem); // startTrans?
  + editor.damaged(_newItem); // startTrans?
       Point snapPt = new Point(x, y);
  - _editor.snap(snapPt);
  + editor.snap(snapPt);
       _handle.index = p.getNumPoints() - 1;
       p.moveVertex(_handle, snapPt.x, snapPt.y, true);
  - _editor.damaged(_newItem); // endTrans?
  + editor.damaged(_newItem); // endTrans?
       me.consume();
     }
   
  
  
  
  1.2 +1 -1 gef/src/org/tigris/g​ef/base/ModeCreateFi​gRRect.java
  
  Index: ModeCreateFigRRect.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeCre​ateFigRRect.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModeCreateFigRRect.java 2000/09/04 12:38:48 1.1
  +++ ModeCreateFigRRect.java 2000/10/16 12:04:47 1.2
  @@ -26,7 +26,7 @@
   // File: ModeCreateFigRRect.java
   // Classes: ModeCreateFigRRect
   // Original Author: jrobbins at ics dot uci dot edu
  -// $Id: ModeCreateFigRRect.java,v 1.1 2000/09/04 12:38:48 1sturm Exp $
  +// $Id: ModeCreateFigRRect.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  
  
  
  1.2 +1 -1 gef/src/org/tigris/g​ef/base/ModeCreateFi​gRect.java
  
  Index: ModeCreateFigRect.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeCre​ateFigRect.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModeCreateFigRect.java 2000/09/04 12:38:48 1.1
  +++ ModeCreateFigRect.java 2000/10/16 12:04:47 1.2
  @@ -26,7 +26,7 @@
   // File: ModeCreateFigRect.java
   // Classes: ModeCreateFigRect
   // Original Author: ics125 spring 1996
  -// $Id: ModeCreateFigRect.java,v 1.1 2000/09/04 12:38:48 1sturm Exp $
  +// $Id: ModeCreateFigRect.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  
  
  
  1.2 +5 -5 gef/src/org/tigris/g​ef/base/ModeCreateFi​gSpline.java
  
  Index: ModeCreateFigSpline.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeCre​ateFigSpline.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModeCreateFigSpline.java 2000/09/04 12:38:48 1.1
  +++ ModeCreateFigSpline.java 2000/10/16 12:04:47 1.2
  @@ -26,7 +26,7 @@
   // File: ModeCreateFigSpline.java
   // Classes: ModeCreateFigSpline
   // Original Author: jrobbins at ics dot uci dot edu
  -// $Id: ModeCreateFigSpline.java,v 1.1 2000/09/04 12:38:48 1sturm Exp $
  +// $Id: ModeCreateFigSpline.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  @@ -72,16 +72,16 @@
       int x = me.getX(), y = me.getY();
       if (_npoints > 2 && nearLast(x, y)) {
         FigSpline p = (FigSpline) _newItem;
  - _editor.damaged(_newItem);
  + editor.damaged(_newItem);
         _handle.index = p.getNumPoints() - 1;
         p.moveVertex(_handle, _startX, _startY, true);
   
         p.removePoint(_handle.index);
   
         _npoints = 0;
  - _editor.damaged(p);
  - _editor.add(p);
  - _editor.getSelection​Manager().select(p);​
  + editor.damaged(p);
  + editor.add(p);
  + editor.getSelectionM​anager().select(p);
         _newItem = null;
         done();
         me.consume();
  
  
  
  1.2 +1 -1 gef/src/org/tigris/g​ef/base/ModeCreateFi​gText.java
  
  Index: ModeCreateFigText.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeCre​ateFigText.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModeCreateFigText.java 2000/09/04 12:38:48 1.1
  +++ ModeCreateFigText.java 2000/10/16 12:04:47 1.2
  @@ -26,7 +26,7 @@
   // File: ModeCreateFigText.java
   // Classes: ModeCreateFigText
   // Original Author: ics125 spring 1996
  -// $Id: ModeCreateFigText.java,v 1.1 2000/09/04 12:38:48 1sturm Exp $
  +// $Id: ModeCreateFigText.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  
  
  
  1.4 +21 -24 gef/src/org/tigris/g​ef/base/ModeCreatePo​lyEdge.java
  
  Index: ModeCreatePolyEdge.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeCre​atePolyEdge.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ModeCreatePolyEdge.java 2000/09/29 16:20:24 1.3
  +++ ModeCreatePolyEdge.java 2000/10/16 12:04:47 1.4
  @@ -24,7 +24,7 @@
   // File: ModeCreatePolyEdge.java
   // Classes: ModeCreateEdge
   // Original Author: agauthie at ics dot uci dot edu
  -// $Id: ModeCreatePolyEdge.java,v 1.3 2000/09/29 16:20:24 boger Exp $
  +// $Id: ModeCreatePolyEdge.java,v 1.4 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  @@ -103,11 +103,11 @@
     public void mousePressed(MouseEvent me) {
       if (me.isConsumed()) return;
       int x = me.getX(), y = me.getY();
  - //Editor _editor = Globals.curEditor();
  - Fig underMouse = _editor.hit(x, y);
  + //Editor editor = Globals.curEditor();
  + Fig underMouse = editor.hit(x, y);
       if (underMouse == null) {
         //System.out.println("bighit");
  - underMouse = _editor.hit(x-16, y-16, 32, 32);
  + underMouse = editor.hit(x-16, y-16, 32, 32);
       }
       if (underMouse == null && _npoints == 0) { done(); me.consume(); return; }
       if (!(underMouse instanceof FigNode) && _npoints == 0) {
  @@ -136,9 +136,9 @@
       if (_sourceFigNode == null) { done(); me.consume(); return; }
   
       int x = me.getX(), y = me.getY();
  - Fig f = _editor.hit(x, y);
  - if (f == null) { f = _editor.hit(x-16, y-16, 32, 32); }
  - GraphModel gm = _editor.getGraphModel();
  + Fig f = editor.hit(x, y);
  + if (f == null) { f = editor.hit(x-16, y-16, 32, 32); }
  + GraphModel gm = editor.getGraphModel();
       if (!(gm instanceof MutableGraphModel)) f = null;
       MutableGraphModel mgm = (MutableGraphModel) gm;
       // needs-more-work: potential class cast exception
  @@ -161,8 +161,8 @@
       FigPoly p = (FigPoly) _newItem;
       if (foundPort == _startPort && _npoints >= 4) p.setSelfLoop(true);
       //_npoints = 0;
  - _editor.damaged(p);
  - //_editor.getSelecti​onManager().select(p​);
  + editor.damaged(p);
  + //editor.getSelectio​nManager().select(p)​;
       p._isComplete = true;
   
       Class edgeClass = (Class) getArg("edgeClass");
  @@ -180,10 +180,10 @@
         System.out.println("​MutableGraphModel connect() return null");
       }
       else {
  - LayerManager lm = _editor.getLayerManager();
  + LayerManager lm = editor.getLayerManager();
         _sourceFigNode.damage();
         destFigNode.damage();
  - Layer lay = _editor.getLayerMana​ger().getActiveLayer​();
  + Layer lay = editor.getLayerManag​er().getActiveLayer(​);
         FigEdge fe = (FigEdge) lay.presentationFor(_newEdge);
         _newItem.setLineColo​r(Color.black);
         fe.setFig(_newItem);
  @@ -192,8 +192,8 @@
         fe.setDestPortFig(destPortFig);
         fe.setDestFigNode(destFigNode);
   
  - if (fe != null) _editor.getSelection​Manager().select(fe)​;
  - _editor.damaged(fe);
  + if (fe != null) editor.getSelectionM​anager().select(fe);​
  + editor.damaged(fe);
   
             // if the new edge implements the MouseListener interface it has to receive the mouseReleased() event
             if (fe instanceof MouseListener) ((MouseListener) fe).mouseReleased(me);
  @@ -201,8 +201,6 @@
             // set the new edge in place
             if (_sourceFigNode != null ) _sourceFigNode.updateEdges();
             if (destFigNode != null ) destFigNode.updateEdges();
  -
  -
       }
       done();
       me.consume();
  @@ -210,12 +208,12 @@
         }
       }
       if (!nearLast(x, y)) {
  - _editor.damaged(_newItem);
  + editor.damaged(_newItem);
         Point snapPt = new Point(x, y);
  - _editor.snap(snapPt);
  + editor.snap(snapPt);
         ((FigPoly)_newItem).​addPoint(snapPt.x, snapPt.y);
         _npoints++;
  - _editor.damaged(_newItem);
  + editor.damaged(_newItem);
       }
       _lastX = x; _lastY = y;
       me.consume();
  @@ -231,12 +229,12 @@
       if (_npoints == 0) { me.consume(); return; }
       if (_newItem == null) { me.consume(); return; }
       FigPoly p = (FigPoly)_newItem;
  - _editor.damaged(_newItem); // startTrans?
  + editor.damaged(_newItem); // startTrans?
       Point snapPt = new Point(x, y);
  - _editor.snap(snapPt);
  + editor.snap(snapPt);
       _handle.index = p.getNumPoints() - 1;
       p.moveVertex(_handle, snapPt.x, snapPt.y, true);
  - _editor.damaged(_newItem); // endTrans?
  + editor.damaged(_newItem); // endTrans?
       me.consume();
     }
   
  @@ -250,7 +248,7 @@
   
     public void done() {
       super.done();
  - if (_newItem != null) _editor.damaged(_newItem);
  + if (_newItem != null) editor.damaged(_newItem);
       _newItem = null;// use this as the fig for the new FigEdge
       _npoints = 0;
       _sourceFigNode = null;
  @@ -260,12 +258,11 @@
   
     ////////////////////​////////////////////​////////////////////​////
     // key events
  -
  +
     public void keyTyped(KeyEvent ke) {
       if (ke.getKeyChar() == '') { // escape
         done();
         ke.consume();
       }
     }
  -
   } /* end class ModeCreatePolyEdge */
  
  
  
  1.2 +3 -4 gef/src/org/tigris/g​ef/base/ModeDragScro​ll.java
  
  Index: ModeDragScroll.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeDra​gScroll.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModeDragScroll.java 2000/09/04 12:38:48 1.1
  +++ ModeDragScroll.java 2000/10/16 12:04:47 1.2
  @@ -21,7 +21,6 @@
   // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
   // UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   
  -
   // File: ModeDragScroll.java
   // Classes: ModeDragScroll
   // Original Author: Sean Chen, schen at webex dot net
  @@ -41,7 +40,7 @@
    * @see Editor
    * @author Sean Chen, schen at webex dot net
    */
  -public class ModeDragScroll extends Mode implements ActionListener {
  +public class ModeDragScroll extends FigModifyingModeImpl implements ActionListener {
   
     /** Pause time between each scroll during autoscroll (in milliseconds)
      */
  @@ -104,7 +103,7 @@
       dragScrolling = (me.isAltDown());
   
       // get the component and the view
  - component = (JComponent) _editor.getAwtComponent();
  + component = (JComponent) editor.getAwtComponent();
       if (component == null) return;
       if (component != null && component.getParent() instanceof JViewport)
         view = (JViewport) component.getParent();
  @@ -239,7 +238,7 @@
       }
       //view.scrollRectToV​isible(newView);
       view.setViewPosition(new Point(currentView.x, currentView.y));
  - //System.out.println("scrolled to "+newView+" / "+_editor.getCurrentView());
  + //System.out.println("scrolled to "+newView+" / "+editor.getCurrentView());
       xcorrection += newView.x;
       ycorrection += newView.y;
       currentView = view.getViewRect(); //jer
  
  
  
  1.2 +1 -1 gef/src/org/tigris/g​ef/base/ModeImpl.jav​a
  
  Index: ModeImpl.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeImp​l.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModeImpl.java 2000/10/16 11:55:04 1.1
  +++ ModeImpl.java 2000/10/16 12:04:47 1.2
  @@ -24,7 +24,7 @@
   // File: ModeImpl.java
   // Classes: ModeImpl
   // Original Author: thorsten Jun 2000
  -// $Id: ModeImpl.java,v 1.1 2000/10/16 11:55:04 1sturm Exp $
  +// $Id: ModeImpl.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  
  
  
  1.2 +29 -25 gef/src/org/tigris/g​ef/base/ModeManager.​java
  
  Index: ModeManager.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeMan​ager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModeManager.java 2000/09/04 12:38:48 1.1
  +++ ModeManager.java 2000/10/16 12:04:47 1.2
  @@ -27,7 +27,7 @@
   // File: ModeManager.java
   // Classes: ModeManager
   // Original Author: jrobbins at ics dot uci dot edu
  -// $Id: ModeManager.java,v 1.1 2000/09/04 12:38:48 1sturm Exp $
  +// $Id: ModeManager.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  @@ -43,7 +43,10 @@
   /** ModeManager keeps track of all the Modes for a given Editor.
    * Events are passed to the Modes for handling. The submodes are
    * prioritized according to their order on a stack, i.e., the last
  - * Mode added gets the first chance to handle an Event. */
  + * Mode added gets the first chance to handle an Event.
  + * The Modes must be of type FigModifyingMode, because Editor can
  + * only deal with such Modes.
  + */
   
   public class ModeManager
   implements Serializable, MouseListener, MouseMotionListener, KeyListener {
  @@ -59,21 +62,21 @@
     private Vector _modes = new Vector();
   
     /** The Editor that owns this ModeManager. */
  - public Editor _editor;
  + public Editor editor;
   
     /** Set the parent Editor of this ModeManager */
  - public void setEditor(Editor w) { _editor = w; }
  + public void setEditor(Editor w) { editor = w; }
   
     protected EventListenerList _listeners = new EventListenerList();
   
     /** Get the parent Editor of this ModeManager */
  - public Editor getEditor() { return _editor; }
  + public Editor getEditor() { return editor; }
   
     ////////////////////​////////////////////​////////////////////​////
     // constructors
   
     /** Construct a ModeManager with no modes. */
  - public ModeManager(Editor ed) { _editor = ed; }
  + public ModeManager(Editor ed) { editor = ed; }
   
     ////////////////////​////////////////////​////////////////////​////
     // accessors
  @@ -85,14 +88,15 @@
     public void setModes(Vector newModes) { _modes = newModes; }
   
     /** Reply the top (first) Mode. */
  - public Mode top() {
  + public FigModifyingMode top() {
       if (_modes.isEmpty()) return null;
  - else return (Mode)_modes.lastElement();
  + else return (FigModifyingMode)_m​odes.lastElement();
     }
   
     /** Add the given Mode to the stack iff another instance
      * of the same class is not already on the stack. */
  - public void push(Mode newMode) {
  + public void push(FigModifyingMode newMode) {
  + if ( !(newMode instanceof FigModifyingMode) ) return;
       if (!includes(newMode.getClass())) {
         _modes.addElement(newMode);
         //fireModeChanged();
  @@ -100,9 +104,9 @@
     }
   
     /** Remove the topmost Mode iff it can exit. */
  - public Mode pop() {
  + public FigModifyingMode pop() {
       if (_modes.isEmpty()) return null;
  - Mode res = top();
  + FigModifyingMode res = top();
       if (res.canExit()) {
         _modes.removeElement(res);
         fireModeChanged();
  @@ -119,7 +123,7 @@
     public boolean includes(Class modeClass) {
       Enumeration subs = _modes.elements();
       while (subs.hasMoreElements()) {
  - Mode m = (Mode) subs.nextElement();
  + FigModifyingMode m = (FigModifyingMode) subs.nextElement();
         if (m.getClass() == modeClass) return true;
       }
       return false;
  @@ -132,7 +136,7 @@
     public void keyTyped(KeyEvent ke) {
       checkModeTransitions(ke);
       for (int i = _modes.size() - 1; i >= 0 && !ke.isConsumed(); --i) {
  - Mode m = ((Mode)_modes.elementAt(i));
  + FigModifyingModeImpl m = ((FigModifyingModeIm​pl)_modes.elementAt(​i));
         m.keyTyped(ke);
       }
     }
  @@ -143,7 +147,7 @@
     /** Pass events to all modes in order, until one consumes it. */
     public void keyPressed(KeyEvent ke) {
       for (int i = _modes.size() - 1; i >= 0 && !ke.isConsumed(); --i) {
  - Mode m = ((Mode)_modes.elementAt(i));
  + FigModifyingModeImpl m = ((FigModifyingModeIm​pl)_modes.elementAt(​i));
         m.keyPressed(ke);
       }
     }
  @@ -151,7 +155,7 @@
     /** Pass events to all modes in order, until one consumes it. */
     public void mouseMoved(MouseEvent me) {
       for (int i = _modes.size() - 1; i >= 0; --i) { // && !me.isConsumed()
  - Mode m = ((Mode)_modes.elementAt(i));
  + FigModifyingModeImpl m = ((FigModifyingModeIm​pl)_modes.elementAt(​i));
         m.mouseMoved(me);
       }
     }
  @@ -159,7 +163,7 @@
     /** Pass events to all modes in order, until one consumes it. */
     public void mouseDragged(MouseEvent me) {
       for (int i = _modes.size() - 1; i >= 0; --i) { // && !me.isConsumed()
  - Mode m = ((Mode)_modes.elementAt(i));
  + FigModifyingModeImpl m = ((FigModifyingModeIm​pl)_modes.elementAt(​i));
         m.mouseDragged(me);
       }
     }
  @@ -168,7 +172,7 @@
     public void mouseClicked(MouseEvent me) {
       checkModeTransitions(me);
       for (int i = _modes.size() - 1; i >= 0 && !me.isConsumed(); --i) {
  - Mode m = ((Mode)_modes.elementAt(i));
  + FigModifyingModeImpl m = ((FigModifyingModeIm​pl)_modes.elementAt(​i));
         m.mouseClicked(me);
       }
     }
  @@ -177,7 +181,7 @@
     public void mousePressed(MouseEvent me) {
       checkModeTransitions(me);
       for (int i = _modes.size() - 1; i >= 0; --i) { // && !me.isConsumed()
  - Mode m = ((Mode)_modes.elementAt(i));
  + FigModifyingModeImpl m = ((FigModifyingModeIm​pl)_modes.elementAt(​i));
         m.mousePressed(me);
       }
     }
  @@ -186,7 +190,7 @@
     public void mouseReleased(MouseEvent me) {
       checkModeTransitions(me);
       for (int i = _modes.size() - 1; i >= 0; --i) { // && !me.isConsumed()
  - Mode m = ((Mode)_modes.elementAt(i));
  + FigModifyingModeImpl m = ((FigModifyingModeIm​pl)_modes.elementAt(​i));
         m.mouseReleased(me);
       }
       //fireModeChanged();
  @@ -195,7 +199,7 @@
     /** Pass events to all modes in order, until one consumes it. */
     public void mouseEntered(MouseEvent me) {
       for (int i = _modes.size() - 1; i >= 0 && !me.isConsumed(); --i) {
  - Mode m = ((Mode)_modes.elementAt(i));
  + FigModifyingModeImpl m = ((FigModifyingModeIm​pl)_modes.elementAt(​i));
         m.mouseEntered(me);
       }
     }
  @@ -203,7 +207,7 @@
     /** Pass events to all modes in order, until one consumes it. */
     public void mouseExited(MouseEvent me) {
       for (int i = _modes.size() - 1; i >= 0 && !me.isConsumed(); --i) {
  - Mode m = ((Mode)_modes.elementAt(i));
  + FigModifyingModeImpl m = ((FigModifyingModeIm​pl)_modes.elementAt(​i));
         m.mouseExited(me);
       }
     }
  @@ -222,12 +226,12 @@
       if (!top().canExit() && ie.getID() == MouseEvent.MOUSE_PRESSED) {
         MouseEvent me = (MouseEvent) ie;
         int x = me.getX(), y = me.getY();
  - Fig underMouse = _editor.hit(x, y);
  + Fig underMouse = editor.hit(x, y);
         if (underMouse instanceof FigNode) {
       Object startPort = ((FigNode) underMouse).hitPort(x, y);
       if (startPort != null) {
         //user clicked on a port, now drag an edge
  - Mode createArc = new ModeCreateEdge(_editor);
  + FigModifyingModeImpl createArc = (FigModifyingModeImpl)new ModeCreateEdge(editor);
         push(createArc);
         createArc.mousePressed(me);
       }
  @@ -251,7 +255,7 @@
       ModeChangeEvent e = null;
       for (int i = listeners.length - 2; i >= 0; i -= 2) {
         if (listeners[i] == ModeChangeListener.class) {
  - if (e == null) e = new ModeChangeEvent(_editor, getModes());
  + if (e == null) e = new ModeChangeEvent(editor, getModes());
              //needs-more-work: should copy vector, use JGraph as src?
              ((ModeChangeListener​)listeners[i+1]).mod​eChange(e);
         }
  @@ -265,7 +269,7 @@
     public void paint(Graphics g) {
       Enumeration modes = _modes.elements();
       while (modes.hasMoreElements()) {
  - Mode m = (Mode) modes.nextElement();
  + FigModifyingMode m = (FigModifyingMode) modes.nextElement();
         m.paint(g);
       }
     }
  
  
  
  1.2 +6 -9 gef/src/org/tigris/g​ef/base/ModeModify.j​ava
  
  Index: ModeModify.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeMod​ify.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModeModify.java 2000/09/04 12:38:48 1.1
  +++ ModeModify.java 2000/10/16 12:04:47 1.2
  @@ -21,13 +21,10 @@
   // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
   // UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   
  -
  -
  -
   // File: ModeModify.java
   // Classes: ModeModify
   // Original Author: ics125 spring 1996
  -// $Id: ModeModify.java,v 1.1 2000/09/04 12:38:48 1sturm Exp $
  +// $Id: ModeModify.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  @@ -46,7 +43,7 @@
    * @see Selection
    */
   
  -public class ModeModify extends Mode {
  +public class ModeModify extends FigModifyingModeImpl {
     ////////////////////​////////////////////​////////////////////​////
     // constants
   
  @@ -176,7 +173,7 @@
       //Note: if _curHandle.index == -2 then do nothing
   
       sm.endTrans();
  - //_editor.scrollToShow(snapX, snapY);
  + //editor.scrollToShow(snapX, snapY);
       me.consume();
     }
   
  @@ -256,7 +253,7 @@
       SelectionManager sm = getEditor().getSelec​tionManager();
       sm.cleanUp();
       if (_highlightTrap != null) {
  - _editor.damaged(_hig​hlightTrap);
  + editor.damaged(_highlightTrap);
         _highlightTrap = null;
       }
     }
  @@ -285,7 +282,7 @@
     }
   
     protected boolean legal(int dx, int dy, SelectionManager sm, MouseEvent me) {
  - if (_highlightTrap != null) _editor.damaged(_hig​hlightTrap);
  + if (_highlightTrap != null) editor.damaged(_highlightTrap);
       _highlightTrap = null;
       Vector figs = sm.getFigs();
       Enumeration sels = figs.elements();
  @@ -317,7 +314,7 @@
           if ((bbox.contains(trap.x, trap.y) &&
            bbox.contains(trap.x + trap.width, trap.y + trap.height))) continue;
       _highlightTrap = trap;
  - _editor.damaged(_hig​hlightTrap);
  + editor.damaged(_highlightTrap);
           return false;
         }
       }
  
  
  
  1.2 +15 -17 gef/src/org/tigris/g​ef/base/ModePlace.ja​va
  
  Index: ModePlace.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModePla​ce.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModePlace.java 2000/09/04 12:38:48 1.1
  +++ ModePlace.java 2000/10/16 12:04:47 1.2
  @@ -21,12 +21,10 @@
   // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
   // UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   
  -
  -
   // File: ModePlace.java
   // Classes: ModePlace
   // Original Author: jrobbins at ics dot uci dot edu
  -// $Id: ModePlace.java,v 1.1 2000/09/04 12:38:48 1sturm Exp $
  +// $Id: ModePlace.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  @@ -44,7 +42,7 @@
    * @see FigNode
    */
   
  -public class ModePlace extends Mode {
  +public class ModePlace extends FigModifyingModeImpl {
   
     ////////////////////​////////////////////​////////////////////​////
     // instance variables
  @@ -99,10 +97,10 @@
       if (me.isConsumed()) return;
       _node = _factory.makeNode();
       start();
  - _editor = Globals.curEditor();
  - GraphModel gm = _editor.getGraphModel();
  - GraphNodeRenderer renderer = _editor.getGraphNodeRenderer();
  - Layer lay = _editor.getLayerMana​ger().getActiveLayer​();
  + editor = Globals.curEditor();
  + GraphModel gm = editor.getGraphModel();
  + GraphNodeRenderer renderer = editor.getGraphNodeRenderer();
  + Layer lay = editor.getLayerManag​er().getActiveLayer(​);
       _pers = renderer.getFigNodeFor(gm, lay, _node);
       mouseMoved(me); // move _pers into position
       me.consume();
  @@ -110,7 +108,7 @@
   
     /** Move the perpective along with the mouse. */
     public void mouseExited(MouseEvent me) {
  - _editor.damaged(_pers);
  + editor.damaged(_pers);
       _pers = null;
       me.consume();
     }
  @@ -120,11 +118,11 @@
       if (me.isConsumed()) return;
       int x = me.getX(), y = me.getY();
       if (_pers == null) { me.consume(); return; }
  - _editor.damaged(_pers);
  + editor.damaged(_pers);
       Point snapPt = new Point(x, y);
  - _editor.snap(snapPt);
  + editor.snap(snapPt);
       _pers.setLocation(snapPt.x, snapPt.y);
  - _editor.damaged(_pers); /* needed? */
  + editor.damaged(_pers); /* needed? */
       me.consume();
     }
   
  @@ -144,19 +142,19 @@
      * @see org.tigris.gef.graph​.GraphNodeHooks#post​Placement */
     public void mouseReleased(MouseEvent me) {
       if (me.isConsumed()) return;
  - GraphModel gm = _editor.getGraphModel();
  + GraphModel gm = editor.getGraphModel();
       if (!(gm instanceof MutableGraphModel)) return;
   
       MutableGraphModel mgm = (MutableGraphModel) gm;
       if (mgm.canAddNode(_node)) {
  - _editor.add(_pers);
  + editor.add(_pers);
         mgm.addNode(_node);
         if(_addRelatedEdges)
           mgm.addNodeRelatedEdges(_node);
   
         Fig encloser = null;
         Rectangle bbox = _pers.getBounds();
  - Layer lay = _editor.getLayerMana​ger().getActiveLayer​();
  + Layer lay = editor.getLayerManag​er().getActiveLayer(​);
         Vector otherFigs = lay.getContents();
         Enumeration others = otherFigs.elements();
         while (others.hasMoreElements()) {
  @@ -170,8 +168,8 @@
         }
         _pers.setEnclosingFi​g(encloser);
         if (_node instanceof GraphNodeHooks)
  - ((GraphNodeHooks)_no​de).postPlacement(_e​ditor);
  - _editor.getSelection​Manager().select(_pe​rs);
  + ((GraphNodeHooks)_no​de).postPlacement(ed​itor);
  + editor.getSelectionM​anager().select(_per​s);
       }
       done();
       me.consume();
  
  
  
  1.2 +4 -6 gef/src/org/tigris/g​ef/base/ModePopup.ja​va
  
  Index: ModePopup.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModePop​up.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModePopup.java 2000/09/04 12:38:48 1.1
  +++ ModePopup.java 2000/10/16 12:04:47 1.2
  @@ -21,8 +21,6 @@
   // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
   // UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   
  -
  -
   package org.tigris.gef.base;
   
   import java.awt.*;
  @@ -38,7 +36,7 @@
    * yet. It should ask the Fig under the mouse what menu it should
    * offer. */
   
  -public class ModePopup extends Mode {
  +public class ModePopup extends FigModifyingModeImpl {
   
     ////////////////////​////////////////////​////////////////////​////
     // constructor
  @@ -56,9 +54,9 @@
   
     public void showPopup(MouseEvent me) {
       int x = me.getX(), y = me.getY();
  - Fig underMouse = _editor.hit(x, y);
  + Fig underMouse = editor.hit(x, y);
       if (!(underMouse instanceof PopupGenerator)) return;
  - _editor.getSelection​Manager().select(und​erMouse);
  + editor.getSelectionM​anager().select(unde​rMouse);
       JPopupMenu popup = new JPopupMenu("test");
       Vector actions = ((PopupGenerator)und​erMouse).getPopUpAct​ions(me);
       int size = actions.size();
  @@ -67,7 +65,7 @@
         if (a instanceof AbstractAction) popup.add((AbstractAction) a);
         else if (a instanceof JMenu) popup.add((JMenu) a);
       }
  - popup.show(_editor.g​etAwtComponent(), me.getX(), me.getY());
  + popup.show(editor.ge​tAwtComponent(), me.getX(), me.getY());
     }
   
     ////////////////////​////////////////////​////////////////////​////
  
  
  
  1.2 +16 -18 gef/src/org/tigris/g​ef/base/ModeSelect.j​ava
  
  Index: ModeSelect.java
  ====================​====================​====================​=======
  RCS file: /cvs/gef/src/org/tig​ris/gef/base/ModeSel​ect.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModeSelect.java 2000/09/04 12:38:48 1.1
  +++ ModeSelect.java 2000/10/16 12:04:47 1.2
  @@ -21,12 +21,10 @@
   // CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
   // UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
   
  -
  -
   // File: ModeSelect.java
   // Classes: ModeSelect
   // Original Author: ics125 spring 1996
  -// $Id: ModeSelect.java,v 1.1 2000/09/04 12:38:48 1sturm Exp $
  +// $Id: ModeSelect.java,v 1.2 2000/10/16 12:04:47 1sturm Exp $
   
   package org.tigris.gef.base;
   
  @@ -58,7 +56,7 @@
    * @see Fig
    * @see Editor */
   
  -public class ModeSelect extends Mode {
  +public class ModeSelect extends FigModifyingModeImpl {
   
     ////////////////////​////////////////////​////////////////////​////
     // instance variables
  @@ -108,11 +106,11 @@
       _selectAnchor = new Point(x, y);
       _selectRect.setBounds(x, y, 0, 0);
       _toggleSelection = me.isShiftDown();
  - SelectionManager sm = _editor.getSelectionManager();
  + SelectionManager sm = editor.getSelectionManager();
       Rectangle hitRect = new Rectangle(x - 4, y - 4, 8, 8);
   
       /* Check if multiple things are selected and user clicked one of them. */
  - Fig underMouse = _editor.hit(_selectAnchor);
  + Fig underMouse = editor.hit(_selectAnchor);
       if (underMouse == null && !sm.hit(hitRect)) return;
   
       Handle h = new Handle(-1);
  @@ -146,10 +144,10 @@
       int bound_w = Math.max(_selectAnchor.x, x) - bound_x;
       int bound_h = Math.max(_selectAnchor.y, y) - bound_y;
   
  - _editor.damaged(_selectRect);
  + editor.damaged(_selectRect);
       _selectRect.setBounds(bound_x, bound_y, bound_w, bound_h);
  - _editor.damaged(_selectRect);
  - _editor.scrollToShow(x, y);
  + editor.damaged(_selectRect);
  + editor.scrollToShow(x, y);
   
       me.consume();
     }
  @@ -163,7 +161,7 @@
       Vector selectList = new Vector();
   
       Rectangle hitRect = new Rectangle(x - 4, y - 4, 8, 8);
  - Enumeration figs = _editor.figs();
  + Enumeration figs = editor.figs();
       while (figs.hasMoreElements()) {
         Fig f = (Fig) figs.nextElement();
         if ((!_toggleSelection && _selectRect.isEmpty() && f.hit(hitRect)) ||
  @@ -172,17 +170,17 @@
         }
       }
       if (!_selectRect.isEmpty() && selectList.isEmpty()) {
  - figs = _editor.figs();
  + figs = editor.figs();
          while (figs.hasMoreElements()) {
        Fig f = (Fig) figs.nextElement();
        if (f.intersects(_selectRect)) selectList.addElement(f);
          }
       }
  - if (_toggleSelection) _editor.getSelection​Manager().toggle(sel​ectList);
  - else _editor.getSelection​Manager().select(sel​ectList);
  + if (_toggleSelection) editor.getSelectionM​anager().toggle(sele​ctList);
  + else editor.getSelectionM​anager().select(sele​ctList);
   
       _selectRect.grow(1,1); /* make sure it is not empty for redraw */
  - _editor.damaged(_selectRect);
  + editor.damaged(_selectRect);
       if (me.getModifiers() == InputEvent.BUTTON3_MASK) return;
       me.consume();
     }
  @@ -215,14 +213,14 @@
      * should not be in ModeSelect, I wanted to move it to ModeModify,
      * but it is too tighly integrated with ModeSelect. */
     protected void gotoModifyMode(MouseEvent me) {
  - Mode nextMode = new ModeModify(_editor);
  - _editor.mode(nextMode);
  + FigModifyingModeImpl nextMode = new ModeModify(editor);
  + editor.mode(nextMode);
       nextMode.mousePressed(me);
     }
   
     protected void gotoBroomMode(MouseEvent me) {
  - Mode nextMode = new ModeBroom(_editor);
  - _editor.mode(nextMode);
  + FigModifyingModeImpl nextMode = new ModeBroom(editor);
  + editor.mode(nextMode);
       nextMode.mousePressed(me);
     }
   } /* end class ModeSelect */

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: gef/src/org/tigris/gef/base Mode.java ModeBroom.java ModeCreate.java ModeCreateEdge.java ModeCreateFigCircle.java ModeCreateFigImage.java ModeCreateFigInk.java ModeCreateFigLine.java ModeC... 1sturm Thorsten Sturm 2000-10-16 05:04:49 PDT
Messages per page: