incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1098945 [10/25] - in /incubator/isis/trunk/viewer: bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/ bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/components/ bdd/common/src/main/java/org/apache/isis/viewer/bdd/commo...
Date Tue, 03 May 2011 07:18:38 GMT
Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/ColorsAndFonts.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/ColorsAndFonts.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/ColorsAndFonts.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/ColorsAndFonts.java Tue May  3 07:18:19 2011
@@ -17,11 +17,8 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.drawing;
 
-
-
 /**
  * A look-up for font and color details.
  * 
@@ -41,7 +38,7 @@ public interface ColorsAndFonts {
     public final static String COLOR_WINDOW = "color.background.window";
     public final static String COLOR_MENU_VALUE = "color.background.menu.value";
     public final static String COLOR_MENU_CONTENT = "color.background.menu.content";
-    public final static String COLOR_MENU_VIEW= "color.background.menu.view";
+    public final static String COLOR_MENU_VIEW = "color.background.menu.view";
     public final static String COLOR_MENU_WORKSPACE = "color.background.menu.workspace";
 
     // menu colors
@@ -52,8 +49,8 @@ public interface ColorsAndFonts {
     // label colors
     public final static String COLOR_LABEL = "color.label.normal";
     public final static String COLOR_LABEL_DISABLED = "color.label.disabled";
-    public final static String COLOR_LABEL_MANDATORY = "color.label.mandatory";    
-    
+    public final static String COLOR_LABEL_MANDATORY = "color.label.mandatory";
+
     // state colors
     public final static String COLOR_IDENTIFIED = "color.identified";
     public final static String COLOR_VALID = "color.valid";
@@ -102,4 +99,3 @@ public interface ColorsAndFonts {
     void init();
 
 }
-

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/DebugCanvas.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/DebugCanvas.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/DebugCanvas.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/DebugCanvas.java Tue May  3 07:18:19 2011
@@ -17,12 +17,10 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.drawing;
 
 import org.apache.isis.core.commons.debug.DebugBuilder;
 
-
 public class DebugCanvas implements Canvas {
     private final DebugBuilder buffer;
     private final int level;
@@ -36,6 +34,7 @@ public class DebugCanvas implements Canv
         this.buffer = buffer;
     }
 
+    @Override
     public Canvas createSubcanvas() {
         buffer.blankLine();
         indent();
@@ -43,10 +42,12 @@ public class DebugCanvas implements Canv
         return new DebugCanvas(buffer, level + 1);
     }
 
+    @Override
     public Canvas createSubcanvas(final Bounds bounds) {
         return createSubcanvas(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());
     }
 
+    @Override
     public Canvas createSubcanvas(final int x, final int y, final int width, final int height) {
         buffer.blankLine();
         indent();
@@ -54,75 +55,76 @@ public class DebugCanvas implements Canv
         return new DebugCanvas(buffer, level + 1);
     }
 
-    public void draw3DRectangle(
-            final int x,
-            final int y,
-            final int width,
-            final int height,
-            final Color color,
-            final boolean raised) {
+    @Override
+    public void draw3DRectangle(final int x, final int y, final int width, final int height, final Color color,
+        final boolean raised) {
         indent();
         buffer.appendln("Rectangle (3D) " + x + "," + y + " " + width + "x" + height);
     }
 
+    @Override
     public void drawImage(final Image image, final int x, final int y) {
         indent();
         buffer.appendln("Icon " + x + "," + y + " " + image.getWidth() + "x" + image.getHeight());
     }
 
+    @Override
     public void drawImage(final Image image, final int x, final int y, final int width, final int height) {
         indent();
         buffer.appendln("Icon " + x + "," + y + " " + width + "x" + height);
     }
 
+    @Override
     public void drawLine(final int x, final int y, final int x2, final int y2, final Color color) {
         indent();
         buffer.appendln("Line from " + x + "," + y + " to " + x2 + "," + y2 + " " + color);
     }
 
+    @Override
     public void drawLine(final Location start, final int xExtent, final int yExtent, final Color color) {
         indent();
         buffer.appendln("Line from " + start.getX() + "," + start.getY() + " to " + (start.getX() + xExtent) + ","
-                + (start.getY() + yExtent) + " " + color);
+            + (start.getY() + yExtent) + " " + color);
     }
 
+    @Override
     public void drawOval(final int x, final int y, final int width, final int height, final Color color) {
         indent();
         buffer.appendln("Oval " + x + "," + y + " " + width + "x" + height + " " + color);
     }
 
+    @Override
     public void drawRectangle(final int x, final int y, final int width, final int height, final Color color) {
         indent();
         buffer.appendln("Rectangle " + x + "," + y + " " + width + "x" + height + " " + color);
     }
 
+    @Override
     public void drawRectangleAround(final Bounds bounds, final Color color) {
         indent();
         buffer.appendln("Rectangle 0,0 " + bounds.getWidth() + "x" + bounds.getHeight() + " " + color);
     }
 
-    public void drawRoundedRectangle(
-            final int x,
-            final int y,
-            final int width,
-            final int height,
-            final int arcWidth,
-            final int arcHeight,
-            final Color color) {
+    @Override
+    public void drawRoundedRectangle(final int x, final int y, final int width, final int height, final int arcWidth,
+        final int arcHeight, final Color color) {
         indent();
         buffer.appendln("Rounded Rectangle " + x + "," + y + " " + (x + width) + "x" + (y + height) + " " + color);
     }
 
+    @Override
     public void drawShape(final Shape shape, final Color color) {
         indent();
         buffer.appendln("Shape " + shape + " " + color);
     }
 
+    @Override
     public void drawShape(final Shape shape, final int x, final int y, final Color color) {
         indent();
         buffer.appendln("Shape " + shape + " at " + x + "/" + y + " (left, top)" + " " + color);
     }
 
+    @Override
     public void drawSolidOval(final int x, final int y, final int width, final int height, final Color color) {
         indent();
         buffer.appendln("Oval (solid) " + x + "," + y + " " + width + "x" + height + " " + color);
@@ -148,7 +150,8 @@ public class DebugCanvas implements Canv
         buffer.appendln("Text " + x + "," + y + " \"" + text + "\" " + style + " " + color);
     }
 
-    public void drawText(final String text, final int x, final int y, final int maxWidth, final Color color, final Text style) {
+    public void drawText(final String text, final int x, final int y, final int maxWidth, final Color color,
+        final Text style) {
         indent();
         buffer.appendln("Text " + x + "," + y + " +" + maxWidth + "xh \"" + text + "\" " + style + " " + color);
     }
@@ -174,6 +177,7 @@ public class DebugCanvas implements Canv
         return "Canvas";
     }
 
-    public void drawDebugOutline(final Bounds bounds, final int baseline, final Color color) {}
+    public void drawDebugOutline(final Bounds bounds, final int baseline, final Color color) {
+    }
 
 }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/DebugCanvasAbsolute.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/DebugCanvasAbsolute.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/DebugCanvasAbsolute.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/DebugCanvasAbsolute.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.drawing;
 
 import java.io.PrintWriter;
@@ -26,7 +25,6 @@ import java.util.StringTokenizer;
 
 import org.apache.isis.core.commons.debug.DebugBuilder;
 
-
 public class DebugCanvasAbsolute implements Canvas {
     private final DebugBuilder buffer;
     private final int level;
@@ -67,19 +65,15 @@ public class DebugCanvasAbsolute impleme
         return new DebugCanvasAbsolute(buffer, level + 1, dx, dy);
     }
 
-    public void draw3DRectangle(
-            final int x,
-            final int y,
-            final int width,
-            final int height,
-            final Color color,
-            final boolean raised) {
+    public void draw3DRectangle(final int x, final int y, final int width, final int height, final Color color,
+        final boolean raised) {
         indent();
         final int px = offsetX + x;
         final int py = offsetY + y;
         final int qx = px + width - 1;
         final int qy = py + height - 1;
-        buffer.appendln("Rectangle (3D) " + px + "," + py + " " + width + "x" + height + " (" + qx + "," + qy + ") " + line());
+        buffer.appendln("Rectangle (3D) " + px + "," + py + " " + width + "x" + height + " (" + qx + "," + qy + ") "
+            + line());
     }
 
     public void drawImage(final Image image, final int x, final int y) {
@@ -88,8 +82,8 @@ public class DebugCanvasAbsolute impleme
         final int py = offsetY + y;
         final int qx = px + image.getWidth() - 1;
         final int qy = py + image.getHeight() - 1;
-        buffer.appendln("Icon " + px + "," + py + " " + image.getWidth() + "x" + image.getHeight() + " (" + qx + "," + qy + ") "
-                + line());
+        buffer.appendln("Icon " + px + "," + py + " " + image.getWidth() + "x" + image.getHeight() + " (" + qx + ","
+            + qy + ") " + line());
     }
 
     public void drawImage(final Image image, final int x, final int y, final int width, final int height) {
@@ -113,7 +107,7 @@ public class DebugCanvasAbsolute impleme
     public void drawLine(final Location start, final int xExtent, final int yExtent, final Color color) {
         indent();
         buffer.appendln("Line from " + start.getX() + "," + start.getY() + " to " + (start.getX() + xExtent) + ","
-                + (start.getY() + yExtent) + " " + color + line());
+            + (start.getY() + yExtent) + " " + color + line());
     }
 
     public void drawOval(final int x, final int y, final int width, final int height, final Color color) {
@@ -130,7 +124,8 @@ public class DebugCanvasAbsolute impleme
         final int qx = px + width - 1;
         final int qy = py + height - 1;
 
-        buffer.appendln("Rectangle " + px + "," + py + " " + width + "x" + height + " (" + qx + "," + qy + ") " + color + line());
+        buffer.appendln("Rectangle " + px + "," + py + " " + width + "x" + height + " (" + qx + "," + qy + ") " + color
+            + line());
     }
 
     private String line() {
@@ -151,21 +146,15 @@ public class DebugCanvasAbsolute impleme
         buffer.appendln("Rectangle 0,0 " + bounds.getWidth() + "x" + bounds.getHeight() + " " + color + line());
     }
 
-    public void drawRoundedRectangle(
-            final int x,
-            final int y,
-            final int width,
-            final int height,
-            final int arcWidth,
-            final int arcHeight,
-            final Color color) {
+    public void drawRoundedRectangle(final int x, final int y, final int width, final int height, final int arcWidth,
+        final int arcHeight, final Color color) {
         indent();
         final int px = offsetX + x;
         final int py = offsetY + y;
         final int qx = px + width - 1;
         final int qy = py + height - 1;
-        buffer.appendln("Rounded Rectangle " + px + "," + py + " " + width + "x" + height + " (" + qx + "," + qy + ") " + color
-                + line());
+        buffer.appendln("Rounded Rectangle " + px + "," + py + " " + width + "x" + height + " (" + qx + "," + qy + ") "
+            + color + line());
     }
 
     public void drawShape(final Shape shape, final Color color) {
@@ -186,8 +175,8 @@ public class DebugCanvasAbsolute impleme
         final int py = offsetY + y;
         final int qx = px + width - 1;
         final int qy = py + height - 1;
-        buffer.appendln("Oval (solid) " + px + "," + py + " " + width + "x" + height + " (" + qx + "," + qy + ") " + color
-                + line());
+        buffer.appendln("Oval (solid) " + px + "," + py + " " + width + "x" + height + " (" + qx + "," + qy + ") "
+            + color + line());
     }
 
     public void drawSolidRectangle(final int x, final int y, final int width, final int height, final Color color) {
@@ -196,8 +185,8 @@ public class DebugCanvasAbsolute impleme
         final int py = offsetY + y;
         final int qx = px + width - 1;
         final int qy = py + height - 1;
-        buffer.appendln("Rectangle (solid) " + px + "," + py + " " + width + "x" + height + " (" + qx + "," + qy + ") " + color
-                + line());
+        buffer.appendln("Rectangle (solid) " + px + "," + py + " " + width + "x" + height + " (" + qx + "," + qy + ") "
+            + color + line());
     }
 
     public void drawSolidShape(final Shape shape, final Color color) {
@@ -219,7 +208,8 @@ public class DebugCanvasAbsolute impleme
         buffer.appendln("Text " + px + "," + py + " \"" + text + "\" " + color + line());
     }
 
-    public void drawText(final String text, final int x, final int y, final int maxWidth, final Color color, final Text style) {
+    public void drawText(final String text, final int x, final int y, final int maxWidth, final Color color,
+        final Text style) {
         indent();
         final int px = offsetX + x;
         final int py = offsetY + y;
@@ -247,6 +237,7 @@ public class DebugCanvasAbsolute impleme
         return "Canvas";
     }
 
-    public void drawDebugOutline(final Bounds bounds, final int baseline, final Color color) {}
+    public void drawDebugOutline(final Bounds bounds, final int baseline, final Color color) {
+    }
 
 }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/DrawingUtil.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/DrawingUtil.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/DrawingUtil.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/DrawingUtil.java Tue May  3 07:18:19 2011
@@ -17,18 +17,11 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.drawing;
 
 public class DrawingUtil {
-    public static void drawHatching(
-            final Canvas canvas,
-            final int x,
-            final int y,
-            final int width,
-            final int height,
-            final Color foreground,
-            final Color shadow) {
+    public static void drawHatching(final Canvas canvas, final int x, final int y, final int width, final int height,
+        final Color foreground, final Color shadow) {
         final int bottom = y + height;
         for (int p = y; p < bottom; p += 4) {
             drawDots(canvas, x, p, width, foreground, shadow);
@@ -38,13 +31,8 @@ public class DrawingUtil {
         }
     }
 
-    private static void drawDots(
-            final Canvas canvas,
-            final int x,
-            final int y,
-            final int width,
-            final Color foreground,
-            final Color shadow) {
+    private static void drawDots(final Canvas canvas, final int x, final int y, final int width,
+        final Color foreground, final Color shadow) {
         final int x2 = x + width;
         for (int p = x; p < x2; p += 4) {
             canvas.drawLine(p, y, p, y, shadow);
@@ -52,4 +40,3 @@ public class DrawingUtil {
         }
     }
 }
-

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Image.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Image.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Image.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Image.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.drawing;
 
 public interface Image {

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/ImageFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/ImageFactory.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/ImageFactory.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/ImageFactory.java Tue May  3 07:18:19 2011
@@ -17,14 +17,13 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.drawing;
 
 /*
-import java.awt.Toolkit;
-import java.awt.image.FilteredImageSource;
-import java.awt.image.RGBImageFilter;
-*/
+ import java.awt.Toolkit;
+ import java.awt.image.FilteredImageSource;
+ import java.awt.image.RGBImageFilter;
+ */
 import java.util.Hashtable;
 
 import org.apache.isis.core.commons.config.IsisConfiguration;
