Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util')
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/editparts/AbstractComponentViewerRootEditPart.java63
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectedEditPartFigure.java138
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectionRenderingFigure.java215
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerFigure.java60
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerLayout.java218
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/FillLayout.java162
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedEditPartFigure.java30
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedFigure.java18
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectionRenderingViewer.java16
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IExpandable.java19
-rw-r--r--bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/SpacingFigure.java27
11 files changed, 0 insertions, 966 deletions
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/editparts/AbstractComponentViewerRootEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/editparts/AbstractComponentViewerRootEditPart.java
deleted file mode 100644
index caef3974c8..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/editparts/AbstractComponentViewerRootEditPart.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.editparts;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Panel;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.eclipse.wst.xsd.ui.internal.gef.util.figures.ContainerLayout;
-
-
-public abstract class AbstractComponentViewerRootEditPart extends AbstractGraphicalEditPart
-{
- protected final static String MESSAGE_PLACE_HOLDER = "MESSAGE_PLACE_HOLDER";
- protected Object input;
-
- public void setInput(Object input)
- {
- this.input = input;
- refreshChildren();
- }
-
- protected IFigure createFigure()
- {
- Panel panel = new Panel();
- ContainerLayout layout = new ContainerLayout();
- layout.setBorder(60);
- panel.setLayoutManager(layout);
- return panel;
- }
-
-
- protected List getModelChildren()
- {
- List list = new ArrayList();
- if (input != null)
- {
- list.add(input);
- }
- else
- {
- list.add(MESSAGE_PLACE_HOLDER);
- }
- return list;
- }
-
- protected abstract EditPart createChild(Object model);
-
- protected void createEditPolicies()
- {
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectedEditPartFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectedEditPartFigure.java
deleted file mode 100644
index f25f67787d..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectedEditPartFigure.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-
-
-public class ConnectedEditPartFigure extends ContainerFigure implements IConnectedEditPartFigure
-{
- protected EditPart editPart;
- protected boolean childConnectionsEnabled = true;
- protected List connectedFigures = new ArrayList();
- protected int connectionType = RIGHT_CONNECTION;
-
- public ConnectedEditPartFigure(EditPart editPart)
- {
- this.editPart = editPart;
- }
-
- public void setChildConnectionsEnabled(boolean enabled)
- {
- childConnectionsEnabled = enabled;
- }
-
- protected IConnectedEditPartFigure getParentGraphNodeFigure()
- {
- IConnectedEditPartFigure result = null;
- for (EditPart parentEditPart = editPart.getParent(); parentEditPart != null; parentEditPart = parentEditPart.getParent())
- {
- IFigure figure = ((AbstractGraphicalEditPart)parentEditPart).getFigure();
- if (figure instanceof IConnectedEditPartFigure)
- {
- IConnectedEditPartFigure graphNodeFigure = (IConnectedEditPartFigure)figure;
- if (graphNodeFigure.getConnectionFigure() != null)
- {
- result = graphNodeFigure;
- break;
- }
- }
- }
- return result;
- }
-
- public void addNotify()
- {
- super.addNotify();
- if (getConnectionFigure() != null)
- {
- IConnectedEditPartFigure parentGraphNodeFigure = getParentGraphNodeFigure();
- if (parentGraphNodeFigure != null)
- {
- parentGraphNodeFigure.addConnectedFigure(this);
- }
- }
- }
-
- public void removeNotify()
- {
- super.removeNotify();
- if (getConnectionFigure() != null)
- {
- IConnectedEditPartFigure parentGraphNodeFigure = getParentGraphNodeFigure();
- if (parentGraphNodeFigure != null)
- {
- parentGraphNodeFigure.removeConnectedFigure(this);
- }
- }
- }
-
- public void addConnectedFigure(IConnectedEditPartFigure figure)
- {
- if (childConnectionsEnabled)
- {
- // this test is required since we sometimes receive the 'addNotify' call twice
- //
- if (!connectedFigures.contains(figure))
- {
- connectedFigures.add(figure);
- }
- }
- }
-
- public void removeConnectedFigure(IConnectedEditPartFigure figure)
- {
- if (childConnectionsEnabled)
- {
- connectedFigures.remove(figure);
- }
- }
-
- public IFigure getSelectionFigure()
- {
- return this;
- }
-
- public IFigure getConnectionFigure()
- {
- return this;
- }
-
- public List getConnectedFigures(int type)
- {
- List list = new ArrayList();
- for (Iterator i = connectedFigures.iterator(); i.hasNext(); )
- {
- IConnectedEditPartFigure figure = (IConnectedEditPartFigure)i.next();
- //if (type == 0 || type == figure.getConnectionType())
- {
- list.add(figure);
- }
- }
- return list;
- }
-
- public int getConnectionType()
- {
- return connectionType;
- }
-
- public void setConnectionType(int type)
- {
- connectionType = type;
- }
-}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectionRenderingFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectionRenderingFigure.java
deleted file mode 100644
index 7192108cd9..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ConnectionRenderingFigure.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.draw2d.geometry.PointList;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.GraphicalEditPart;
-
-
-public class ConnectionRenderingFigure extends RectangleFigure
-{
- protected boolean isOutlined = true;
- protected IFigure primaryLayer;
-
- public ConnectionRenderingFigure(IFigure primaryLayer)
- {
- setOpaque(false);
- this.primaryLayer = primaryLayer;
- //setFocusTraversable(false);
- //setEnabled(false);
- }
-
- protected boolean isMouseEventTarget()
- {
- return false;
- }
-
- public boolean containsPoint(int x, int y)
- {
- return false;
- }
-
- protected void fillShape(Graphics graphics)
- {
- graphics.setForegroundColor(ColorConstants.black);
- drawLines(graphics, primaryLayer);
- }
-
- protected void outlineShape(Graphics graphics)
- {
- if (isOutlined)
- {
- super.outlineShape(graphics);
- }
- }
-
- protected void drawLines(Graphics graphics, IFigure figure)
- {
- if (figure instanceof IConnectedEditPartFigure)
- {
- IConnectedEditPartFigure graphNodeFigure = (IConnectedEditPartFigure)figure;
- List connectedFigures = graphNodeFigure.getConnectedFigures(IConnectedEditPartFigure.RIGHT_CONNECTION);
- int connectedFiguresSize = connectedFigures.size();
-
- if (connectedFiguresSize > 0)
- {
- IConnectedEditPartFigure firstGraphNodeFigure = (IConnectedEditPartFigure)connectedFigures.get(0);
- Rectangle r = graphNodeFigure.getConnectionFigure().getBounds();
-
- int x1 = r.x + r.width;
- int y1 = r.y + r.height/2;
-
- int startOfChildBox = firstGraphNodeFigure.getConnectionFigure().getBounds().x;
- int x2 = x1 + (startOfChildBox - x1) / 3;
- int y2 = y1;
-
- if (connectedFiguresSize == 1)
- {
- graphics.drawLine(x1, y1, startOfChildBox, y2);
- }
- else // (connectedFigures.length > 1)
- {
- graphics.drawLine(x1, y1, x2, y2);
-
- int minY = Integer.MAX_VALUE;
- int maxY = -1;
-
- for (Iterator i = connectedFigures.iterator(); i.hasNext(); )
- {
- IConnectedEditPartFigure connectedFigure = (IConnectedEditPartFigure)i.next();
- Rectangle childConnectionRectangle = connectedFigure.getConnectionFigure().getBounds();
- int y = childConnectionRectangle.y + childConnectionRectangle.height / 2;
- minY = Math.min(minY, y);
- maxY = Math.max(maxY, y);
- graphics.drawLine(x2, y, childConnectionRectangle.x, y);
- }
- graphics.drawLine(x2, minY, x2, maxY);
- }
- }
- }
-
- //boolean visitChildren = true;
- List children = figure.getChildren();
- for (Iterator i = children.iterator(); i.hasNext(); )
- {
- IFigure child = (IFigure)i.next();
- drawLines(graphics, child);
- }
- }
-
- // This method supports the preview connection line function related to drag and drop
- //
- public PointList getConnectionPoints(GraphicalEditPart parentEditPart, GraphicalEditPart childRefEditPart, Rectangle draggedFigureBounds)
- {
- PointList pointList = new PointList();
- int[] data = new int[1];
- Point a = getConnectionPoint(parentEditPart, childRefEditPart, data);
- if (a != null)
- {
- int draggedFigureBoundsY = draggedFigureBounds.y + draggedFigureBounds.height/2;
-
- pointList.addPoint(a);
- //pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
-
- if (data[0] == 0) // insert between 2 items
- {
- int x = a.x + (draggedFigureBounds.x - a.x)/2;
- pointList.addPoint(new Point(x, a.y));
- pointList.addPoint(new Point(x, draggedFigureBoundsY));
- pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
- }
- else // insert at first or last position
- {
- pointList.addPoint(new Point(a.x, draggedFigureBoundsY));
- pointList.addPoint(new Point(draggedFigureBounds.x, draggedFigureBoundsY));
- }
- }
- return pointList;
- }
-
-
- // This method supports the preview connection line function related to drag and drop
- //
- protected Point getConnectionPoint(GraphicalEditPart parentEditPart, GraphicalEditPart childRefEditPart, int[] data)
- {
- Point point = null;
- List childList = parentEditPart.getChildren();
-
- if (parentEditPart.getFigure() instanceof IConnectedEditPartFigure && childList.size() > 0)
- {
- point = new Point();
-
- GraphicalEditPart prev = null;
- GraphicalEditPart next = null;
-
- for (Iterator i = childList.iterator(); i.hasNext(); )
- {
- Object o = i.next();
- if (o instanceof GraphicalEditPart)
- {
- GraphicalEditPart childEditPart = (GraphicalEditPart)o;
- if (childEditPart.getFigure() instanceof IConnectedEditPartFigure)
- {
- if (childEditPart == childRefEditPart)
- {
- next = childEditPart;
- break;
- }
- prev = childEditPart;
- }
- }
- }
-
-
- if (next != null && prev != null)
- {
- int ya = getConnectedEditPartConnectionBounds(prev).getCenter().y;
- int yb = getConnectedEditPartConnectionBounds(next).getCenter().y;
- point.y = ya + (yb - ya)/2;
- data[0] = 0;
- }
- else if (prev != null) // add it last
- {
- point.y = getConnectedEditPartConnectionBounds(prev).getCenter().y;
- data[0] = 1;
- }
- else if (next != null) // add it first!
- {
- point.y = getConnectedEditPartConnectionBounds(next).getCenter().y;
- data[0] = -1;
- }
-
- if (next != null || prev != null)
- {
- GraphicalEditPart child = prev != null ? prev : next;
- int startOfChildBox = getConnectedEditPartConnectionBounds(child).x;
- Rectangle r = getConnectedEditPartConnectionBounds(parentEditPart);
- int x1 = r.x + r.width;
- point.x = x1 + (startOfChildBox - x1) / 3;
- }
- }
- return point;
- }
-
- protected Rectangle getConnectedEditPartConnectionBounds(GraphicalEditPart editPart)
- {
- return ((IConnectedEditPartFigure)editPart.getFigure()).getConnectionFigure().getBounds();
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerFigure.java
deleted file mode 100644
index d7a77ac685..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerFigure.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.RectangleFigure;
-
-public class ContainerFigure extends RectangleFigure implements IExpandable
-{
- protected boolean isOutlined = false;
- protected boolean isExpanded = true;
-
- public ContainerFigure()
- {
- setLayoutManager(new ContainerLayout());
- setFill(false);
- }
-
- public void doLayout()
- {
- layout();
- setValid(true);
- }
-
- public ContainerLayout getContainerLayout()
- {
- return (ContainerLayout)getLayoutManager();
- }
-
- public void setOutlined(boolean isOutlined)
- {
- this.isOutlined = isOutlined;
- }
-
- protected void outlineShape(Graphics graphics)
- {
- if (isOutlined)
- {
- super.outlineShape(graphics);
- }
- }
-
- public boolean isExpanded()
- {
- return isExpanded;
- }
-
- public void setExpanded(boolean isExpanded)
- {
- this.isExpanded = isExpanded;
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerLayout.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerLayout.java
deleted file mode 100644
index 12f654bd5b..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/ContainerLayout.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-
-public class ContainerLayout extends AbstractLayout
-{
- protected boolean isHorizontal;
- protected int spacing = 0;
- protected int border = 0;
-
- public ContainerLayout()
- {
- this(true, 0);
- }
-
- public ContainerLayout(boolean isHorizontal, int spacing)
- {
- this.isHorizontal = isHorizontal;
- this.spacing = spacing;
- }
-
- public void setHorizontal(boolean isHorizontal)
- {
- this.isHorizontal = isHorizontal;
- }
-
- public void setSpacing(int spacing)
- {
- this.spacing = spacing;
- }
-
- public void setBorder(int border)
- {
- this.border = border;
- }
-
- protected int alignFigure(IFigure parent, IFigure child)
- {
- return -1;
- }
-
- /**
- * Calculates and returns the preferred size of the container
- * given as input.
- *
- * @param figure Figure whose preferred size is required.
- * @return The preferred size of the passed Figure.
- * @since 2.0
- */
- protected Dimension calculatePreferredSizeHelper(IFigure parent)
- {
- Dimension preferred = new Dimension();
- List children = parent.getChildren();
-
- for (int i=0; i < children.size(); i++)
- {
- IFigure child = (IFigure)children.get(i);
-
- Dimension childSize = child.getPreferredSize();
-
- if (isHorizontal)
- {
- preferred.width += childSize.width;
- preferred.height = Math.max(preferred.height, childSize.height);
- }
- else
- {
- preferred.height += childSize.height;
- preferred.width = Math.max(preferred.width, childSize.width);
- }
- }
-
- int childrenSize = children.size();
- if (childrenSize > 1)
- {
- if (isHorizontal)
- {
- preferred.width += spacing * (childrenSize - 1);
- }
- else
- {
- preferred.height += spacing * (childrenSize - 1);
- }
- }
-
- preferred.width += border * 2;
- preferred.height += border * 2;
- preferred.width += parent.getInsets().getWidth();
- preferred.height += parent.getInsets().getHeight();
-
- return preferred;
- }
-
- protected Dimension calculatePreferredSize(IFigure parent, int width, int height)
- {
- Dimension preferred = null;
-
- // Here we ensure that an unexpanded container is given a size of (0,0)
- //
- if (parent instanceof IExpandable)
- {
- IExpandable expandableFigure = (IExpandable)parent;
- if (!expandableFigure.isExpanded())
- {
- preferred = new Dimension();
- }
- }
-
- if (preferred == null)
- {
- preferred = calculatePreferredSizeHelper(parent);
- }
-
- return preferred;
- }
-
-
- protected void adjustLayoutLocation(IFigure parent, Dimension dimension)
- {
- }
-
- public void layout(IFigure parent)
- {
- List children = parent.getChildren();
-
- int rx = 0;
- Dimension dimension = new Dimension();
-
-
- for (int i=0; i < children.size(); i++)
- {
- IFigure child = (IFigure)children.get(i);
- Dimension childSize = child.getPreferredSize();
- if (isHorizontal)
- {
- dimension.height = Math.max(dimension.height, childSize.height);
- rx += childSize.width;
- }
- else
- {
- dimension.width = Math.max(dimension.width, childSize.width);
- }
- }
-
- //dimension.width += parent.getInsets().left;
- //dimension.height += parent.getInsets().top;
-
- if (isHorizontal)
- {
- dimension.height += border*2;
- dimension.width += border;
- }
- else
- {
- dimension.width += border*2;
- dimension.height += border;
- }
- adjustLayoutLocation(parent, dimension);
-
- for (int i=0; i < children.size(); i++)
- {
- IFigure child = (IFigure)children.get(i);
- Dimension childSize = child.getPreferredSize();
-
- if (isHorizontal)
- {
- int y = -1;
-
- y = alignFigure(parent, child);
-
- if (y == -1)
- {
- y = (dimension.height - childSize.height) / 2;
- }
-
- Rectangle rectangle = new Rectangle(dimension.width, y, childSize.width, childSize.height);
- rectangle.translate(parent.getClientArea().getLocation());
-
-
- child.setBounds(rectangle);
- dimension.width += childSize.width;
- dimension.width += spacing;
-
- if (child instanceof SpacingFigure)
- {
- int availableHorizontalSpace = parent.getClientArea().width - rx;
- dimension.width += availableHorizontalSpace;
- }
- }
- else
- {
- Rectangle rectangle = new Rectangle(0, dimension.height, childSize.width, childSize.height);
- rectangle.translate(parent.getClientArea().getLocation());
-
-
- child.setBounds(rectangle);
- dimension.height += childSize.height;
- dimension.height += spacing;
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/FillLayout.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/FillLayout.java
deleted file mode 100644
index 1b2976b64e..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/FillLayout.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-
-public class FillLayout extends AbstractLayout
-{
- protected boolean isHorizontal = false;
- protected int spacing = 0;
- public Dimension min;
-
- public FillLayout(){}
-
- public FillLayout(int spacing)
- {
- this.spacing = spacing;
- }
-
- public void setHorizontal(boolean isHorizontal)
- {
- this.isHorizontal = isHorizontal;
- }
-
- /**
- * Calculates and returns the preferred size of the input container.
- * This is the size of the largest child of the container, as all
- * other children fit into this size.
- *
- * @param figure Container figure for which preferred size is required.
- * @return The preferred size of the input figure.
- * @since 2.0
- */
-
- protected Dimension calculatePreferredSize(IFigure figure, int width, int height)
- {
- Dimension d = calculatePreferredClientAreaSize(figure);
- d.expand(figure.getInsets().getWidth(),
- figure.getInsets().getHeight());
- d.union(getBorderPreferredSize(figure));
- return d;
- }
-
- protected Dimension calculatePreferredClientAreaSize(IFigure figure)
- {
- Dimension d = new Dimension();
- List children = figure.getChildren();
-
-
- for (Iterator i = children.iterator(); i.hasNext(); )
- {
- IFigure child = (IFigure)i.next();
- Dimension childSize = child.getPreferredSize();
-
- if (isHorizontal)
- {
- d.width += childSize.width;
- d.height = Math.max(childSize.height, d.height);
- }
- else
- {
- d.height += childSize.height;
- d.width = Math.max(childSize.width, d.width);
- }
- }
-
-
- int childrenSize = children.size();
- if (childrenSize > 0)
- {
- if (isHorizontal)
- {
- d.width += spacing * (childrenSize - 1);
- }
- else
- {
- d.height += spacing * (childrenSize - 1);
- }
- }
-
- if (min != null)
- {
- d.width = Math.max(d.width, min.width);
- d.height = Math.max(d.height, min.height);
- }
- return d;
- }
-
- /*
- * Returns the minimum size required by the input container.
- * This is the size of the largest child of the container, as all
- * other children fit into this size.
- */
- public Dimension getMinimumSize(IFigure figure, int width, int height)
- {
- Dimension d = new Dimension();
- List children = figure.getChildren();
- IFigure child;
-
- for (int i=0; i < children.size(); i++)
- {
- child = (IFigure)children.get(i);
- d.union(child.getMinimumSize());
- }
- d.expand(figure.getInsets().getWidth(),
- figure.getInsets().getHeight());
- return d;
- }
-
- public Dimension getPreferredSize(IFigure figure, int width, int height)
- {
- return calculatePreferredSize(figure, width, height);
- }
-
- /*
- * Lays out the children on top of each other with
- * their sizes equal to that of the available
- * paintable area of the input container figure.
- */
- public void layout(IFigure figure)
- {
- Dimension preferredSize = calculatePreferredClientAreaSize(figure);
- Rectangle r = figure.getClientArea().getCopy();
- List children = figure.getChildren();
-
- int nChildren = children.size();
- int extraHorizontalSpace = r.width - preferredSize.width;
-
- for (Iterator i = children.iterator(); i.hasNext(); )
- {
- IFigure child = (IFigure)i.next();
- Dimension preferredChildSize = child.getPreferredSize();
-
- if (isHorizontal)
- {
- int w = preferredChildSize.width + (extraHorizontalSpace / nChildren);
- child.setBounds(new Rectangle(r.x, r.y, w, Math.max(preferredSize.height, r.height)));
- r.x += w + spacing;
- }
- else
- {
- child.setBounds(new Rectangle(r.x, r.y, Math.max(preferredSize.width, r.width), preferredChildSize.height));
- r.y += preferredChildSize.height + spacing;
- }
- }
- }
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedEditPartFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedEditPartFigure.java
deleted file mode 100644
index 4c778d7e20..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedEditPartFigure.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-
-public interface IConnectedEditPartFigure extends IConnectedFigure
-{
- public static final int UP_CONNECTION = 1;
- public static final int DOWN_CONNECTION = 2;
- public static final int LEFT_CONNECTION = 3;
- public static final int RIGHT_CONNECTION = 4;
-
- public IFigure getSelectionFigure();
- public IFigure getConnectionFigure();
- public List getConnectedFigures(int type);
- public int getConnectionType();
- public void addConnectedFigure(IConnectedEditPartFigure figure);
- public void removeConnectedFigure(IConnectedEditPartFigure figure);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedFigure.java
deleted file mode 100644
index 4a6d7ded2c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectedFigure.java
+++ /dev/null
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-
-import org.eclipse.draw2d.IFigure;
-
-public interface IConnectedFigure extends IFigure
-{
- public IFigure getConnectionFigure();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectionRenderingViewer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectionRenderingViewer.java
deleted file mode 100644
index 6ed611d9d7..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IConnectionRenderingViewer.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-
-public interface IConnectionRenderingViewer
-{
- public ConnectionRenderingFigure getConnectionRenderingFigure();
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IExpandable.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IExpandable.java
deleted file mode 100644
index 161581bb00..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/IExpandable.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-
-import org.eclipse.draw2d.IFigure;
-
-public interface IExpandable extends IFigure
-{
- boolean isExpanded();
- void setExpanded(boolean isExpanded);
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/SpacingFigure.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/SpacingFigure.java
deleted file mode 100644
index e245d6960c..0000000000
--- a/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/gef/util/figures/SpacingFigure.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.xsd.ui.internal.gef.util.figures;
-
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-
-public class SpacingFigure extends RectangleFigure
-{
- public SpacingFigure()
- {
- setFill(false);
- setPreferredSize(new Dimension(0, 0));
- }
-
- //protected void outlineShape(Graphics graphics)
- //{
- //}
-} \ No newline at end of file

Back to the top