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:05 UTC
[04/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/viewer/basic/ApplicationWorkspace.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspace.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspace.java
deleted file mode 100644
index 16eed8c..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspace.java
+++ /dev/null
@@ -1,519 +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.viewer.basic;
-
-import java.util.Enumeration;
-import java.util.List;
-import java.util.Set;
-import java.util.Vector;
-
-import com.google.common.collect.Lists;
-
-import org.apache.isis.core.commons.authentication.AuthenticationSession;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager;
-import org.apache.isis.core.metamodel.consent.Allow;
-import org.apache.isis.core.metamodel.consent.Consent;
-import org.apache.isis.core.metamodel.consent.Veto;
-import org.apache.isis.core.metamodel.spec.ActionType;
-import org.apache.isis.core.metamodel.spec.FreeStandingList;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.metamodel.spec.SpecificationLoader;
-import org.apache.isis.core.runtime.authentication.exploration.MultiUserExplorationSession;
-import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.apache.isis.core.runtime.system.persistence.PersistenceSession;
-import org.apache.isis.core.runtime.userprofile.PerspectiveEntry;
-import org.apache.isis.viewer.dnd.drawing.ColorsAndFonts;
-import org.apache.isis.viewer.dnd.drawing.Location;
-import org.apache.isis.viewer.dnd.drawing.Padding;
-import org.apache.isis.viewer.dnd.service.PerspectiveContent;
-import org.apache.isis.viewer.dnd.service.ServiceObject;
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Click;
-import org.apache.isis.viewer.dnd.view.CompositeViewSpecification;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.ContentDrag;
-import org.apache.isis.viewer.dnd.view.DragEvent;
-import org.apache.isis.viewer.dnd.view.DragStart;
-import org.apache.isis.viewer.dnd.view.Feedback;
-import org.apache.isis.viewer.dnd.view.Look;
-import org.apache.isis.viewer.dnd.view.ObjectContent;
-import org.apache.isis.viewer.dnd.view.Placement;
-import org.apache.isis.viewer.dnd.view.Toolkit;
-import org.apache.isis.viewer.dnd.view.UserActionSet;
-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.Workspace;
-import org.apache.isis.viewer.dnd.view.base.Layout;
-import org.apache.isis.viewer.dnd.view.composite.CompositeViewUsingBuilder;
-import org.apache.isis.viewer.dnd.view.content.FieldContent;
-import org.apache.isis.viewer.dnd.view.look.LookFactory;
-import org.apache.isis.viewer.dnd.view.option.UserActionAbstract;
-import org.apache.isis.viewer.dnd.view.window.DialogBorder;
-import org.apache.isis.viewer.dnd.view.window.SubviewFocusManager;
-import org.apache.isis.viewer.dnd.view.window.WindowBorder;
-
-public final class ApplicationWorkspace extends CompositeViewUsingBuilder implements Workspace {
- protected Vector<View> serviceViews;
- protected Vector<View> iconViews;
-
- public ApplicationWorkspace(final Content content, final Axes axes, final CompositeViewSpecification specification, final Layout layout, final ApplicationWorkspaceBuilder builder) {
- super(content, specification, axes, layout, builder);
- serviceViews = new Vector<View>();
- iconViews = new Vector<View>();
- LookFactory.init();
- }
-
- @Override
- public void addDialog(final View dialogContent, final Placement placement) {
- final DialogBorder dialogView = new DialogBorder(dialogContent, false);
- addView(dialogView);
- placement.position(this, dialogView);
- // dialogView.setFocusManager( new SubviewFocusManager(dialogView));
- }
-
- @Override
- public void addWindow(final View containedView, final Placement placement) {
- final boolean scrollable = !containedView.getSpecification().isResizeable();
- final WindowBorder windowView = new WindowBorder(containedView, scrollable);
- addView(windowView);
- placement.position(this, windowView);
- windowView.setFocusManager(new SubviewFocusManager(windowView));
- }
-
- @Override
- public void addView(final View view) {
- super.addView(view);
- getViewManager().setKeyboardFocus(view);
- view.getFocusManager().focusFirstChildView();
- }
-
- @Override
- public void replaceView(final View toReplace, final View replacement) {
- if (replacement.getSpecification().isOpen()) {
- final boolean scrollable = !replacement.getSpecification().isResizeable();
- final WindowBorder windowView = new WindowBorder(replacement, scrollable);
- super.replaceView(toReplace, windowView);
- } else {
- super.replaceView(toReplace, replacement);
- }
- }
-
- @Override
- public View addWindowFor(final ObjectAdapter object, final Placement placement) {
- final Content content = Toolkit.getContentFactory().createRootContent(object);
- final View view = Toolkit.getViewFactory().createView(new ViewRequirement(content, ViewRequirement.OPEN));
- addWindow(view, placement);
- getViewManager().setKeyboardFocus(view);
- return view;
- }
-
- @Override
- public View addIconFor(final ObjectAdapter object, final Placement placement) {
- final Content content = Toolkit.getContentFactory().createRootContent(object);
- final View icon = Toolkit.getViewFactory().createView(new ViewRequirement(content, ViewRequirement.CLOSED | ViewRequirement.ROOT));
- add(iconViews, icon);
- placement.position(this, icon);
- return icon;
- }
-
- public void addServiceIconFor(final ObjectAdapter service) {
- final Content content = new ServiceObject(service);
- final View serviceIcon = Toolkit.getViewFactory().createView(new ViewRequirement(content, ViewRequirement.CLOSED | ViewRequirement.SUBVIEW));
- add(serviceViews, serviceIcon);
- }
-
- @Override
- public DragEvent dragStart(final DragStart drag) {
- final View subview = subviewFor(drag.getLocation());
- if (subview != null) {
- drag.subtract(subview.getLocation());
- return subview.dragStart(drag);
- } else {
- return null;
- }
- }
-
- // TODO check the dragging in of objects, flag to user that object cannot be
- // dropped
- @Override
- public void drop(final ContentDrag drag) {
- getFeedbackManager().showDefaultCursor();
-
- if (!drag.getSourceContent().isObject()) {
- return;
- }
-
- if (drag.getSourceContent().getAdapter() == getPerspective()) {
- getFeedbackManager().setAction("can' drop self on workspace");
- return;
- }
-
- final ObjectAdapter source = ((ObjectContent) drag.getSourceContent()).getObject();
- if (source.getSpecification().isService()) {
- getPerspective().addToServices(source.getObject());
- invalidateContent();
- } else {
- if (!drag.isShift()) {
- getPerspective().addToObjects(source.getObject());
- }
- }
-
- View newView;
- if (source.getSpecification().isService()) {
- return;
- } else {
- final Location dropLocation = drag.getTargetLocation();
- dropLocation.subtract(drag.getOffset());
-
- if (drag.isShift()) {
- newView = Toolkit.getViewFactory().createView(new ViewRequirement(getContent(), ViewRequirement.OPEN | ViewRequirement.SUBVIEW));
- drag.getTargetView().addView(newView);
- newView.setLocation(dropLocation);
- } else {
- // place object onto desktop as icon
- final View sourceView = drag.getSource();
- if (!sourceView.getSpecification().isOpen()) {
- final View[] subviews = getSubviews();
- for (final View subview : subviews) {
- if (subview == sourceView) {
- sourceView.markDamaged();
- sourceView.setLocation(dropLocation);
- sourceView.markDamaged();
- return;
- }
- }
- } else {
- for (final View view : iconViews) {
- if (view.getContent().getAdapter() == source) {
- view.markDamaged();
- view.setLocation(dropLocation);
- view.markDamaged();
- return;
- }
- }
- }
- addIconFor(source, new Placement(dropLocation));
- }
- }
- }
-
- @Override
- public void entered() {
- // prevents status details about "Persective..."
- }
-
- private PerspectiveEntry getPerspective() {
- return ((PerspectiveContent) getContent()).getPerspective();
- }
-
- @Override
- public void drop(final ViewDrag drag) {
- getFeedbackManager().showDefaultCursor();
-
- final View sourceView = drag.getSourceView();
- final Location newLocation = drag.getViewDropLocation();
- if (sourceView.getSpecification() != null && sourceView.getSpecification().isSubView()) {
- if (sourceView.getSpecification().isOpen() && sourceView.getSpecification().isReplaceable()) {
- // TODO remove the open view from the container and place on
- // workspace; replace the internal view with an icon
- } else if (sourceView.getContent() instanceof FieldContent) {
- final ViewRequirement requirement = new ViewRequirement(sourceView.getContent(), ViewRequirement.OPEN);
- final View view = Toolkit.getViewFactory().createView(requirement);
- addWindow(view, new Placement(newLocation));
- sourceView.getState().clearViewIdentified();
- } else {
- addWindowFor(sourceView.getContent().getAdapter(), new Placement(newLocation));
- sourceView.getState().clearViewIdentified();
- }
- } else {
- sourceView.markDamaged();
- sourceView.setLocation(newLocation);
- sourceView.limitBoundsWithin(getSize());
- sourceView.markDamaged();
- }
- }
-
- @Override
- public Padding getPadding() {
- return new Padding();
- }
-
- @Override
- public Workspace getWorkspace() {
- return this;
- }
-
- @Override
- public void lower(final View view) {
- if (views.contains(view)) {
- views.removeElement(view);
- views.insertElementAt(view, 0);
- markDamaged();
- }
- }
-
- @Override
- public void raise(final View view) {
- if (views.contains(view)) {
- views.removeElement(view);
- views.addElement(view);
- markDamaged();
- }
- }
-
- @Override
- public void removeView(final View view) {
- view.markDamaged();
- if (iconViews.contains(view)) {
- iconViews.remove(view);
- getViewManager().removeFromNotificationList(view);
- removeObject(view.getContent().getAdapter());
- } else if (serviceViews.contains(view)) {
- serviceViews.remove(view);
- getViewManager().removeFromNotificationList(view);
- removeService(view.getContent().getAdapter());
- } else {
- super.removeView(view);
- }
- }
-
- private void removeService(final ObjectAdapter object) {
- getPerspective().removeFromServices(object.getObject());
- }
-
- private void removeObject(final ObjectAdapter object) {
- getPerspective().removeFromObjects(object.getObject());
- }
-
- @Override
- public void secondClick(final Click click) {
- final View subview = subviewFor(click.getLocation());
- if (subview != null) {
- // ignore double-click on self - don't open up new view
- super.secondClick(click);
- }
- }
-
- @Override
- public String toString() {
- return "Workspace" + getId();
- }
-
- @Override
- public void viewMenuOptions(final UserActionSet options) {
- options.setColor(Toolkit.getColor(ColorsAndFonts.COLOR_MENU_WORKSPACE));
-
- options.add(new UserActionAbstract("Close all") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- final View views[] = getWindowViews();
- for (final View v : views) {
- // if (v.getSpecification().isOpen()) {
- v.dispose();
- // }
- }
- markDamaged();
- }
- });
-
- options.add(new UserActionAbstract("Tidy up windows") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- tidyViews(getWindowViews());
- }
- });
-
- options.add(new UserActionAbstract("Tidy up icons") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- tidyViews(getObjectIconViews());
- }
- });
-
- options.add(new UserActionAbstract("Tidy up all") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- tidyViews(getObjectIconViews());
- tidyViews(getWindowViews());
- }
- });
-
- options.add(new UserActionAbstract("Services...") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- final List<Object> servicePojos = IsisContext.getServices();
- final List<ObjectAdapter> serviceAdapters = Lists.newArrayList();
- for (final Object servicePojo : servicePojos) {
- final AdapterManager adapterManager = getPersistenceSession().getAdapterManager();
- serviceAdapters.add(adapterManager.adapterFor(servicePojo));
- }
- final ObjectSpecification spec = getSpecificationLoader().loadSpecification(Object.class);
- final FreeStandingList collection = new FreeStandingList(spec, serviceAdapters);
- addWindowFor(getAdapterManager().adapterFor(collection), new Placement(at));
- }
-
- });
-
- menuForChangingLook(options);
-
- menuForChangingUsers(options);
-
- options.add(new UserActionAbstract("Save User Profile", ActionType.USER) {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- final Feedback feedbackManager = getFeedbackManager();
- feedbackManager.showBusyState(ApplicationWorkspace.this);
- getViewManager().saveOpenObjects();
- feedbackManager.addMessage("Profile saved");
- feedbackManager.showBusyState(ApplicationWorkspace.this);
- }
- });
- }
-
- private void menuForChangingLook(final UserActionSet options) {
- final UserActionSet set = options.addNewActionSet("Change Look", ActionType.USER);
- for (final Look look : LookFactory.getAvailableLooks()) {
- menuOptionForChangingLook(set, look, look.getName());
- }
- }
-
- private void menuOptionForChangingLook(final UserActionSet set, final Look look, final String name) {
- set.add(new UserActionAbstract(name) {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- LookFactory.setLook(look);
- ApplicationWorkspace.this.invalidateLayout();
- ApplicationWorkspace.this.markDamaged();
- }
-
- @Override
- public Consent disabled(final View view) {
- return LookFactory.getInstalledLook() == look ? new Veto("Current look") : Allow.DEFAULT;
- }
- });
- }
-
- private void menuForChangingUsers(final UserActionSet options) {
- // TODO pick out users from the perspectives, but only show when in
- // exploration mode
- if (getAuthenticationSession() instanceof MultiUserExplorationSession) {
- final MultiUserExplorationSession session = (MultiUserExplorationSession) getAuthenticationSession();
-
- final Set<String> users = session.getUserNames();
- final UserActionSet set = options.addNewActionSet("Change user", ActionType.EXPLORATION);
- for (final String user : users) {
- menuOptionForChangingUser(set, user, session.getUserName());
- }
- }
- }
-
- private void menuOptionForChangingUser(final UserActionSet set, final String user, final String currentUser) {
- set.add(new UserActionAbstract(user) {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- final MultiUserExplorationSession session = (MultiUserExplorationSession) getAuthenticationSession();
- session.setCurrentSession(user);
- }
-
- @Override
- public Consent disabled(final View view) {
- return user.equals(currentUser) ? new Veto("Current user") : Allow.DEFAULT;
- }
- });
- }
-
- @Override
- protected View[] subviews() {
- final Object[] viewsCopy = views.toArray();
- final Object[] serviceViewsCopy = serviceViews.toArray();
- final Object[] iconViewsCopy = iconViews.toArray();
-
- final View v[] = new View[viewsCopy.length + serviceViewsCopy.length + iconViewsCopy.length];
- int offset = 0;
- Object[] src = serviceViewsCopy;
- System.arraycopy(src, 0, v, offset, src.length);
- offset += src.length;
- src = iconViewsCopy;
- System.arraycopy(src, 0, v, offset, src.length);
- offset += src.length;
- src = viewsCopy;
- System.arraycopy(src, 0, v, offset, src.length);
-
- return v;
- }
-
- public void clearServiceViews() {
- final Enumeration e = serviceViews.elements();
- while (e.hasMoreElements()) {
- final View view = (View) e.nextElement();
- view.markDamaged();
- }
- serviceViews.clear();
- }
-
- protected View[] getWindowViews() {
- return createArrayOfViews(views);
- }
-
- private View[] createArrayOfViews(final Vector<View> views) {
- final View[] array = new View[views.size()];
- views.copyInto(array);
- return array;
- }
-
- protected View[] getServiceIconViews() {
- return createArrayOfViews(serviceViews);
- }
-
- protected View[] getObjectIconViews() {
- return createArrayOfViews(iconViews);
- }
-
- private void tidyViews(final View[] views) {
- for (final View v : views) {
- v.setLocation(ApplicationWorkspaceBuilder.UNPLACED);
- }
- invalidateLayout();
- markDamaged();
- }
-
- // //////////////////////////////////////////////////////////////////
- // Dependencies (from singleton)
- // //////////////////////////////////////////////////////////////////
-
- private SpecificationLoader getSpecificationLoader() {
- return IsisContext.getSpecificationLoader();
- }
-
- private PersistenceSession getPersistenceSession() {
- return IsisContext.getPersistenceSession();
- }
-
- private AdapterManager getAdapterManager() {
- return getPersistenceSession().getAdapterManager();
- }
-
- private AuthenticationSession getAuthenticationSession() {
- return IsisContext.getAuthenticationSession();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspaceBuilder.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspaceBuilder.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspaceBuilder.java
deleted file mode 100644
index a62655f..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/ApplicationWorkspaceBuilder.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.viewer.basic;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.apache.isis.core.runtime.userprofile.PerspectiveEntry;
-import org.apache.isis.viewer.dnd.drawing.Location;
-import org.apache.isis.viewer.dnd.drawing.Size;
-import org.apache.isis.viewer.dnd.service.PerspectiveContent;
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Placement;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.base.Layout;
-import org.apache.isis.viewer.dnd.view.composite.AbstractViewBuilder;
-
-/**
- * WorkspaceBuilder builds a workspace view for an ObjectContent view by finding
- * a collection of classes from a field called 'classes' and adding an icon for
- * each element. Similarly, if there is a collection called 'objects' its
- * elements are also added to the display.
- *
- * <p>
- * During lay-out any icons that have an UNPLACED location (-1, -1) are given a
- * location. Objects of type ObjectSpecification are added to the left-hand
- * side, while all other icons are placed on the right-hand side of the
- * workspace view. Open windows are displayed in the centre.
- */
-public class ApplicationWorkspaceBuilder extends AbstractViewBuilder {
- private static final Logger LOG = LoggerFactory.getLogger(ApplicationWorkspaceBuilder.class);
- private static final int PADDING = 10;
- public static final Location UNPLACED = new Location(-1, -1);
-
- public static class ApplicationLayout implements Layout {
- @Override
- public Size getRequiredSize(final View view) {
- return new Size(600, 400);
- }
-
- public String getName() {
- return "Simple Workspace";
- }
-
- @Override
- public void layout(final View view1, final Size maximumSize) {
- final ApplicationWorkspace view = (ApplicationWorkspace) view1;
-
- final int widthUsed = layoutServiceIcons(maximumSize, view);
- layoutObjectIcons(maximumSize, view);
- layoutWindowViews(maximumSize, view, widthUsed);
- }
-
- private void layoutWindowViews(final Size maximumSize, final ApplicationWorkspace view, final int xOffset) {
- final Size size = view.getSize();
- size.contract(view.getPadding());
-
- final int maxHeight = size.getHeight();
- final int maxWidth = size.getWidth();
-
- final int xWindow = xOffset + PADDING;
- int yWindow = PADDING;
-
- int xMinimized = 1;
- int yMinimized = maxHeight - 1;
-
- final View windows[] = view.getWindowViews();
- for (final View v : windows) {
- final Size componentSize = v.getRequiredSize(new Size(size));
- v.setSize(componentSize);
- if (v instanceof MinimizedView) {
- final Size s = v.getRequiredSize(Size.createMax());
- if (xMinimized + s.getWidth() > maxWidth) {
- xMinimized = 1;
- yMinimized -= s.getHeight() + 1;
- }
- v.setLocation(new Location(xMinimized, yMinimized - s.getHeight()));
- xMinimized += s.getWidth() + 1;
-
- } else if (v.getLocation().equals(UNPLACED)) {
- final int height = componentSize.getHeight() + 6;
- v.setLocation(new Location(xWindow, yWindow));
- yWindow += height;
-
- }
- v.limitBoundsWithin(maximumSize);
- }
-
- for (final View window : windows) {
- window.layout();
- }
- }
-
- private int layoutServiceIcons(final Size maximumSize, final ApplicationWorkspace view) {
- final Size size = view.getSize();
- size.contract(view.getPadding());
-
- final int maxHeight = size.getHeight();
-
- int xService = PADDING;
- int yService = PADDING;
- int maxServiceWidth = 0;
-
- final View views[] = view.getServiceIconViews();
- for (final View v : views) {
- final Size componentSize = v.getRequiredSize(new Size(size));
- v.setSize(componentSize);
- final int height = componentSize.getHeight() + 6;
-
- final ObjectAdapter object = v.getContent().getAdapter();
- if (object.getSpecification().isService()) {
- if (yService + height > maxHeight) {
- yService = PADDING;
- xService += maxServiceWidth + PADDING;
- maxServiceWidth = 0;
- LOG.debug("creating new column at " + xService + ", " + yService);
- }
- LOG.debug("service icon at " + xService + ", " + yService);
- v.setLocation(new Location(xService, yService));
- maxServiceWidth = Math.max(maxServiceWidth, componentSize.getWidth());
- yService += height;
- }
- v.limitBoundsWithin(maximumSize);
- }
-
- return xService + maxServiceWidth;
- }
-
- private void layoutObjectIcons(final Size maximumSize, final ApplicationWorkspace view) {
- final Size size = view.getSize();
- size.contract(view.getPadding());
-
- final int maxWidth = size.getWidth();
-
- final int xObject = maxWidth - PADDING;
- int yObject = PADDING;
-
- final View views[] = view.getObjectIconViews();
- for (final View v : views) {
- final Size componentSize = v.getRequiredSize(new Size(size));
- v.setSize(componentSize);
- if (v.getLocation().equals(UNPLACED)) {
- final int height = componentSize.getHeight() + 6;
- v.setLocation(new Location(xObject - componentSize.getWidth(), yObject));
- yObject += height;
- }
- v.limitBoundsWithin(maximumSize);
- }
- }
- }
-
- @Override
- public void build(final View view1, final Axes axes) {
- final ApplicationWorkspace workspace = (ApplicationWorkspace) view1;
-
- final PerspectiveContent perspectiveContent = (PerspectiveContent) view1.getContent();
-
- // REVIEW is this needed?
- workspace.clearServiceViews();
-
- final PerspectiveEntry perspective = perspectiveContent.getPerspective();
- for (final Object object : perspective.getObjects()) {
- final ObjectAdapter adapter = IsisContext.getPersistenceSession().getAdapterManager().adapterFor(object);
- workspace.addIconFor(adapter, new Placement(ApplicationWorkspaceBuilder.UNPLACED));
- }
-
- for (final Object service : perspective.getServices()) {
- final ObjectAdapter adapter = IsisContext.getPersistenceSession().getAdapterManager().adapterFor(service);
- if (isHidden(adapter)) {
- continue;
- }
- workspace.addServiceIconFor(adapter);
- }
- }
-
- private boolean isHidden(final ObjectAdapter serviceNO) {
- final ObjectSpecification serviceNoSpec = serviceNO.getSpecification();
- return serviceNoSpec.isHidden();
- }
-
- public boolean canDisplay(final ObjectAdapter object) {
- return object instanceof ObjectAdapter && object != null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/CollectionDisplayIterator.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/CollectionDisplayIterator.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/CollectionDisplayIterator.java
deleted file mode 100644
index e9b7d99..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/CollectionDisplayIterator.java
+++ /dev/null
@@ -1,62 +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.viewer.basic;
-
-import java.util.Enumeration;
-
-public interface CollectionDisplayIterator {
-
- /**
- * Return cache to be viewed on current page
- */
- public Enumeration displayElements();
-
- /**
- * Position cursor at first element
- */
- public void first();
-
- public int getDisplaySize();
-
- /**
- * If true there is a next page to display, and 'next' and 'last' options
- * are valid
- */
- public boolean hasNext();
-
- public boolean hasPrevious();
-
- /**
- * Position cursor at last
- */
- public void last();
-
- /**
- * Position cursor at beginning of next page
- */
- public void next();
-
- public int position();
-
- /**
- * Position cursor at beginning of previous page
- */
- public void previous();
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/DragContentSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/DragContentSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/DragContentSpecification.java
deleted file mode 100644
index 8e20462..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/DragContentSpecification.java
+++ /dev/null
@@ -1,37 +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.viewer.basic;
-
-import org.apache.isis.viewer.dnd.drawing.ColorsAndFonts;
-import org.apache.isis.viewer.dnd.icon.IconSpecification;
-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.border.LineBorder;
-
-public class DragContentSpecification extends IconSpecification {
-
- @Override
- public View createView(final Content content, final Axes axes, final int sequence) {
- final View icon = super.createView(content, axes, sequence);
- return new LineBorder(1, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1), icon);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/FallbackView.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/FallbackView.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/FallbackView.java
deleted file mode 100644
index 7ef7f36..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/FallbackView.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.viewer.basic;
-
-import org.apache.isis.viewer.dnd.drawing.Canvas;
-import org.apache.isis.viewer.dnd.drawing.ColorsAndFonts;
-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.ViewAreaType;
-import org.apache.isis.viewer.dnd.view.ViewRequirement;
-import org.apache.isis.viewer.dnd.view.ViewSpecification;
-import org.apache.isis.viewer.dnd.view.base.ObjectView;
-
-public class FallbackView extends ObjectView {
-
- public static class Specification implements ViewSpecification {
- @Override
- public boolean canDisplay(final ViewRequirement requirement) {
- return true;
- }
-
- @Override
- public View createView(final Content content, final Axes axes, final int sequence) {
- return new FallbackView(content, this);
- }
-
- @Override
- public String getName() {
- return "Fallback";
- }
-
- @Override
- public boolean isAligned() {
- return false;
- }
-
- @Override
- public boolean isOpen() {
- return false;
- }
-
- @Override
- public boolean isReplaceable() {
- return false;
- }
-
- @Override
- public boolean isResizeable() {
- return false;
- }
-
- @Override
- public boolean isSubView() {
- return false;
- }
- }
-
- protected FallbackView(final Content content, final ViewSpecification specification) {
- super(content, specification);
- }
-
- @Override
- public void draw(final Canvas canvas) {
- super.draw(canvas);
-
- final Size size = getSize();
- final int width = size.getWidth() - 1;
- final int height = size.getHeight() - 1;
- canvas.drawSolidRectangle(0, 0, width, height, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3));
- canvas.drawSolidRectangle(0, 0, 10, height, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2));
- canvas.drawLine(10, 0, 10, height - 2, Toolkit.getColor(ColorsAndFonts.COLOR_BLACK));
- canvas.drawRectangle(0, 0, width, height, Toolkit.getColor(ColorsAndFonts.COLOR_BLACK));
- canvas.drawText(getContent().title(), 14, getBaseline(), Toolkit.getColor(ColorsAndFonts.COLOR_BLACK), Toolkit.getText(ColorsAndFonts.TEXT_NORMAL));
- }
-
- @Override
- public int getBaseline() {
- return 14;
- }
-
- @Override
- public Size getRequiredSize(final Size availableSpace) {
- return new Size(150, 20);
- }
-
- @Override
- public ViewAreaType viewAreaType(final Location mouseLocation) {
- return mouseLocation.getX() <= 10 ? ViewAreaType.VIEW : ViewAreaType.CONTENT;
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/Identifier.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/Identifier.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/Identifier.java
deleted file mode 100644
index 2c44e19..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/Identifier.java
+++ /dev/null
@@ -1,82 +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.viewer.basic;
-
-import org.apache.isis.core.commons.debug.DebugBuilder;
-import org.apache.isis.viewer.dnd.drawing.Canvas;
-import org.apache.isis.viewer.dnd.drawing.ColorsAndFonts;
-import org.apache.isis.viewer.dnd.drawing.Size;
-import org.apache.isis.viewer.dnd.view.ContentDrag;
-import org.apache.isis.viewer.dnd.view.Toolkit;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.base.AbstractViewDecorator;
-
-public class Identifier extends AbstractViewDecorator {
- private boolean identified;
-
- public Identifier(final View wrappedView) {
- super(wrappedView);
- }
-
- @Override
- public void debugDetails(final DebugBuilder debug) {
- debug.append("Identifier");
- }
-
- @Override
- public void dragIn(final ContentDrag drag) {
- wrappedView.dragIn(drag);
- markDamaged();
- }
-
- @Override
- public void dragOut(final ContentDrag drag) {
- wrappedView.dragOut(drag);
- markDamaged();
- }
-
- @Override
- public void draw(final Canvas canvas) {
- final Size s = getSize();
- canvas.drawSolidRectangle(0, 0, s.getWidth(), s.getHeight(), Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3));
- wrappedView.draw(canvas);
- }
-
- @Override
- public void entered() {
- getState().setContentIdentified();
- wrappedView.entered();
- identified = true;
- markDamaged();
- }
-
- @Override
- public void exited() {
- getState().clearObjectIdentified();
- wrappedView.exited();
- identified = false;
- markDamaged();
- }
-
- @Override
- public String toString() {
- return wrappedView.toString() + "/Identifier [identified=" + identified + "]";
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/InnerWorkspaceSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/InnerWorkspaceSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/InnerWorkspaceSpecification.java
deleted file mode 100644
index 595df22..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/InnerWorkspaceSpecification.java
+++ /dev/null
@@ -1,36 +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.viewer.basic;
-
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.View;
-
-public class InnerWorkspaceSpecification extends WorkspaceSpecification {
- @Override
- public View createView(final Content content, final Axes axes, final int sequence) {
- return super.createView(content, axes, sequence);
- }
-
- @Override
- public String getName() {
- return "Workspace";
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/LogoBackground.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/LogoBackground.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/LogoBackground.java
deleted file mode 100644
index 8538711..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/LogoBackground.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.viewer.basic;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.apache.isis.viewer.dnd.drawing.Background;
-import org.apache.isis.viewer.dnd.drawing.Canvas;
-import org.apache.isis.viewer.dnd.drawing.Image;
-import org.apache.isis.viewer.dnd.drawing.ImageFactory;
-import org.apache.isis.viewer.dnd.drawing.Location;
-import org.apache.isis.viewer.dnd.drawing.Size;
-import org.apache.isis.viewer.dnd.util.Properties;
-
-public class LogoBackground implements Background {
- private static final Logger LOG = LoggerFactory.getLogger(LogoBackground.class);
- private static final String PARAMETER_BASE = Properties.PROPERTY_BASE + "logo-background.";
- private Location location;
- private Image logo;
- private Size logoSize;
-
- public LogoBackground() {
- final IsisConfiguration configuration = IsisContext.getConfiguration();
-
- final String fileName = configuration.getString(PARAMETER_BASE + "image", "background");
- logo = ImageFactory.getInstance().loadImage(fileName);
-
- if (logo == null) {
- logo = ImageFactory.getInstance().loadImage("poweredby-logo");
- }
-
- if (logo == null) {
- LOG.debug("logo image not found: " + fileName);
- } else {
- location = Properties.getLocation(PARAMETER_BASE + "location", new Location(-30, -30));
- logoSize = Properties.getSize(PARAMETER_BASE + "size", logo.getSize());
- }
- }
-
- @Override
- public void draw(final Canvas canvas, final Size viewSize) {
- if (logo != null) {
- int x;
- int y;
-
- if (location.getX() == 0 && location.getY() == 0) {
- x = viewSize.getWidth() / 2 - logoSize.getWidth() / 2;
- y = viewSize.getHeight() / 2 - logoSize.getHeight() / 2;
- } else {
- x = (location.getX() >= 0) ? location.getX() : viewSize.getWidth() + location.getX() - logoSize.getWidth();
- y = (location.getY() >= 0) ? location.getY() : viewSize.getHeight() + location.getY() - logoSize.getHeight();
- }
- canvas.drawImage(logo, x, y, logoSize.getWidth(), logoSize.getHeight());
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/MinimizedView.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/MinimizedView.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/MinimizedView.java
deleted file mode 100644
index 33910fb..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/MinimizedView.java
+++ /dev/null
@@ -1,455 +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.viewer.basic;
-
-import org.apache.isis.core.commons.debug.DebugBuilder;
-import org.apache.isis.core.commons.exceptions.IsisException;
-import org.apache.isis.core.metamodel.consent.Allow;
-import org.apache.isis.core.metamodel.consent.Consent;
-import org.apache.isis.core.metamodel.spec.ActionType;
-import org.apache.isis.viewer.dnd.drawing.Canvas;
-import org.apache.isis.viewer.dnd.drawing.Color;
-import org.apache.isis.viewer.dnd.drawing.ColorsAndFonts;
-import org.apache.isis.viewer.dnd.drawing.Location;
-import org.apache.isis.viewer.dnd.drawing.Padding;
-import org.apache.isis.viewer.dnd.drawing.Size;
-import org.apache.isis.viewer.dnd.icon.SubviewIconSpecification;
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Click;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.ContentDrag;
-import org.apache.isis.viewer.dnd.view.DragEvent;
-import org.apache.isis.viewer.dnd.view.DragStart;
-import org.apache.isis.viewer.dnd.view.Toolkit;
-import org.apache.isis.viewer.dnd.view.UserAction;
-import org.apache.isis.viewer.dnd.view.UserActionSet;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.ViewAreaType;
-import org.apache.isis.viewer.dnd.view.ViewConstants;
-import org.apache.isis.viewer.dnd.view.ViewRequirement;
-import org.apache.isis.viewer.dnd.view.ViewSpecification;
-import org.apache.isis.viewer.dnd.view.ViewState;
-import org.apache.isis.viewer.dnd.view.Workspace;
-import org.apache.isis.viewer.dnd.view.base.AbstractView;
-import org.apache.isis.viewer.dnd.view.option.UserActionAbstract;
-import org.apache.isis.viewer.dnd.view.window.WindowControl;
-
-public class MinimizedView extends AbstractView {
- private class CloseWindowControl extends WindowControl {
-
- public CloseWindowControl(final View target) {
- super(new UserAction() {
- @Override
- public Consent disabled(final View view) {
- return Allow.DEFAULT;
- }
-
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- ((MinimizedView) view).close();
- }
-
- @Override
- public String getDescription(final View view) {
- return "Close " + view.getSpecification().getName();
- }
-
- @Override
- public String getHelp(final View view) {
- return null;
- }
-
- @Override
- public String getName(final View view) {
- return "Close view";
- }
-
- @Override
- public ActionType getType() {
- return ActionType.USER;
- }
- }, target);
- }
-
- @Override
- public void draw(final Canvas canvas) {
- final int x = 0;
- final int y = 0;
- final Color crossColor = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
- canvas.drawLine(x + 4, y + 3, x + 10, y + 9, crossColor);
- canvas.drawLine(x + 5, y + 3, x + 11, y + 9, crossColor);
- canvas.drawLine(x + 10, y + 3, x + 4, y + 9, crossColor);
- canvas.drawLine(x + 11, y + 3, x + 5, y + 9, crossColor);
- }
- }
-
- private class RestoreWindowControl extends WindowControl {
- public RestoreWindowControl(final View target) {
- super(new UserAction() {
-
- @Override
- public Consent disabled(final View view) {
- return Allow.DEFAULT;
- }
-
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- ((MinimizedView) view).restore();
- }
-
- @Override
- public String getDescription(final View view) {
- return "Restore " + view.getSpecification().getName() + " to normal size";
- }
-
- @Override
- public String getHelp(final View view) {
- return null;
- }
-
- @Override
- public String getName(final View view) {
- return "Restore view";
- }
-
- @Override
- public ActionType getType() {
- return ActionType.USER;
- }
- }, target);
- }
-
- @Override
- public void draw(final Canvas canvas) {
- final int x = 0;
- final int y = 0;
- final Color black = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
- canvas.drawRectangle(x + 1, y + 1, WIDTH - 1, HEIGHT - 1, black);
- canvas.drawLine(x + 2, y + 2, x + WIDTH - 2, y + 2, black);
- canvas.drawLine(x + 2, y + 3, x + WIDTH - 2, y + 3, black);
- }
- }
-
- private static class Specification implements ViewSpecification {
-
- @Override
- public boolean canDisplay(final ViewRequirement requirement) {
- return false;
- }
-
- @Override
- public View createView(final Content content, final Axes axes, final int sequence) {
- return null;
- }
-
- @Override
- public String getName() {
- return "minimized view";
- }
-
- @Override
- public boolean isAligned() {
- return false;
- }
-
- @Override
- public boolean isOpen() {
- return false;
- }
-
- @Override
- public boolean isReplaceable() {
- return false;
- }
-
- @Override
- public boolean isResizeable() {
- return false;
- }
-
- @Override
- public boolean isSubView() {
- return false;
- }
-
- }
-
- private final static int BORDER_WIDTH = 5;
- private final WindowControl controls[];
- private View iconView;
-
- private final View minimizedView;
-
- public MinimizedView(final View viewToMinimize) {
- super(viewToMinimize.getContent(), new Specification());
- this.minimizedView = viewToMinimize;
- iconView = new SubviewIconSpecification().createView(viewToMinimize.getContent(), viewToMinimize.getViewAxes(), -1);
- iconView.setParent(this);
- controls = new WindowControl[] { new RestoreWindowControl(this), new CloseWindowControl(this) };
- }
-
- @Override
- public void debug(final DebugBuilder debug) {
- super.debug(debug);
- debug.appendln("minimized view", minimizedView);
- debug.appendln();
-
- debug.appendln("icon size", iconView.getSize());
- debug.append(iconView);
- }
-
- @Override
- public void dispose() {
- super.dispose();
- iconView.dispose();
- // viewToMinimize.dispose();
- }
-
- @Override
- public DragEvent dragStart(final DragStart drag) {
- if (iconView.getBounds().contains(drag.getLocation())) {
- drag.subtract(BORDER_WIDTH, BORDER_WIDTH);
- return iconView.dragStart(drag);
- } else {
- return super.dragStart(drag);
- }
- // View dragOverlay = new DragViewOutline(getView());
- // return new ViewDrag(this, new Offset(drag.getLocation()),
- // dragOverlay);
- }
-
- @Override
- public void draw(final Canvas canvas) {
- super.draw(canvas);
-
- final Size size = getSize();
- final int width = size.getWidth();
- final int height = size.getHeight();
- final int left = 3;
- final int top = 3;
-
- final boolean hasFocus = containsFocus();
- final Color lightColor = hasFocus ? Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1) : Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2);
- clearBackground(canvas, Toolkit.getColor(ColorsAndFonts.COLOR_WINDOW));
- canvas.drawRectangle(1, 0, width - 2, height, lightColor);
- canvas.drawRectangle(0, 1, width, height - 2, lightColor);
- for (int i = 2; i < left; i++) {
- canvas.drawRectangle(i, i, width - 2 * i, height - 2 * i, lightColor);
- }
- final ViewState state = getState();
- if (state.isActive()) {
- final int i = left;
- canvas.drawRectangle(i, top, width - 2 * i, height - 2 * i - top, Toolkit.getColor(ColorsAndFonts.COLOR_ACTIVE));
- }
-
- final int bw = controls[0].getLocation().getX() - 3; // controls.length
- // *
- // WindowControl.WIDTH;
- canvas.drawSolidRectangle(bw, top, width - bw - 3, height - top * 2, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3));
- canvas.drawLine(bw - 1, top, bw - 1, height - top * 2, lightColor);
-
- for (int i = 0; controls != null && i < controls.length; i++) {
- final Canvas controlCanvas = canvas.createSubcanvas(controls[i].getBounds());
- controls[i].draw(controlCanvas);
- }
-
- final Canvas c = canvas.createSubcanvas(iconView.getBounds());
- iconView.draw(c);
- }
-
- @Override
- public Size getRequiredSize(final Size availableSpace) {
- final Size size = new Size();
-
- size.extendWidth(BORDER_WIDTH);
- final Size iconMaximumSize = iconView.getRequiredSize(Size.createMax());
- size.extendWidth(iconMaximumSize.getWidth());
-
- size.extendHeight(iconMaximumSize.getHeight());
- size.ensureHeight(WindowControl.HEIGHT);
- size.extendHeight(BORDER_WIDTH);
- size.extendHeight(BORDER_WIDTH);
-
- size.extendWidth(ViewConstants.HPADDING);
- size.extendWidth(controls.length * (WindowControl.WIDTH + ViewConstants.HPADDING));
- size.extendWidth(BORDER_WIDTH);
- return size;
- }
-
- @Override
- public Padding getPadding() {
- return new Padding(BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH);
- }
-
- @Override
- public void layout() {
- final Size size = getRequiredSize(Size.createMax());
-
- layoutControls(size.getWidth());
-
- size.contractWidth(BORDER_WIDTH * 2);
- size.contractWidth(ViewConstants.HPADDING);
- size.contractWidth(controls.length * (WindowControl.WIDTH + ViewConstants.HPADDING));
-
- size.contractHeight(BORDER_WIDTH * 2);
-
- iconView.setLocation(new Location(BORDER_WIDTH, BORDER_WIDTH));
- iconView.setSize(size);
- }
-
- private void layoutControls(final int width) {
- final int widthControl = WindowControl.WIDTH + ViewConstants.HPADDING;
- int x = width - BORDER_WIDTH + ViewConstants.HPADDING;
- x -= widthControl * controls.length;
- final int y = BORDER_WIDTH;
-
- for (final WindowControl control : controls) {
- control.setSize(control.getRequiredSize(Size.createMax()));
- control.setLocation(new Location(x, y));
- x += widthControl;
- }
- }
-
- private void restore() {
- final Workspace workspace = getWorkspace();
- final View[] views = workspace.getSubviews();
- for (final View view : views) {
- if (view == this) {
- dispose();
-
- minimizedView.setParent(workspace);
- // workspace.removeView(this);
- workspace.addView(minimizedView);
- workspace.invalidateLayout();
-
- return;
-
- }
- }
- }
-
- private void close() {
- final Workspace workspace = getWorkspace();
- final View[] views = workspace.getSubviews();
- for (final View view : views) {
- if (view == this) {
- dispose();
-
- minimizedView.setParent(workspace);
- workspace.invalidateLayout();
- workspace.addView(minimizedView);
- minimizedView.dispose();
-
- return;
-
- }
- }
- }
-
- @Override
- public void removeView(final View view) {
- if (view == iconView) {
- iconView = null;
- } else {
- throw new IsisException("No view " + view + " in " + this);
- }
- }
-
- @Override
- public void secondClick(final Click click) {
- restore();
- }
-
- @Override
- public ViewAreaType viewAreaType(final Location location) {
- location.subtract(BORDER_WIDTH, BORDER_WIDTH);
- return iconView.viewAreaType(location);
- }
-
- @Override
- public void viewMenuOptions(final UserActionSet options) {
- options.add(new UserActionAbstract("Restore") {
-
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- restore();
- }
- });
- super.viewMenuOptions(options);
- }
-
- @Override
- public void firstClick(final Click click) {
- final View button = overControl(click.getLocation());
- if (button == null) {
- /*
- * if (overBorder(click.getLocation())) { Workspace workspace =
- * getWorkspace(); if (workspace != null) { if (click.button2()) {
- * workspace.lower(getView()); } else if (click.button1()) {
- * workspace.raise(getView()); } } } else { super.firstClick(click);
- * }
- */} else {
- button.firstClick(click);
- }
-
- }
-
- private View overControl(final Location location) {
- for (final WindowControl control : controls) {
- if (control.getBounds().contains(location)) {
- return control;
- }
- }
- return null;
- }
-
- @Override
- public void dragIn(final ContentDrag drag) {
- if (iconView.getBounds().contains(drag.getTargetLocation())) {
- drag.subtract(BORDER_WIDTH, BORDER_WIDTH);
- iconView.dragIn(drag);
- }
- }
-
- @Override
- public void dragOut(final ContentDrag drag) {
- if (iconView.getBounds().contains(drag.getTargetLocation())) {
- drag.subtract(BORDER_WIDTH, BORDER_WIDTH);
- iconView.dragOut(drag);
- }
- }
-
- @Override
- public View identify(final Location location) {
- if (iconView.getBounds().contains(location)) {
- location.subtract(BORDER_WIDTH, BORDER_WIDTH);
- return iconView.identify(location);
- }
- return this;
- }
-
- @Override
- public void drop(final ContentDrag drag) {
- if (iconView.getBounds().contains(drag.getTargetLocation())) {
- drag.subtract(BORDER_WIDTH, BORDER_WIDTH);
- iconView.drop(drag);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/NullFocusManager.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/NullFocusManager.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/NullFocusManager.java
deleted file mode 100644
index 941953f..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/NullFocusManager.java
+++ /dev/null
@@ -1,62 +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.viewer.basic;
-
-import org.apache.isis.viewer.dnd.view.FocusManager;
-import org.apache.isis.viewer.dnd.view.View;
-
-public class NullFocusManager implements FocusManager {
- private View focus;
-
- @Override
- public void focusNextView() {
- }
-
- @Override
- public void focusPreviousView() {
- }
-
- @Override
- public void focusParentView() {
- }
-
- @Override
- public void focusFirstChildView() {
- }
-
- @Override
- public void focusLastChildView() {
- }
-
- @Override
- public void focusInitialChildView() {
- }
-
- @Override
- public View getFocus() {
- return focus;
- }
-
- @Override
- public void setFocus(final View view) {
- focus = 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/viewer/basic/RootWorkspaceSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/RootWorkspaceSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/RootWorkspaceSpecification.java
deleted file mode 100644
index b128419..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/RootWorkspaceSpecification.java
+++ /dev/null
@@ -1,39 +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.viewer.basic;
-
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.View;
-
-public class RootWorkspaceSpecification extends WorkspaceSpecification {
- @Override
- public View createView(final Content content, final Axes axes, final int sequence) {
- View workspace;
- workspace = super.createView(content, axes, sequence);
- workspace.setFocusManager(new WorkspaceFocusManager());
- return workspace;
- }
-
- @Override
- public String getName() {
- return "Root Workspace";
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/SimpleIdentifier.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/SimpleIdentifier.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/SimpleIdentifier.java
deleted file mode 100644
index 177c1b2..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/SimpleIdentifier.java
+++ /dev/null
@@ -1,93 +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.viewer.basic;
-
-import org.apache.isis.core.commons.debug.DebugBuilder;
-import org.apache.isis.viewer.dnd.drawing.Canvas;
-import org.apache.isis.viewer.dnd.drawing.Color;
-import org.apache.isis.viewer.dnd.drawing.ColorsAndFonts;
-import org.apache.isis.viewer.dnd.drawing.Size;
-import org.apache.isis.viewer.dnd.view.ContentDrag;
-import org.apache.isis.viewer.dnd.view.Toolkit;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.base.AbstractViewDecorator;
-
-public class SimpleIdentifier extends AbstractViewDecorator {
-
- public SimpleIdentifier(final View wrappedView) {
- super(wrappedView);
- }
-
- @Override
- public void debugDetails(final DebugBuilder debug) {
- debug.append("SimpleIdentifier");
- }
-
- @Override
- public void dragIn(final ContentDrag drag) {
- wrappedView.dragIn(drag);
- markDamaged();
- }
-
- @Override
- public void dragOut(final ContentDrag drag) {
- wrappedView.dragOut(drag);
- markDamaged();
- }
-
- @Override
- public void draw(final Canvas canvas) {
- Color color = null;
- if (getState().canDrop()) {
- color = Toolkit.getColor(ColorsAndFonts.COLOR_VALID);
- } else if (getState().cantDrop()) {
- color = Toolkit.getColor(ColorsAndFonts.COLOR_INVALID);
- } else if (getState().isViewIdentified() || getState().isObjectIdentified()) {
- color = Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY1);
- }
-
- wrappedView.draw(canvas.createSubcanvas());
-
- if (color != null) {
- final Size s = getSize();
- canvas.drawRectangle(0, 0, s.getWidth() - 1, s.getHeight() - 1, color);
- canvas.drawRectangle(1, 1, s.getWidth() - 3, s.getHeight() - 3, color);
- }
- }
-
- @Override
- public void entered() {
- getState().setContentIdentified();
- wrappedView.entered();
- markDamaged();
- }
-
- @Override
- public void exited() {
- getState().clearObjectIdentified();
- wrappedView.exited();
- markDamaged();
- }
-
- @Override
- public String toString() {
- return wrappedView.toString() + "/SimpleIdentifier";
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/TableFocusManager.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/TableFocusManager.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/TableFocusManager.java
deleted file mode 100755
index 34490bf..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/TableFocusManager.java
+++ /dev/null
@@ -1,172 +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.viewer.basic;
-
-import org.apache.isis.core.commons.util.ToString;
-import org.apache.isis.viewer.dnd.view.FocusManager;
-import org.apache.isis.viewer.dnd.view.View;
-
-public class TableFocusManager implements FocusManager {
- private int row;
- private int cell;
- private final View table;
-
- public TableFocusManager(final View table) {
- this.table = table;
-
- focusInitialChildView();
- }
-
- @Override
- public void focusNextView() {
- View r = table.getSubviews()[row];
- View[] cells = r.getSubviews();
- for (int j = cell + 1; j < cells.length; j++) {
- if (cells[j].canFocus()) {
- cells[cell].markDamaged();
- cell = j;
- // setFocus(cells[cell]);
- cells[j].markDamaged();
- return;
- }
- }
-
- row++;
- if (row == table.getSubviews().length) {
- row = 0;
- }
-
- r = table.getSubviews()[row];
- cells = r.getSubviews();
- for (int j = 0; j < cells.length; j++) {
- if (cells[j].canFocus()) {
- cells[cell].markDamaged();
- cell = j;
- cells[j].markDamaged();
- // setFocus(cells[cell]);
- return;
- }
- }
- }
-
- @Override
- public void focusPreviousView() {
- View r = table.getSubviews()[row];
- View[] cells = r.getSubviews();
- for (int j = cell - 1; j >= 0; j--) {
- if (cells[j].canFocus()) {
- cells[cell].markDamaged();
- cell = j;
- cells[j].markDamaged();
- return;
- }
- }
-
- row--;
- if (row == -1) {
- row = table.getSubviews().length - 1;
- }
-
- r = table.getSubviews()[row];
- cells = r.getSubviews();
- for (int j = cells.length - 1; j >= 0; j--) {
- if (cells[j].canFocus()) {
- cells[cell].markDamaged();
- cell = j;
- cells[j].markDamaged();
- return;
- }
- }
- }
-
- @Override
- public void focusParentView() {
- }
-
- @Override
- public void focusFirstChildView() {
- }
-
- @Override
- public void focusLastChildView() {
- }
-
- @Override
- public void focusInitialChildView() {
- row = cell = 0;
-
- final View[] rows = table.getSubviews();
- if (rows.length > 0) {
- row = 0;
- final View[] cells = rows[0].getSubviews();
- for (int j = 0; j < cells.length; j++) {
- if (cells[j].canFocus()) {
- cells[cell].markDamaged();
- cell = j;
- cells[j].markDamaged();
- // setFocus(cells[cell]);
- return;
- }
- }
- }
- }
-
- @Override
- public View getFocus() {
- final View[] rows = table.getSubviews();
- if (row < 0 || row >= rows.length) {
- return table;
- }
- final View rowView = rows[row];
- final View[] cells = rowView.getSubviews();
- if (cell < 0 || cell >= cells.length) {
- return rowView;
- }
- return cells[cell];
- }
-
- @Override
- public void setFocus(final View view) {
- if (view == table) {
- return;
- }
-
- final View[] rows = table.getSubviews();
- for (row = 0; row < rows.length; row++) {
- final View[] cells = rows[row].getSubviews();
- for (int j = 0; j < cells.length; j++) {
- if (view == cells[j] && cells[j].canFocus()) {
- cells[cell].markDamaged();
- cell = j;
- cells[j].markDamaged();
- return;
- }
- }
- }
- }
-
- @Override
- public String toString() {
- final ToString str = new ToString(this);
- str.append("row", row);
- str.append("cell", cell);
- return str.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/UnlinedTextFieldSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/UnlinedTextFieldSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/UnlinedTextFieldSpecification.java
deleted file mode 100644
index 767ce0b..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/UnlinedTextFieldSpecification.java
+++ /dev/null
@@ -1,54 +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.viewer.basic;
-
-import org.apache.isis.viewer.dnd.field.SingleLineTextField;
-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.ViewRequirement;
-import org.apache.isis.viewer.dnd.view.base.AbstractFieldSpecification;
-import org.apache.isis.viewer.dnd.view.content.TextParseableContent;
-
-/**
- * Creates a single line text field without the baseline being drawn.
- */
-public class UnlinedTextFieldSpecification extends AbstractFieldSpecification {
- @Override
- public boolean canDisplay(final ViewRequirement requirement) {
- return requirement.isTextParseable() && ((TextParseableContent) requirement.getContent()).getNoLines() == 1;
- }
-
- @Override
- public View createView(final Content content, final Axes axes, final int sequence) {
- return new SingleLineTextField((TextParseableContent) content, this, false);
- }
-
- @Override
- public String getName() {
- return "Single Line Text Field";
- }
-
- @Override
- public boolean isAligned() {
- return true;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/WorkspaceFocusManager.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/WorkspaceFocusManager.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/WorkspaceFocusManager.java
deleted file mode 100755
index 4694c3f..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/WorkspaceFocusManager.java
+++ /dev/null
@@ -1,64 +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.viewer.basic;
-
-import org.apache.isis.viewer.dnd.view.FocusManager;
-import org.apache.isis.viewer.dnd.view.View;
-
-public class WorkspaceFocusManager implements FocusManager {
-
- public WorkspaceFocusManager() {
- super();
- }
-
- @Override
- public void focusNextView() {
- }
-
- @Override
- public void focusPreviousView() {
- }
-
- @Override
- public void focusParentView() {
- }
-
- @Override
- public void focusFirstChildView() {
- }
-
- @Override
- public void focusLastChildView() {
- }
-
- @Override
- public void focusInitialChildView() {
- }
-
- @Override
- public View getFocus() {
- return null;
- }
-
- @Override
- public void setFocus(final View 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/viewer/basic/WorkspaceSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/WorkspaceSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/WorkspaceSpecification.java
deleted file mode 100644
index 1f99910..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/viewer/basic/WorkspaceSpecification.java
+++ /dev/null
@@ -1,94 +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.viewer.basic;
-
-import org.apache.isis.viewer.dnd.service.PerspectiveContent;
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.CompositeViewSpecification;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.ViewAxis;
-import org.apache.isis.viewer.dnd.view.ViewRequirement;
-import org.apache.isis.viewer.dnd.view.Workspace;
-import org.apache.isis.viewer.dnd.view.base.Layout;
-import org.apache.isis.viewer.dnd.view.composite.ViewBuilder;
-
-public class WorkspaceSpecification implements CompositeViewSpecification {
- ApplicationWorkspaceBuilder builder = new ApplicationWorkspaceBuilder();
-
- @Override
- public View createView(final Content content, final Axes axes, final int sequence) {
- Workspace workspace;
- workspace = new ApplicationWorkspace(content, axes, this, createLayout(content, axes), builder);
- // workspace.setFocusManager(new WorkspaceFocusManager());
- return workspace;
- }
-
- public Layout createLayout(final Content content, final Axes axes) {
- return new ApplicationWorkspaceBuilder.ApplicationLayout();
- }
-
- public void createAxes(final Content content, final Axes axes) {
- }
-
- public ViewAxis axis(final Content content) {
- return null;
- }
-
- public ViewBuilder getSubviewBuilder() {
- return builder;
- }
-
- @Override
- public String getName() {
- return "Root Workspace";
- }
-
- @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 boolean canDisplay(final ViewRequirement requirement) {
- return requirement.isFor(PerspectiveContent.class);
- }
-
-}