Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r944 - trunk/src/org/tigris/gef/base

gef
Discussion topic

Back to topic list

svn commit: r944 - trunk/src/org/tigris/gef/base

Author mvw
Full name Michiel van der Wulp
Date 2006-11-12 07:39:51 PST
Message Author: mvw
Date: 2006-11-12 07:39:51-0800
New Revision: 944

Modified:
   trunk/src/org/tigris​/gef/base/Layer.java​
   trunk/src/org/tigris​/gef/base/LayerGrid.​java

Log:
Provide an interface to set the grid.
Loosely related to issue 83.
Conditio sine qua non for ArgoUML issue 603.

Modified: trunk/src/org/tigris​/gef/base/Layer.java​
Url: http://gef.tigris.or​g/source/browse/gef/​trunk/src/org/tigris​/gef/base/Layer.java​?view=diff&rev=9​44&p1=trunk/src/​org/tigris/gef/base/​Layer.java&p2=tr​unk/src/org/tigris/g​ef/base/Layer.java​&r1=943&r2=944​
====================​====================​====================​==================
--- trunk/src/org/tigris​/gef/base/Layer.java​ (original)
+++ trunk/src/org/tigris​/gef/base/Layer.java​ 2006-11-12 07:39:51-0800
@@ -30,22 +30,23 @@
 
 package org.tigris.gef.base;
 
-import org.tigris.gef.prese​ntation.Fig;
-import org.tigris.gef.prese​ntation.FigEdge;
-import org.tigris.gef.prese​ntation.FigPainter;
-import org.tigris.gef.util.​EnumerationEmpty;
-import org.tigris.gef.util.​EnumerationPredicate​;
-import org.tigris.gef.util.​PredFigInRect;
-import org.tigris.gef.util.​PredFigNodeInRect;
-
 import java.awt.Color;
 import java.awt.Graphics;
 import java.awt.Rectangle;
 import java.util.ArrayList;
 import java.util.Enumeration;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Vector;
 
+import org.tigris.gef.prese​ntation.Fig;
+import org.tigris.gef.prese​ntation.FigEdge;
+import org.tigris.gef.prese​ntation.FigPainter;
+import org.tigris.gef.util.​EnumerationEmpty;
+import org.tigris.gef.util.​EnumerationPredicate​;
+import org.tigris.gef.util.​PredFigInRect;
+import org.tigris.gef.util.​PredFigNodeInRect;
+
 /** A Layer is like a drawing layer in high-end drawing applications
  * (e.g., MacDraw Pro). A Layer is like a sheet of clear plastic that
  * can contain part of the picture being drawn and multiple layers
@@ -498,4 +499,15 @@
     public void adjust() {
     }
 
+ /**
+ * Allow the user to edit the properties of this layer (not the
+ * properties of the contents of this layer). For example, in
+ * LayerGrid this could set the grid size. By default, does nothing.
+ *
+ * @see LayerGrid
+ * @param map a hashmap with properties
+ */
+ public void adjust(HashMap map) {
+ }
+
 } /* end class Layer */

Modified: trunk/src/org/tigris​/gef/base/LayerGrid.​java
Url: http://gef.tigris.or​g/source/browse/gef/​trunk/src/org/tigris​/gef/base/LayerGrid.​java?view=diff&r​ev=944&p1=trunk/​src/org/tigris/gef/b​ase/LayerGrid.java​&p2=trunk/src/org/​tigris/gef/base/Laye​rGrid.java&r1=94​3&r2=944
====================​====================​====================​==================
--- trunk/src/org/tigris​/gef/base/LayerGrid.​java (original)
+++ trunk/src/org/tigris​/gef/base/LayerGrid.​java 2006-11-12 07:39:51-0800
@@ -39,6 +39,7 @@
 import java.awt.Image;
 import java.awt.PrintGraphics;
 import java.awt.Rectangle;
+import java.util.HashMap;
 import java.util.List;
 
 import org.tigris.gef.prese​ntation.Fig;
@@ -286,4 +287,33 @@
     }
     refreshEditors();
   }
+
+ /**
+ * This function allows to adjust various properties of this Layer. <p>
+ *
+ * Supported are:<ul><li>
+ * "spacing", Integer : the size of the grid <li>
+ * "paintLines", Boolean : shows grid as lines (overrules dots) <li>
+ * "paintDots", Boolean : shows grid as dots
+ *
+ * @see org.tigris.gef.base.​Layer#adjust(java.ut​il.HashMap)
+ */
+ public void adjust(HashMap map) {
+ super.adjust(map);
+ Object m;
+ _stamp = null;
+ setHidden(false);
+
+ m = map.get("spacing");
+ if (m instanceof Integer) _spacing = ((Integer) m).intValue();
+
+ m = map.get("paintLines");
+ if (m instanceof Boolean) _paintLines = ((Boolean) m).booleanValue();
+
+ m = map.get("paintDots");
+ if (m instanceof Boolean) _paintDots = ((Boolean) m).booleanValue();
+
+ refreshEditors();
+ }
+
 } /* end class LayerGrid */

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

Messages

Show all messages in topic

svn commit: r944 - trunk/src/org/tigris/gef/base mvw Michiel van der Wulp 2006-11-12 07:39:51 PST
Messages per page: