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 [11/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/field/SimpleDatePicker.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/SimpleDatePicker.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/SimpleDatePicker.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/SimpleDatePicker.java Tue May  3 07:18:19 2011
@@ -41,20 +41,19 @@ import org.apache.isis.viewer.dnd.view.b
 import org.apache.isis.viewer.dnd.view.content.FieldContent;
 import org.apache.isis.viewer.dnd.view.content.TextParseableContent;
 
-
 public class SimpleDatePicker extends AbstractView implements DatePicker {
     private static class Button {
-        private char key;
-        private int period;
-        private int increment;
+        private final char key;
+        private final int period;
+        private final int increment;
 
-        public Button(char key, int period, int increment) {
+        public Button(final char key, final int period, final int increment) {
             this.key = key;
             this.period = period;
             this.increment = increment;
         }
 
-        public void adjustDate(Calendar date) {
+        public void adjustDate(final Calendar date) {
             date.add(period, increment);
         }
 
@@ -62,35 +61,27 @@ public class SimpleDatePicker extends Ab
             return "" + key;
         }
     }
-       
-    private static final Button[] buttons = new Button[] {
-        new Button('W', Calendar.WEEK_OF_YEAR, 1 ),
-        new Button('F', Calendar.WEEK_OF_YEAR, 2),
-        new Button('M', Calendar.MONTH, 1),
-        new Button('Q', Calendar.MONTH, 3),
-        new Button('Y', Calendar.YEAR, 1),
-        new Button('D', Calendar.YEAR, 10),
-
-        new Button('w', Calendar.WEEK_OF_YEAR, -1),
-        new Button('f', Calendar.WEEK_OF_YEAR, -2),
-        new Button('m', Calendar.MONTH, -1),
-        new Button('q', Calendar.MONTH, -3),
-        new Button('y', Calendar.YEAR, -1),
-        new Button('d', Calendar.YEAR, -10)
-    };
+
+    private static final Button[] buttons = new Button[] { new Button('W', Calendar.WEEK_OF_YEAR, 1),
+        new Button('F', Calendar.WEEK_OF_YEAR, 2), new Button('M', Calendar.MONTH, 1),
+        new Button('Q', Calendar.MONTH, 3), new Button('Y', Calendar.YEAR, 1), new Button('D', Calendar.YEAR, 10),
+
+        new Button('w', Calendar.WEEK_OF_YEAR, -1), new Button('f', Calendar.WEEK_OF_YEAR, -2),
+        new Button('m', Calendar.MONTH, -1), new Button('q', Calendar.MONTH, -3), new Button('y', Calendar.YEAR, -1),
+        new Button('d', Calendar.YEAR, -10) };
     private static final int ROWS = 7;
     private static final int COLUMNS = 7;
     private static final int PADDING = 5;
     private final Calendar date;
-    private Text style = Toolkit.getText(ColorsAndFonts.TEXT_NORMAL);
-    private int labelWidth = style.stringWidth("XXX 0000") * 4 / 3;
-    private int cellWidth = style.stringWidth("00") * 8 / 5;
-    private int cellHeight = style.getLineHeight() * 4 / 3;
-    private int headerHeight = style.getLineHeight() + PADDING * 2;
-    private int firstRowBaseline = headerHeight + style.getLineHeight();
-    private int calendarHeight = cellHeight * ROWS;
-    private int controlWidth = style.charWidth('W') + 4;
-    private int controlHeight = style.getLineHeight() * 11 / 10 + controlWidth + 4 + PADDING * 2;
+    private final Text style = Toolkit.getText(ColorsAndFonts.TEXT_NORMAL);
+    private final int labelWidth = style.stringWidth("XXX 0000") * 4 / 3;
+    private final int cellWidth = style.stringWidth("00") * 8 / 5;
+    private final int cellHeight = style.getLineHeight() * 4 / 3;
+    private final int headerHeight = style.getLineHeight() + PADDING * 2;
+    private final int firstRowBaseline = headerHeight + style.getLineHeight();
+    private final int calendarHeight = cellHeight * ROWS;
+    private final int controlWidth = style.charWidth('W') + 4;
+    private final int controlHeight = style.getLineHeight() * 11 / 10 + controlWidth + 4 + PADDING * 2;
     private int mouseOverButton = -1;
     private int mouseOverRow = -1;
     private int mouseOverColumn;
@@ -98,23 +89,22 @@ public class SimpleDatePicker extends Ab
     private final Calendar today;
     private final DateFormat monthFormat = new SimpleDateFormat("MMM");
     private final DateFormat dayFormat = new SimpleDateFormat("EEE");
-    private boolean isEditable;
+    private final boolean isEditable;
 
-
-    public SimpleDatePicker(Content content) {
+    public SimpleDatePicker(final Content content) {
         super(content);
 
         isEditable = content instanceof FieldContent && ((FieldContent) content).isEditable().isAllowed();
-        
+
         today = Calendar.getInstance();
         clearTime(today);
 
         date = Calendar.getInstance();
-        ObjectAdapter dateAdapter = ((TextParseableContent) getContent()).getAdapter();
+        final ObjectAdapter dateAdapter = ((TextParseableContent) getContent()).getAdapter();
         if (dateAdapter != null) {
-            DateValueFacet facet = dateAdapter.getSpecification().getFacet(DateValueFacet.class);
+            final DateValueFacet facet = dateAdapter.getSpecification().getFacet(DateValueFacet.class);
             currentDate = Calendar.getInstance();
-            Date dateValue = facet.dateValue(dateAdapter);
+            final Date dateValue = facet.dateValue(dateAdapter);
             currentDate.setTime(dateValue);
             clearTime(currentDate);
             date.setTime(dateValue);
@@ -128,7 +118,7 @@ public class SimpleDatePicker extends Ab
         date.add(Calendar.DAY_OF_MONTH, date.getFirstDayOfWeek() - date.get(Calendar.DAY_OF_WEEK));
     }
 
-    private void clearTime(Calendar date) {
+    private void clearTime(final Calendar date) {
         date.clear(Calendar.AM_PM);
         date.clear(Calendar.HOUR);
         date.clear(Calendar.HOUR_OF_DAY);
@@ -137,24 +127,28 @@ public class SimpleDatePicker extends Ab
         date.clear(Calendar.MILLISECOND);
     }
 
-    /* (non-Javadoc)
-	 * @see org.nakedobjects.plugins.dnd.field.DatePicker#getRequiredSize(org.nakedobjects.plugins.dnd.drawing.Size)
-	 */
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.nakedobjects.plugins.dnd.field.DatePicker#getRequiredSize(org.nakedobjects.plugins.dnd.drawing.Size)
+     */
     @Override
-    public Size getRequiredSize(Size availableSpace) {
+    public Size getRequiredSize(final Size availableSpace) {
         return new Size(labelWidth + COLUMNS * cellWidth + 2, headerHeight + calendarHeight + controlHeight + 2);
     }
 
-    /* (non-Javadoc)
-	 * @see org.nakedobjects.plugins.dnd.field.DatePicker#draw(org.nakedobjects.plugins.dnd.drawing.Canvas)
-	 */
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.nakedobjects.plugins.dnd.field.DatePicker#draw(org.nakedobjects.plugins.dnd.drawing.Canvas)
+     */
     @Override
     public void draw(final Canvas canvas) {
-        int width = getSize().getWidth();
-        int height = getSize().getHeight();
+        final int width = getSize().getWidth();
+        final int height = getSize().getHeight();
 
-        Color secondaryTextColor = Toolkit.getColor(ColorsAndFonts.COLOR_WHITE);
-        Color mainTextColor = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
+        final Color secondaryTextColor = Toolkit.getColor(ColorsAndFonts.COLOR_WHITE);
+        final Color mainTextColor = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
 
         drawBackground(canvas, width, height);
         drawDaysOfWeek(canvas, secondaryTextColor);
@@ -166,21 +160,21 @@ public class SimpleDatePicker extends Ab
         drawControls(canvas, width);
     }
 
-    private void drawBackground(final Canvas canvas, int width, int height) {
+    private void drawBackground(final Canvas canvas, final int width, final int height) {
         canvas.drawSolidRectangle(0, 0, width - 1, headerHeight, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1));
         canvas.drawSolidRectangle(0, 0, labelWidth, height - 1, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1));
-        canvas.drawSolidRectangle(labelWidth, headerHeight, width - labelWidth - 1, height - cellHeight - 1, Toolkit
-                .getColor(ColorsAndFonts.COLOR_WINDOW));
+        canvas.drawSolidRectangle(labelWidth, headerHeight, width - labelWidth - 1, height - cellHeight - 1,
+            Toolkit.getColor(ColorsAndFonts.COLOR_WINDOW));
         canvas.drawRectangle(0, 0, width - 1, height - 1, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1));
     }
 
     private void drawDaysOfWeek(final Canvas canvas, final Color textColor) {
-        Calendar d = Calendar.getInstance();
+        final Calendar d = Calendar.getInstance();
         d.setTime(date.getTime());
         int x = labelWidth + cellWidth / 2;
-        int y = PADDING + style.getAscent();
+        final int y = PADDING + style.getAscent();
         for (int column = 0; column < 7; column++) {
-            String day = dayFormat.format(d.getTime()).substring(0,1);
+            final String day = dayFormat.format(d.getTime()).substring(0, 1);
             canvas.drawText(day, x - style.stringWidth(day) / 2, y, textColor, style);
             x += cellWidth;
             d.add(Calendar.DAY_OF_MONTH, 1);
@@ -189,24 +183,24 @@ public class SimpleDatePicker extends Ab
 
     private void drawDayMarker(final Canvas canvas) {
         if (mouseOverColumn >= 0 && mouseOverColumn < COLUMNS && mouseOverRow >= 0 && mouseOverRow < ROWS) {
-            canvas.drawRectangle(labelWidth + mouseOverColumn * cellWidth, headerHeight + mouseOverRow * cellHeight, cellWidth,
-                    cellHeight, Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY3));
+            canvas.drawRectangle(labelWidth + mouseOverColumn * cellWidth, headerHeight + mouseOverRow * cellHeight,
+                cellWidth, cellHeight, Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY3));
         }
     }
 
-    private int drawMonthsAndWeeks(final Canvas canvas, Color color) {
-        Calendar d = Calendar.getInstance();
+    private int drawMonthsAndWeeks(final Canvas canvas, final Color color) {
+        final Calendar d = Calendar.getInstance();
         d.setTime(date.getTime());
         int y = firstRowBaseline;
         String lastMonth = "";
         for (int row = 0; row < ROWS; row++) {
-            int x = labelWidth;
-            String month = monthFormat.format(d.getTime()) + " " + d.get(Calendar.YEAR);
+            final int x = labelWidth;
+            final String month = monthFormat.format(d.getTime()) + " " + d.get(Calendar.YEAR);
             if (!month.equals(lastMonth)) {
                 canvas.drawText(month, x - style.stringWidth(month) - PADDING, y, color, style);
                 lastMonth = month;
             } else {
-                String week = "wk " + (d.get(Calendar.WEEK_OF_YEAR));
+                final String week = "wk " + (d.get(Calendar.WEEK_OF_YEAR));
                 canvas.drawText(week == null ? "*" : week, x - style.stringWidth(week) - PADDING, y, color, style);
             }
             d.add(Calendar.DAY_OF_MONTH, 7);
@@ -215,21 +209,21 @@ public class SimpleDatePicker extends Ab
         return y;
     }
 
-    private int drawDays(final Canvas canvas, Color mainTextColor) {
-        Calendar d = Calendar.getInstance();
+    private int drawDays(final Canvas canvas, final Color mainTextColor) {
+        final Calendar d = Calendar.getInstance();
         d.setTime(date.getTime());
         int y = firstRowBaseline;
         for (int row = 0; row < ROWS; row++) {
             int x = labelWidth;
             for (int column = 0; column < COLUMNS; column++) {
-                String day = "" + d.get(Calendar.DAY_OF_MONTH);
+                final String day = "" + d.get(Calendar.DAY_OF_MONTH);
                 if (currentDate != null && currentDate.equals(d)) {
-                    canvas.drawSolidRectangle(x, headerHeight + row * cellHeight, cellWidth, cellHeight, Toolkit
-                            .getColor(ColorsAndFonts.COLOR_PRIMARY2));
+                    canvas.drawSolidRectangle(x, headerHeight + row * cellHeight, cellWidth, cellHeight,
+                        Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY2));
                 }
                 if (today.getTime().equals(d.getTime())) {
-                    canvas.drawRectangle(x, headerHeight + row * cellHeight, cellWidth, cellHeight, Toolkit
-                            .getColor(ColorsAndFonts.COLOR_SECONDARY2));
+                    canvas.drawRectangle(x, headerHeight + row * cellHeight, cellWidth, cellHeight,
+                        Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2));
                 }
                 canvas.drawText(day, x - PADDING / 2 + cellWidth - style.stringWidth(day), y, mainTextColor, style);
                 x += cellWidth;
@@ -240,13 +234,13 @@ public class SimpleDatePicker extends Ab
         return y;
     }
 
-    private void drawControls(final Canvas canvas, int width) {
+    private void drawControls(final Canvas canvas, final int width) {
         int x = labelWidth + PADDING;
-        int y = headerHeight + calendarHeight + PADDING;
-        
-        int spaceTaken = width - labelWidth - 2 * PADDING - 6 * controlWidth;
-        int spaceBetween = spaceTaken / 5;
-        int adjustment = spaceTaken - 5 * spaceBetween - 2;
+        final int y = headerHeight + calendarHeight + PADDING;
+
+        final int spaceTaken = width - labelWidth - 2 * PADDING - 6 * controlWidth;
+        final int spaceBetween = spaceTaken / 5;
+        final int adjustment = spaceTaken - 5 * spaceBetween - 2;
 
         for (int i = 0; i < buttons.length / 2; i++) {
             drawControl(canvas, x, y, controlWidth, controlHeight - PADDING * 2, buttons[i].getLabel(), i);
@@ -254,21 +248,15 @@ public class SimpleDatePicker extends Ab
         }
     }
 
-    private void drawControl(
-            final Canvas canvas,
-            final int x,
-            final int y,
-            final int width,
-            final int height,
-            final String label,
-            int over) {
+    private void drawControl(final Canvas canvas, final int x, final int y, final int width, final int height,
+        final String label, final int over) {
         if (Toolkit.debug) {
             canvas.drawRectangle(x - 2, y, width + 4, height, Toolkit.getColor(ColorsAndFonts.COLOR_DEBUG_BOUNDS_VIEW));
         }
-        Color color = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2);
+        final Color color = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2);
 
-        int arrowHeight = width / 2;
-        Shape upArrow = new Shape(0, arrowHeight);
+        final int arrowHeight = width / 2;
+        final Shape upArrow = new Shape(0, arrowHeight);
         upArrow.addVector(arrowHeight, -arrowHeight);
         upArrow.addVector(arrowHeight, arrowHeight);
         if (mouseOverButton == over + 6) {
@@ -277,28 +265,31 @@ public class SimpleDatePicker extends Ab
             canvas.drawShape(upArrow, x, y + 2, color);
         }
 
-        Shape downArrow = new Shape(0, 0);
+        final Shape downArrow = new Shape(0, 0);
         downArrow.addVector(arrowHeight, arrowHeight);
         downArrow.addVector(arrowHeight, -arrowHeight);
         if (mouseOverButton == over) {
             canvas.drawSolidShape(downArrow, x, y + height - 4 - arrowHeight, color);
         } else {
-            canvas.drawShape(downArrow, x, y + height - 4 - arrowHeight, color);            
+            canvas.drawShape(downArrow, x, y + height - 4 - arrowHeight, color);
         }
-        int charWidth = style.stringWidth(label);
+        final int charWidth = style.stringWidth(label);
         canvas.drawText(label, x + width / 2 - charWidth / 2, y + 2 + arrowHeight + style.getAscent(), color, style);
 
     }
 
-    /* (non-Javadoc)
-	 * @see org.nakedobjects.plugins.dnd.field.DatePicker#mouseMoved(org.nakedobjects.plugins.dnd.drawing.Location)
-	 */
-    public void mouseMoved(Location location) {
-        int over = overButton(location);
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.nakedobjects.plugins.dnd.field.DatePicker#mouseMoved(org.nakedobjects.plugins.dnd.drawing.Location)
+     */
+    @Override
+    public void mouseMoved(final Location location) {
+        final int over = overButton(location);
         if (over == -1) {
             mouseOverButton = -1;
-            int col = column(location);
-            int row = row(location);
+            final int col = column(location);
+            final int row = row(location);
             if (col != mouseOverColumn || row != mouseOverRow) {
                 if (isEditable) {
                     mouseOverColumn = col;
@@ -311,34 +302,39 @@ public class SimpleDatePicker extends Ab
             markDamaged();
         }
     }
-    
-    /* (non-Javadoc)
-	 * @see org.nakedobjects.plugins.dnd.field.DatePicker#exited()
-	 */
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.nakedobjects.plugins.dnd.field.DatePicker#exited()
+     */
+    @Override
     public void exited() {
         mouseOverButton = -1;
         super.exited();
     }
 
-    private int overButton(Location location) {
-        int x = location.getX();
-        int y = location.getY();
-        int verticalBoundary = headerHeight + calendarHeight + PADDING;
-        int height = controlHeight - PADDING * 2;
+    private int overButton(final Location location) {
+        final int x = location.getX();
+        final int y = location.getY();
+        final int verticalBoundary = headerHeight + calendarHeight + PADDING;
+        final int height = controlHeight - PADDING * 2;
         if (x > labelWidth && y > verticalBoundary && y < verticalBoundary + height) {
             int column = (x - labelWidth) / ((getSize().getWidth() - labelWidth) / 6);
-            if (y <= verticalBoundary + height / 2 ) {
+            if (y <= verticalBoundary + height / 2) {
                 column += 6;
             }
             return column;
         } else {
             return -1;
         }
-    }   
+    }
 
-    /* (non-Javadoc)
-	 * @see org.nakedobjects.plugins.dnd.field.DatePicker#firstClick(org.nakedobjects.plugins.dnd.view.Click)
-	 */
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.nakedobjects.plugins.dnd.field.DatePicker#firstClick(org.nakedobjects.plugins.dnd.view.Click)
+     */
     @Override
     public void firstClick(final Click click) {
         if (mouseOverButton != -1) {
@@ -347,44 +343,45 @@ public class SimpleDatePicker extends Ab
             markDamaged();
             return;
         }
-        
+
         if (isEditable) {
-            Location location = click.getLocation();
-            int col = column(location);
-            int row = row(location);
+            final Location location = click.getLocation();
+            final int col = column(location);
+            final int row = row(location);
             if (col >= 0 && col < COLUMNS && row >= 0 && row < ROWS) {
                 date.add(Calendar.DAY_OF_MONTH, row * 7 + col);
-                Content content = getContent();
-                DateValueFacet facet = content.getSpecification().getFacet(DateValueFacet.class);
-                ObjectAdapter value = facet.createValue(date.getTime());
+                final Content content = getContent();
+                final DateValueFacet facet = content.getSpecification().getFacet(DateValueFacet.class);
+                final ObjectAdapter value = facet.createValue(date.getTime());
                 ((TextParseableContent) content).parseTextEntry(value.titleString());
                 ((TextParseableContent) content).entryComplete();
                 /*
-                if (content.isObject()) {
-                    ((ObjectContent) content).setObject(value);
-                }
-                */
-                //content.
+                 * if (content.isObject()) { ((ObjectContent) content).setObject(value); }
+                 */
+                // content.
                 getView().refresh();
-                
-                //content.
+
+                // content.
             }
         }
         getViewManager().clearOverlayView();
     }
 
-    private int row(Location location) {
+    private int row(final Location location) {
         return (location.getY() - headerHeight) / cellHeight;
     }
 
-    private int column(Location location) {
+    private int column(final Location location) {
         return (location.getX() - labelWidth) / cellWidth;
     }
 
-    /* (non-Javadoc)
-	 * @see org.nakedobjects.plugins.dnd.field.DatePicker#keyPressed(org.nakedobjects.plugins.dnd.view.KeyboardAction)
-	 */
-    public void keyPressed(KeyboardAction key) {
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.nakedobjects.plugins.dnd.field.DatePicker#keyPressed(org.nakedobjects.plugins.dnd.view.KeyboardAction)
+     */
+    @Override
+    public void keyPressed(final KeyboardAction key) {
         if (isEditable && key.getKeyCode() == KeyEvent.VK_ESCAPE) {
             getViewManager().clearOverlayView();
         } else {

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/SingleLineTextField.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/SingleLineTextField.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/SingleLineTextField.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/SingleLineTextField.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.IsisException;
@@ -31,15 +30,12 @@ import org.apache.isis.viewer.dnd.view.c
 import org.apache.isis.viewer.dnd.view.text.TextContent;
 import org.apache.isis.viewer.dnd.view.text.TextUtils;
 
-
 public class SingleLineTextField extends TextField {
     private static final int LIMIT = 20;
     private int offset = 0;
 
-    public SingleLineTextField(
-            final TextParseableContent content,
-            final ViewSpecification specification,
-            final boolean showLines) {
+    public SingleLineTextField(final TextParseableContent content, final ViewSpecification specification,
+        final boolean showLines) {
         super(content, specification, showLines, TextContent.NO_WRAPPING);
     }
 
@@ -84,8 +80,8 @@ public class SingleLineTextField extends
         if (line != null) {
             final int start = style.stringWidth(line.substring(0, from));
             final int end = style.stringWidth(line.substring(0, to));
-            canvas.drawSolidRectangle(start + (HPADDING), top, end - start, style.getLineHeight(), Toolkit
-                    .getColor(ColorsAndFonts.COLOR_TEXT_HIGHLIGHT));
+            canvas.drawSolidRectangle(start + (HPADDING), top, end - start, style.getLineHeight(),
+                Toolkit.getColor(ColorsAndFonts.COLOR_TEXT_HIGHLIGHT));
         }
     }
 
@@ -100,7 +96,7 @@ public class SingleLineTextField extends
         final String[] lines = textContent.getDisplayLines();
         if (lines.length > 1) {
             throw new IsisException(
-                    "Single line text field should contain a string that contains no line breaks; contains " + lines.length);
+                "Single line text field should contain a string that contains no line breaks; contains " + lines.length);
         }
 
         final String chars = lines[0];
@@ -117,12 +113,12 @@ public class SingleLineTextField extends
         if (hasFocus() && canChangeValue().isAllowed()) {
             final int at = Math.min(cursor.getCharacter(), chars.length());
             final int pos = style.stringWidth(chars.substring(0, at)) - offset + HPADDING;
-            canvas.drawLine(pos, (baseline + style.getDescent()), pos, baseline - style.getAscent(), Toolkit
-                    .getColor(ColorsAndFonts.COLOR_TEXT_CURSOR));
+            canvas.drawLine(pos, (baseline + style.getDescent()), pos, baseline - style.getAscent(),
+                Toolkit.getColor(ColorsAndFonts.COLOR_TEXT_CURSOR));
         }
 
         // draw text
-        String line = hasFocus() ? chars : TextUtils.limitText(chars, style, width);
+        final String line = hasFocus() ? chars : TextUtils.limitText(chars, style, width);
         canvas.drawText(line, HPADDING - offset, baseline, textColor, style);
     }
 

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextField.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextField.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextField.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextField.java Tue May  3 07:18:19 2011
@@ -17,13 +17,11 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
 import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
 
-import org.apache.log4j.Logger;
 import org.apache.isis.core.commons.debug.DebugBuilder;
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
@@ -54,7 +52,7 @@ import org.apache.isis.viewer.dnd.view.t
 import org.apache.isis.viewer.dnd.view.text.TextBlockTarget;
 import org.apache.isis.viewer.dnd.view.text.TextContent;
 import org.apache.isis.viewer.dnd.view.text.TextSelection;
-
+import org.apache.log4j.Logger;
 
 public abstract class TextField extends TextParseableFieldAbstract implements TextBlockTarget {
     private static final Logger LOG = Logger.getLogger(TextField.class);
@@ -70,20 +68,13 @@ public abstract class TextField extends 
     protected TextContent textContent;
     protected boolean useEmptyLines;
 
-    public TextField(
-            final TextParseableContent content,
-            final ViewSpecification specification,
-            final boolean showLines,
-            final int wrapStyle) {
+    public TextField(final TextParseableContent content, final ViewSpecification specification,
+        final boolean showLines, final int wrapStyle) {
         this(content, specification, showLines, wrapStyle, false);
     }
 
-    public TextField(
-            final TextParseableContent content,
-            final ViewSpecification specification,
-            final boolean showLines,
-            final int wrapStyle,
-            final boolean useEmptyLines) {
+    public TextField(final TextParseableContent content, final ViewSpecification specification,
+        final boolean showLines, final int wrapStyle, final boolean useEmptyLines) {
         super(content, specification);
         this.showLines = showLines;
 
@@ -187,14 +178,10 @@ public abstract class TextField extends 
         final Location anchor = getAbsoluteLocation();
         // TODO adjust anchor so only the field is rubberbanded
         /*
-        final Size size = getView().getSize();
-        final ViewAxis axis = getViewAxis(LabelAxis.class);
-        if (axis instanceof LabelAxis) {
-            final int width = ((LabelAxis) axis).getWidth();
-            size.contractWidth(width);
-            anchor.add(width, 0);
-        }
-*/
+         * final Size size = getView().getSize(); final ViewAxis axis = getViewAxis(LabelAxis.class); if (axis
+         * instanceof LabelAxis) { final int width = ((LabelAxis) axis).getWidth(); size.contractWidth(width);
+         * anchor.add(width, 0); }
+         */
         if (canChangeValue().isAllowed()) {
             cursor.cursorAt(at);
             resetSelection();
@@ -228,12 +215,10 @@ public abstract class TextField extends 
         }
 
         /*
-        if (showLines == true && canChangeValue().isAllowed()) {
-            Color color = identified ? Toolkit.getColor(ColorsAndFonts.COLOR_IDENTIFIED) : Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3);
-            color = hasFocus() ? Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY1) : color;
-            drawLines(canvas, color, width);
-        }
-*/
+         * if (showLines == true && canChangeValue().isAllowed()) { Color color = identified ?
+         * Toolkit.getColor(ColorsAndFonts.COLOR_IDENTIFIED) : Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3); color
+         * = hasFocus() ? Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY1) : color; drawLines(canvas, color, width); }
+         */
         Color textColor;
         Color lineColor;
         if (getState().isInvalid()) {
@@ -249,12 +234,12 @@ public abstract class TextField extends 
             }
         } else if (identified) {
             textColor = Toolkit.getColor(ColorsAndFonts.COLOR_IDENTIFIED);
-            lineColor = Toolkit.getColor(ColorsAndFonts.COLOR_IDENTIFIED);            
+            lineColor = Toolkit.getColor(ColorsAndFonts.COLOR_IDENTIFIED);
         } else {
             textColor = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
             lineColor = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3);
         }
-        
+
         if (showLines == true && canChangeValue().isAllowed()) {
             drawLines(canvas, lineColor, width);
         }
@@ -268,14 +253,14 @@ public abstract class TextField extends 
     protected abstract void drawText(final Canvas canvas, final Color textColor, final int width);
 
     @Override
-    public void editComplete(final boolean moveFocus, boolean toNextField) {
+    public void editComplete(final boolean moveFocus, final boolean toNextField) {
         if (canChangeValue().isAllowed() && !isSaved) {
             isSaved = true;
             initiateSave(moveFocus);
         } else if (moveFocus) {
             if (toNextField) {
                 getFocusManager().focusNextView();
-            } else {                
+            } else {
                 getFocusManager().focusPreviousView();
             }
         }
@@ -293,8 +278,8 @@ public abstract class TextField extends 
     }
 
     /**
-     * Called when 'enter' has been pressed. Return indicates whether event has been consumed; by default it
-     * hasn't. This default implementation marks field as having edit completed.
+     * Called when 'enter' has been pressed. Return indicates whether event has been consumed; by default it hasn't.
+     * This default implementation marks field as having edit completed.
      */
     protected boolean enter() {
         editComplete(false, false);
@@ -332,8 +317,7 @@ public abstract class TextField extends 
     }
 
     /**
-     * Responds to first click by placing the cursor between the two characters nearest the point of the
-     * mouse.
+     * Responds to first click by placing the cursor between the two characters nearest the point of the mouse.
      */
     @Override
     public void firstClick(final Click click) {
@@ -346,22 +330,22 @@ public abstract class TextField extends 
             // testing
             if (cursor.getLine() > textContent.getNoLinesOfContent()) {
                 throw new IsisException("not inside content for line " + cursor.getLine() + " : "
-                        + textContent.getNoLinesOfContent());
+                    + textContent.getNoLinesOfContent());
             }
 
             markDamaged();
         }
 
         if (!canChangeValue().isAllowed() || click.isShift() || click.button2()) {
-            ObjectAdapter valueAdapter = getContent().getAdapter();
+            final ObjectAdapter valueAdapter = getContent().getAdapter();
             if (valueAdapter != null && valueAdapter.titleString().length() > 0) {
-                final View textView = new BackgroundBorder(Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY3), 
-                        new LineBorder(1, Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY1), 
-                        new TextView(getContent(), null)));
+                final View textView =
+                    new BackgroundBorder(Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY3), new LineBorder(1,
+                        Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY1), new TextView(getContent(), null)));
                 getViewManager().setOverlayView(textView);
-                
-                int offset = getView().getPadding().getLeft();
-                Location location = getAbsoluteLocation();
+
+                final int offset = getView().getPadding().getLeft();
+                final Location location = getAbsoluteLocation();
                 location.add(offset, 0);
                 textView.setLocation(location);
                 textView.markDamaged();
@@ -387,7 +371,7 @@ public abstract class TextField extends 
     }
 
     @Override
-    public Size getRequiredSize(Size availableSpace) {
+    public Size getRequiredSize(final Size availableSpace) {
         final int width = HPADDING + displayWidth + HPADDING;
         int height;
         if (textContent.getNoDisplayLines() == 1) {
@@ -399,10 +383,12 @@ public abstract class TextField extends 
         return new Size(width, height);
     }
 
+    @Override
     public int getMaxFieldWidth() {
         return displayWidth;
     }
 
+    @Override
     public Text getText() {
         return style;
     }
@@ -417,8 +403,7 @@ public abstract class TextField extends 
     }
 
     /**
-     * modifies the selection object so that text is selected if the flag is true, or text is unselected if
-     * false.
+     * modifies the selection object so that text is selected if the flag is true, or text is unselected if false.
      */
     private void highlight(final boolean select) {
         if (canChangeValue().isAllowed()) {
@@ -489,76 +474,76 @@ public abstract class TextField extends 
         final boolean ctrl = (modifiers & InputEvent.CTRL_MASK) > 0;
 
         switch (keyCode) {
-        case KeyEvent.VK_PAGE_UP:
-            key.consume();
-            pageUp(shift, ctrl);
-            break;
-        case KeyEvent.VK_PAGE_DOWN:
-            key.consume();
-            pageDown(shift, ctrl);
-            break;
-        case KeyEvent.VK_V:
-            if (ctrl) {
+            case KeyEvent.VK_PAGE_UP:
                 key.consume();
-                pasteFromClipboard();
-                highlight(false);
-            }
-            break;
-        case KeyEvent.VK_C:
-            if (ctrl) {
+                pageUp(shift, ctrl);
+                break;
+            case KeyEvent.VK_PAGE_DOWN:
                 key.consume();
-                copyToClipboard();
-            }
-            break;
-        case KeyEvent.VK_DOWN:
-            key.consume();
-            down(shift);
-            break;
-        case KeyEvent.VK_UP:
-            key.consume();
-            up(shift);
-            break;
-        case KeyEvent.VK_HOME:
-            key.consume();
-            home(alt, shift);
-            break;
-        case KeyEvent.VK_END:
-            key.consume();
-            end(alt, shift);
-            break;
-        case KeyEvent.VK_LEFT:
-            key.consume();
-            left(alt, shift);
-            break;
-        case KeyEvent.VK_RIGHT:
-            key.consume();
-            right(alt, shift);
-            break;
-        case KeyEvent.VK_DELETE:
-            key.consume();
-            deleteForward();
-            break;
-        case KeyEvent.VK_BACK_SPACE:
-            key.consume();
-            delete();
-            break;
-        case KeyEvent.VK_TAB:
-            key.consume();
-            boolean moveToNextField = !shift;
-            tab(moveToNextField);
-            break;
-        case KeyEvent.VK_ENTER:
-            if (!enter()) {
-                getParent().keyPressed(key);
-            }
-            break;
-        case KeyEvent.VK_ESCAPE:
-            key.consume();
-            escape();
-            break;
+                pageDown(shift, ctrl);
+                break;
+            case KeyEvent.VK_V:
+                if (ctrl) {
+                    key.consume();
+                    pasteFromClipboard();
+                    highlight(false);
+                }
+                break;
+            case KeyEvent.VK_C:
+                if (ctrl) {
+                    key.consume();
+                    copyToClipboard();
+                }
+                break;
+            case KeyEvent.VK_DOWN:
+                key.consume();
+                down(shift);
+                break;
+            case KeyEvent.VK_UP:
+                key.consume();
+                up(shift);
+                break;
+            case KeyEvent.VK_HOME:
+                key.consume();
+                home(alt, shift);
+                break;
+            case KeyEvent.VK_END:
+                key.consume();
+                end(alt, shift);
+                break;
+            case KeyEvent.VK_LEFT:
+                key.consume();
+                left(alt, shift);
+                break;
+            case KeyEvent.VK_RIGHT:
+                key.consume();
+                right(alt, shift);
+                break;
+            case KeyEvent.VK_DELETE:
+                key.consume();
+                deleteForward();
+                break;
+            case KeyEvent.VK_BACK_SPACE:
+                key.consume();
+                delete();
+                break;
+            case KeyEvent.VK_TAB:
+                key.consume();
+                final boolean moveToNextField = !shift;
+                tab(moveToNextField);
+                break;
+            case KeyEvent.VK_ENTER:
+                if (!enter()) {
+                    getParent().keyPressed(key);
+                }
+                break;
+            case KeyEvent.VK_ESCAPE:
+                key.consume();
+                escape();
+                break;
 
-        default:
-            break;
+            default:
+                break;
         }
 
         LOG.debug("character at " + cursor.getCharacter() + " line " + cursor.getLine());
@@ -569,15 +554,15 @@ public abstract class TextField extends 
      * 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) {
         if (canChangeValue().isAllowed()) {
             insert("" + action.getKeyChar());
         }
@@ -668,7 +653,8 @@ public abstract class TextField extends 
         // do nothing if entry is same as the value object
         final ObjectAdapter value = getValue();
         if (!entry.equals(value == null ? "" : value.titleString())) {
-            LOG.debug("field edited: \'" + entry + "\' to replace \'" + (value == null ? "" : value.titleString()) + "\'");
+            LOG.debug("field edited: \'" + entry + "\' to replace \'" + (value == null ? "" : value.titleString())
+                + "\'");
 
             try {
                 parseEntry(entry.toString());

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextFieldBorder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextFieldBorder.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextFieldBorder.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextFieldBorder.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;
@@ -26,7 +25,6 @@ import org.apache.isis.viewer.dnd.view.T
 import org.apache.isis.viewer.dnd.view.View;
 import org.apache.isis.viewer.dnd.view.base.AbstractBorder;
 
-
 /**
  * Border decorator to draw a white background and 3D style border around a text field.
  */

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextFieldSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextFieldSpecification.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextFieldSpecification.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextFieldSpecification.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.view.Axes;
@@ -29,18 +28,19 @@ import org.apache.isis.viewer.dnd.view.b
 import org.apache.isis.viewer.dnd.view.content.TextParseableContent;
 import org.apache.isis.viewer.dnd.view.lookup.OpenValueDropDownBorder;
 
-
 /**
  * Creates a single line text field with the base line drawn.
  */
 public class TextFieldSpecification extends AbstractFieldSpecification {
     @Override
-    public boolean canDisplay(ViewRequirement requirement) {
-        return requirement.isTextParseable() && ((TextParseableContent)  requirement.getContent()).getNoLines() == 1;
+    public boolean canDisplay(final ViewRequirement requirement) {
+        return requirement.isTextParseable() && ((TextParseableContent) requirement.getContent()).getNoLines() == 1;
     }
 
-    public View createView(final Content content, Axes axes, int sequence) {
-        final View field = new TextFieldResizeBorder(new SingleLineTextField((TextParseableContent) content, this, true));
+    @Override
+    public View createView(final Content content, final Axes axes, final int sequence) {
+        final View field =
+            new TextFieldResizeBorder(new SingleLineTextField((TextParseableContent) content, this, true));
         if (content.isOptionEnabled()) {
             return new OpenValueDropDownBorder(field);
         } else {
@@ -48,6 +48,7 @@ public class TextFieldSpecification exte
         }
     }
 
+    @Override
     public String getName() {
         return "Single Line Text Field";
     }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextParseableFieldAbstract.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextParseableFieldAbstract.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextParseableFieldAbstract.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextParseableFieldAbstract.java Tue May  3 07:18:19 2011
@@ -17,20 +17,19 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
-import org.apache.log4j.Logger;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.consent.Consent;
 import org.apache.isis.viewer.dnd.view.Content;
 import org.apache.isis.viewer.dnd.view.ViewSpecification;
 import org.apache.isis.viewer.dnd.view.content.TextParseableContent;
+import org.apache.log4j.Logger;
 
 public abstract class TextParseableFieldAbstract extends AbstractField {
     private static final Logger LOG = Logger.getLogger(TextField.class);
 
-    protected TextParseableFieldAbstract(Content content, ViewSpecification design) {
+    protected TextParseableFieldAbstract(final Content content, final ViewSpecification design) {
         super(content, design);
     }
 
@@ -38,7 +37,7 @@ public abstract class TextParseableField
     protected boolean provideClearCopyPaste() {
         return true;
     }
-    
+
     @Override
     protected void pasteFromClipboard() {
         try {
@@ -67,27 +66,26 @@ public abstract class TextParseableField
             LOG.debug("cleared");
         } catch (final Throwable e) {
             LOG.error("invalid paste operation " + e);
-        }    
+        }
     }
-    
+
     @Override
     protected void copyToClipboard() {
         final TextParseableContent content = (TextParseableContent) getContent();
-        ObjectAdapter object = content.getAdapter();
+        final ObjectAdapter object = content.getAdapter();
         if (object != null) {
-            String text = object.titleString();
+            final String text = object.titleString();
             getViewManager().setClipboard(text, String.class);
             LOG.debug("copied " + text);
         }
     }
 
-    
+    @Override
     public boolean isEmpty() {
         final TextParseableContent content = (TextParseableContent) getContent();
         return content.isEmpty();
     }
 
-
     @Override
     public Consent canChangeValue() {
         final TextParseableContent cont = (TextParseableContent) getContent();
@@ -105,5 +103,3 @@ public abstract class TextParseableField
     }
 
 }
-
-

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/WrappedTextField.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/WrappedTextField.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/WrappedTextField.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/WrappedTextField.java Tue May  3 07:18:19 2011
@@ -17,10 +17,8 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.field;
 
-import org.apache.log4j.Logger;
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.viewer.dnd.drawing.Canvas;
 import org.apache.isis.viewer.dnd.drawing.Color;
@@ -31,19 +29,18 @@ import org.apache.isis.viewer.dnd.view.V
 import org.apache.isis.viewer.dnd.view.content.TextParseableContent;
 import org.apache.isis.viewer.dnd.view.text.CursorPosition;
 import org.apache.isis.viewer.dnd.view.text.TextContent;
-
+import org.apache.log4j.Logger;
 
 public class WrappedTextField extends TextField {
     private static final Logger LOG = Logger.getLogger(WrappedTextField.class);
 
-    public WrappedTextField(
-            final TextParseableContent content,
-            final ViewSpecification specification,
-            final boolean showLines) {
+    public WrappedTextField(final TextParseableContent content, final ViewSpecification specification,
+        final boolean showLines) {
         super(content, specification, showLines, TextContent.WRAPPING);
     }
 
-    public void setWrapping(final boolean wrapping) {}
+    public void setWrapping(final boolean wrapping) {
+    }
 
     @Override
     protected void drawLines(final Canvas canvas, final Color color, final int width) {
@@ -82,8 +79,8 @@ public class WrappedTextField extends Te
                     end = style.stringWidth(line.substring(0, at));
                 }
 
-                canvas.drawSolidRectangle(start + (HPADDING), top, end - start, getText().getLineHeight(), Toolkit
-                        .getColor(ColorsAndFonts.COLOR_TEXT_HIGHLIGHT));
+                canvas.drawSolidRectangle(start + (HPADDING), top, end - start, getText().getLineHeight(),
+                    Toolkit.getColor(ColorsAndFonts.COLOR_TEXT_HIGHLIGHT));
             }
 
             top += getText().getLineHeight();
@@ -108,8 +105,8 @@ public class WrappedTextField extends Te
             if (hasFocus() && canChangeValue().isAllowed() && cursorLine == i) {
                 final int at = Math.min(cursor.getCharacter(), chars.length());
                 final int pos = style.stringWidth(chars.substring(0, at)) + HPADDING;
-                canvas.drawLine(pos, (baseline + style.getDescent()), pos, baseline - style.getAscent(), Toolkit
-                        .getColor(ColorsAndFonts.COLOR_TEXT_CURSOR));
+                canvas.drawLine(pos, (baseline + style.getDescent()), pos, baseline - style.getAscent(),
+                    Toolkit.getColor(ColorsAndFonts.COLOR_TEXT_CURSOR));
             }
 
             // draw text
@@ -117,8 +114,8 @@ public class WrappedTextField extends Te
             baseline += getText().getLineHeight();
         }
         /*
-         * if (end < entryLength) { int x = style.stringWidth(new String(buffer, start, end));
-         * g.setColor(Color.red); g.drawString("\u00bb", x, baseline - lineHeight()); }
+         * if (end < entryLength) { int x = style.stringWidth(new String(buffer, start, end)); g.setColor(Color.red);
+         * g.drawString("\u00bb", x, baseline - lineHeight()); }
          */
     }
 
@@ -155,6 +152,7 @@ public class WrappedTextField extends Te
     }
 
     @Override
-    protected void align() {}
+    protected void align() {
+    }
 
 }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/AbstractFormSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/AbstractFormSpecification.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/AbstractFormSpecification.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/AbstractFormSpecification.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.form;
 
 import org.apache.isis.viewer.dnd.view.Content;
@@ -25,7 +24,6 @@ import org.apache.isis.viewer.dnd.view.V
 import org.apache.isis.viewer.dnd.view.ViewRequirement;
 import org.apache.isis.viewer.dnd.view.composite.StandardFields;
 
-
 public abstract class AbstractFormSpecification extends AbstractObjectViewSpecification {
 
     @Override
@@ -35,9 +33,9 @@ public abstract class AbstractFormSpecif
             protected int collectionRequirement() {
                 return AbstractFormSpecification.this.collectionRequirement();
             }
-            
+
             @Override
-            protected boolean include(Content content, int sequence) {
+            protected boolean include(final Content content, final int sequence) {
                 return AbstractFormSpecification.this.include(content, sequence);
             }
         };
@@ -46,8 +44,8 @@ public abstract class AbstractFormSpecif
     protected int collectionRequirement() {
         return ViewRequirement.OPEN | ViewRequirement.SUBVIEW;
     }
-    
-    protected boolean include(Content content, int sequence) {
+
+    protected boolean include(final Content content, final int sequence) {
         return true;
     }
 

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/AbstractObjectViewSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/AbstractObjectViewSpecification.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/AbstractObjectViewSpecification.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/AbstractObjectViewSpecification.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.form;
 
 import org.apache.isis.viewer.dnd.view.Axes;
@@ -30,26 +29,28 @@ import org.apache.isis.viewer.dnd.view.c
 import org.apache.isis.viewer.dnd.view.composite.StackLayout;
 import org.apache.isis.viewer.dnd.view.composite.StandardFields;
 
-
 public abstract class AbstractObjectViewSpecification extends CompositeViewSpecification {
 
     public AbstractObjectViewSpecification() {
         builder = new ObjectFieldBuilder(createFieldFactory());
         init();
     }
-        
-    protected void init() {}
+
+    protected void init() {
+    }
 
     protected ViewFactory createFieldFactory() {
         return new StandardFields();
     }
 
-    public Layout createLayout(Content content, Axes axes) {
+    @Override
+    public Layout createLayout(final Content content, final Axes axes) {
         return new StackLayout();
     }
 
-    public boolean canDisplay(ViewRequirement requirement) {
-        return requirement.isObject() && !requirement.isTextParseable() && requirement.hasReference() && requirement.isOpen();
+    @Override
+    public boolean canDisplay(final ViewRequirement requirement) {
+        return requirement.isObject() && !requirement.isTextParseable() && requirement.hasReference()
+            && requirement.isOpen();
     }
 }
-

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/ExpandableFormSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/ExpandableFormSpecification.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/ExpandableFormSpecification.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/ExpandableFormSpecification.java Tue May  3 07:18:19 2011
@@ -17,17 +17,16 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.form;
 
 import org.apache.isis.viewer.dnd.view.ViewRequirement;
 import org.apache.isis.viewer.dnd.view.border.IconBorder;
 import org.apache.isis.viewer.dnd.view.composite.FieldLabelsDecorator;
 
-
 public class ExpandableFormSpecification extends AbstractFormSpecification {
 
-    public boolean canDisplay(ViewRequirement requirement) {
+    @Override
+    public boolean canDisplay(final ViewRequirement requirement) {
         return super.canDisplay(requirement) && !requirement.is(ViewRequirement.SUBVIEW);
     }
 
@@ -36,13 +35,14 @@ public class ExpandableFormSpecification
         addSubviewDecorator(new ExpandableViewBorder.Factory());
         addSubviewDecorator(new FieldLabelsDecorator());
         addViewDecorator(new IconBorder.Factory());
-   }
+    }
 
     @Override
     protected int collectionRequirement() {
         return super.collectionRequirement() | ViewRequirement.EXPANDABLE;
     }
 
+    @Override
     public String getName() {
         return "Expanding Form (experimental)";
     }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/ExpandableViewBorder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/ExpandableViewBorder.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/ExpandableViewBorder.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/ExpandableViewBorder.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.form;
 
 import java.util.List;
@@ -51,7 +50,6 @@ import org.apache.isis.viewer.dnd.view.c
 import org.apache.isis.viewer.dnd.view.content.FieldContent;
 import org.apache.isis.viewer.dnd.view.field.OneToOneFieldImpl;
 
-
 public class ExpandableViewBorder extends AbstractBorder {
     public static final int CAN_OPEN = 1;
     public static final int CANT_OPEN = 2;
@@ -64,26 +62,24 @@ public class ExpandableViewBorder extend
 
         public Factory() {
             this.closedViewSpecification = new SubviewIconSpecification();
-            this.openObjectViewSpecification =  new InternalFormSpecification();
+            this.openObjectViewSpecification = new InternalFormSpecification();
             this.openCollectionViewSpecification = new InternalListSpecification();
         }
 
-        public Factory(
-                final ViewSpecification closedViewSpecification,
-                final ViewSpecification openObjectViewSpecification,
-                ViewSpecification openCollectionViewSpecification) {
+        public Factory(final ViewSpecification closedViewSpecification,
+            final ViewSpecification openObjectViewSpecification, final ViewSpecification openCollectionViewSpecification) {
             this.closedViewSpecification = closedViewSpecification;
             this.openObjectViewSpecification = openObjectViewSpecification;
             this.openCollectionViewSpecification = openCollectionViewSpecification;
         }
 
         @Override
-        public ViewAxis createAxis(Content content) {
+        public ViewAxis createAxis(final Content content) {
             return null;
         }
 
         @Override
-        public View decorate(Axes axes, View view) {
+        public View decorate(final Axes axes, final View view) {
             if (view.getContent().isObject()) {
                 return new ExpandableViewBorder(view, closedViewSpecification, openObjectViewSpecification);
             } else if (view.getContent().isCollection()) {
@@ -94,16 +90,13 @@ public class ExpandableViewBorder extend
         }
     }
 
-
     private boolean isOpen = false;
     private final ViewSpecification openViewSpecification;
     private final ViewSpecification closedViewSpecification;
     private int canOpen;
 
-    public ExpandableViewBorder(
-            final View view,
-            final ViewSpecification closedViewSpecification,
-            final ViewSpecification openViewSpecification) {
+    public ExpandableViewBorder(final View view, final ViewSpecification closedViewSpecification,
+        final ViewSpecification openViewSpecification) {
         super(view);
         left = Toolkit.defaultFieldHeight();
         this.openViewSpecification = openViewSpecification;
@@ -112,7 +105,7 @@ public class ExpandableViewBorder extend
     }
 
     @Override
-    protected void debugDetails(DebugBuilder debug) {
+    protected void debugDetails(final DebugBuilder debug) {
         super.debugDetails(debug);
         debug.appendln("open spec", openViewSpecification);
         debug.appendln("closed spec", closedViewSpecification);
@@ -152,7 +145,7 @@ public class ExpandableViewBorder extend
             if (canOpen != CANT_OPEN) {
                 isOpen = !isOpen;
 
-                View parent = wrappedView.getParent();
+                final View parent = wrappedView.getParent();
 
                 getViewManager().removeFromNotificationList(wrappedView);
                 if (isOpen) {
@@ -179,13 +172,13 @@ public class ExpandableViewBorder extend
     }
 
     @Override
-    public void update(ObjectAdapter object) {
+    public void update(final ObjectAdapter object) {
         super.update(object);
         canOpen();
     }
 
     private void canOpen() {
-        Content content = getContent();
+        final Content content = getContent();
         if (content.isCollection()) {
             canOpen = canOpenCollection(content);
         } else if (content.isObject()) {
@@ -206,24 +199,25 @@ public class ExpandableViewBorder extend
     private int canOpenObject(final Content content) {
         final ObjectAdapter object = ((ObjectContent) content).getObject();
         if (object != null) {
-            final List<ObjectAssociation> fields = object.getSpecification().getAssociations(
+            final List<ObjectAssociation> fields =
+                object.getSpecification().getAssociations(
                     ObjectAssociationFilters.dynamicallyVisible(IsisContext.getAuthenticationSession(), object));
             for (int i = 0; i < fields.size(); i++) {
                 if (fields.get(i).isOneToManyAssociation()) {
                     return CAN_OPEN;
                 } else if (fields.get(i).isOneToOneAssociation() && !fields.get(i).getSpecification().isParseable()
-                        && fieldContainsReference(object, fields.get(i))) {
+                    && fieldContainsReference(object, fields.get(i))) {
                     return CAN_OPEN;
                 }
             }
         }
-        boolean openForObjectsWithOutReferences =true;
-        return openForObjectsWithOutReferences  ? CAN_OPEN : CANT_OPEN;
+        final boolean openForObjectsWithOutReferences = true;
+        return openForObjectsWithOutReferences ? CAN_OPEN : CANT_OPEN;
     }
 
-    private boolean fieldContainsReference(ObjectAdapter parent, ObjectAssociation field) {
-        OneToOneAssociation association = (OneToOneAssociation) field;
-        OneToOneFieldImpl fieldContent = new OneToOneFieldImpl(parent, field.get(parent), association);
+    private boolean fieldContainsReference(final ObjectAdapter parent, final ObjectAssociation field) {
+        final OneToOneAssociation association = (OneToOneAssociation) field;
+        final OneToOneFieldImpl fieldContent = new OneToOneFieldImpl(parent, field.get(parent), association);
         if (openViewSpecification.canDisplay(new ViewRequirement(fieldContent, ViewRequirement.OPEN))) {
             return true;
         }
@@ -247,4 +241,3 @@ public class ExpandableViewBorder extend
     }
 
 }
-

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/FormSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/FormSpecification.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/FormSpecification.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/FormSpecification.java Tue May  3 07:18:19 2011
@@ -17,17 +17,16 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.form;
 
 import org.apache.isis.viewer.dnd.view.ViewRequirement;
 import org.apache.isis.viewer.dnd.view.border.IconBorder;
 import org.apache.isis.viewer.dnd.view.composite.FieldLabelsDecorator;
 
-
 public class FormSpecification extends AbstractFormSpecification {
 
-    public boolean canDisplay(ViewRequirement requirement) {
+    @Override
+    public boolean canDisplay(final ViewRequirement requirement) {
         return super.canDisplay(requirement) && !requirement.is(ViewRequirement.SUBVIEW);
     }
 
@@ -37,6 +36,7 @@ public class FormSpecification extends A
         addViewDecorator(new IconBorder.Factory());
     }
 
+    @Override
     public String getName() {
         return "Form";
     }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/FormWithDetailSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/FormWithDetailSpecification.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/FormWithDetailSpecification.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/FormWithDetailSpecification.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.form;
 
 import java.util.List;
@@ -34,9 +33,8 @@ import org.apache.isis.viewer.dnd.view.V
 import org.apache.isis.viewer.dnd.view.border.SelectObjectBorder;
 import org.apache.isis.viewer.dnd.view.composite.MasterDetailPanel;
 
-
 public class FormWithDetailSpecification implements ViewSpecification {
-    private FormSpecification leftHandSideSpecification;
+    private final FormSpecification leftHandSideSpecification;
 
     public FormWithDetailSpecification() {
         leftHandSideSpecification = new FormSpecification();
@@ -44,24 +42,25 @@ public class FormWithDetailSpecification
     }
 
     @Override
-    public boolean canDisplay(ViewRequirement requirement) {
-        return requirement.isObject() && requirement.isOpen() && !requirement.isSubview() && containsEnoughFields(requirement.getContent());
+    public boolean canDisplay(final ViewRequirement requirement) {
+        return requirement.isObject() && requirement.isOpen() && !requirement.isSubview()
+            && containsEnoughFields(requirement.getContent());
     }
 
-    private boolean containsEnoughFields(Content content) {
-        ObjectSpecification specification = content.getSpecification();
-        List<ObjectAssociation> associations = specification.getAssociations(new Filter<ObjectAssociation>() {
+    private boolean containsEnoughFields(final Content content) {
+        final ObjectSpecification specification = content.getSpecification();
+        final List<ObjectAssociation> associations = specification.getAssociations(new Filter<ObjectAssociation>() {
             @Override
-            public boolean accept(ObjectAssociation t) {
+            public boolean accept(final ObjectAssociation t) {
                 return t.isOneToManyAssociation()
-                        || (t.isOneToOneAssociation() && !((OneToOneAssociation) t).getSpecification().isParseable());
+                    || (t.isOneToOneAssociation() && !((OneToOneAssociation) t).getSpecification().isParseable());
             }
         });
         return associations.size() >= 1;
     }
 
     @Override
-    public View createView(Content content, Axes axes, int sequence) {
+    public View createView(final Content content, final Axes axes, final int sequence) {
         return new MasterDetailPanel(content, this, leftHandSideSpecification);
     }
 
@@ -96,4 +95,3 @@ public class FormWithDetailSpecification
     }
 
 }
-

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/InternalFormSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/InternalFormSpecification.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/InternalFormSpecification.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/InternalFormSpecification.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.form;
 
 import org.apache.isis.viewer.dnd.drawing.ColorsAndFonts;
@@ -26,10 +25,10 @@ import org.apache.isis.viewer.dnd.view.V
 import org.apache.isis.viewer.dnd.view.border.IconBorder;
 import org.apache.isis.viewer.dnd.view.composite.FieldLabelsDecorator;
 
-
 public class InternalFormSpecification extends AbstractFormSpecification {
 
-    public boolean canDisplay(ViewRequirement requirement) {
+    @Override
+    public boolean canDisplay(final ViewRequirement requirement) {
         return super.canDisplay(requirement) && requirement.is(ViewRequirement.SUBVIEW);
     }
 
@@ -40,6 +39,7 @@ public class InternalFormSpecification e
 
     }
 
+    @Override
     public String getName() {
         return "Internal form";
     }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/SummaryFields.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/SummaryFields.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/SummaryFields.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/SummaryFields.java Tue May  3 07:18:19 2011
@@ -17,21 +17,21 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.form;
 
 import org.apache.isis.viewer.dnd.view.Content;
 import org.apache.isis.viewer.dnd.view.ViewRequirement;
 import org.apache.isis.viewer.dnd.view.composite.StandardFields;
 
+public class SummaryFields extends StandardFields {
 
-public class SummaryFields extends StandardFields{
-
+    @Override
     protected int collectionRequirement() {
         return ViewRequirement.NONE;
     }
-    
-    protected boolean include(Content content, int sequence) {
+
+    @Override
+    protected boolean include(final Content content, final int sequence) {
         return sequence < 4 && content.getAdapter() != null;
     }
 }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/SummaryFormSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/SummaryFormSpecification.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/SummaryFormSpecification.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/SummaryFormSpecification.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.form;
 
 import org.apache.isis.viewer.dnd.view.Axes;
@@ -30,19 +29,20 @@ import org.apache.isis.viewer.dnd.view.b
 import org.apache.isis.viewer.dnd.view.border.LineBorder;
 import org.apache.isis.viewer.dnd.view.composite.CompositeViewDecorator;
 
-
 public class SummaryFormSpecification extends AbstractFormSpecification {
 
-    public boolean canDisplay(ViewRequirement requirement) {
-        return requirement.isObject() && !requirement.isTextParseable() && requirement.hasReference() && requirement.isOpen()
-                && requirement.isSubview() && requirement.isFixed();
+    @Override
+    public boolean canDisplay(final ViewRequirement requirement) {
+        return requirement.isObject() && !requirement.isTextParseable() && requirement.hasReference()
+            && requirement.isOpen() && requirement.isSubview() && requirement.isFixed();
     }
 
     @Override
     protected void init() {
         addViewDecorator(new IconBorder.Factory());
         addViewDecorator(new CompositeViewDecorator() {
-            public View decorate(View view, Axes axes) {
+            @Override
+            public View decorate(final View view, final Axes axes) {
                 return new EmptyBorder(3, new BackgroundBorder(new LineBorder(1, 8, new EmptyBorder(3, view))));
             }
         });
@@ -53,6 +53,7 @@ public class SummaryFormSpecification ex
         return new SummaryFields();
     }
 
+    @Override
     public String getName() {
         return "Summary";
     }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/grid/GridSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/grid/GridSpecification.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/grid/GridSpecification.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/grid/GridSpecification.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.grid;
 
 import org.apache.isis.viewer.dnd.drawing.Canvas;
@@ -39,23 +38,26 @@ import org.apache.isis.viewer.dnd.view.c
 import org.apache.isis.viewer.dnd.view.composite.CompositeViewSpecification;
 import org.apache.isis.viewer.dnd.view.content.FieldContent;
 
-
 public class GridSpecification extends CompositeViewSpecification {
 
     public GridSpecification() {
         builder = new CollectionElementBuilder(new AbstractFormSpecification() {
+            @Override
             public String getName() {
                 return "";
             }
 
+            @Override
             protected void init() {
                 super.init();
                 addSubviewDecorator(new SubviewDecorator() {
-                    public ViewAxis createAxis(Content content) {
+                    @Override
+                    public ViewAxis createAxis(final Content content) {
                         return null;
                     }
 
-                    public View decorate(Axes axes, View view) {
+                    @Override
+                    public View decorate(final Axes axes, final View view) {
                         return new EmptyBorder(0, 0, 5, 0, view);
                     }
                 });
@@ -65,15 +67,18 @@ public class GridSpecification extends C
         addViewDecorator(new ColumnLabelBorder.Factory());
     }
 
-    public Layout createLayout(Content content, Axes axes) {
+    @Override
+    public Layout createLayout(final Content content, final Axes axes) {
         return new ColumnLayout(true);
     }
 
+    @Override
     public String getName() {
         return "Grid (experimental)";
     }
 
-    public boolean canDisplay(ViewRequirement requirement) {
+    @Override
+    public boolean canDisplay(final ViewRequirement requirement) {
         return requirement.isCollection() && requirement.isOpen();
     }
 }
@@ -81,28 +86,29 @@ public class GridSpecification extends C
 class ColumnLabelBorder extends AbstractBorder {
 
     public static class Factory implements CompositeViewDecorator {
-        public View decorate(View view, Axes axes) {
+        @Override
+        public View decorate(final View view, final Axes axes) {
             return new ColumnLabelBorder(view);
         }
     }
 
-    protected ColumnLabelBorder(View view) {
+    protected ColumnLabelBorder(final View view) {
         super(view);
         left = 100;
     }
 
-    public void draw(Canvas canvas) {
-        View subview = getSubviews()[0];
-
-        int top = subview.getPadding().getTop();
-        for (View view : subview.getSubviews()) {
-            String fieldName = ((FieldContent) view.getContent()).getFieldName();
-            canvas.drawText(fieldName + ":", 0, view.getLocation().getY() + top + view.getBaseline(), Toolkit
-                    .getColor(ColorsAndFonts.COLOR_PRIMARY1), Toolkit.getText(ColorsAndFonts.TEXT_LABEL));
+    @Override
+    public void draw(final Canvas canvas) {
+        final View subview = getSubviews()[0];
+
+        final int top = subview.getPadding().getTop();
+        for (final View view : subview.getSubviews()) {
+            final String fieldName = ((FieldContent) view.getContent()).getFieldName();
+            canvas.drawText(fieldName + ":", 0, view.getLocation().getY() + top + view.getBaseline(),
+                Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY1), Toolkit.getText(ColorsAndFonts.TEXT_LABEL));
             // canvas.drawRectangle(0, view.getLocation().getY() + top, 80, 10, Toolkit.getColor("primary1"));
         }
 
         super.draw(canvas);
     }
 }
-

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/AboutView.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/AboutView.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/AboutView.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/AboutView.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.help;
 
 import org.apache.isis.core.runtime.about.AboutIsis;
@@ -35,7 +34,6 @@ import org.apache.isis.viewer.dnd.view.b
 import org.apache.isis.viewer.dnd.view.content.NullContent;
 import org.apache.isis.viewer.dnd.view.window.SubviewFocusManager;
 
-
 public class AboutView extends AbstractView {
     private static final int MAX_WIDTH = 300;
     private final int linePadding = -2;
@@ -43,7 +41,7 @@ public class AboutView extends AbstractV
     private final int margin = 14;
     private final Image image;
     private final int left;
-    private FocusManager focusManager;
+    private final FocusManager focusManager;
 
     public AboutView() {
         super(new NullContent());
@@ -54,6 +52,7 @@ public class AboutView extends AbstractV
         focusManager = new SubviewFocusManager(this);
     }
 
+    @Override
     public FocusManager getFocusManager() {
         return focusManager;
     }
@@ -115,7 +114,7 @@ public class AboutView extends AbstractV
     }
 
     @Override
-    public Size getRequiredSize(Size availableSpace) {
+    public Size getRequiredSize(final Size availableSpace) {
         final Text titleStyle = Toolkit.getText(ColorsAndFonts.TEXT_TITLE);
         final Text normalStyle = Toolkit.getText(ColorsAndFonts.TEXT_LABEL);
 
@@ -167,6 +166,6 @@ public class AboutView extends AbstractV
 
     @Override
     public void firstClick(final Click click) {
-    // dispose();
+        // dispose();
     }
 }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/ExternalHelpViewerProgram.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/ExternalHelpViewerProgram.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/ExternalHelpViewerProgram.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/ExternalHelpViewerProgram.java Tue May  3 07:18:19 2011
@@ -17,15 +17,13 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.help;
 
 import java.io.IOException;
 
-import org.apache.log4j.Logger;
 import org.apache.isis.core.commons.exceptions.IsisException;
 import org.apache.isis.viewer.dnd.drawing.Location;
-
+import org.apache.log4j.Logger;
 
 public class ExternalHelpViewerProgram implements HelpViewer {
     private static final Logger LOG = Logger.getLogger(ExternalHelpViewerProgram.class);
@@ -35,6 +33,7 @@ public class ExternalHelpViewerProgram i
         this.program = program;
     }
 
+    @Override
     public void open(final Location location, final String name, final String description, final String help) {
         final String exec = program + " " + help;
         try {

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/HelpView.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/HelpView.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/HelpView.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/HelpView.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.help;
 
 import org.apache.isis.viewer.dnd.drawing.Canvas;
@@ -32,7 +31,6 @@ import org.apache.isis.viewer.dnd.view.c
 import org.apache.isis.viewer.dnd.view.text.TextBlockTarget;
 import org.apache.isis.viewer.dnd.view.text.TextContent;
 
-
 public class HelpView extends AbstractView implements TextBlockTarget {
     private static final int HEIGHT = 350;
     private static final int WIDTH = 400;
@@ -41,8 +39,10 @@ public class HelpView extends AbstractVi
 
     public HelpView(final String name, final String description, final String help) {
         super(new NullContent());
-        final String text = (name == null || name.trim().equals("") ? "" : (name + "\n"))
-                + (description == null || description.trim().equals("") ? "" : (description + "\n")) + (help == null ? "" : help);
+        final String text =
+            (name == null || name.trim().equals("") ? "" : (name + "\n"))
+                + (description == null || description.trim().equals("") ? "" : (description + "\n"))
+                + (help == null ? "" : help);
         content = new TextContent(this, 10, TextContent.WRAPPING);
         content.setText(text);
     }
@@ -56,9 +56,10 @@ public class HelpView extends AbstractVi
 
         final int arc = 9;
         canvas.drawSolidRectangle(x + 2, y + 2, xEntent - 4, yExtent - 4, Toolkit.getColor(ColorsAndFonts.COLOR_WHITE));
-        Color black = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
+        final Color black = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
         canvas.drawRoundedRectangle(x, y++, xEntent, yExtent, arc, arc, black);
-        canvas.drawRoundedRectangle(x + 1, y++, xEntent - 2, yExtent - 2, arc, arc, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2));
+        canvas.drawRoundedRectangle(x + 1, y++, xEntent - 2, yExtent - 2, arc, arc,
+            Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2));
         canvas.drawRoundedRectangle(x + 2, y++, xEntent - 4, yExtent - 4, arc, arc, black);
 
         x += 10;
@@ -67,9 +68,9 @@ public class HelpView extends AbstractVi
         canvas.drawText("Help", x, y, black, Toolkit.getText(ColorsAndFonts.TEXT_TITLE));
 
         final String[] lines = content.getDisplayLines();
-        for (int i = 0; i < lines.length; i++) {
+        for (final String line : lines) {
             y += Toolkit.getText(ColorsAndFonts.TEXT_NORMAL).getLineHeight();
-            canvas.drawText(lines[i], x, y, MAX_TEXT_WIDTH, black, Toolkit.getText(ColorsAndFonts.TEXT_NORMAL));
+            canvas.drawText(line, x, y, MAX_TEXT_WIDTH, black, Toolkit.getText(ColorsAndFonts.TEXT_NORMAL));
         }
     }
 
@@ -88,10 +89,12 @@ public class HelpView extends AbstractVi
         getViewManager().clearOverlayView(this);
     }
 
+    @Override
     public int getMaxFieldWidth() {
         return WIDTH - 20;
     }
 
+    @Override
     public Text getText() {
         return Toolkit.getText(ColorsAndFonts.TEXT_NORMAL);
     }

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/HelpViewer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/HelpViewer.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/HelpViewer.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/HelpViewer.java Tue May  3 07:18:19 2011
@@ -17,12 +17,10 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.help;
 
 import org.apache.isis.viewer.dnd.drawing.Location;
 
-
 /**
  * A HelpSystem is used to launch the help system and bring up contextual help.
  */

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/InternalHelpViewer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/InternalHelpViewer.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/InternalHelpViewer.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/InternalHelpViewer.java Tue May  3 07:18:19 2011
@@ -17,14 +17,12 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.help;
 
 import org.apache.isis.viewer.dnd.drawing.Location;
 import org.apache.isis.viewer.dnd.view.View;
 import org.apache.isis.viewer.dnd.view.Viewer;
 
-
 public class InternalHelpViewer implements HelpViewer {
     private final Viewer viewer;
 
@@ -32,6 +30,7 @@ public class InternalHelpViewer implemen
         this.viewer = viewer;
     }
 
+    @Override
     public void open(final Location location, final String name, final String description, final String help) {
         viewer.clearAction();
 

Modified: incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/HistogramAxis.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/HistogramAxis.java?rev=1098945&r1=1098944&r2=1098945&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/HistogramAxis.java (original)
+++ incubator/isis/trunk/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/HistogramAxis.java Tue May  3 07:18:19 2011
@@ -17,7 +17,6 @@
  *  under the License.
  */
 
-
 package org.apache.isis.viewer.dnd.histogram;
 
 import java.util.List;
@@ -29,36 +28,37 @@ import org.apache.isis.viewer.dnd.view.C
 import org.apache.isis.viewer.dnd.view.ViewAxis;
 import org.apache.isis.viewer.dnd.view.collection.CollectionContent;
 
-
 class HistogramAxis implements ViewAxis {
-    private ObjectAssociation fields[];
-    private double maxValues[];
-    private int noBars;
-
-    public HistogramAxis(Content content) {
-        List<? extends ObjectAssociation> associationList = HistogramSpecification
-                .availableFields((CollectionContent) content);
+    private final ObjectAssociation fields[];
+    private final double maxValues[];
+    private final int noBars;
+
+    public HistogramAxis(final Content content) {
+        final List<? extends ObjectAssociation> associationList =
+            HistogramSpecification.availableFields((CollectionContent) content);
         noBars = associationList.size();
         fields = new ObjectAssociation[noBars];
         maxValues = new double[noBars];
         int i = 0;
-        for (ObjectAssociation association : associationList) {
+        for (final ObjectAssociation association : associationList) {
             fields[i++] = association;
         }
     }
 
-    public double getLengthFor(Content content, int fieldNo) {
-        return NumberAdapters.doubleValue(fields[fieldNo],  fields[fieldNo].get(content.getAdapter())) / maxValues[fieldNo];
+    public double getLengthFor(final Content content, final int fieldNo) {
+        return NumberAdapters.doubleValue(fields[fieldNo], fields[fieldNo].get(content.getAdapter()))
+            / maxValues[fieldNo];
     }
 
-    public void determineMaximum(Content content) {
+    public void determineMaximum(final Content content) {
         int i = 0;
-        for (ObjectAssociation field : fields) {
+        for (final ObjectAssociation field : fields) {
             maxValues[i] = 0;
-            CollectionFacet collectionFacet = content.getAdapter().getSpecification().getFacet(CollectionFacet.class);
-            for (ObjectAdapter element : collectionFacet.iterable(content.getAdapter())) {
-                ObjectAdapter value = field.get(element);
-                double doubleValue = NumberAdapters.doubleValue(field, value);
+            final CollectionFacet collectionFacet =
+                content.getAdapter().getSpecification().getFacet(CollectionFacet.class);
+            for (final ObjectAdapter element : collectionFacet.iterable(content.getAdapter())) {
+                final ObjectAdapter value = field.get(element);
+                final double doubleValue = NumberAdapters.doubleValue(field, value);
                 maxValues[i] = Math.max(maxValues[i], doubleValue);
             }
             i++;
@@ -69,4 +69,3 @@ class HistogramAxis implements ViewAxis 
         return noBars;
     }
 }
-



Mime
View raw message