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 2016/05/21 07:10:24 UTC
[23/56] [abbrv] [partial] isis git commit: ISIS-1335: deleting the
mothballed directory.
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/Panel.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/Panel.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/Panel.java
deleted file mode 100644
index d18ce22..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/Panel.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.dnd.configurable;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.isis.core.commons.debug.DebugBuilder;
-import org.apache.isis.viewer.dnd.drawing.Location;
-import org.apache.isis.viewer.dnd.drawing.Size;
-import org.apache.isis.viewer.dnd.view.View;
-
-public class Panel {
-
- private static enum Orientation {
- Undefined, Horizontal, Vertical
- };
-
- private static interface Content {
- public Size getRequiredSize(Size availableSpace);
-
- public void setLocation(Location location);
-
- public void setSize(Size size);
-
- public void layout(Size maximumSize);
-
- public void debug(DebugBuilder debug);
- }
-
- private static class ViewContent implements Content {
- private final View view;
-
- public ViewContent(final View view) {
- this.view = view;
- }
-
- @Override
- public Size getRequiredSize(final Size availableSpace) {
- return view.getRequiredSize(availableSpace);
- }
-
- @Override
- public void layout(final Size maximumSize) {
- view.layout();
- }
-
- @Override
- public void setLocation(final Location location) {
- view.setLocation(location);
- }
-
- @Override
- public void setSize(final Size size) {
- view.setSize(size);
- }
-
- @Override
- public void debug(final DebugBuilder debug) {
- debug.appendln(view.toString());
- }
- }
-
- private static class PanelContent implements Content {
- private final Panel panel;
- private Location location;
-
- public PanelContent(final Panel panel) {
- this.panel = panel;
- }
-
- @Override
- public Size getRequiredSize(final Size availableSpace) {
- return panel.getRequiredSize(availableSpace);
- }
-
- @Override
- public void layout(final Size maximumSize) {
- panel.layout(location, maximumSize);
- }
-
- @Override
- public void setLocation(final Location location) {
- this.location = location;
- }
-
- @Override
- public void setSize(final Size size) {
- }
-
- @Override
- public void debug(final DebugBuilder debug) {
- panel.debug(debug);
- }
- }
-
- private List<Content> contents = new ArrayList<Content>();
- private Orientation orientation;
-
- public void debug(final DebugBuilder debug) {
- debug.appendln("orientation", orientation);
- debug.appendln("size", getRequiredSize(Size.createMax()));
- debug.indent();
- for (final Content content : contents) {
- content.debug(debug);
- }
- debug.unindent();
- }
-
- public void addView(final View view, final PanelView.Position position) {
- if (contents.isEmpty() || position == null) {
- addToContents(view, false);
- } else if (position == PanelView.Position.East || position == PanelView.Position.West) {
- if (orientation == Orientation.Undefined) {
- orientation = Orientation.Horizontal;
- }
- if (orientation == Orientation.Horizontal) {
- addToContents(view, position == PanelView.Position.West);
- } else {
- replaceViewsWithPanel(view, position == PanelView.Position.West);
- }
- } else if (position == PanelView.Position.South || position == PanelView.Position.North) {
- if (orientation == Orientation.Undefined) {
- orientation = Orientation.Vertical;
- }
- if (orientation == Orientation.Horizontal) {
- replaceViewsWithPanel(view, position == PanelView.Position.North);
- } else {
- addToContents(view, position == PanelView.Position.North);
- }
- }
- }
-
- private void addToContents(final View view, final boolean atBeginning) {
- if (atBeginning) {
- contents.add(0, new ViewContent(view));
- } else {
- contents.add(new ViewContent(view));
- }
- }
-
- private void replaceViewsWithPanel(final View view, final boolean atBeginning) {
- final Panel panel = new Panel();
- panel.contents = contents;
- contents = new ArrayList<Content>();
- contents.add(new PanelContent(panel));
- addToContents(view, atBeginning);
- panel.orientation = orientation;
- orientation = orientation == Orientation.Horizontal ? Orientation.Vertical : Orientation.Horizontal;
- }
-
- public void layout(final Size maximumSize) {
- final Location location = new Location();
- layout(location, maximumSize);
- }
-
- private void layout(final Location location, final Size maximumSize) {
- for (final Content content : contents) {
- content.setLocation(new Location(location));
- final Size requiredSize = content.getRequiredSize(maximumSize);
- content.setSize(requiredSize);
- content.layout(maximumSize);
- if (orientation == Orientation.Horizontal) {
- location.add(requiredSize.getWidth(), 0);
- } else {
- location.add(0, requiredSize.getHeight());
- }
- }
- }
-
- public Size getRequiredSize(final Size availableSpace) {
- final Size size = new Size();
- for (final Content content : contents) {
- final Size requiredSize = content.getRequiredSize(availableSpace);
- if (orientation == Orientation.Horizontal) {
- size.extendWidth(requiredSize.getWidth());
- size.ensureHeight(requiredSize.getHeight());
- } else {
- size.extendHeight(requiredSize.getHeight());
- size.ensureWidth(requiredSize.getWidth());
- }
- }
- return size;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/PanelView.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/PanelView.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/PanelView.java
deleted file mode 100644
index 60d5de8..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/PanelView.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.dnd.configurable;
-
-import org.apache.isis.core.commons.debug.DebugBuilder;
-import org.apache.isis.viewer.dnd.drawing.Location;
-import org.apache.isis.viewer.dnd.drawing.Size;
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.Toolkit;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.ViewDrag;
-import org.apache.isis.viewer.dnd.view.ViewRequirement;
-import org.apache.isis.viewer.dnd.view.ViewSpecification;
-import org.apache.isis.viewer.dnd.view.composite.CompositeView;
-
-public class PanelView extends CompositeView {
- public static enum Position {
- North, South, East, West
- };
-
- private final Panel panel = new Panel();
- private ViewSpecification initialViewSpecification;;
-
- @Override
- public void debug(final DebugBuilder debug) {
- super.debug(debug);
- debug.appendln("Panel");
- debug.indent();
- panel.debug(debug);
- debug.unindent();
- }
-
- public void setInitialViewSpecification(final ViewSpecification initialViewSpecification) {
- this.initialViewSpecification = initialViewSpecification;
- }
-
- public PanelView(final Content content, final ViewSpecification specification) {
- super(content, specification);
- }
-
- @Override
- protected void buildView() {
- // addView(getContent(), initialViewSpecification, null);
- final View newView = initialViewSpecification.createView(getContent(), new Axes(), 0);
- panel.addView(newView, null);
- addView(newView);
- }
-
- @Override
- protected void doLayout(final Size maximumSize) {
- panel.layout(maximumSize);
- }
-
- @Override
- public Size requiredSize(final Size availableSpace) {
- return panel.getRequiredSize(availableSpace);
- }
-
- @Override
- public void drop(final ViewDrag drag) {
- if (drag.getSourceView() == getView() || !contains(drag.getSourceView())) {
- super.drop(drag);
- } else {
- final Location dropAt = drag.getLocation();
- dropAt.subtract(getLocation());
- final int x = dropAt.getX();
- final int y = dropAt.getY();
- final int borderWdth = 45;
- final int left = getSize().getWidth() - borderWdth;
- final int bottom = getSize().getHeight() - borderWdth;
- if (y < borderWdth) {
- addView(drag.getSourceView().getContent(), Position.North);
- } else if (y > bottom) {
- addView(drag.getSourceView().getContent(), Position.South);
- } else if (x < borderWdth) {
- addView(drag.getSourceView().getContent(), Position.West);
- } else if (x > left) {
- addView(drag.getSourceView().getContent(), Position.East);
- }
- }
- }
-
- public void addView(final Content content, final Position position) {
- final ViewRequirement requirement = new ViewRequirement(content, ViewRequirement.OPEN | ViewRequirement.SUBVIEW);
- final ViewSpecification viewSpecification = Toolkit.getViewFactory().availableViews(requirement).nextElement();
- addView(content, viewSpecification, position);
- }
-
- public void addView(final Content content, final ViewSpecification specification, final Position position) {
- final View newView = specification.createView(content, new Axes(), 0);
- // newView = new LineBorder(newView);
- panel.addView(newView, position);
- addView(newView);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/PanelViewSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/PanelViewSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/PanelViewSpecification.java
deleted file mode 100644
index 8ef3d32..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/PanelViewSpecification.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.dnd.configurable;
-
-import org.apache.isis.viewer.dnd.drawing.ColorsAndFonts;
-import org.apache.isis.viewer.dnd.form.InternalFormSpecification;
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.Toolkit;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.ViewRequirement;
-import org.apache.isis.viewer.dnd.view.ViewSpecification;
-import org.apache.isis.viewer.dnd.view.border.IconBorder;
-
-public class PanelViewSpecification implements ViewSpecification {
-
- @Override
- public boolean canDisplay(final ViewRequirement requirement) {
- return requirement.isObject() && requirement.isOpen() && requirement.isExpandable() && requirement.isDesign();
- }
-
- @Override
- public String getName() {
- return "Panel (experimental)";
- }
-
- @Override
- public boolean isAligned() {
- return false;
- }
-
- @Override
- public boolean isOpen() {
- return true;
- }
-
- @Override
- public boolean isReplaceable() {
- return false;
- }
-
- @Override
- public boolean isResizeable() {
- return false;
- }
-
- @Override
- public boolean isSubView() {
- return false;
- }
-
- @Override
- public View createView(final Content content, final Axes axes, final int sequence) {
- final PanelView wrappedView = new PanelView(content, this);
- wrappedView.setInitialViewSpecification(new InternalFormSpecification());
- final View newView = new IconBorder(wrappedView, Toolkit.getText(ColorsAndFonts.TEXT_TITLE));
- return newView;
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ViewDesignBorder.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ViewDesignBorder.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ViewDesignBorder.java
deleted file mode 100644
index dc118fa..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ViewDesignBorder.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.dnd.configurable;
-
-import java.util.List;
-
-import org.apache.isis.core.metamodel.spec.feature.Contributed;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
-import org.apache.isis.viewer.dnd.drawing.Location;
-import org.apache.isis.viewer.dnd.view.UserActionSet;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.Workspace;
-import org.apache.isis.viewer.dnd.view.base.AbstractBorder;
-import org.apache.isis.viewer.dnd.view.option.UserActionAbstract;
-
-public class ViewDesignBorder extends AbstractBorder {
- private final NewObjectView viewUnderControl;
-
- protected ViewDesignBorder(final View view, final NewObjectView view2) {
- super(view);
- viewUnderControl = view2;
- }
-
- private NewObjectView getNewObjectView() {
- return viewUnderControl;
- }
-
- @Override
- public void viewMenuOptions(final UserActionSet menuOptions) {
- super.viewMenuOptions(menuOptions);
-
- // ObjectAdapter object = getContent().getAdapter();
- final List<ObjectAssociation> associations = getContent().getSpecification().getAssociations(Contributed.EXCLUDED);
-
- for (final ObjectAssociation objectAssociation : associations) {
- final ObjectAssociation f = objectAssociation;
- final UserActionAbstract action = new UserActionAbstract("Add field " + objectAssociation.getName()) {
-
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- final NewObjectField field = new NewObjectField(f);
- getNewObjectView().addField(field);
- }
- };
- menuOptions.add(action);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/dialog/ActionDialogFocusManager.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/dialog/ActionDialogFocusManager.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/dialog/ActionDialogFocusManager.java
deleted file mode 100644
index 19f425a..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/dialog/ActionDialogFocusManager.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.dnd.dialog;
-
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.base.AbstractFocusManager;
-import org.apache.isis.viewer.dnd.view.border.ButtonBorder;
-
-public class ActionDialogFocusManager extends AbstractFocusManager {
- private final ButtonBorder buttonBorder;
-
- public ActionDialogFocusManager(final ButtonBorder buttonBorder) {
- super(buttonBorder.getView());
- this.buttonBorder = buttonBorder;
-
- }
-
- @Override
- protected View[] getChildViews() {
- final View[] subviews = container.getSubviews();
- final View[] buttons = buttonBorder.getButtons();
-
- final View[] views = new View[subviews.length + buttons.length];
- System.arraycopy(subviews, 0, views, 0, subviews.length);
- System.arraycopy(buttons, 0, views, subviews.length, buttons.length);
- return views;
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/dialog/ActionDialogSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/dialog/ActionDialogSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/dialog/ActionDialogSpecification.java
deleted file mode 100644
index c1be3ff..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/dialog/ActionDialogSpecification.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.dnd.dialog;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.consent.Consent;
-import org.apache.isis.core.metamodel.consent.Veto;
-import org.apache.isis.viewer.dnd.drawing.ColorsAndFonts;
-import org.apache.isis.viewer.dnd.drawing.Location;
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.BackgroundTask;
-import org.apache.isis.viewer.dnd.view.ButtonAction;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.GlobalViewFactory;
-import org.apache.isis.viewer.dnd.view.Placement;
-import org.apache.isis.viewer.dnd.view.Toolkit;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.ViewFactory;
-import org.apache.isis.viewer.dnd.view.ViewRequirement;
-import org.apache.isis.viewer.dnd.view.Workspace;
-import org.apache.isis.viewer.dnd.view.action.ActionContent;
-import org.apache.isis.viewer.dnd.view.action.BackgroundWork;
-import org.apache.isis.viewer.dnd.view.action.ObjectParameter;
-import org.apache.isis.viewer.dnd.view.action.ParameterContent;
-import org.apache.isis.viewer.dnd.view.action.TextParseableParameter;
-import org.apache.isis.viewer.dnd.view.base.Layout;
-import org.apache.isis.viewer.dnd.view.border.ButtonBorder;
-import org.apache.isis.viewer.dnd.view.border.IconBorder;
-import org.apache.isis.viewer.dnd.view.composite.CompositeViewDecorator;
-import org.apache.isis.viewer.dnd.view.composite.CompositeViewSpecification;
-import org.apache.isis.viewer.dnd.view.composite.StackLayout;
-import org.apache.isis.viewer.dnd.view.control.AbstractButtonAction;
-import org.apache.isis.viewer.dnd.view.control.CancelAction;
-
-public class ActionDialogSpecification extends CompositeViewSpecification {
- private static final Logger LOG = LoggerFactory.getLogger(ActionDialogSpecification.class);
-
- private static class DialogFormSubviews implements ViewFactory {
-
- @Override
- public View createView(final Content content, final Axes axes, final int fieldNumber) {
- if (content instanceof TextParseableParameter) {
- final GlobalViewFactory factory = Toolkit.getViewFactory();
- return factory.createView(new ViewRequirement(content, ViewRequirement.CLOSED | ViewRequirement.SUBVIEW));
- } else if (content instanceof ObjectParameter) {
- final GlobalViewFactory factory = Toolkit.getViewFactory();
- return factory.createView(new ViewRequirement(content, ViewRequirement.CLOSED | ViewRequirement.SUBVIEW));
- }
-
- return null;
- }
- }
-
- private static class ExecuteAction extends AbstractButtonAction {
- public ExecuteAction() {
- this("Apply");
- }
-
- public ExecuteAction(final String name) {
- super(name, true);
- }
-
- @Override
- public Consent disabled(final View view) {
- final View[] subviews = view.getSubviews();
- final StringBuffer missingFields = new StringBuffer();
- final StringBuffer invalidFields = new StringBuffer();
- for (final View field : subviews) {
- final ParameterContent content = ((ParameterContent) field.getContent());
- final boolean isEmpty = content.getAdapter() == null;
- if (content.isRequired() && isEmpty) {
- final String parameterName = content.getParameterName();
- if (missingFields.length() > 0) {
- missingFields.append(", ");
- }
- missingFields.append(parameterName);
-
- } else if (field.getState().isInvalid()) {
- final String parameterName = content.getParameterName();
- if (invalidFields.length() > 0) {
- invalidFields.append(", ");
- }
- invalidFields.append(parameterName);
- }
- }
- if (missingFields.length() > 0) {
- // TODO: move logic into Facet
- return new Veto(String.format("Fields needed: %s", missingFields));
- }
- if (invalidFields.length() > 0) {
- // TODO: move logic into Facet
- return new Veto(String.format("Invalid fields: %s", invalidFields));
- }
-
- final ActionContent actionContent = ((ActionContent) view.getContent());
- return actionContent.disabled();
- }
-
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- final BackgroundTask task = new BackgroundTask() {
- @Override
- public void execute() {
- final ActionContent actionContent = ((ActionContent) view.getContent());
- final ObjectAdapter result = actionContent.execute();
- LOG.debug("action invoked with result " + result);
- if (result != null) {
- view.objectActionResult(result, new Placement(view.getAbsoluteLocation()));
- }
- view.getViewManager().disposeUnneededViews();
- view.getFeedbackManager().showMessagesAndWarnings();
- }
-
- @Override
- public String getName() {
- return ((ActionContent) view.getContent()).getActionName();
- }
-
- @Override
- public String getDescription() {
- return "Running action " + getName() + " on " + view.getContent().getAdapter();
- }
- };
- LOG.debug(" ... created task " + task);
-
- BackgroundWork.runTaskInBackground(view, task);
- }
-
- protected void move(final Location at) {
- at.move(30, 60);
- }
- }
-
- private static class ExecuteAndCloseAction extends ExecuteAction {
- public ExecuteAndCloseAction() {
- super("OK");
- }
-
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- LOG.debug("executing action " + this);
- view.dispose();
- LOG.debug(" ... disposed view, now executing");
- super.execute(workspace, view, at);
- view.getViewManager().setKeyboardFocus(workspace);
- // view.getViewManager().clearKeyboardFocus();
- }
-
- @Override
- protected void move(final Location at) {
- }
- }
-
- public ActionDialogSpecification() {
- builder = new ActionFieldBuilder(new DialogFormSubviews());
- addSubviewDecorator(new ParametersLabelDecorator());
- addViewDecorator(new CompositeViewDecorator() {
- @Override
- public View decorate(final View view, final Axes axes) {
- // TODO reintroduce the 'Apply' notion, but under control from
- // the method declaration
- final ButtonAction[] actions = new ButtonAction[] { new ExecuteAndCloseAction(), new CancelAction() };
- final ButtonBorder buttonBorder = new ButtonBorder(actions, new IconBorder(view, Toolkit.getText(ColorsAndFonts.TEXT_TITLE_SMALL)));
- buttonBorder.setFocusManager(new ActionDialogFocusManager(buttonBorder));
- return buttonBorder;
- }
- });
- }
-
- @Override
- public Layout createLayout(final Content content, final Axes axes) {
- return new StackLayout();
- }
-
- @Override
- public boolean canDisplay(final ViewRequirement requirement) {
- return requirement.getContent() instanceof ActionContent;
- }
-
- @Override
- public String getName() {
- return "Action Dialog";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/dialog/ActionFieldBuilder.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/dialog/ActionFieldBuilder.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/dialog/ActionFieldBuilder.java
deleted file mode 100644
index 15fa6a8..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/dialog/ActionFieldBuilder.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.dnd.dialog;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.core.commons.ensure.Assert;
-import org.apache.isis.core.commons.exceptions.IsisException;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.ViewFactory;
-import org.apache.isis.viewer.dnd.view.action.ActionContent;
-import org.apache.isis.viewer.dnd.view.action.ObjectParameter;
-import org.apache.isis.viewer.dnd.view.action.ObjectParameterImpl;
-import org.apache.isis.viewer.dnd.view.action.ParameterContent;
-import org.apache.isis.viewer.dnd.view.action.TextParseableParameter;
-import org.apache.isis.viewer.dnd.view.composite.AbstractViewBuilder;
-
-public class ActionFieldBuilder extends AbstractViewBuilder {
- private static final Logger LOG = LoggerFactory.getLogger(ActionFieldBuilder.class);
- private final ViewFactory subviewDesign;
-
- public ActionFieldBuilder(final ViewFactory subviewDesign) {
- this.subviewDesign = subviewDesign;
- }
-
- @Override
- public void build(final View view, final Axes axes) {
- Assert.assertEquals(view.getView(), view);
-
- final ActionContent actionContent = ((ActionContent) view.getContent());
- if (view.getSubviews().length == 0) {
- initialBuild(view, actionContent);
- } else {
- updateBuild(view, actionContent);
- }
-
- }
-
- private View createFieldView(final View view, final ParameterContent parameter, final int sequence) {
- final View fieldView = subviewDesign.createView(parameter, null, sequence);
- if (fieldView == null) {
- throw new IsisException("All parameters must be shown");
- }
- return fieldView;
- }
-
- private void initialBuild(final View view, final ActionContent actionContent) {
- LOG.debug("build new view " + view + " for " + actionContent);
- final int noParameters = actionContent.getNoParameters();
- View focusOn = null;
- for (int f = 0; f < noParameters; f++) {
- final ParameterContent parameter = actionContent.getParameterContent(f);
- final View fieldView = createFieldView(view, parameter, f);
- final View decoratedSubview = decorateSubview(view.getViewAxes(), fieldView);
- view.addView(decoratedSubview);
-
- // set focus to first value field
- if (focusOn == null && parameter instanceof TextParseableParameter && fieldView.canFocus()) {
- focusOn = decoratedSubview;
- }
- }
-
- if (focusOn != null) {
- view.getViewManager().setKeyboardFocus(focusOn);
- }
- }
-
- private void updateBuild(final View view, final ActionContent actionContent) {
- LOG.debug("rebuild view " + view + " for " + actionContent);
- final View[] subviews = view.getSubviews();
-
- for (int i = 0; i < subviews.length; i++) {
- final View subview = subviews[i];
- final Content content = subview.getContent();
-
- final ObjectAdapter subviewsObject = subview.getContent().getAdapter();
- final ObjectAdapter invocationsObject = ((ActionContent) view.getContent()).getParameterObject(i);
-
- if (content instanceof ObjectParameter) {
- if (subviewsObject != invocationsObject) {
- final ObjectParameter parameter = new ObjectParameterImpl((ObjectParameterImpl) content, invocationsObject);
- final View fieldView = createFieldView(view, parameter, i);
- view.replaceView(subview, decorateSubview(view.getViewAxes(), fieldView));
- }
- } else {
- subview.refresh();
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/dialog/ParametersLabelDecorator.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/dialog/ParametersLabelDecorator.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/dialog/ParametersLabelDecorator.java
deleted file mode 100644
index f61b886..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/dialog/ParametersLabelDecorator.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.dnd.dialog;
-
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.SubviewDecorator;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.ViewAxis;
-import org.apache.isis.viewer.dnd.view.axis.LabelAxis;
-import org.apache.isis.viewer.dnd.view.border.DroppableLabelBorder;
-import org.apache.isis.viewer.dnd.view.border.LabelBorder;
-
-public class ParametersLabelDecorator implements SubviewDecorator {
-
- @Override
- public ViewAxis createAxis(final Content content) {
- return new LabelAxis();
- }
-
- @Override
- public View decorate(final Axes axes, final View view) {
- final LabelAxis axis = axes.getAxis(LabelAxis.class);
- if (view.getContent().isObject() && !view.getContent().isTextParseable()) {
- return DroppableLabelBorder.createObjectParameterLabelBorder(axis, view);
- } else {
- return LabelBorder.createValueParameterLabelBorder(axis, view);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Background.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Background.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Background.java
deleted file mode 100644
index 5cc9037..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Background.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.dnd.drawing;
-
-/**
- * A strategy for rendering the background of the application window.
- */
-public interface Background {
- void draw(Canvas canvas, Size size);
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Bounds.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Bounds.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Bounds.java
deleted file mode 100644
index 2ef1530..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Bounds.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.dnd.drawing;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Bounds represent a rectangular area on the screen. The top-left corner is
- * represented by the location (available using getLocation(), and getX() and
- * getY()). The extent of the bounds is specified by its height and width
- * (available using getHeight() and getWidth()). The bottom-right point is the
- * offset from the top-left point by width -1 and hieght - 1 pixels.
- *
- * For example a bounds created as follows
- *
- * new Bounds(5, 10, 10, 20)
- *
- * Would represent a rectangle at location (5, 10), with a width of 10 pixels
- * and a height of 20. Note, hower that the lower-right corner would be at (14,
- * 29), as there are 10 pixels between pixel 5 and pixel 14, and 20 between 10
- * and 29.
- */
-public class Bounds {
- Logger LOG = LoggerFactory.getLogger("Bounds");
- int x;
- int y;
- int height;
- int width;
-
- public Bounds() {
- x = 0;
- y = 0;
- width = 0;
- height = 0;
- }
-
- public Bounds(final Bounds bounds) {
- this(bounds.x, bounds.y, bounds.width, bounds.height);
- }
-
- public Bounds(final int x, final int y, final int width, final int height) {
- super();
- this.x = x;
- this.y = y;
- this.width = width;
- this.height = height;
- }
-
- public Bounds(final Location location, final Size size) {
- this(location.x, location.y, size.width, size.height);
- }
-
- public Bounds(final Size size) {
- this(0, 0, size.width, size.height);
- }
-
- public boolean contains(final Location location) {
- final int xp = location.getX();
- final int yp = location.getY();
- final int xMax = x + width - 1;
- final int yMax = y + height - 1;
-
- return xp >= x && xp <= xMax && yp >= y && yp <= yMax;
- }
-
- public void contract(final int width, final int height) {
- this.width -= width;
- this.height -= height;
- }
-
- public void contract(final Padding padding) {
- height -= padding.top + padding.bottom;
- width -= padding.left + padding.right;
- x += padding.left;
- y += padding.top;
- }
-
- public void contract(final Size size) {
- this.width -= size.width;
- this.height -= size.height;
- }
-
- public void contractHeight(final int height) {
- this.height -= height;
- }
-
- public void contractWidth(final int width) {
- this.width -= width;
- }
-
- public void ensureHeight(final int height) {
- this.height = Math.max(this.height, height);
- }
-
- public void ensureWidth(final int width) {
- this.width = Math.max(this.width, width);
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (obj == this) {
- return true;
- }
-
- if (obj instanceof Bounds) {
- final Bounds b = (Bounds) obj;
-
- return b.x == x && b.y == y && b.width == width && b.height == height;
- }
-
- return false;
- }
-
- public void extend(final int width, final int height) {
- this.width += width;
- this.height += height;
- }
-
- public void extend(final Padding padding) {
- this.width += padding.getLeftRight();
- this.height += padding.getTopBottom();
- }
-
- public void extend(final Size size) {
- this.width += size.width;
- this.height += size.height;
- }
-
- public void extendHeight(final int height) {
- this.height += height;
- }
-
- public void extendWidth(final int width) {
- this.width += width;
- }
-
- public int getHeight() {
- return height;
- }
-
- public Location getLocation() {
- return new Location(x, y);
- }
-
- public Size getSize() {
- return new Size(width, height);
- }
-
- public int getWidth() {
- return width;
- }
-
- public int getX() {
- return x;
- }
-
- public int getX2() {
- return x + width - 1;
- }
-
- public int getY() {
- return y;
- }
-
- public int getY2() {
- return y + height - 1;
- }
-
- /**
- * Determines whether this bounds overlaps the specified bounds. If any area
- * is shared by the two bounds then this will return true. As the edges of
- * the bounds are of a finite size the bounds overlap if any of the edges
- * overlap.
- */
- public boolean intersects(final Bounds bounds) {
- final int tx1 = this.x;
- final int tx2 = this.x + this.width - 1;
- final int ox1 = bounds.x;
- final int ox2 = bounds.x + bounds.width - 1;
-
- // tx1 < ox1 < tx2 || tx1 < ox2 < tx2
- final boolean xOverlap = (tx1 <= ox1 && ox1 <= tx2) || (tx1 <= ox2 && ox1 <= tx2) || (ox1 <= tx1 && tx1 <= ox2) || (ox1 <= tx2 && tx1 <= ox2);
-
- final int ty1 = this.y;
- final int ty2 = this.y + this.height - 1;
- final int oy1 = bounds.y;
- final int oy2 = bounds.y + bounds.height - 1;
- final boolean yOverlap = (ty1 <= oy1 && oy1 <= ty2) || (ty1 <= oy2 && oy1 <= ty2) || (oy1 <= ty1 && ty1 <= oy2) || (oy1 <= ty2 && ty1 <= oy2);
- return xOverlap && yOverlap;
-
- }
-
- public void limitLocation(final Size bounds) {
- if (x + width > bounds.width) {
- x = bounds.width - width;
- }
- if (y + height > bounds.height) {
- y = bounds.height - height;
- }
- }
-
- /**
- * Limits the specified bounds so that it fits within this bounds.
- */
- public boolean limitBounds(final Bounds toLimit) {
- boolean limited = false;
- final Location location = toLimit.getLocation();
- final Size size = toLimit.getSize();
-
- int viewLeft = location.getX();
- int viewTop = location.getY();
- int viewRight = viewLeft + size.getWidth();
- int viewBottom = viewTop + size.getHeight();
-
- final Size wd = getSize();
-
- final int limitLeft = x;
- final int limitTop = y;
- final int limitRight = x + width;
- final int limitBottom = y + height;
-
- if (viewRight > limitRight) {
- viewLeft = limitRight - size.getWidth();
- limited = true;
- LOG.info("right side oustide limits, moving left to " + viewLeft);
- }
-
- if (viewLeft < limitLeft) {
- viewLeft = limitLeft;
- limited = true;
- LOG.info("left side outside limit, moving left to " + viewLeft);
- }
-
- if (viewBottom > limitBottom) {
- viewTop = limitBottom - size.getHeight();
- limited = true;
- LOG.info("bottom outside limit, moving top to " + viewTop);
- }
-
- if (viewTop < limitTop) {
- viewTop = limitTop;
- limited = true;
- LOG.info("top outside limit, moving top to " + viewTop);
- }
-
- toLimit.setX(viewLeft);
- toLimit.setY(viewTop);
-
- viewBottom = viewTop + size.getHeight();
- viewRight = viewLeft + size.getWidth();
-
- if (viewRight > limitRight) {
- toLimit.width = wd.width;
- limited = true;
- LOG.info("width outside limit, reducing width to " + viewTop);
- }
-
- if (viewBottom > limitBottom) {
- toLimit.height = wd.height;
- limited = true;
- LOG.info("height outside limit, reducing height to " + viewTop);
- }
-
- if (limited) {
- LOG.info("limited " + toLimit);
- }
- return limited;
- }
-
- public void setBounds(final Bounds bounds) {
- x = bounds.x;
- y = bounds.y;
- width = bounds.width;
- height = bounds.height;
-
- }
-
- public void setHeight(final int height) {
- this.height = height;
- }
-
- public void setWidth(final int width) {
- this.width = width;
- }
-
- public void setX(final int x) {
- this.x = x;
- }
-
- public void setY(final int y) {
- this.y = y;
- }
-
- @Override
- public String toString() {
- return x + "," + y + " " + width + "x" + height;
- }
-
- public void translate(final int x, final int y) {
- this.x += x;
- this.y += y;
- }
-
- public void union(final Bounds bounds) {
- final int newX = Math.min(x, bounds.x);
- final int newY = Math.min(y, bounds.y);
- width = Math.max(x + width, bounds.x + bounds.width) - newX;
- height = Math.max(y + height, bounds.y + bounds.height) - newY;
- x = newX;
- y = newY;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Canvas.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Canvas.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Canvas.java
deleted file mode 100644
index 4271de1..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Canvas.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.dnd.drawing;
-
-public interface Canvas {
- Canvas createSubcanvas();
-
- Canvas createSubcanvas(Bounds bounds);
-
- Canvas createSubcanvas(int x, int y, int width, int height);
-
- void draw3DRectangle(int x, int y, int width, int height, Color color, boolean raised);
-
- void drawDebugOutline(Bounds bounds, int baseline, Color color);
-
- void drawImage(Image image, int x, int y);
-
- void drawImage(Image image, int x, int y, int width, int height);
-
- void drawLine(int x, int y, int x2, int y2, Color color);
-
- void drawLine(Location start, int xExtent, int yExtent, Color color);
-
- void drawOval(int x, int y, int width, int height, Color color);
-
- void drawRectangle(int x, int y, int width, int height, Color color);
-
- void drawRectangleAround(Bounds bounds, Color color);
-
- void drawRoundedRectangle(int x, int y, int width, int height, int arcWidth, int arcHeight, Color color);
-
- void drawShape(Shape shape, Color color);
-
- void drawShape(Shape shape, int x, int y, Color color);
-
- void drawSolidOval(int x, int y, int width, int height, Color color);
-
- void drawSolidRectangle(int x, int y, int width, int height, Color color);
-
- void drawSolidShape(Shape shape, Color color);
-
- void drawSolidShape(Shape shape, int x, int y, Color color);
-
- void drawText(String text, int x, int y, Color color, Text style);
-
- void drawText(String text, int x, int y, int maxWidth, Color color, Text style);
-
- void offset(int x, int y);
-
- boolean overlaps(Bounds bounds);
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Color.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Color.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Color.java
deleted file mode 100644
index cadf826..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Color.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.dnd.drawing;
-
-public interface Color {
-
- Color brighter();
-
- Color darker();
-
- String getName();
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/ColorsAndFonts.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/ColorsAndFonts.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/ColorsAndFonts.java
deleted file mode 100644
index 5cc4866..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/ColorsAndFonts.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.dnd.drawing;
-
-/**
- * A look-up for font and color details.
- *
- */
-public interface ColorsAndFonts {
- public final static String COLOR_BLACK = "color.black";
- public final static String COLOR_WHITE = "color.white";
- public final static String COLOR_PRIMARY1 = "color.primary1";
- public final static String COLOR_PRIMARY2 = "color.primary2";
- public final static String COLOR_PRIMARY3 = "color.primary3";
- public final static String COLOR_SECONDARY1 = "color.secondary1";
- public final static String COLOR_SECONDARY2 = "color.secondary2";
- public final static String COLOR_SECONDARY3 = "color.secondary3";
-
- // background colors
- public final static String COLOR_APPLICATION = "color.background.application";
- public final static String COLOR_WINDOW = "color.background.window";
- public final static String COLOR_MENU_VALUE = "color.background.menu.value";
- public final static String COLOR_MENU_CONTENT = "color.background.menu.content";
- public final static String COLOR_MENU_VIEW = "color.background.menu.view";
- public final static String COLOR_MENU_WORKSPACE = "color.background.menu.workspace";
-
- // menu colors
- public final static String COLOR_MENU = "color.menu.normal";
- public final static String COLOR_MENU_DISABLED = "color.menu.disabled";
- public final static String COLOR_MENU_REVERSED = "color.menu.reversed";
-
- // label colors
- public final static String COLOR_LABEL = "color.label.normal";
- public final static String COLOR_LABEL_DISABLED = "color.label.disabled";
- public final static String COLOR_LABEL_MANDATORY = "color.label.mandatory";
-
- // state colors
- public final static String COLOR_IDENTIFIED = "color.identified";
- public final static String COLOR_VALID = "color.valid";
- public final static String COLOR_INVALID = "color.invalid";
- public final static String COLOR_ERROR = "color.error";
- public final static String COLOR_ACTIVE = "color.active";
- public final static String COLOR_OUT_OF_SYNC = "color.out-of-sync";
-
- // text colors
- public final static String COLOR_TEXT_SAVED = "color.text.saved";
- public final static String COLOR_TEXT_EDIT = "color.text.edit";
- public final static String COLOR_TEXT_CURSOR = "color.text.cursor";
- public final static String COLOR_TEXT_HIGHLIGHT = "color.text.highlight";
-
- // debug outline colors
- public final static String COLOR_DEBUG_BASELINE = "color.debug.baseline";
- public final static String COLOR_DEBUG_BOUNDS_BORDER = "color.debug.bounds.border";
- public final static String COLOR_DEBUG_BOUNDS_DRAW = "color.debug.bounds.draw";
- public final static String COLOR_DEBUG_BOUNDS_REPAINT = "color.debug.bounds.repaint";
- public final static String COLOR_DEBUG_BOUNDS_VIEW = "color.debug.bounds.view";
-
- // fonts
- public final static String TEXT_DEFAULT = "text.default";
- public final static String TEXT_CONTROL = "text.control";
- public final static String TEXT_TITLE = "text.title";
- public final static String TEXT_TITLE_SMALL = "text.title.small";
- public final static String TEXT_DEBUG = "text.debug";
- public final static String TEXT_STATUS = "text.status";
- public final static String TEXT_ICON = "text.icon";
- public final static String TEXT_LABEL = "text.label";
- public final static String TEXT_LABEL_MANDATORY = "text.label.mandatory";
- public final static String TEXT_LABEL_DISABLED = "text.label.disabled";
- public final static String TEXT_MENU = "text.menu";
- public final static String TEXT_NORMAL = "text.normal";
-
- int defaultBaseline();
-
- int defaultFieldHeight();
-
- Color getColor(int rgbColor);
-
- Color getColor(String name);
-
- Text getText(String name);
-
- void init();
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/DebugCanvas.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/DebugCanvas.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/DebugCanvas.java
deleted file mode 100644
index 7cc7656..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/DebugCanvas.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.dnd.drawing;
-
-import org.apache.isis.core.commons.debug.DebugBuilder;
-
-public class DebugCanvas implements Canvas {
- private final DebugBuilder buffer;
- private final int level;
-
- public DebugCanvas(final DebugBuilder buffer, final Bounds bounds) {
- this(buffer, 0);
- }
-
- private DebugCanvas(final DebugBuilder buffer, final int level) {
- this.level = level;
- this.buffer = buffer;
- }
-
- @Override
- public Canvas createSubcanvas() {
- buffer.blankLine();
- indent();
- buffer.appendln("Create subcanvas for same area");
- return new DebugCanvas(buffer, level + 1);
- }
-
- @Override
- public Canvas createSubcanvas(final Bounds bounds) {
- return createSubcanvas(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());
- }
-
- @Override
- public Canvas createSubcanvas(final int x, final int y, final int width, final int height) {
- buffer.blankLine();
- indent();
- buffer.appendln("Create subcanvas for area " + x + "," + y + " " + width + "x" + height);
- return new DebugCanvas(buffer, level + 1);
- }
-
- @Override
- public void draw3DRectangle(final int x, final int y, final int width, final int height, final Color color, final boolean raised) {
- indent();
- buffer.appendln("Rectangle (3D) " + x + "," + y + " " + width + "x" + height);
- }
-
- @Override
- public void drawImage(final Image image, final int x, final int y) {
- indent();
- buffer.appendln("Icon " + x + "," + y + " " + image.getWidth() + "x" + image.getHeight());
- }
-
- @Override
- public void drawImage(final Image image, final int x, final int y, final int width, final int height) {
- indent();
- buffer.appendln("Icon " + x + "," + y + " " + width + "x" + height);
- }
-
- @Override
- public void drawLine(final int x, final int y, final int x2, final int y2, final Color color) {
- indent();
- buffer.appendln("Line from " + x + "," + y + " to " + x2 + "," + y2 + " " + color);
- }
-
- @Override
- public void drawLine(final Location start, final int xExtent, final int yExtent, final Color color) {
- indent();
- buffer.appendln("Line from " + start.getX() + "," + start.getY() + " to " + (start.getX() + xExtent) + "," + (start.getY() + yExtent) + " " + color);
- }
-
- @Override
- public void drawOval(final int x, final int y, final int width, final int height, final Color color) {
- indent();
- buffer.appendln("Oval " + x + "," + y + " " + width + "x" + height + " " + color);
- }
-
- @Override
- public void drawRectangle(final int x, final int y, final int width, final int height, final Color color) {
- indent();
- buffer.appendln("Rectangle " + x + "," + y + " " + width + "x" + height + " " + color);
- }
-
- @Override
- public void drawRectangleAround(final Bounds bounds, final Color color) {
- indent();
- buffer.appendln("Rectangle 0,0 " + bounds.getWidth() + "x" + bounds.getHeight() + " " + color);
- }
-
- @Override
- public void drawRoundedRectangle(final int x, final int y, final int width, final int height, final int arcWidth, final int arcHeight, final Color color) {
- indent();
- buffer.appendln("Rounded Rectangle " + x + "," + y + " " + (x + width) + "x" + (y + height) + " " + color);
- }
-
- @Override
- public void drawShape(final Shape shape, final Color color) {
- indent();
- buffer.appendln("Shape " + shape + " " + color);
- }
-
- @Override
- public void drawShape(final Shape shape, final int x, final int y, final Color color) {
- indent();
- buffer.appendln("Shape " + shape + " at " + x + "/" + y + " (left, top)" + " " + color);
- }
-
- @Override
- public void drawSolidOval(final int x, final int y, final int width, final int height, final Color color) {
- indent();
- buffer.appendln("Oval (solid) " + x + "," + y + " " + width + "x" + height + " " + color);
- }
-
- @Override
- public void drawSolidRectangle(final int x, final int y, final int width, final int height, final Color color) {
- indent();
- buffer.appendln("Rectangle (solid) " + x + "," + y + " " + width + "x" + height + " " + color);
- }
-
- @Override
- public void drawSolidShape(final Shape shape, final Color color) {
- indent();
- buffer.appendln("Shape (solid) " + shape + " " + color);
- }
-
- @Override
- public void drawSolidShape(final Shape shape, final int x, final int y, final Color color) {
- indent();
- buffer.appendln("Shape (solid)" + shape + " at " + x + "/" + y + " (left, top)" + " " + color);
- }
-
- @Override
- public void drawText(final String text, final int x, final int y, final Color color, final Text style) {
- indent();
- buffer.appendln("Text " + x + "," + y + " \"" + text + "\" " + style + " " + color);
- }
-
- @Override
- public void drawText(final String text, final int x, final int y, final int maxWidth, final Color color, final Text style) {
- indent();
- buffer.appendln("Text " + x + "," + y + " +" + maxWidth + "xh \"" + text + "\" " + style + " " + color);
- }
-
- private void indent() {
- // buffer.append("\n");
- for (int i = 0; i < level; i++) {
- buffer.append(" ");
- }
- }
-
- @Override
- public void offset(final int x, final int y) {
- indent();
- buffer.appendln("Offset by " + x + "/" + y + " (left, top)");
- }
-
- @Override
- public boolean overlaps(final Bounds bounds) {
- return true;
- }
-
- @Override
- public String toString() {
- return "Canvas";
- }
-
- @Override
- public void drawDebugOutline(final Bounds bounds, final int baseline, final Color color) {
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/DebugCanvasAbsolute.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/DebugCanvasAbsolute.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/DebugCanvasAbsolute.java
deleted file mode 100644
index e9fba46..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/DebugCanvasAbsolute.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.dnd.drawing;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.StringTokenizer;
-
-import org.apache.isis.core.commons.debug.DebugBuilder;
-
-public class DebugCanvasAbsolute implements Canvas {
- private final DebugBuilder buffer;
- private final int level;
- private int offsetX;
- private int offsetY;
-
- public DebugCanvasAbsolute(final DebugBuilder buffer, final Bounds bounds) {
- this(buffer, 0, bounds.getX(), bounds.getY());
- }
-
- private DebugCanvasAbsolute(final DebugBuilder buffer, final int level, final int x, final int y) {
- this.level = level;
- this.buffer = buffer;
- offsetX = x;
- offsetY = y;
- }
-
- @Override
- public Canvas createSubcanvas() {
- buffer.blankLine();
- indent();
- buffer.appendln("Create subcanvas for same area");
- return new DebugCanvasAbsolute(buffer, level + 1, offsetX, offsetY);
- }
-
- @Override
- public Canvas createSubcanvas(final Bounds bounds) {
- return createSubcanvas(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());
- }
-
- @Override
- public Canvas createSubcanvas(final int x, final int y, final int width, final int height) {
- // buffer.blankLine();
- indent();
- final int dx = offsetX + x;
- final int qx = dx + width - 1;
- final int dy = offsetY + y;
- final int qy = dy + height - 1;
- buffer.appendln("Canvas " + dx + "," + dy + " " + width + "x" + height + " (" + qx + "," + qy + ") " + line());
- // buffer.appendln(line());
- return new DebugCanvasAbsolute(buffer, level + 1, dx, dy);
- }
-
- @Override
- public void draw3DRectangle(final int x, final int y, final int width, final int height, final Color color, final boolean raised) {
- indent();
- final int px = offsetX + x;
- final int py = offsetY + y;
- final int qx = px + width - 1;
- final int qy = py + height - 1;
- buffer.appendln("Rectangle (3D) " + px + "," + py + " " + width + "x" + height + " (" + qx + "," + qy + ") " + line());
- }
-
- @Override
- public void drawImage(final Image image, final int x, final int y) {
- indent();
- final int px = offsetX + x;
- final int py = offsetY + y;
- final int qx = px + image.getWidth() - 1;
- final int qy = py + image.getHeight() - 1;
- buffer.appendln("Icon " + px + "," + py + " " + image.getWidth() + "x" + image.getHeight() + " (" + qx + "," + qy + ") " + line());
- }
-
- @Override
- public void drawImage(final Image image, final int x, final int y, final int width, final int height) {
- indent();
- final int px = offsetX + x;
- final int py = offsetY + y;
- final int qx = px + width - 1;
- final int qy = py + height - 1;
- buffer.appendln("Icon " + px + "," + py + " " + width + "x" + height + " (" + qx + "," + qy + ") " + line());
- }
-
- @Override
- public void drawLine(final int x, final int y, final int x2, final int y2, final Color color) {
- indent();
- final int px = offsetX + x;
- final int py = offsetY + y;
- final int qx = offsetX + x2;
- final int qy = offsetY + y2;
- buffer.appendln("Line from " + px + "," + py + " to " + qx + "," + qy + " " + color + line());
- }
-
- @Override
- public void drawLine(final Location start, final int xExtent, final int yExtent, final Color color) {
- indent();
- buffer.appendln("Line from " + start.getX() + "," + start.getY() + " to " + (start.getX() + xExtent) + "," + (start.getY() + yExtent) + " " + color + line());
- }
-
- @Override
- public void drawOval(final int x, final int y, final int width, final int height, final Color color) {
- indent();
- final int px = offsetX + x;
- final int py = offsetY + y;
- buffer.appendln("Oval " + px + "," + py + " " + width + "x" + height + " " + color + line());
- }
-
- @Override
- public void drawRectangle(final int x, final int y, final int width, final int height, final Color color) {
- indent();
- final int px = offsetX + x;
- final int py = offsetY + y;
- final int qx = px + width - 1;
- final int qy = py + height - 1;
-
- buffer.appendln("Rectangle " + px + "," + py + " " + width + "x" + height + " (" + qx + "," + qy + ") " + color + line());
- }
-
- private String line() {
- final RuntimeException e = new RuntimeException();
- StringWriter s;
- final PrintWriter p = new PrintWriter(s = new StringWriter());
- e.printStackTrace(p);
- final StringTokenizer st = new StringTokenizer(s.toString(), "\n\r");
- st.nextElement();
- st.nextElement();
- st.nextElement();
- final String line = st.nextToken();
- return line.substring(line.indexOf('('));
- }
-
- @Override
- public void drawRectangleAround(final Bounds bounds, final Color color) {
- indent();
- buffer.appendln("Rectangle 0,0 " + bounds.getWidth() + "x" + bounds.getHeight() + " " + color + line());
- }
-
- @Override
- public void drawRoundedRectangle(final int x, final int y, final int width, final int height, final int arcWidth, final int arcHeight, final Color color) {
- indent();
- final int px = offsetX + x;
- final int py = offsetY + y;
- final int qx = px + width - 1;
- final int qy = py + height - 1;
- buffer.appendln("Rounded Rectangle " + px + "," + py + " " + width + "x" + height + " (" + qx + "," + qy + ") " + color + line());
- }
-
- @Override
- public void drawShape(final Shape shape, final Color color) {
- indent();
- buffer.appendln("Shape " + shape + " " + color);
- }
-
- @Override
- public void drawShape(final Shape shape, final int x, final int y, final Color color) {
- indent();
- final int px = offsetX + x;
- final int py = offsetY + y;
- buffer.appendln("Shape " + shape + " at " + px + "," + py + " (left, top)" + " " + color + line());
- }
-
- @Override
- public void drawSolidOval(final int x, final int y, final int width, final int height, final Color color) {
- indent();
- final int px = offsetX + x;
- final int py = offsetY + y;
- final int qx = px + width - 1;
- final int qy = py + height - 1;
- buffer.appendln("Oval (solid) " + px + "," + py + " " + width + "x" + height + " (" + qx + "," + qy + ") " + color + line());
- }
-
- @Override
- public void drawSolidRectangle(final int x, final int y, final int width, final int height, final Color color) {
- indent();
- final int px = offsetX + x;
- final int py = offsetY + y;
- final int qx = px + width - 1;
- final int qy = py + height - 1;
- buffer.appendln("Rectangle (solid) " + px + "," + py + " " + width + "x" + height + " (" + qx + "," + qy + ") " + color + line());
- }
-
- @Override
- public void drawSolidShape(final Shape shape, final Color color) {
- indent();
- buffer.appendln("Shape (solid) " + shape + " " + color);
- }
-
- @Override
- public void drawSolidShape(final Shape shape, final int x, final int y, final Color color) {
- indent();
- final int px = offsetX + x;
- final int py = offsetY + y;
- buffer.appendln("Shape (solid)" + shape + " at " + px + "," + py + " (left, top)" + " " + color + line());
- }
-
- @Override
- public void drawText(final String text, final int x, final int y, final Color color, final Text style) {
- indent();
- final int px = offsetX + x;
- final int py = offsetY + y;
- buffer.appendln("Text " + px + "," + py + " \"" + text + "\" " + color + line());
- }
-
- @Override
- public void drawText(final String text, final int x, final int y, final int maxWidth, final Color color, final Text style) {
- indent();
- final int px = offsetX + x;
- final int py = offsetY + y;
- buffer.appendln("Text " + px + "," + py + " +" + maxWidth + "xh \"" + text + "\" " + color + line());
- }
-
- private void indent() {
- for (int i = 0; i < level; i++) {
- buffer.append(" ");
- }
- }
-
- @Override
- public void offset(final int x, final int y) {
- // indent();
- offsetX += x;
- offsetY += y;
- // buffer.appendln("Offset by " + x + "/" + y + " (left, top)");
- }
-
- @Override
- public boolean overlaps(final Bounds bounds) {
- return true;
- }
-
- @Override
- public String toString() {
- return "Canvas";
- }
-
- @Override
- public void drawDebugOutline(final Bounds bounds, final int baseline, final Color color) {
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/DrawingUtil.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/DrawingUtil.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/DrawingUtil.java
deleted file mode 100644
index 69e1b48..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/DrawingUtil.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.dnd.drawing;
-
-public class DrawingUtil {
- public static void drawHatching(final Canvas canvas, final int x, final int y, final int width, final int height, final Color foreground, final Color shadow) {
- final int bottom = y + height;
- for (int p = y; p < bottom; p += 4) {
- drawDots(canvas, x, p, width, foreground, shadow);
- if (p + 2 < bottom) {
- drawDots(canvas, x + 2, p + 2, width - 2, foreground, shadow);
- }
- }
- }
-
- private static void drawDots(final Canvas canvas, final int x, final int y, final int width, final Color foreground, final Color shadow) {
- final int x2 = x + width;
- for (int p = x; p < x2; p += 4) {
- canvas.drawLine(p, y, p, y, shadow);
- canvas.drawLine(p + 1, y + 1, p + 1, y + 1, foreground);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Image.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Image.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Image.java
deleted file mode 100644
index 33d25f2..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/drawing/Image.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.isis.viewer.dnd.drawing;
-
-public interface Image {
- int getHeight();
-
- int getWidth();
-
- Size getSize();
-}