@@ -33,7 +32,6 @@ import org.apache.isis.core.metamodel.sp
 import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
 import org.apache.isis.viewer.dnd.util.Properties;
 
-
 public abstract class ImageFactory {
     private static final String DEFAULT_IMAGE_NAME = "Default";
     private static final String DEFAULT_IMAGE_PROPERTY = Properties.PROPERTY_BASE + "default-image";
@@ -47,33 +45,30 @@ public abstract class ImageFactory {
         return instance;
     }
 
-    
     /**
-     * Keyed list of icons (each derived from an image, of a specific size etc), where the key is the name of
-     * the icon and its size.
+     * Keyed list of icons (each derived from an image, of a specific size etc), where the key is the name of the icon
+     * and its size.
      */
-    private final Hashtable<String,Image> templateImages = new Hashtable<String,Image>();
+    private final Hashtable<String, Image> templateImages = new Hashtable<String, Image>();
 
-    
-    //////////////////////////////////////////////////////////////////////
+    // ////////////////////////////////////////////////////////////////////
     // Constructor
-    //////////////////////////////////////////////////////////////////////
-    
+    // ////////////////////////////////////////////////////////////////////
+
     public ImageFactory() {
         instance = this;
     }
 
-    
-    //////////////////////////////////////////////////////////////////////
+    // ////////////////////////////////////////////////////////////////////
     // loadIcon for Specifications
-    //////////////////////////////////////////////////////////////////////
-    
+    // ////////////////////////////////////////////////////////////////////
+
     public Image loadIcon(final ObjectSpecification specification, final int iconHeight, final Color tint) {
         return findIcon(specification, iconHeight, null);
     }
 
     private Image findIcon(final ObjectSpecification specification, final int iconHeight, final Color tint) {
-        Image loadIcon = null;       
+        Image loadIcon = null;
         if (loadIcon == null) {
             final String fullClassNameSlashes = specification.getFullIdentifier().replace(".", "/");
             loadIcon = loadIcon(fullClassNameSlashes, iconHeight, tint);
@@ -97,7 +92,7 @@ public abstract class ImageFactory {
 
     private Image findIconForSuperClass(final ObjectSpecification specification, final int iconHeight, final Color tint) {
         final ObjectSpecification superclassSpecification = specification.superclass();
-        Image loadIcon; 
+        Image loadIcon;
         if (superclassSpecification == null) {
             loadIcon = null;
         } else {
@@ -107,8 +102,8 @@ public abstract class ImageFactory {
     }
 
     private Image findIconForInterfaces(final ObjectSpecification specification, final int iconHeight, final Color tint) {
-        Image loadIcon = null; 
-        for (ObjectSpecification interfaceSpecification : specification.interfaces()) {
+        Image loadIcon = null;
+        for (final ObjectSpecification interfaceSpecification : specification.interfaces()) {
             loadIcon = findIcon(interfaceSpecification, iconHeight, tint);
             if (loadIcon != null) {
                 return loadIcon;
@@ -117,14 +112,12 @@ public abstract class ImageFactory {
         return loadIcon;
     }
 
-    
-    //////////////////////////////////////////////////////////////////////
+    // ////////////////////////////////////////////////////////////////////
     // loadIcon for arbitrary path
-    //////////////////////////////////////////////////////////////////////
+    // ////////////////////////////////////////////////////////////////////
 
     /**
-     * Loads an icon of the specified size, and with the specified tint. If color is null then no tint is
-     * applied.
+     * Loads an icon of the specified size, and with the specified tint. If color is null then no tint is applied.
      */
     public Image loadIcon(final String name, final int height, final Color tint) {
         final String id = name + SEPARATOR + height + SEPARATOR + tint;
@@ -139,9 +132,9 @@ public abstract class ImageFactory {
         return icon;
     }
 
-    //////////////////////////////////////////////////////////////////////
+    // ////////////////////////////////////////////////////////////////////
     // loadDefaultIcon
-    //////////////////////////////////////////////////////////////////////
+    // ////////////////////////////////////////////////////////////////////
 
     /**
      * Loads the fall back icon image, for use when no specific image can be found
@@ -158,30 +151,26 @@ public abstract class ImageFactory {
         return icon;
     }
 
-
-    //////////////////////////////////////////////////////////////////////
+    // ////////////////////////////////////////////////////////////////////
     // loadImage
-    //////////////////////////////////////////////////////////////////////
+    // ////////////////////////////////////////////////////////////////////
 
     /**
      * Load an image with the given name.
      */
-    public abstract Image loadImage(final String path);    
+    public abstract Image loadImage(final String path);
 
     /**
      * Load an image with the given name, but of a specific height and of a specific hint.
      */
     protected abstract Image loadImage(final String name, final int height, final Color tint);
 
-    //////////////////////////////////////////////////////////////////////
+    // ////////////////////////////////////////////////////////////////////
     // Dependencies (from singleton)
-    //////////////////////////////////////////////////////////////////////
+    // ////////////////////////////////////////////////////////////////////
 
     private IsisConfiguration getConfiguration() {
         return IsisContext.getConfiguration();
     }
 
-
-
-
 }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Location.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Location.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Location.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Location.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.drawing;
 
 public class Location {

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Offset.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Offset.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Offset.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Offset.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.drawing;
 
 public class Offset {

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Padding.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Padding.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Padding.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Padding.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.drawing;
 
 public class Padding {
@@ -125,7 +124,7 @@ public class Padding {
             final Padding object = (Padding) obj;
 
             return object.top == this.top && object.bottom == this.bottom && object.left == this.left
-                    && object.right == this.right;
+                && object.right == this.right;
         }
 
         return false;

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Shape.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Shape.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Shape.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Shape.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.drawing;
 
 public class Shape {
@@ -25,7 +24,8 @@ public class Shape {
     int[] x = new int[6];
     int[] y = new int[6];
 
-    public Shape() {}
+    public Shape() {
+    }
 
     public Shape(final int xOrigin, final int yOrigin) {
         this.x[0] = xOrigin;

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Size.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Size.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Size.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Size.java Tue May  3 07:18:19 2011
@@ -17,14 +17,13 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.drawing;
 
 public class Size {
     public static final Size createMax() {
         return new Size(10000, 10000);
     }
-    
+
     int height;
     int width;
 
@@ -121,17 +120,16 @@ public class Size {
     }
 
     /**
-     * Limits the height of this Size so that if its height is greater than the specified maximum then the
-     * height is reduced to the maximum. If the height is less than maximum (or equal to it) then nothing is
-     * done.
+     * Limits the height of this Size so that if its height is greater than the specified maximum then the height is
+     * reduced to the maximum. If the height is less than maximum (or equal to it) then nothing is done.
      */
     public void limitHeight(final int maximum) {
         height = Math.min(height, maximum);
     }
 
     /**
-     * Limits the width of this Size so that if its width is greater than the specified maximum then the width
-     * is reduced to the maximum. If the width is less than maximum (or equal to it) then nothing is done.
+     * Limits the width of this Size so that if its width is greater than the specified maximum then the width is
+     * reduced to the maximum. If the width is less than maximum (or equal to it) then nothing is done.
      */
     public void limitWidth(final int maximum) {
         width = Math.min(width, maximum);

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Text.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Text.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Text.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/drawing/Text.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.drawing;
 
 public interface Text {
@@ -28,14 +27,13 @@ public interface Text {
     int charWidth(char c);
 
     /**
-     * Returns the height, in pixels, of the distance from the baseline to top of the tallest character
-     * (including accents that are not common in english.
+     * Returns the height, in pixels, of the distance from the baseline to top of the tallest character (including
+     * accents that are not common in english.
      */
     int getAscent();
 
     /**
-     * Returns the height, in pixels, of the distance from bottom of the lowest descending character to the
-     * baseline.
+     * Returns the height, in pixels, of the distance from bottom of the lowest descending character to the baseline.
      */
     int getDescent();
 
@@ -50,8 +48,7 @@ public interface Text {
     String getName();
 
     /**
-     * Returns the height, in pixels, for a normal line of text - where there is some space between two lines
-     * of text.
+     * Returns the height, in pixels, for a normal line of text - where there is some space between two lines of text.
      */
     int getTextHeight();
 
@@ -64,8 +61,7 @@ public interface Text {
     int getLineHeight();
 
     /**
-     * Returns the number of blank vertical pixels to add between adjacent lines to give them additional
-     * spacing.
+     * Returns the number of blank vertical pixels to add between adjacent lines to give them additional spacing.
      */
     int getLineSpacing();
 

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/AbstractField.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/AbstractField.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/AbstractField.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/AbstractField.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
 import org.apache.isis.core.commons.exceptions.NotYetImplementedException;
@@ -43,7 +42,6 @@ import org.apache.isis.viewer.dnd.view.V
 import org.apache.isis.viewer.dnd.view.action.BackgroundWork;
 import org.apache.isis.viewer.dnd.view.base.AbstractView;
 
-
 public abstract class AbstractField extends AbstractView {
     protected static final int TEXT_WIDTH = 20;
     private boolean identified;
@@ -60,28 +58,33 @@ public abstract class AbstractField exte
     protected boolean provideClearCopyPaste() {
         return false;
     }
-    
+
     protected Consent canClear() {
         return Allow.DEFAULT;
     }
 
-    protected void clear() {}
+    protected void clear() {
+    }
 
-    protected void copyToClipboard() {}
+    protected void copyToClipboard() {
+    }
 
-    protected void pasteFromClipboard() {}
+    protected void pasteFromClipboard() {
+    }
 
     /**
      * Indicates the drag started within this view's bounds is continuing. By default does nothing.
      */
     @Override
-    public void drag(final InternalDrag drag) {}
+    public void drag(final InternalDrag drag) {
+    }
 
     /**
      * Default implementation - does nothing
      */
     @Override
-    public void dragCancel(final InternalDrag drag) {}
+    public void dragCancel(final InternalDrag drag) {
+    }
 
     /**
      * Indicates the start of a drag within this view's bounds. By default does nothing.
@@ -92,11 +95,12 @@ public abstract class AbstractField exte
     }
 
     /**
-     * Indicates the drag started within this view's bounds has been finished (although the location may now
-     * be outside of its bounds). By default does nothing.
+     * Indicates the drag started within this view's bounds has been finished (although the location may now be outside
+     * of its bounds). By default does nothing.
      */
     @Override
-    public void dragTo(final InternalDrag drag) {}
+    public void dragTo(final InternalDrag drag) {
+    }
 
     @Override
     public void draw(final Canvas canvas) {
@@ -109,12 +113,12 @@ public abstract class AbstractField exte
         }
 
         if (getState().isInvalid()) {
-            Image image = ImageFactory.getInstance().loadIcon("invalid-entry", 12, null);
+            final Image image = ImageFactory.getInstance().loadIcon("invalid-entry", 12, null);
             if (image != null) {
                 canvas.drawImage(image, getSize().getWidth() - 16, 2);
             }
-            
-            //canvas.clearBackground(this, Toolkit.getColor(ColorsAndFonts.COLOR_INVALID));
+
+            // canvas.clearBackground(this, Toolkit.getColor(ColorsAndFonts.COLOR_INVALID));
         }
 
         super.draw(canvas);
@@ -163,7 +167,7 @@ public abstract class AbstractField exte
     public boolean isEmpty() {
         return false;
     }
-    
+
     public boolean indicatesForView(final Location mouseLocation) {
         return false;
     }
@@ -172,21 +176,23 @@ public abstract class AbstractField exte
      * Called when the user presses any key on the keyboard while this view has the focus.
      */
     @Override
-    public void keyPressed(final KeyboardAction key) {}
+    public void keyPressed(final KeyboardAction key) {
+    }
 
     /**
      * Called when the user releases any key on the keyboard while this view has the focus.
      */
     @Override
-    public void keyReleased(KeyboardAction action) {}
+    public void keyReleased(final KeyboardAction action) {
+    }
 
     /**
-     * Called when the user presses a non-control key (i.e. data entry keys and not shift, up-arrow etc). Such
-     * a key press will result in a prior call to <code>keyPressed</code> and a subsequent call to
-     * <code>keyReleased</code>.
+     * Called when the user presses a non-control key (i.e. data entry keys and not shift, up-arrow etc). Such a key
+     * press will result in a prior call to <code>keyPressed</code> and a subsequent call to <code>keyReleased</code>.
      */
     @Override
-    public void keyTyped(KeyboardAction action) {}
+    public void keyTyped(final KeyboardAction action) {
+    }
 
     @Override
     public void contentMenuOptions(final UserActionSet options) {
@@ -202,6 +208,7 @@ public abstract class AbstractField exte
 
     protected final void initiateSave(final boolean moveToNextField) {
         BackgroundWork.runTaskInBackground(this, new BackgroundTask() {
+            @Override
             public void execute() {
                 save();
                 getParent().updateView();
@@ -211,10 +218,12 @@ public abstract class AbstractField exte
                 }
             }
 
+            @Override
             public String getName() {
                 return "Save field";
             }
 
+            @Override
             public String getDescription() {
                 return "Saving " + getContent().windowTitle();
             }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/AbstractValueOption.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/AbstractValueOption.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/AbstractValueOption.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/AbstractValueOption.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -25,11 +24,10 @@ import org.apache.isis.viewer.dnd.view.V
 import org.apache.isis.viewer.dnd.view.content.TextParseableContent;
 import org.apache.isis.viewer.dnd.view.option.UserActionAbstract;
 
-
 public abstract class AbstractValueOption extends UserActionAbstract {
     protected final AbstractField field;
 
-    AbstractValueOption(AbstractField field, final String name) {
+    AbstractValueOption(final AbstractField field, final String name) {
         super(name);
         this.field = field;
     }
@@ -42,16 +40,15 @@ public abstract class AbstractValueOptio
 
     protected void updateParent(final View view) {
         // have commented this out because it isn't needed; the transaction manager will do this
-        // for us on endTransaction.  Still, if I'm wrong and it is needed, hopefully this
+        // for us on endTransaction. Still, if I'm wrong and it is needed, hopefully this
         // comment will help...
         // IsisContext.getObjectPersistor().objectChangedAllDirty();
-        
+
         view.markDamaged();
         view.getParent().invalidateContent();
     }
 
-    
     protected boolean isEmpty(final View view) {
         return field.isEmpty();
-   }
+    }
 }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/CheckboxField.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/CheckboxField.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/CheckboxField.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/CheckboxField.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -40,7 +39,6 @@ import org.apache.isis.viewer.dnd.view.V
 import org.apache.isis.viewer.dnd.view.base.AbstractFieldSpecification;
 import org.apache.isis.viewer.dnd.view.content.TextParseableContent;
 
-
 /*
  * TODO this class does not set the underlying business object  via its boolean adapter.  Need
  * to create an content type for flags.
@@ -50,14 +48,16 @@ public class CheckboxField extends Abstr
 
     public static class Specification extends AbstractFieldSpecification {
         @Override
-        public boolean canDisplay(ViewRequirement requirement) {
+        public boolean canDisplay(final ViewRequirement requirement) {
             return requirement.isTextParseable() && requirement.isForValueType(BooleanValueFacet.class);
         }
 
-        public View createView(final Content content, Axes axes, int sequence) {
+        @Override
+        public View createView(final Content content, final Axes axes, final int sequence) {
             return new CheckboxField(content, this);
         }
 
+        @Override
         public String getName() {
             return "Checkbox";
         }
@@ -82,7 +82,7 @@ public class CheckboxField extends Abstr
         color = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1);
         canvas.drawRectangle(left, top, size, size, color);
         if (isSet()) {
-            Image image = ImageFactory.getInstance().loadImage("check-mark");
+            final Image image = ImageFactory.getInstance().loadImage("check-mark");
             canvas.drawImage(image, 3, 3, size, size);
         }
     }
@@ -92,16 +92,18 @@ public class CheckboxField extends Abstr
         toggle();
     }
 
-    public void secondClick(Click click) {
-    // ignore
+    @Override
+    public void secondClick(final Click click) {
+        // ignore
     }
 
-    public void thirdClick(Click click) {
-    // ignore
+    @Override
+    public void thirdClick(final Click click) {
+        // ignore
     }
 
     @Override
-    public void keyTyped(KeyboardAction action) {
+    public void keyTyped(final KeyboardAction action) {
         if (action.getKeyCode() == ' ') {
             toggle();
         } else {
@@ -127,7 +129,7 @@ public class CheckboxField extends Abstr
     }
 
     @Override
-    public Size getRequiredSize(Size availableSpace) {
+    public Size getRequiredSize(final Size availableSpace) {
         return new Size(HPADDING + size + HPADDING, VPADDING + size + VPADDING);
     }
 

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/ClearValueOption.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/ClearValueOption.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/ClearValueOption.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/ClearValueOption.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -27,7 +26,6 @@ import org.apache.isis.viewer.dnd.drawin
 import org.apache.isis.viewer.dnd.view.View;
 import org.apache.isis.viewer.dnd.view.Workspace;
 
-
 public class ClearValueOption extends AbstractValueOption {
 
     public ClearValueOption(final AbstractField field) {
@@ -46,7 +44,7 @@ public class ClearValueOption extends Ab
         if (consent.isVetoed()) {
             return consent;
         }
-        Consent canClear = field.canClear();
+        final Consent canClear = field.canClear();
         if (canClear.isVetoed()) {
             // TODO: move logic into Facets.
             return new Veto(String.format("Can't clear %s values", value.getSpecification().getShortIdentifier()));

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/ColorField.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/ColorField.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/ColorField.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/ColorField.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
 import org.apache.isis.core.commons.exceptions.NotYetImplementedException;
@@ -38,16 +37,16 @@ import org.apache.isis.viewer.dnd.view.c
 import org.apache.isis.viewer.dnd.view.lookup.OpenDropDownBorder;
 import org.apache.isis.viewer.dnd.view.lookup.OptionContent;
 
-
 public class ColorField extends TextParseableFieldAbstract {
     public static class Specification extends AbstractFieldSpecification {
 
         @Override
-        public boolean canDisplay(ViewRequirement requirement) {
+        public boolean canDisplay(final ViewRequirement requirement) {
             return requirement.isTextParseable() && requirement.isForValueType(ColorValueFacet.class);
         }
 
-        public View createView(final Content content, Axes axes, int sequence) {
+        @Override
+        public View createView(final Content content, final Axes axes, final int sequence) {
             final ColorField field = new ColorField(content, this);
             return new OpenDropDownBorder(field) {
                 @Override
@@ -56,10 +55,12 @@ public class ColorField extends TextPars
                 }
 
                 @Override
-                protected void setSelection(OptionContent selectedContent) {}
-                };
+                protected void setSelection(final OptionContent selectedContent) {
+                }
+            };
         }
 
+        @Override
         public String getName() {
             return "Color";
         }
@@ -70,7 +71,7 @@ public class ColorField extends TextPars
     public ColorField(final Content content, final ViewSpecification specification) {
         super(content, specification);
     }
-    
+
     @Override
     public void draw(final Canvas canvas) {
         Color color;
@@ -98,22 +99,15 @@ public class ColorField extends TextPars
         h -= 1;
         canvas.drawSolidRectangle(left, top, w, h, Toolkit.getColor(getColor()));
     }
-/*
-    @Override
-    public void firstClick(final Click click) {
-        if (((TextParseableContent) getContent()).isEditable().isAllowed()) {
-            final View overlay = new DisposeOverlay(new ColorFieldOverlay(this), new ValueDropDownAxis((TextParseableContent) getContent(), getView()));
-            final Location location = this.getAbsoluteLocation();
-            // Location location = click.getLocationWithinViewer();
-            // TODO offset by constant amount
-            // location.move(10, 10);
-            overlay.setLocation(location);
-            // overlay.setSize(overlay.getRequiredSize(new Size()));
-            // overlay.markDamaged();
-            getViewManager().setOverlayView(overlay);
-        }
-    }
-*/
+
+    /*
+     * @Override public void firstClick(final Click click) { if (((TextParseableContent)
+     * getContent()).isEditable().isAllowed()) { final View overlay = new DisposeOverlay(new ColorFieldOverlay(this),
+     * new ValueDropDownAxis((TextParseableContent) getContent(), getView())); final Location location =
+     * this.getAbsoluteLocation(); // Location location = click.getLocationWithinViewer(); // TODO offset by constant
+     * amount // location.move(10, 10); overlay.setLocation(location); // overlay.setSize(overlay.getRequiredSize(new
+     * Size())); // overlay.markDamaged(); getViewManager().setOverlayView(overlay); } }
+     */
     @Override
     public int getBaseline() {
         return VPADDING + Toolkit.getText(ColorsAndFonts.TEXT_NORMAL).getAscent();
@@ -126,7 +120,7 @@ public class ColorField extends TextPars
     }
 
     @Override
-    public Size getRequiredSize(Size availableSpace) {
+    public Size getRequiredSize(final Size availableSpace) {
         return new Size(45, 15);
     }
 

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/ColorFieldOverlay.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/ColorFieldOverlay.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/ColorFieldOverlay.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/ColorFieldOverlay.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
 import org.apache.isis.viewer.dnd.drawing.Canvas;
@@ -28,14 +27,13 @@ import org.apache.isis.viewer.dnd.view.C
 import org.apache.isis.viewer.dnd.view.Toolkit;
 import org.apache.isis.viewer.dnd.view.base.AbstractView;
 
-
 class ColorFieldOverlay extends AbstractView {
     private static final int colors[] = new int[] { 0xffffff, 0x0, 0x666666, 0xcccccc, // white, black, dark
-            // gray, light gray
-            0x000099, 0x0066cc, 0x0033ff, 0x99ccff, // blues
-            0x990000, 0xff0033, 0xcc0066, 0xff66ff, // reds
-            0x003300, 0x00ff33, 0x669933, 0xccff66 // greens
-    };
+        // gray, light gray
+        0x000099, 0x0066cc, 0x0033ff, 0x99ccff, // blues
+        0x990000, 0xff0033, 0xcc0066, 0xff66ff, // reds
+        0x003300, 0x00ff33, 0x669933, 0xccff66 // greens
+        };
     private static final int COLUMNS = 4;
     private static final int ROWS = 4;
     private static final int ROW_HEIGHT = 18;
@@ -50,20 +48,22 @@ class ColorFieldOverlay extends Abstract
     }
 
     @Override
-    public Size getRequiredSize(Size availableSpace) {
+    public Size getRequiredSize(final Size availableSpace) {
         return new Size(COLUMNS * COLUMN_WIDTH, ROWS * ROW_HEIGHT);
     }
 
     @Override
     public void draw(final Canvas canvas) {
-        canvas.drawSolidRectangle(0, 0, COLUMNS * COLUMN_WIDTH - 1, ROWS * ROW_HEIGHT - 1, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3));
+        canvas.drawSolidRectangle(0, 0, COLUMNS * COLUMN_WIDTH - 1, ROWS * ROW_HEIGHT - 1,
+            Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3));
         for (int i = 0; i < colors.length; i++) {
             final Color color = Toolkit.getColor(colors[i]);
             final int y = i / COLUMNS * ROW_HEIGHT;
             final int x = i % COLUMNS * COLUMN_WIDTH;
             canvas.drawSolidRectangle(x, y, COLUMN_WIDTH - 1, ROW_HEIGHT - 1, color);
         }
-        canvas.drawRectangle(0, 0, COLUMNS * COLUMN_WIDTH - 1, ROWS * ROW_HEIGHT - 1, Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY2));
+        canvas.drawRectangle(0, 0, COLUMNS * COLUMN_WIDTH - 1, ROWS * ROW_HEIGHT - 1,
+            Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY2));
     }
 
     @Override

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/CopyValueOption.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/CopyValueOption.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/CopyValueOption.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/CopyValueOption.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
 import org.apache.isis.core.metamodel.consent.Allow;
@@ -27,7 +26,6 @@ import org.apache.isis.viewer.dnd.drawin
 import org.apache.isis.viewer.dnd.view.View;
 import org.apache.isis.viewer.dnd.view.Workspace;
 
-
 public class CopyValueOption extends AbstractValueOption {
 
     public CopyValueOption(final AbstractField field) {
@@ -42,7 +40,7 @@ public class CopyValueOption extends Abs
         }
         // TODO: move logic into Facets
         return Allow.DEFAULT;
-        //return new Allow(String.format("Copy value '%s' to clipboard", field.getSelectedText()));
+        // return new Allow(String.format("Copy value '%s' to clipboard", field.getSelectedText()));
     }
 
     @Override

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/DateFieldSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/DateFieldSpecification.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/DateFieldSpecification.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/DateFieldSpecification.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
 import org.apache.isis.core.progmodel.facets.value.date.DateValueFacet;
@@ -31,18 +30,18 @@ import org.apache.isis.viewer.dnd.view.c
 import org.apache.isis.viewer.dnd.view.lookup.OpenDropDownBorder;
 import org.apache.isis.viewer.dnd.view.lookup.OptionContent;
 
-
 /**
  * Creates a single line text field with the base line drawn.
  */
 public class DateFieldSpecification extends AbstractFieldSpecification {
     @Override
-    public boolean canDisplay(ViewRequirement requirement) {
+    public boolean canDisplay(final ViewRequirement requirement) {
         return requirement.isTextParseable() && requirement.isForValueType(DateValueFacet.class);
     }
 
-    public View createView(final Content content, Axes axes, int sequence) {
-        SingleLineTextField textField = new SingleLineTextField((TextParseableContent) content, this, true);
+    @Override
+    public View createView(final Content content, final Axes axes, final int sequence) {
+        final SingleLineTextField textField = new SingleLineTextField((TextParseableContent) content, this, true);
         final View field = new TextFieldResizeBorder(textField);
         return new OpenDropDownBorder(field) {
             @Override
@@ -51,12 +50,13 @@ public class DateFieldSpecification exte
             }
 
             @Override
-            protected void setSelection(OptionContent selectedContent) {}
+            protected void setSelection(final OptionContent selectedContent) {
+            }
         };
     }
 
+    @Override
     public String getName() {
         return "Date Field";
     }
 }
-

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/DatePickerControl.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/DatePickerControl.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/DatePickerControl.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/DatePickerControl.java Tue May  3 07:18:19 2011
@@ -25,15 +25,14 @@ import org.apache.isis.viewer.dnd.view.l
 import org.apache.isis.viewer.dnd.view.look.linux.LinuxDatePicker;
 import org.apache.isis.viewer.dnd.view.look.linux.LinuxLook;
 
-
 public class DatePickerControl {
 
     private static final Look LINUX_LOOK = new LinuxLook();
 
-    public static View getPicker(Content content) {
-        Look look = LookFactory.getInstalledLook();
+    public static View getPicker(final Content content) {
+        final Look look = LookFactory.getInstalledLook();
         if (look.getClass().isInstance(LINUX_LOOK)) {
-        	return new LinuxDatePicker(content);
+            return new LinuxDatePicker(content);
         }
         return new SimpleDatePicker(content);
     }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/EmptyField.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/EmptyField.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/EmptyField.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/EmptyField.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -44,19 +43,20 @@ import org.apache.isis.viewer.dnd.view.f
 import org.apache.isis.viewer.dnd.view.lookup.OpenObjectDropDownBorder;
 import org.apache.isis.viewer.dnd.view.text.TitleText;
 
-
 public class EmptyField extends AbstractView {
 
     public static class Specification implements ViewSpecification {
-        public boolean canDisplay(ViewRequirement requirement) {
+        @Override
+        public boolean canDisplay(final ViewRequirement requirement) {
             return requirement.isObject() && requirement.isOpen() && !requirement.isTextParseable()
-                    && !requirement.hasReference();
+                && !requirement.hasReference();
         }
 
-        public View createView(final Content content, Axes axes, int sequence) {
+        @Override
+        public View createView(final Content content, final Axes axes, final int sequence) {
             final EmptyField emptyField = new EmptyField(content, this, Toolkit.getText(ColorsAndFonts.TEXT_NORMAL));
             if ((content instanceof OneToOneField && ((OneToOneField) content).isEditable().isAllowed())
-                    || content instanceof ObjectParameter) {
+                || content instanceof ObjectParameter) {
                 if (content.isOptionEnabled()) {
                     return new ObjectBorder(new OpenObjectDropDownBorder(emptyField, new IconSpecification()));
                 } else {
@@ -67,26 +67,32 @@ public class EmptyField extends Abstract
             }
         }
 
+        @Override
         public String getName() {
             return "empty field";
         }
 
+        @Override
         public boolean isAligned() {
             return false;
         }
 
+        @Override
         public boolean isOpen() {
             return false;
         }
 
+        @Override
         public boolean isReplaceable() {
             return true;
         }
-        
+
+        @Override
         public boolean isResizeable() {
             return false;
         }
 
+        @Override
         public boolean isSubView() {
             return true;
         }
@@ -126,7 +132,7 @@ public class EmptyField extends Abstract
     }
 
     @Override
-    public Size getRequiredSize(Size availableSpace) {
+    public Size getRequiredSize(final Size availableSpace) {
         final Size size = icon.getSize();
         size.extendWidth(View.HPADDING);
         size.extendWidth(text.getSize().getWidth());
@@ -149,7 +155,7 @@ public class EmptyField extends Abstract
             } else {
                 getState().setCantDrop();
             }
-            String actionText = canDrop.isVetoed() ? canDrop.getReason() : "Set to " + sourceContent.title();
+            final String actionText = canDrop.isVetoed() ? canDrop.getReason() : "Set to " + sourceContent.title();
             getFeedbackManager().setAction(actionText);
         } else {
             getState().setCantDrop();

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/EmptyFieldTitleText.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/EmptyFieldTitleText.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/EmptyFieldTitleText.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/EmptyFieldTitleText.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
 import org.apache.isis.viewer.dnd.drawing.ColorsAndFonts;
@@ -28,7 +27,6 @@ import org.apache.isis.viewer.dnd.view.T
 import org.apache.isis.viewer.dnd.view.View;
 import org.apache.isis.viewer.dnd.view.text.TitleText;
 
-
 class EmptyFieldTitleText extends TitleText {
     private final Content content;
 

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/FieldOfSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/FieldOfSpecification.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/FieldOfSpecification.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/FieldOfSpecification.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -40,37 +39,45 @@ import org.apache.isis.viewer.dnd.view.t
 
 public class FieldOfSpecification implements ViewSpecification {
 
-    public boolean canDisplay(ViewRequirement requirement) {
+    @Override
+    public boolean canDisplay(final ViewRequirement requirement) {
         return requirement.isOpen() && !requirement.isSubview() && requirement.getContent() instanceof FieldContent;
     }
 
+    @Override
     public String getName() {
         return "Field Of";
     }
 
+    @Override
     public boolean isAligned() {
         return false;
     }
 
+    @Override
     public boolean isOpen() {
         return false;
     }
 
+    @Override
     public boolean isReplaceable() {
         return false;
     }
 
+    @Override
     public boolean isResizeable() {
         return false;
     }
 
+    @Override
     public boolean isSubView() {
         return false;
     }
 
-    public View createView(Content content, Axes axes, int sequence) {
+    @Override
+    public View createView(final Content content, final Axes axes, final int sequence) {
         final FieldContent fieldContent = (FieldContent) content;
-        ObjectAdapter parent = fieldContent.getParent();
+        final ObjectAdapter parent = fieldContent.getParent();
         final Content parentContent = Toolkit.getContentFactory().createRootContent(parent);
         View view = new InternalFieldView(parentContent, fieldContent, axes, this);
         view = addBorder(parentContent, fieldContent, view);
@@ -78,9 +85,9 @@ public class FieldOfSpecification implem
     }
 
     private View addBorder(final Content parentContent, final FieldContent fieldContent, View view) {
-        Text textStyle = Toolkit.getText(ColorsAndFonts.TEXT_TITLE);
-        Color colorStyle = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
-        TitleText titleText = new TitleText(view, textStyle, colorStyle) {
+        final Text textStyle = Toolkit.getText(ColorsAndFonts.TEXT_TITLE);
+        final Color colorStyle = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
+        final TitleText titleText = new TitleText(view, textStyle, colorStyle) {
             @Override
             protected String title() {
                 return parentContent.title() + "/" + fieldContent.getFieldName();
@@ -93,34 +100,34 @@ public class FieldOfSpecification implem
 }
 
 class InternalFieldView extends CompositeView {
-  //  final View[] subviews = new View[1];
-    
+    // final View[] subviews = new View[1];
+
     private final Content fieldContent;
 
-    public InternalFieldView(Content content, Content fieldContent, Axes axes, ViewSpecification specification) {
+    public InternalFieldView(final Content content, final Content fieldContent, final Axes axes,
+        final ViewSpecification specification) {
         super(content, specification);
         this.fieldContent = fieldContent;
     }
-    
-  /*  
-    public void draw(Canvas canvas) {
-        subviews[0].draw(canvas);
-    }
-    
-    public View[] getSubviews() {
-        return subviews;
-    }
-    */
-    public Size requiredSize(Size availableSpace) {
+
+    /*
+     * public void draw(Canvas canvas) { subviews[0].draw(canvas); }
+     * 
+     * public View[] getSubviews() { return subviews; }
+     */
+    @Override
+    public Size requiredSize(final Size availableSpace) {
         return getSubviews()[0].getRequiredSize(availableSpace);
     }
-    
-    protected void doLayout(Size maximumSize) {
-        View view = getSubviews()[0];
+
+    @Override
+    protected void doLayout(final Size maximumSize) {
+        final View view = getSubviews()[0];
         view.setSize(view.getRequiredSize(maximumSize));
         view.layout();
     }
 
+    @Override
     protected void buildView() {
         ViewSpecification internalSpecification;
         if (fieldContent.isCollection()) {
@@ -131,5 +138,3 @@ class InternalFieldView extends Composit
         addView(internalSpecification.createView(fieldContent, new Axes(), 0));
     }
 }
-
-

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/ImageField.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/ImageField.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/ImageField.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/ImageField.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
 import java.awt.Image;
@@ -29,7 +28,6 @@ import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
 import java.io.File;
 
-import org.apache.log4j.Logger;
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.progmodel.facets.value.image.ImageValueFacet;
@@ -52,19 +50,21 @@ import org.apache.isis.viewer.dnd.view.b
 import org.apache.isis.viewer.dnd.view.content.FieldContent;
 import org.apache.isis.viewer.dnd.view.field.OneToOneField;
 import org.apache.isis.viewer.dnd.view.option.UserActionAbstract;
-
+import org.apache.log4j.Logger;
 
 public class ImageField extends AbstractField {
     public static class Specification extends AbstractFieldSpecification {
         @Override
-        public boolean canDisplay(ViewRequirement requirement) {
+        public boolean canDisplay(final ViewRequirement requirement) {
             return requirement.isForValueType(ImageValueFacet.class);
         }
 
-        public View createView(final Content content, Axes axes, int sequence) {
+        @Override
+        public View createView(final Content content, final Axes axes, final int sequence) {
             return new ImageField(content, this);
         }
 
+        @Override
         public String getName() {
             return "Image";
         }
@@ -97,7 +97,8 @@ public class ImageField extends Abstract
         });
     }
 
-    private void copy() {}
+    private void copy() {
+    }
 
     @Override
     public void draw(final Canvas canvas) {
@@ -173,18 +174,18 @@ public class ImageField extends Abstract
         final boolean ctrl = (modifiers & InputEvent.CTRL_MASK) > 0;
 
         switch (keyCode) {
-        case KeyEvent.VK_V:
-            if (ctrl) {
-                key.consume();
-                pasteFromClipboard();
-            }
-            break;
-        case KeyEvent.VK_C:
-            if (ctrl) {
-                key.consume();
-                copy();
-            }
-            break;
+            case KeyEvent.VK_V:
+                if (ctrl) {
+                    key.consume();
+                    pasteFromClipboard();
+                }
+                break;
+            case KeyEvent.VK_C:
+                if (ctrl) {
+                    key.consume();
+                    copy();
+                }
+                break;
         }
     }
 
@@ -196,24 +197,19 @@ public class ImageField extends Abstract
             throw new IsisException(e);
         }
 
-      //  final ObjectAdapter value = getContent().getAdapter();
-        ImageValueFacet facet = ((FieldContent) getContent()).getSpecification().getFacet(ImageValueFacet.class);
-        ObjectAdapter object = facet.createValue(image);
+        // final ObjectAdapter value = getContent().getAdapter();
+        final ImageValueFacet facet = ((FieldContent) getContent()).getSpecification().getFacet(ImageValueFacet.class);
+        final ObjectAdapter object = facet.createValue(image);
         ((OneToOneField) getContent()).setObject(object);
-        //((TextParseableField) getContent()).entryComplete();
+        // ((TextParseableField) getContent()).entryComplete();
         invalidateLayout();
     }
-/*
-    private void loadImageFromURL(final String filename) {
-        try {
-            final URL url = new URL("file://" + filename);
-            final Image image = java.awt.Toolkit.getDefaultToolkit().getImage(url);
-            loadImage(image);
-        } catch (final MalformedURLException e) {
-            throw new IsisException("Failed to load image from " + filename);
-        }
-    }
-*/
+
+    /*
+     * private void loadImageFromURL(final String filename) { try { final URL url = new URL("file://" + filename); final
+     * Image image = java.awt.Toolkit.getDefaultToolkit().getImage(url); loadImage(image); } catch (final
+     * MalformedURLException e) { throw new IsisException("Failed to load image from " + filename); } }
+     */
     private void loadImageFromFile(final String filename) {
         final Image image = java.awt.Toolkit.getDefaultToolkit().getImage(filename);
         loadImage(image);
@@ -241,8 +237,7 @@ public class ImageField extends Abstract
                  * transferDataFlavors.length; i++) { LOG.debug("data transfer as " +
                  * transferDataFlavors[i].getMimeType()); }
                  * 
-                 * Image image = (Image) content.getTransferData(DataFlavor.imageFlavor); LOG.debug("pasted " +
-                 * image);
+                 * Image image = (Image) content.getTransferData(DataFlavor.imageFlavor); LOG.debug("pasted " + image);
                  */
 
             }
@@ -254,5 +249,6 @@ public class ImageField extends Abstract
     }
 
     @Override
-    protected void save() {}
+    protected void save() {
+    }
 }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/PasswordField.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/PasswordField.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/PasswordField.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/PasswordField.java Tue May  3 07:18:19 2011
@@ -17,9 +17,8 @@
  *  under the License.
  */
 
+package org.apache.isis.viewer.dnd.field;
 
-package org.apache.isis.viewer.dnd.field;
-
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.runtimes.dflt.runtime.system.context.IsisContext;
 import org.apache.isis.viewer.dnd.drawing.Canvas;
@@ -34,138 +33,155 @@ import org.apache.isis.viewer.dnd.view.U
 import org.apache.isis.viewer.dnd.view.ViewSpecification;
 import org.apache.isis.viewer.dnd.view.content.TextParseableContent;
 import org.apache.isis.viewer.dnd.view.text.TextContent;
-
-
-public class PasswordField extends TextField {
-    protected static final Text style = Toolkit.getText(ColorsAndFonts.TEXT_NORMAL);
-    private int maxTextWidth;
-    private char echoCharacter;
-
-    public PasswordField(final Content content, final ViewSpecification design) {
-        super((TextParseableContent) content, design, true, TextContent.NO_WRAPPING);
-        setMaxTextWidth(TEXT_WIDTH);
-        final String echoCharacterSetting = IsisContext.getConfiguration().getString(Properties.PROPERTY_BASE + "echo");
-        if (echoCharacterSetting == null || echoCharacterSetting.equals(" ")) {
-            echoCharacter = '*';
-        } else {
-            echoCharacter = echoCharacterSetting.charAt(0);
-        }
-    }
-
-    @Override
-    public void contentMenuOptions(final UserActionSet options) {
-        options.add(new ClearValueOption(this));
-        options.setColor(Toolkit.getColor(ColorsAndFonts.COLOR_MENU_VALUE));
-    }
-
-    protected boolean provideClearCopyPaste() {
-        return false;
-    }
-
-    /**
-     * Only allow deletion of last character, ie don;t allow editing of the internals of the password.
-     */
-    public void delete() {
-        textContent.deleteLeft(cursor);
-        cursor.left();
-        selection.resetTo(cursor);
-        changeMade();
-    }
-
-    /**
-     * disable left key.
-     */
-    protected void left(boolean alt, boolean shift) {}
-
-    /**
-     * disable right key.
-     */
-    protected void right(boolean alt, boolean shift) {}
-
-    /**
-     * disable home key.
-     */
-    protected void home(boolean alt, boolean shift) {}
-
-    /**
-     * disable end key.
-     */
-    protected void end(boolean alt, boolean shift) {}
-
-    /**
-     * disable page down key.
-     */
-    protected void pageDown(boolean shift, boolean ctrl) {}
-
-    /**
-     * disable page up key.
-     */
-    protected void pageUp(boolean shift, boolean ctrl) {}
-
-    private String echoPassword(String password) {
-        final int length = password.length();
-        String echoedPassword = "";
-        for (int i = 0; i < length; i++) {
-            echoedPassword += echoCharacter;
-        }
-        return echoedPassword;
-    }
-
-    @Override
-    public Size getRequiredSize(Size availableSpace) {
-        final int width = HPADDING + maxTextWidth + HPADDING;
-        int height = style.getTextHeight() + VPADDING;
-        height = Math.max(height, Toolkit.defaultFieldHeight());
-
-        return new Size(width, height);
-    }
-
-    /**
-     * Set the maximum width of the field, as a number of characters
-     */
-    private void setMaxTextWidth(final int noCharacters) {
-        maxTextWidth = style.charWidth('o') * noCharacters;
-    }
-
-    protected void align() {}
-
-    protected void drawHighlight(Canvas canvas, int maxWidth) {}
-
-    @Override
-    protected void drawLines(final Canvas canvas, final Color color, final int width) {
-        final int baseline = getBaseline();
-        canvas.drawLine(HPADDING, baseline, HPADDING + width, baseline, color);
-    }
-
-    @Override
-    protected void drawText(final Canvas canvas, final Color textColor, final int width) {
-
-        final String[] lines = textContent.getDisplayLines();
-        if (lines.length > 1) {
-            throw new IsisException("Password field should contain a string that contains no line breaks; contains "
-                    + lines.length);
-        }
-
-        final String chars = lines[0];
-        if (chars == null) {
-            throw new IsisException();
-        }
-        if (chars.endsWith("\n")) {
-            throw new IsisException();
-        }
-
-        final int baseline = getBaseline();
-        String echoPassword = echoPassword(chars);
-
-        // draw cursor
-        if (hasFocus() && canChangeValue().isAllowed()) {
-            final int pos = style.stringWidth(echoPassword) - HPADDING;
-            Color color = Toolkit.getColor(ColorsAndFonts.COLOR_TEXT_CURSOR);
-            canvas.drawLine(pos, (baseline + style.getDescent()), pos, baseline - style.getAscent(), color);
-        }
-
-        // draw text
-        canvas.drawText(echoPassword, HPADDING, baseline, textColor, style);
-    }
-
-}
+
+public class PasswordField extends TextField {
+    protected static final Text style = Toolkit.getText(ColorsAndFonts.TEXT_NORMAL);
+    private int maxTextWidth;
+    private char echoCharacter;
+
+    public PasswordField(final Content content, final ViewSpecification design) {
+        super((TextParseableContent) content, design, true, TextContent.NO_WRAPPING);
+        setMaxTextWidth(TEXT_WIDTH);
+        final String echoCharacterSetting = IsisContext.getConfiguration().getString(Properties.PROPERTY_BASE + "echo");
+        if (echoCharacterSetting == null || echoCharacterSetting.equals(" ")) {
+            echoCharacter = '*';
+        } else {
+            echoCharacter = echoCharacterSetting.charAt(0);
+        }
+    }
+
+    @Override
+    public void contentMenuOptions(final UserActionSet options) {
+        options.add(new ClearValueOption(this));
+        options.setColor(Toolkit.getColor(ColorsAndFonts.COLOR_MENU_VALUE));
+    }
+
+    @Override
+    protected boolean provideClearCopyPaste() {
+        return false;
+    }
+
+    /**
+     * Only allow deletion of last character, ie don;t allow editing of the internals of the password.
+     */
+    @Override
+    public void delete() {
+        textContent.deleteLeft(cursor);
+        cursor.left();
+        selection.resetTo(cursor);
+        changeMade();
+    }
+
+    /**
+     * disable left key.
+     */
+    @Override
+    protected void left(final boolean alt, final boolean shift) {
+    }
+
+    /**
+     * disable right key.
+     */
+    @Override
+    protected void right(final boolean alt, final boolean shift) {
+    }
+
+    /**
+     * disable home key.
+     */
+    @Override
+    protected void home(final boolean alt, final boolean shift) {
+    }
+
+    /**
+     * disable end key.
+     */
+    @Override
+    protected void end(final boolean alt, final boolean shift) {
+    }
+
+    /**
+     * disable page down key.
+     */
+    @Override
+    protected void pageDown(final boolean shift, final boolean ctrl) {
+    }
+
+    /**
+     * disable page up key.
+     */
+    @Override
+    protected void pageUp(final boolean shift, final boolean ctrl) {
+    }
+
+    private String echoPassword(final String password) {
+        final int length = password.length();
+        String echoedPassword = "";
+        for (int i = 0; i < length; i++) {
+            echoedPassword += echoCharacter;
+        }
+        return echoedPassword;
+    }
+
+    @Override
+    public Size getRequiredSize(final Size availableSpace) {
+        final int width = HPADDING + maxTextWidth + HPADDING;
+        int height = style.getTextHeight() + VPADDING;
+        height = Math.max(height, Toolkit.defaultFieldHeight());
+
+        return new Size(width, height);
+    }
+
+    /**
+     * Set the maximum width of the field, as a number of characters
+     */
+    private void setMaxTextWidth(final int noCharacters) {
+        maxTextWidth = style.charWidth('o') * noCharacters;
+    }
+
+    @Override
+    protected void align() {
+    }
+
+    @Override
+    protected void drawHighlight(final Canvas canvas, final int maxWidth) {
+    }
+
+    @Override
+    protected void drawLines(final Canvas canvas, final Color color, final int width) {
+        final int baseline = getBaseline();
+        canvas.drawLine(HPADDING, baseline, HPADDING + width, baseline, color);
+    }
+
+    @Override
+    protected void drawText(final Canvas canvas, final Color textColor, final int width) {
+
+        final String[] lines = textContent.getDisplayLines();
+        if (lines.length > 1) {
+            throw new IsisException("Password field should contain a string that contains no line breaks; contains "
+                + lines.length);
+        }
+
+        final String chars = lines[0];
+        if (chars == null) {
+            throw new IsisException();
+        }
+        if (chars.endsWith("\n")) {
+            throw new IsisException();
+        }
+
+        final int baseline = getBaseline();
+        final String echoPassword = echoPassword(chars);
+
+        // draw cursor
+        if (hasFocus() && canChangeValue().isAllowed()) {
+            final int pos = style.stringWidth(echoPassword) - HPADDING;
+            final Color color = Toolkit.getColor(ColorsAndFonts.COLOR_TEXT_CURSOR);
+            canvas.drawLine(pos, (baseline + style.getDescent()), pos, baseline - style.getAscent(), color);
+        }
+
+        // draw text
+        canvas.drawText(echoPassword, HPADDING, baseline, textColor, style);
+    }
+
+}

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/PasswordFieldSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/PasswordFieldSpecification.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/PasswordFieldSpecification.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/PasswordFieldSpecification.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
 import org.apache.isis.core.progmodel.facets.value.password.PasswordValueFacet;
@@ -27,17 +26,18 @@ import org.apache.isis.viewer.dnd.view.V
 import org.apache.isis.viewer.dnd.view.ViewRequirement;
 import org.apache.isis.viewer.dnd.view.base.AbstractFieldSpecification;
 
-
 public class PasswordFieldSpecification extends AbstractFieldSpecification {
     @Override
-    public boolean canDisplay(ViewRequirement requirement) {
+    public boolean canDisplay(final ViewRequirement requirement) {
         return requirement.isTextParseable() && requirement.isForValueType(PasswordValueFacet.class);
     }
 
-    public View createView(final Content content, Axes axes, int sequence) {
+    @Override
+    public View createView(final Content content, final Axes axes, final int sequence) {
         return new PasswordField(content, this);
     }
 
+    @Override
     public String getName() {
         return "Password Field";
     }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/PasteValueOption.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/PasteValueOption.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/PasteValueOption.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/PasteValueOption.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
 import org.apache.isis.core.metamodel.consent.Consent;
@@ -25,7 +24,6 @@ import org.apache.isis.viewer.dnd.drawin
 import org.apache.isis.viewer.dnd.view.View;
 import org.apache.isis.viewer.dnd.view.Workspace;
 
-
 public class PasteValueOption extends AbstractValueOption {
 
     public PasteValueOption(final AbstractField field) {
@@ -38,7 +36,8 @@ public class PasteValueOption extends Ab
         if (changable.isVetoed()) {
             return changable;
         } else {
-            return changable.setDescription(String.format("Replace field content with '%s' from clipboard", getClipboard(view)));
+            return changable.setDescription(String.format("Replace field content with '%s' from clipboard",
+                getClipboard(view)));
         }
     }
 

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/RevertFieldOption.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/RevertFieldOption.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/RevertFieldOption.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/RevertFieldOption.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
 import org.apache.isis.core.metamodel.consent.Consent;
@@ -27,7 +26,6 @@ import org.apache.isis.viewer.dnd.view.V
 import org.apache.isis.viewer.dnd.view.Workspace;
 import org.apache.isis.viewer.dnd.view.option.UserActionAbstract;
 
-
 public class RevertFieldOption extends UserActionAbstract {
     private final TextField field;
 
@@ -52,4 +50,3 @@ public class RevertFieldOption extends U
     }
 
 }
-



Mime
View raw message