You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2012/01/22 09:05:57 UTC
svn commit: r1234460 [5/30] - in /incubator/isis/trunk/framework/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/...
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/SingleLineTextField.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/SingleLineTextField.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/SingleLineTextField.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/SingleLineTextField.java Sun Jan 22 08:05:17 2012
@@ -34,8 +34,7 @@ public class SingleLineTextField extends
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);
}
@@ -80,8 +79,7 @@ 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));
}
}
@@ -95,8 +93,7 @@ public class SingleLineTextField extends
protected void drawText(final Canvas canvas, final Color textColor, final int width) {
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);
+ throw new IsisException("Single line text field should contain a string that contains no line breaks; contains " + lines.length);
}
final String chars = lines[0];
@@ -113,8 +110,7 @@ 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
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextField.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextField.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextField.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextField.java Sun Jan 22 08:05:17 2012
@@ -68,13 +68,11 @@ 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;
@@ -178,8 +176,9 @@ 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);
+ * 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()) {
@@ -215,9 +214,11 @@ 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;
@@ -278,8 +279,9 @@ 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);
@@ -317,7 +319,8 @@ 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) {
@@ -329,8 +332,7 @@ public abstract class TextField extends
// testing
if (cursor.getLine() > textContent.getNoLinesOfContent()) {
- throw new IsisException("not inside content for line " + cursor.getLine() + " : "
- + textContent.getNoLinesOfContent());
+ throw new IsisException("not inside content for line " + cursor.getLine() + " : " + textContent.getNoLinesOfContent());
}
markDamaged();
@@ -339,9 +341,7 @@ public abstract class TextField extends
if (!canChangeValue().isAllowed() || click.isShift() || click.button2()) {
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);
final int offset = getView().getPadding().getLeft();
@@ -403,7 +403,8 @@ 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()) {
@@ -454,7 +455,8 @@ public abstract class TextField extends
}
/**
- * Called when the user presses any key on the keyboard while this view has the focus.
+ * Called when the user presses any key on the keyboard while this view has
+ * the focus.
*/
@Override
public void keyPressed(final KeyboardAction key) {
@@ -474,76 +476,76 @@ public abstract class TextField extends
final boolean ctrl = (modifiers & InputEvent.CTRL_MASK) > 0;
switch (keyCode) {
- case KeyEvent.VK_PAGE_UP:
+ 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) {
key.consume();
- pageUp(shift, ctrl);
- break;
- case KeyEvent.VK_PAGE_DOWN:
- key.consume();
- 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:
+ pasteFromClipboard();
+ highlight(false);
+ }
+ break;
+ case KeyEvent.VK_C:
+ if (ctrl) {
key.consume();
- escape();
- break;
+ 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());
@@ -551,15 +553,18 @@ public abstract class TextField extends
}
/**
- * Called when the user releases any key on the keyboard while this view has the focus.
+ * Called when the user releases any key on the keyboard while this view has
+ * the focus.
*/
@Override
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(final KeyboardAction action) {
@@ -653,8 +658,7 @@ 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/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextFieldBorder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextFieldBorder.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextFieldBorder.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextFieldBorder.java Sun Jan 22 08:05:17 2012
@@ -26,7 +26,8 @@ import org.apache.isis.viewer.dnd.view.V
import org.apache.isis.viewer.dnd.view.base.AbstractBorder;
/**
- * Border decorator to draw a white background and 3D style border around a text field.
+ * Border decorator to draw a white background and 3D style border around a text
+ * field.
*/
public class TextFieldBorder extends AbstractBorder {
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextFieldSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextFieldSpecification.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextFieldSpecification.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/TextFieldSpecification.java Sun Jan 22 08:05:17 2012
@@ -39,8 +39,7 @@ public class TextFieldSpecification exte
@Override
public View createView(final Content content, final Axes axes, final int sequence) {
- final View field =
- new TextFieldResizeBorder(new SingleLineTextField((TextParseableContent) content, this, true));
+ final View field = new TextFieldResizeBorder(new SingleLineTextField((TextParseableContent) content, this, true));
if (content.isOptionEnabled()) {
return new OpenValueDropDownBorder(field);
} else {
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/WrappedTextField.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/WrappedTextField.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/WrappedTextField.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/field/WrappedTextField.java Sun Jan 22 08:05:17 2012
@@ -34,8 +34,7 @@ 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);
}
@@ -79,8 +78,7 @@ 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();
@@ -105,8 +103,7 @@ 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
@@ -114,8 +111,9 @@ 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()); }
*/
}
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/AbstractObjectViewSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/AbstractObjectViewSpecification.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/AbstractObjectViewSpecification.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/AbstractObjectViewSpecification.java Sun Jan 22 08:05:17 2012
@@ -50,7 +50,6 @@ public abstract class AbstractObjectView
@Override
public boolean canDisplay(final ViewRequirement requirement) {
- return requirement.isObject() && !requirement.isTextParseable() && requirement.hasReference()
- && requirement.isOpen();
+ return requirement.isObject() && !requirement.isTextParseable() && requirement.hasReference() && requirement.isOpen();
}
}
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/ExpandableViewBorder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/ExpandableViewBorder.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/ExpandableViewBorder.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/ExpandableViewBorder.java Sun Jan 22 08:05:17 2012
@@ -66,8 +66,7 @@ public class ExpandableViewBorder extend
this.openCollectionViewSpecification = new InternalListSpecification();
}
- public Factory(final ViewSpecification closedViewSpecification,
- final ViewSpecification openObjectViewSpecification, final ViewSpecification openCollectionViewSpecification) {
+ public Factory(final ViewSpecification closedViewSpecification, final ViewSpecification openObjectViewSpecification, final ViewSpecification openCollectionViewSpecification) {
this.closedViewSpecification = closedViewSpecification;
this.openObjectViewSpecification = openObjectViewSpecification;
this.openCollectionViewSpecification = openCollectionViewSpecification;
@@ -95,8 +94,7 @@ public class ExpandableViewBorder extend
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;
@@ -199,14 +197,11 @@ 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(
- ObjectAssociationFilters.dynamicallyVisible(IsisContext.getAuthenticationSession(), object));
+ 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))) {
+ } else if (fields.get(i).isOneToOneAssociation() && !fields.get(i).getSpecification().isParseable() && fieldContainsReference(object, fields.get(i))) {
return CAN_OPEN;
}
}
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/FormWithDetailSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/FormWithDetailSpecification.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/FormWithDetailSpecification.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/FormWithDetailSpecification.java Sun Jan 22 08:05:17 2012
@@ -43,8 +43,7 @@ public class FormWithDetailSpecification
@Override
public boolean canDisplay(final ViewRequirement requirement) {
- return requirement.isObject() && requirement.isOpen() && !requirement.isSubview()
- && containsEnoughFields(requirement.getContent());
+ return requirement.isObject() && requirement.isOpen() && !requirement.isSubview() && containsEnoughFields(requirement.getContent());
}
private boolean containsEnoughFields(final Content content) {
@@ -52,8 +51,7 @@ public class FormWithDetailSpecification
final List<ObjectAssociation> associations = specification.getAssociations(new Filter<ObjectAssociation>() {
@Override
public boolean accept(final ObjectAssociation t) {
- return t.isOneToManyAssociation()
- || (t.isOneToOneAssociation() && !((OneToOneAssociation) t).getSpecification().isParseable());
+ return t.isOneToManyAssociation() || (t.isOneToOneAssociation() && !((OneToOneAssociation) t).getSpecification().isParseable());
}
});
return associations.size() >= 1;
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/SummaryFormSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/SummaryFormSpecification.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/SummaryFormSpecification.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/form/SummaryFormSpecification.java Sun Jan 22 08:05:17 2012
@@ -33,8 +33,7 @@ public class SummaryFormSpecification ex
@Override
public boolean canDisplay(final ViewRequirement requirement) {
- return requirement.isObject() && !requirement.isTextParseable() && requirement.hasReference()
- && requirement.isOpen() && requirement.isSubview() && requirement.isFixed();
+ return requirement.isObject() && !requirement.isTextParseable() && requirement.hasReference() && requirement.isOpen() && requirement.isSubview() && requirement.isFixed();
}
@Override
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/grid/GridSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/grid/GridSpecification.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/grid/GridSpecification.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/grid/GridSpecification.java Sun Jan 22 08:05:17 2012
@@ -104,9 +104,9 @@ class ColumnLabelBorder extends Abstract
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"));
+ 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/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/HelpView.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/HelpView.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/HelpView.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/help/HelpView.java Sun Jan 22 08:05:17 2012
@@ -39,10 +39,7 @@ 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);
}
@@ -58,8 +55,7 @@ public class HelpView extends AbstractVi
canvas.drawSolidRectangle(x + 2, y + 2, xEntent - 4, yExtent - 4, Toolkit.getColor(ColorsAndFonts.COLOR_WHITE));
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;
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/HistogramAxis.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/HistogramAxis.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/HistogramAxis.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/HistogramAxis.java Sun Jan 22 08:05:17 2012
@@ -34,8 +34,7 @@ class HistogramAxis implements ViewAxis
private final int noBars;
public HistogramAxis(final Content content) {
- final List<? extends ObjectAssociation> associationList =
- HistogramSpecification.availableFields((CollectionContent) content);
+ final List<? extends ObjectAssociation> associationList = HistogramSpecification.availableFields((CollectionContent) content);
noBars = associationList.size();
fields = new ObjectAssociation[noBars];
maxValues = new double[noBars];
@@ -46,16 +45,14 @@ class HistogramAxis implements ViewAxis
}
public double getLengthFor(final Content content, final int fieldNo) {
- return NumberAdapters.doubleValue(fields[fieldNo], fields[fieldNo].get(content.getAdapter()))
- / maxValues[fieldNo];
+ return NumberAdapters.doubleValue(fields[fieldNo], fields[fieldNo].get(content.getAdapter())) / maxValues[fieldNo];
}
public void determineMaximum(final Content content) {
int i = 0;
for (final ObjectAssociation field : fields) {
maxValues[i] = 0;
- final CollectionFacet collectionFacet =
- content.getAdapter().getSpecification().getFacet(CollectionFacet.class);
+ 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);
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/HistogramBar.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/HistogramBar.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/HistogramBar.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/HistogramBar.java Sun Jan 22 08:05:17 2012
@@ -32,8 +32,7 @@ class HistogramBar extends ObjectView {
private static final int colors[] = new int[] { 0xccccff, 0x99ff99, 0xffccff };
private final HistogramAxis histogramAxis;
- protected HistogramBar(final Content content, final HistogramAxis histogramAxis,
- final ViewSpecification specification) {
+ protected HistogramBar(final Content content, final HistogramAxis histogramAxis, final ViewSpecification specification) {
super(content, specification);
this.histogramAxis = histogramAxis;
}
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/HistogramSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/HistogramSpecification.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/HistogramSpecification.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/HistogramSpecification.java Sun Jan 22 08:05:17 2012
@@ -62,8 +62,7 @@ public class HistogramSpecification exte
@Override
public boolean canDisplay(final ViewRequirement requirement) {
- return requirement.isCollection() && requirement.isOpen()
- && availableFields((CollectionContent) requirement.getContent()).size() > 0;
+ return requirement.isCollection() && requirement.isOpen() && availableFields((CollectionContent) requirement.getContent()).size() > 0;
}
@Override
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/NumberAdapters.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/NumberAdapters.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/NumberAdapters.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/histogram/NumberAdapters.java Sun Jan 22 08:05:17 2012
@@ -43,10 +43,7 @@ public class NumberAdapters {
}
public static boolean contains(final ObjectAssociation t) {
- return t.getSpecification().containsFacet(IntegerValueFacet.class)
- || t.getSpecification().containsFacet(DoubleFloatingPointValueFacet.class)
- || t.getSpecification().containsFacet(FloatingPointValueFacet.class)
- || t.getSpecification().containsFacet(MoneyValueFacet.class);
+ return t.getSpecification().containsFacet(IntegerValueFacet.class) || t.getSpecification().containsFacet(DoubleFloatingPointValueFacet.class) || t.getSpecification().containsFacet(FloatingPointValueFacet.class) || t.getSpecification().containsFacet(MoneyValueFacet.class);
}
public static double doubleValue(final ObjectAssociation field, final ObjectAdapter value) {
@@ -57,8 +54,7 @@ public class NumberAdapters {
return intValueFacet.integerValue(value).doubleValue();
}
- final DoubleFloatingPointValueFacet doubleValueFacet =
- specification.getFacet(DoubleFloatingPointValueFacet.class);
+ final DoubleFloatingPointValueFacet doubleValueFacet = specification.getFacet(DoubleFloatingPointValueFacet.class);
if (doubleValueFacet != null) {
return doubleValueFacet.doubleValue(value).doubleValue();
}
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/Icon.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/Icon.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/Icon.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/Icon.java Sun Jan 22 08:05:17 2012
@@ -118,7 +118,8 @@ public class Icon extends ObjectView {
}
/**
- * Set up the graphic to be used when displaying the icon and the icon is selected.
+ * Set up the graphic to be used when displaying the icon and the icon is
+ * selected.
*/
public void setSelectedGraphic(final IconGraphic selectedGraphic) {
this.selectedGraphic = selectedGraphic;
@@ -136,8 +137,9 @@ public class Icon extends ObjectView {
}
/**
- * Set up the graphic to be used when displaying the icon and the icon is unselected. If this returns null the
- * graphic will not be changed when the icon becomes unselected.
+ * Set up the graphic to be used when displaying the icon and the icon is
+ * unselected. If this returns null the graphic will not be changed when the
+ * icon becomes unselected.
*/
public void setUnselectedGraphic(final IconGraphic unselectedGraphic) {
this.unselectedGraphic = unselectedGraphic;
@@ -145,7 +147,8 @@ public class Icon extends ObjectView {
}
/**
- * Specifies if the graphic should be aligned vertical above the label; otherwise aligned horizontally.
+ * Specifies if the graphic should be aligned vertical above the label;
+ * otherwise aligned horizontally.
*/
public void setVertical(final boolean isVertical) {
this.isVertical = isVertical;
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/IconElementFactory.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/IconElementFactory.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/IconElementFactory.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/IconElementFactory.java Sun Jan 22 08:05:17 2012
@@ -35,8 +35,7 @@ public class IconElementFactory implemen
this(null, null, false);
}
- public IconElementFactory(final ViewSpecification objectSpec, final ViewSpecification collectionSpec,
- final boolean createViewsForEmptyContent) {
+ public IconElementFactory(final ViewSpecification objectSpec, final ViewSpecification collectionSpec, final boolean createViewsForEmptyContent) {
this.objectSpec = this.objectSpec == null ? new SubviewIconSpecification() : objectSpec;
this.collectionSpec = this.collectionSpec == null ? new SubviewIconSpecification() : collectionSpec;
this.createViewsForEmptyContent = createViewsForEmptyContent;
@@ -53,7 +52,8 @@ public class IconElementFactory implemen
} else if (content.isCollection()) {
return collectionSpec.createView(content, axes, -1);
} else {
- // TODO decide what to do with values: use factory, use another SubviewSpec, or ignore always
+ // TODO decide what to do with values: use factory, use another
+ // SubviewSpec, or ignore always
return null;
}
}
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/LargeIconSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/LargeIconSpecification.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/LargeIconSpecification.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/LargeIconSpecification.java Sun Jan 22 08:05:17 2012
@@ -45,8 +45,7 @@ public class LargeIconSpecification impl
@Override
public boolean canDisplay(final ViewRequirement requirement) {
- return requirement.isClosed() && requirement.isObject() && requirement.hasReference()
- && requirement.isSubview();
+ return requirement.isClosed() && requirement.isObject() && requirement.hasReference() && requirement.isSubview();
}
@Override
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/RootIconSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/RootIconSpecification.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/RootIconSpecification.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/RootIconSpecification.java Sun Jan 22 08:05:17 2012
@@ -44,7 +44,8 @@ class IconOpenAction extends AbstractVie
@Override
public void execute(final Workspace workspace, final View view, final Location at) {
getView().dispose();
- // getWorkspace().removeObject((ObjectAdapter) view.getContent().getAdapter());
+ // getWorkspace().removeObject((ObjectAdapter)
+ // view.getContent().getAdapter());
}
});
}
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/SubviewIconSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/SubviewIconSpecification.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/SubviewIconSpecification.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/icon/SubviewIconSpecification.java Sun Jan 22 08:05:17 2012
@@ -33,17 +33,17 @@ public class SubviewIconSpecification ex
@Override
public boolean canDisplay(final ViewRequirement requirement) {
- return super.canDisplay(requirement) && requirement.is(ViewRequirement.CLOSED)
- && requirement.is(ViewRequirement.SUBVIEW);
+ return super.canDisplay(requirement) && requirement.is(ViewRequirement.CLOSED) && requirement.is(ViewRequirement.SUBVIEW);
}
@Override
public View createView(final Content content, final Axes axes, final int sequence) {
final View view = super.createView(content, axes, sequence);
/*
- * boolean isEditable = content instanceof OneToOneField && ((OneToOneField) content).isEditable().isAllowed();
- * boolean hasOptions = content.isOptionEnabled(); if (isEditable && hasOptions) { return new
- * OpenObjectDropDownBorder(view, spec); } return view;
+ * boolean isEditable = content instanceof OneToOneField &&
+ * ((OneToOneField) content).isEditable().isAllowed(); boolean
+ * hasOptions = content.isOptionEnabled(); if (isEditable && hasOptions)
+ * { return new OpenObjectDropDownBorder(view, spec); } return view;
*/
if (content instanceof OneToOneField && ((OneToOneField) content).isEditable().isVetoed()) {
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/ClickImpl.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/ClickImpl.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/ClickImpl.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/ClickImpl.java Sun Jan 22 08:05:17 2012
@@ -36,7 +36,8 @@ public class ClickImpl extends PointerEv
* @param mouseLocation
* the location of the mouse relative to the viewer
* @param modifiers
- * the button and key held down during the click (@see java.awt.event.MouseEvent)
+ * the button and key held down during the click (@see
+ * java.awt.event.MouseEvent)
*/
public ClickImpl(final Location mouseLocation, final int modifiers) {
super(modifiers);
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/ContentDragImpl.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/ContentDragImpl.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/ContentDragImpl.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/ContentDragImpl.java Sun Jan 22 08:05:17 2012
@@ -37,9 +37,10 @@ public class ContentDragImpl extends Dra
private final View source;
/**
- * Creates a new drag event. The source view has its pickup(), and then, exited() methods called on it. The view
- * returned by the pickup method becomes this event overlay view, which is moved continuously so that it tracks the
- * pointer,
+ * Creates a new drag event. The source view has its pickup(), and then,
+ * exited() methods called on it. The view returned by the pickup method
+ * becomes this event overlay view, which is moved continuously so that it
+ * tracks the pointer,
*
* @param source
* the view over which the pointer was when this event started
@@ -56,7 +57,8 @@ public class ContentDragImpl extends Dra
}
/**
- * Cancels drag by calling dragOut() on the current target, and changes the cursor back to the default.
+ * Cancels drag by calling dragOut() on the current target, and changes the
+ * cursor back to the default.
*/
@Override
public void cancel(final Viewer viewer) {
@@ -101,7 +103,8 @@ public class ContentDragImpl extends Dra
}
/**
- * Ends the drag by calling drop() on the current target, and changes the cursor back to the default.
+ * Ends the drag by calling drop() on the current target, and changes the
+ * cursor back to the default.
*/
@Override
public void end(final Viewer viewer) {
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/DragImpl.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/DragImpl.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/DragImpl.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/DragImpl.java Sun Jan 22 08:05:17 2012
@@ -42,7 +42,8 @@ public abstract class DragImpl extends P
public abstract void drag(final View target, final Location location, final int mods);
/**
- * Indicates the drag has properly ended (the mouse button has been released)
+ * Indicates the drag has properly ended (the mouse button has been
+ * released)
*
*/
@Override
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/SimpleInternalDrag.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/SimpleInternalDrag.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/SimpleInternalDrag.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/SimpleInternalDrag.java Sun Jan 22 08:05:17 2012
@@ -34,9 +34,10 @@ public class SimpleInternalDrag extends
private final View view;
/**
- * Creates a new drag event. The source view has its pickup(), and then, exited() methods called on it. The view
- * returned by the pickup method becomes this event overlay view, which is moved continuously so that it tracks the
- * pointer,
+ * Creates a new drag event. The source view has its pickup(), and then,
+ * exited() methods called on it. The view returned by the pickup method
+ * becomes this event overlay view, which is moved continuously so that it
+ * tracks the pointer,
*
* @param view
* the view over which the pointer was when this event started
@@ -53,8 +54,7 @@ public class SimpleInternalDrag extends
final Padding targetPadding = view.getPadding();
final Padding containerPadding = view.getView().getPadding();
- offset.add(containerPadding.getLeft() - targetPadding.getLeft(),
- containerPadding.getTop() - targetPadding.getTop());
+ offset.add(containerPadding.getLeft() - targetPadding.getLeft(), containerPadding.getTop() - targetPadding.getTop());
this.location.subtract(offset);
}
@@ -68,8 +68,7 @@ public class SimpleInternalDrag extends
final Padding targetPadding = view.getPadding();
final Padding containerPadding = view.getView().getPadding();
- offset.add(containerPadding.getLeft() - targetPadding.getLeft(),
- containerPadding.getTop() - targetPadding.getTop());
+ offset.add(containerPadding.getLeft() - targetPadding.getLeft(), containerPadding.getTop() - targetPadding.getTop());
this.location.subtract(offset);
}
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/ViewDragImpl.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/ViewDragImpl.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/ViewDragImpl.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/interaction/ViewDragImpl.java Sun Jan 22 08:05:17 2012
@@ -29,7 +29,8 @@ import org.apache.isis.viewer.dnd.view.W
public class ViewDragImpl extends DragImpl implements ViewDrag {
private Location location;
/**
- * Offset from the view's top-left corner to the pointer (relative to the view).
+ * Offset from the view's top-left corner to the pointer (relative to the
+ * view).
*/
private final Offset overlayOffset;
private final View sourceView;
@@ -38,9 +39,10 @@ public class ViewDragImpl extends DragIm
private final Workspace viewsWorkspace;
/**
- * Creates a new drag event. The source view has its pickup(), and then, exited() methods called on it. The view
- * returned by the pickup method becomes this event overlay view, which is moved continuously so that it tracks the
- * pointer.
+ * Creates a new drag event. The source view has its pickup(), and then,
+ * exited() methods called on it. The view returned by the pickup method
+ * becomes this event overlay view, which is moved continuously so that it
+ * tracks the pointer.
*
* @param view
* the view over which the pointer was when this event started
@@ -54,7 +56,8 @@ public class ViewDragImpl extends DragIm
}
/**
- * getView().getAbsoluteLocation().getX(), -getView().getAbsoluteLocation().getY() Cancel drag by changing cursor
+ * getView().getAbsoluteLocation().getX(),
+ * -getView().getAbsoluteLocation().getY() Cancel drag by changing cursor
* back to pointer.
*/
@Override
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/list/InternalCollectionBorder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/list/InternalCollectionBorder.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/list/InternalCollectionBorder.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/list/InternalCollectionBorder.java Sun Jan 22 08:05:17 2012
@@ -102,7 +102,8 @@ public class InternalCollectionBorder ex
@Override
public void contentMenuOptions(final UserActionSet options) {
super.contentMenuOptions(options);
- // final ObjectSpecification specification = ((OneToManyField) getContent()).getSpecification();
+ // final ObjectSpecification specification = ((OneToManyField)
+ // getContent()).getSpecification();
// OptionFactory.addCreateOptions(specification, options);
}
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/list/InternalCollectionIconGraphic.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/list/InternalCollectionIconGraphic.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/list/InternalCollectionIconGraphic.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/list/InternalCollectionIconGraphic.java Sun Jan 22 08:05:17 2012
@@ -30,8 +30,10 @@ public class InternalCollectionIconGraph
}
/*
- * protected Image iconPicture(ObjectAdapter object) { final InternalCollection cls = (InternalCollection) object;
- * final ObjectSpecification spec = cls.getElementSpecification(); Image icon = loadIcon(spec, ""); if(icon == null)
- * { icon = loadIcon(spec, ""); } return icon; }
+ * protected Image iconPicture(ObjectAdapter object) { final
+ * InternalCollection cls = (InternalCollection) object; final
+ * ObjectSpecification spec = cls.getElementSpecification(); Image icon =
+ * loadIcon(spec, ""); if(icon == null) { icon = loadIcon(spec, ""); }
+ * return icon; }
*/
}
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/service/ServiceBorder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/service/ServiceBorder.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/service/ServiceBorder.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/service/ServiceBorder.java Sun Jan 22 08:05:17 2012
@@ -77,8 +77,7 @@ public class ServiceBorder extends Abstr
canvas.drawRectangle(i, i, xExtent - 2 * i, s.getHeight() - 2 * i, color);
}
canvas.drawLine(xExtent - BORDER, left, xExtent - BORDER, left + s.getHeight(), color);
- canvas.drawSolidRectangle(xExtent - BORDER + 1, left, BORDER - 2, s.getHeight() - 2 * left,
- Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3));
+ canvas.drawSolidRectangle(xExtent - BORDER + 1, left, BORDER - 2, s.getHeight() - 2 * left, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3));
}
}
}
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/service/ServiceObject.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/service/ServiceObject.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/service/ServiceObject.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/service/ServiceObject.java Sun Jan 22 08:05:17 2012
@@ -69,8 +69,7 @@ public class ServiceObject extends Abstr
public String getDescription() {
final String specName = getSpecification().getSingularName();
final String objectTitle = getObject().titleString();
- return specName + (specName.equalsIgnoreCase(objectTitle) ? "" : ": " + objectTitle) + " "
- + getSpecification().getDescription();
+ return specName + (specName.equalsIgnoreCase(objectTitle) ? "" : ": " + objectTitle) + " " + getSpecification().getDescription();
}
@Override
@@ -138,8 +137,7 @@ public class ServiceObject extends Abstr
return Veto.DEFAULT;
} else {
final ObjectAdapter source = sourceContent.getAdapter();
- final Consent parameterSetValid =
- action.isProposedArgumentSetValid(adapter, new ObjectAdapter[] { source });
+ final Consent parameterSetValid = action.isProposedArgumentSetValid(adapter, new ObjectAdapter[] { source });
parameterSetValid.setDescription("Execute '" + action.getName() + "' with " + source.titleString());
return parameterSetValid;
}
@@ -147,9 +145,7 @@ public class ServiceObject extends Abstr
private ObjectAction actionFor(final Content sourceContent) {
ObjectAction action;
- action =
- adapter.getSpecification().getObjectAction(ActionType.USER, null,
- Arrays.asList(sourceContent.getSpecification()));
+ action = adapter.getSpecification().getObjectAction(ActionType.USER, null, Arrays.asList(sourceContent.getSpecification()));
return action;
}
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/AbstractTableSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/AbstractTableSpecification.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/AbstractTableSpecification.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/AbstractTableSpecification.java Sun Jan 22 08:05:17 2012
@@ -45,7 +45,8 @@ public abstract class AbstractTableSpeci
// TODO do directly without specification
@Override
public View createView(final Content content, final Axes axes, final int sequence) {
- // ViewSpecification rowSpecification = new SubviewIconSpecification();
+ // ViewSpecification rowSpecification = new
+ // SubviewIconSpecification();
return rowSpecification.createView(content, axes, -1);
}
});
@@ -78,8 +79,7 @@ public abstract class AbstractTableSpeci
} else {
final CollectionContent collectionContent = (CollectionContent) requirement.getContent();
final ObjectSpecification elementSpecification = collectionContent.getElementSpecification();
- final List<ObjectAssociation> fields =
- elementSpecification.getAssociations(ObjectAssociationFilters.STATICALLY_VISIBLE_ASSOCIATIONS);
+ final List<ObjectAssociation> fields = elementSpecification.getAssociations(ObjectAssociationFilters.STATICALLY_VISIBLE_ASSOCIATIONS);
for (int i = 0; i < fields.size(); i++) {
if (fields.get(i).isOneToOneAssociation()) {
return true;
@@ -90,9 +90,11 @@ public abstract class AbstractTableSpeci
}
/*
- * protected View decorateView(View view) { TableAxis tableAxis = (TableAxis) view.getViewAxisForChildren();
- * tableAxis.setRoot(view); return view; // return doCreateView(table, content, axis); } protected abstract View
- * doCreateView(final View table, final Content content, final ViewAxis axis);
+ * protected View decorateView(View view) { TableAxis tableAxis =
+ * (TableAxis) view.getViewAxisForChildren(); tableAxis.setRoot(view);
+ * return view; // return doCreateView(table, content, axis); } protected
+ * abstract View doCreateView(final View table, final Content content, final
+ * ViewAxis axis);
*/
@Override
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/InternalTableSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/InternalTableSpecification.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/InternalTableSpecification.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/InternalTableSpecification.java Sun Jan 22 08:05:17 2012
@@ -34,7 +34,8 @@ public class InternalTableSpecification
@Override
public View decorate(final View view, final Axes axes) {
final ScrollBorder scrollingView = new ScrollBorder(view);
- // note - the next call needs to be after the creation of the window border
+ // note - the next call needs to be after the creation of the
+ // window border
// so that it exists when the header is set up
scrollingView.setTopHeader(new TableHeader(view.getContent(), axes.getAxis(TableAxis.class)));
scrollingView.setFocusManager(new TableFocusManager(scrollingView));
@@ -52,18 +53,21 @@ public class InternalTableSpecification
// TODO remove
/*
- * @Override public View doCreateView(final View view, final Content content, final ViewAxis axis) { final
- * ScrollBorder scrollingView = new ScrollBorder(view); // note - the next call needs to be after the creation of
- * the window border // so that it exists when the header is set up scrollingView.setTopHeader(new
- * TableHeader(content)); scrollingView.setFocusManager(new TableFocusManager(scrollingView)); return scrollingView;
- * }
+ * @Override public View doCreateView(final View view, final Content
+ * content, final ViewAxis axis) { final ScrollBorder scrollingView = new
+ * ScrollBorder(view); // note - the next call needs to be after the
+ * creation of the window border // so that it exists when the header is set
+ * up scrollingView.setTopHeader(new TableHeader(content));
+ * scrollingView.setFocusManager(new TableFocusManager(scrollingView));
+ * return scrollingView; }
*
* protected View decorateView(View view) { super.decorateView(view);
*
- * final ScrollBorder scrollingView = new ScrollBorder(view); // note - the next call needs to be after the creation
- * of the window border // so that it exists when the header is set up scrollingView.setTopHeader(new
- * TableHeader(view.getContent())); scrollingView.setFocusManager(new TableFocusManager(scrollingView)); return
- * scrollingView; }
+ * final ScrollBorder scrollingView = new ScrollBorder(view); // note - the
+ * next call needs to be after the creation of the window border // so that
+ * it exists when the header is set up scrollingView.setTopHeader(new
+ * TableHeader(view.getContent())); scrollingView.setFocusManager(new
+ * TableFocusManager(scrollingView)); return scrollingView; }
*/
@Override
public String getName() {
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableAxis.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableAxis.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableAxis.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableAxis.java Sun Jan 22 08:05:17 2012
@@ -28,16 +28,17 @@ public interface TableAxis extends ViewA
void ensureOffset(final int offset);
/**
- * Returns the number of the column found at the specificied position, ignoring the columns two borders. Returns 0
- * for the first column, 1 for second column, etc.
+ * Returns the number of the column found at the specificied position,
+ * ignoring the columns two borders. Returns 0 for the first column, 1 for
+ * second column, etc.
*
* If over the column border then returns -1.
*/
int getColumnAt(final int xPosition);
/**
- * Returns 0 for left side of first column, 1 for right side of first column, 2 for right side of second column,
- * etc.
+ * Returns 0 for left side of first column, 1 for right side of first
+ * column, 2 for right side of second column, etc.
*
* If no column border is identified then returns -1.
*/
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableAxisImpl.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableAxisImpl.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableAxisImpl.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableAxisImpl.java Sun Jan 22 08:05:17 2012
@@ -39,10 +39,10 @@ public class TableAxisImpl implements Ta
private final int[] widths;
public TableAxisImpl(final CollectionContent content) {
- // TODO create axis first, then after view built set up the axis details?
+ // TODO create axis first, then after view built set up the axis
+ // details?
final ObjectSpecification elementSpecification = (content).getElementSpecification();
- final List<ObjectAssociation> accessibleFields =
- elementSpecification.getAssociations(ObjectAssociationFilters.STATICALLY_VISIBLE_ASSOCIATIONS);
+ final List<ObjectAssociation> accessibleFields = elementSpecification.getAssociations(ObjectAssociationFilters.STATICALLY_VISIBLE_ASSOCIATIONS);
this.columns = tableFields(accessibleFields, content);
widths = new int[columns.size()];
@@ -51,26 +51,29 @@ public class TableAxisImpl implements Ta
columnName[i] = columns.get(i).getName();
}
- // TODO make the setting of the column width strategy external so it can be changed
+ // TODO make the setting of the column width strategy external so it can
+ // be changed
setupColumnWidths(new TypeBasedColumnWidthStrategy());
}
/*
- * public TableAxis(final ObjectAssociation[] columns) { this.columns = columns; widths = new int[columns.length];
- * columnName = new String[columns.length]; for (int i = 0; i < widths.length; i++) { columnName[i] =
- * columns[i].getName(); } }
+ * public TableAxis(final ObjectAssociation[] columns) { this.columns =
+ * columns; widths = new int[columns.length]; columnName = new
+ * String[columns.length]; for (int i = 0; i < widths.length; i++) {
+ * columnName[i] = columns[i].getName(); } }
*/
- private List<ObjectAssociation> tableFields(final List<ObjectAssociation> viewFields,
- final CollectionContent content) {
+ private List<ObjectAssociation> tableFields(final List<ObjectAssociation> viewFields, final CollectionContent content) {
for (int i = 0; i < viewFields.size(); i++) {
// final ObjectAssociation objectAssociation = viewFields[i];
// TODO reinstate check to skip unsuitable types
/*
* if (viewFields[i].getSpecification().isOfType(
- * IsisContext.getSpecificationLoader().loadSpecification(ImageValue.class))) { continue; }
+ * IsisContext.getSpecificationLoader
+ * ().loadSpecification(ImageValue.class))) { continue; }
*/
- // if (!objectAssociation.isVisible(IsisContext.getAuthenticationSession(),
+ // if
+ // (!objectAssociation.isVisible(IsisContext.getAuthenticationSession(),
// content.getAdapter()).isAllowed()) {
// continue;
// }
@@ -94,8 +97,9 @@ public class TableAxisImpl implements Ta
}
/**
- * Returns the number of the column found at the specificied position, ignoring the columns two borders. Returns 0
- * for the first column, 1 for second column, etc.
+ * Returns the number of the column found at the specificied position,
+ * ignoring the columns two borders. Returns 0 for the first column, 1 for
+ * second column, etc.
*
* If over the column border then returns -1.
*/
@@ -116,8 +120,8 @@ public class TableAxisImpl implements Ta
}
/**
- * Returns 0 for left side of first column, 1 for right side of first column, 2 for right side of second column,
- * etc.
+ * Returns 0 for left side of first column, 1 for right side of first
+ * column, 2 for right side of second column, etc.
*
* If no column border is identified then returns -1.
*/
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableCellBuilder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableCellBuilder.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableCellBuilder.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableCellBuilder.java Sun Jan 22 08:05:17 2012
@@ -87,15 +87,13 @@ class TableCellBuilder extends AbstractV
final View subview = subviews[i];
final ObjectAdapter value = field.get(object);
- // if the field is parseable then it may have been modified; we need to replace what was
+ // if the field is parseable then it may have been modified; we need
+ // to replace what was
// typed in with the actual title.
if (field.getSpecification().isParseable()) {
- final boolean visiblityChange =
- !field.isVisible(IsisContext.getAuthenticationSession(), object).isAllowed()
- ^ (subview instanceof BlankView);
+ final boolean visiblityChange = !field.isVisible(IsisContext.getAuthenticationSession(), object).isAllowed() ^ (subview instanceof BlankView);
final ObjectAdapter adapter = subview.getContent().getAdapter();
- final boolean valueChange =
- value != null && value.getObject() != null && !value.getObject().equals(adapter.getObject());
+ final boolean valueChange = value != null && value.getObject() != null && !value.getObject().equals(adapter.getObject());
if (visiblityChange || valueChange) {
final View fieldView = createFieldView(view, axes, object, field, value);
@@ -137,8 +135,7 @@ class TableCellBuilder extends AbstractV
}
}
- private View createFieldView(final View view, final Axes axes, final ObjectAdapter object,
- final ObjectAssociation field, final ObjectAdapter value) {
+ private View createFieldView(final View view, final Axes axes, final ObjectAdapter object, final ObjectAssociation field, final ObjectAdapter value) {
if (field == null) {
throw new NullPointerException();
}
@@ -162,8 +159,9 @@ class TableCellBuilder extends AbstractV
}
if (((TextParseableContent) content).getNoLines() > 0) {
/*
- * TODO remove this after introducing constraints into view specs that allow the parent view to
- * specify what kind of subviews it can deal
+ * TODO remove this after introducing constraints into view
+ * specs that allow the parent view to specify what kind of
+ * subviews it can deal
*/
if (fieldSpecification.containsFacet(BooleanValueFacet.class)) {
@@ -179,8 +177,7 @@ class TableCellBuilder extends AbstractV
if (!field.isVisible(IsisContext.getAuthenticationSession(), object).isAllowed()) {
return new BlankView(content);
}
- return factory
- .createView(new ViewRequirement(content, ViewRequirement.CLOSED | ViewRequirement.SUBVIEW));
+ return factory.createView(new ViewRequirement(content, ViewRequirement.CLOSED | ViewRequirement.SUBVIEW));
}
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableHeader.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableHeader.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableHeader.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableHeader.java Sun Jan 22 08:05:17 2012
@@ -146,13 +146,13 @@ public class TableHeader extends Abstrac
canvas.drawLine(0, 0, 0, getSize().getHeight() - 1, secondary1);
canvas.drawLine(x, 0, x, getSize().getHeight() - 1, secondary1);
final Canvas headerCanvas = canvas.createSubcanvas(x, 0, axis.getColumnWidth(i) - 1, height);
- headerCanvas.drawText(axis.getColumnName(i), HPADDING, y, secondary1,
- Toolkit.getText(ColorsAndFonts.TEXT_LABEL));
+ headerCanvas.drawText(axis.getColumnName(i), HPADDING, y, secondary1, Toolkit.getText(ColorsAndFonts.TEXT_LABEL));
x += axis.getColumnWidth(i);
}
// Color secondary2 = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2);
// canvas.drawLine(x, 0, x, getSize().getHeight() - 1, secondary2);
- // canvas.drawRectangle(0, height, getSize().getWidth() - 1, getSize().getHeight() - height - 1, secondary2);
+ // canvas.drawRectangle(0, height, getSize().getWidth() - 1,
+ // getSize().getHeight() - height - 1, secondary2);
}
private void drawOrderIndicator(final Canvas canvas, final TableAxis axis, final int x) {
@@ -167,7 +167,8 @@ public class TableHeader extends Abstrac
arrow.addPoint(6, 0);
arrow.addPoint(3, 7);
}
- // canvas.drawRectangle(x + axis.getColumnWidth(i) - 10, 3, 7, 8, Toolkit.getColor("secondary3"));
+ // canvas.drawRectangle(x + axis.getColumnWidth(i) - 10, 3, 7, 8,
+ // Toolkit.getColor("secondary3"));
canvas.drawShape(arrow, x, 3, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2));
}
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableRowBorder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableRowBorder.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableRowBorder.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableRowBorder.java Sun Jan 22 08:05:17 2012
@@ -135,8 +135,7 @@ public class TableRowBorder extends Abst
if (getState().isObjectIdentified()) {
final int xExtent = width - 1;
canvas.drawLine(xExtent - BORDER, top, xExtent - BORDER, top + s.getHeight() - 1, secondary2);
- canvas.drawSolidRectangle(xExtent - BORDER + 1, top, BORDER - 2, s.getHeight() - 2 * top - 1,
- Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3));
+ canvas.drawSolidRectangle(xExtent - BORDER + 1, top, BORDER - 2, s.getHeight() - 2 * top - 1, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3));
}
// components
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableRowLayout.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableRowLayout.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableRowLayout.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TableRowLayout.java Sun Jan 22 08:05:17 2012
@@ -41,7 +41,13 @@ public class TableRowLayout implements L
for (int i = 0; i < cells.length; i++) {
totalWidth += axis.getColumnWidth(i);
- final Size s = cells[i].getRequiredSize(Size.createMax());// TODO Need to pass in a max size (is 0 at the
+ final Size s = cells[i].getRequiredSize(Size.createMax());// TODO
+ // Need to
+ // pass in
+ // a max
+ // size
+ // (is 0
+ // at the
// moment)
final int b = cells[i].getBaseline();
final int baselineOffset = Math.max(0, maxBaseline - b);
@@ -59,7 +65,11 @@ public class TableRowLayout implements L
int x = 0;
for (int i = 0; i < cells.length; i++) {
final View cell = cells[i];
- final Size s = cell.getRequiredSize(Size.createMax()); // TODO Need to pass in a max size (is 0 at the
+ final Size s = cell.getRequiredSize(Size.createMax()); // TODO Need
+ // to pass in
+ // a max size
+ // (is 0 at
+ // the
// moment)
s.setWidth(axis.getColumnWidth(i));
cell.setSize(s);
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TypeBasedColumnWidthStrategy.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TypeBasedColumnWidthStrategy.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TypeBasedColumnWidthStrategy.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/TypeBasedColumnWidthStrategy.java Sun Jan 22 08:05:17 2012
@@ -30,8 +30,10 @@ public class TypeBasedColumnWidthStrateg
public TypeBasedColumnWidthStrategy() {
/*
* ObjectSpecificationLoader loader = Isis.getSpecificationLoader();
- * addWidth(loader.loadSpecification(Logical.class), 25); addWidth(loader.loadSpecification(Date.class), 65);
- * addWidth(loader.loadSpecification(Time.class), 38); addWidth(loader.loadSpecification(DateTime.class), 100);
+ * addWidth(loader.loadSpecification(Logical.class), 25);
+ * addWidth(loader.loadSpecification(Date.class), 65);
+ * addWidth(loader.loadSpecification(Time.class), 38);
+ * addWidth(loader.loadSpecification(DateTime.class), 100);
* addWidth(loader.loadSpecification(TextString.class), 80);
*/
}
@@ -57,7 +59,7 @@ public class TypeBasedColumnWidthStrateg
if (type == null) {
return 200;
}
- final Integer t = (Integer) types.get(type);
+ final Integer t = types.get(type);
if (t != null) {
return t.intValue();
} else if (type.isNotCollection()) {
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/WindowTableSpecification.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/WindowTableSpecification.java?rev=1234460&r1=1234459&r2=1234460&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/WindowTableSpecification.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/table/WindowTableSpecification.java Sun Jan 22 08:05:17 2012
@@ -32,7 +32,8 @@ public class WindowTableSpecification ex
public View decorate(final View view, final Axes axes) {
final ScrollBorder scrollingView = new ScrollBorder(view);
final View viewWithWindowBorder = scrollingView;
- // note - the next call needs to be after the creation of the window border so
+ // note - the next call needs to be after the creation of the
+ // window border so
// that it exists when the header is set up
scrollingView.setTopHeader(new TableHeader(view.getContent(), axes.getAxis(TableAxis.class)));
viewWithWindowBorder.setFocusManager(new TableFocusManager(viewWithWindowBorder));
@@ -43,20 +44,25 @@ public class WindowTableSpecification ex
}
/*
- * @Override public View doCreateView(final View view, final Content content, final ViewAxis axis) { if (true)
- * return view;
+ * @Override public View doCreateView(final View view, final Content
+ * content, final ViewAxis axis) { if (true) return view;
*
- * final ScrollBorder scrollingView = new ScrollBorder(view); View viewWithWindowBorder = scrollingView; // note -
- * the next call needs to be after the creation of the window border so // that it exists when the header is set up
- * scrollingView.setTopHeader(new TableHeader(content, view.getViewAxisForChildren()));
- * viewWithWindowBorder.setFocusManager(new TableFocusManager(viewWithWindowBorder)); return viewWithWindowBorder; }
+ * final ScrollBorder scrollingView = new ScrollBorder(view); View
+ * viewWithWindowBorder = scrollingView; // note - the next call needs to be
+ * after the creation of the window border so // that it exists when the
+ * header is set up scrollingView.setTopHeader(new TableHeader(content,
+ * view.getViewAxisForChildren())); viewWithWindowBorder.setFocusManager(new
+ * TableFocusManager(viewWithWindowBorder)); return viewWithWindowBorder; }
*
* protected View decorateView(View view) { super.decorateView(view);
*
- * final ScrollBorder scrollingView = new ScrollBorder(view); View viewWithWindowBorder = scrollingView; // note -
- * the next call needs to be after the creation of the window border so // that it exists when the header is set up
- * scrollingView.setTopHeader(new TableHeader(view.getContent(), view.getViewAxisForChildren()));
- * viewWithWindowBorder.setFocusManager(new TableFocusManager(viewWithWindowBorder)); return viewWithWindowBorder; }
+ * final ScrollBorder scrollingView = new ScrollBorder(view); View
+ * viewWithWindowBorder = scrollingView; // note - the next call needs to be
+ * after the creation of the window border so // that it exists when the
+ * header is set up scrollingView.setTopHeader(new
+ * TableHeader(view.getContent(), view.getViewAxisForChildren()));
+ * viewWithWindowBorder.setFocusManager(new
+ * TableFocusManager(viewWithWindowBorder)); return viewWithWindowBorder; }
*/
@Override
public String getName() {