Author: dazarov
Date: 2008-07-04 04:35:56 -0400 (Fri, 04 Jul 2008)
New Revision: 9066
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesContextMenuProvider.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/Link.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/LinkImpl.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEndpointEditPolicy.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ParamEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ParamListEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/xpl/PagesConnectionRouter.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ConnectionFigure.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamFigure.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamListFigure.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1189
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesContextMenuProvider.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesContextMenuProvider.java 2008-07-04
00:48:40 UTC (rev 9065)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesContextMenuProvider.java 2008-07-04
08:35:56 UTC (rev 9066)
@@ -113,7 +113,7 @@
}
if(selected instanceof ParamEditPart) {
ParamEditPart part = (ParamEditPart)selected;
- Object partModel = part.getExceptionModel().getPagesModel();
+ Object partModel = part.getParamModel().getPagesModel();
if(partModel instanceof PagesElement) {
return (XModelObject)((PagesElement)partModel).getData();
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesEditor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesEditor.java 2008-07-04
00:48:40 UTC (rev 9065)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesEditor.java 2008-07-04
08:35:56 UTC (rev 9066)
@@ -659,7 +659,7 @@
}
if(selected instanceof ParamEditPart) {
ParamEditPart part = (ParamEditPart)selected;
- Object partModel = part.getExceptionModel().getPagesModel();
+ Object partModel = part.getParamModel().getPagesModel();
if(partModel instanceof PagesElement) {
return (XModelObject)((PagesElement)partModel).getData();
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/Link.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/Link.java 2008-07-04
00:48:40 UTC (rev 9065)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/Link.java 2008-07-04
08:35:56 UTC (rev 9066)
@@ -1,5 +1,6 @@
package org.jboss.tools.seam.ui.pages.editor.ecore.pages;
+import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.emf.ecore.EObject;
/**
@@ -91,4 +92,12 @@
void setData(Object value);
public void dataChanged();
+
+ public PointList getPointList();
+
+ public void savePointList(PointList list);
+
+ public void clearPointList();
+
+ public String getPathFromModel();
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/LinkImpl.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/LinkImpl.java 2008-07-04
00:48:40 UTC (rev 9065)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/LinkImpl.java 2008-07-04
08:35:56 UTC (rev 9066)
@@ -6,6 +6,8 @@
*/
package org.jboss.tools.seam.ui.pages.editor.ecore.pages.impl;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
@@ -16,6 +18,7 @@
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.jst.web.model.helpers.WebProcessStructureHelper;
import org.jboss.tools.seam.pages.xml.model.helpers.SeamPagesDiagramStructureHelper;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Link;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PagesElement;
@@ -507,5 +510,67 @@
}
}
}
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ private final static String PROPERTY_SHAPE = "shape";
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public PointList getPointList() {
+ int[] path = null;
+ path = SeamPagesDiagramStructureHelper.instance.asIntArray((XModelObject)getData(),
PROPERTY_SHAPE);
+
+ PointList list = new PointList();
+
+ if (path.length < 4)
+ return list;
+
+ for (int i = 0; i < path.length; i += 2) {
+ list.addPoint(path[i], path[i + 1]);
+ }
+
+ return list;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void savePointList(PointList list) {
+ String value = "";
+ for (int i = 0; i < list.size(); i++) {
+ if (i != 0)
+ value += ",";
+ Point p = list.getPoint(i);
+ value += p.x + "," + p.y;
+ }
+ SeamPagesDiagramStructureHelper.instance.setAttributeValue((XModelObject)getData(),
PROPERTY_SHAPE, value);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public void clearPointList() {
+ ((XModelObject)getData()).setAttributeValue(PROPERTY_SHAPE, "");
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String getPathFromModel() {
+ return ((XModelObject)getData()).getAttributeValue(PROPERTY_SHAPE);
+ }
} //LinkImpl
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java 2008-07-04
00:48:40 UTC (rev 9065)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEditPart.java 2008-07-04
08:35:56 UTC (rev 9066)
@@ -13,26 +13,21 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
-import org.eclipse.draw2d.*;
+import org.eclipse.draw2d.Connection;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
-import org.jboss.tools.common.model.ui.dnd.DnDUtil;
import org.eclipse.gef.AccessibleEditPart;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartListener;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.editparts.AbstractConnectionEditPart;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.accessibility.AccessibleEvent;
import org.eclipse.swt.graphics.Image;
-
-import org.jboss.tools.common.meta.action.XAction;
-import org.jboss.tools.common.model.XModelException;
-import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.gef.GEFGraphicalViewer;
import org.jboss.tools.common.gef.edit.GEFRootEditPart;
import org.jboss.tools.common.gef.figures.GEFLabel;
import org.jboss.tools.common.gef.figures.xpl.CustomLocator;
@@ -86,12 +81,13 @@
return null;
ConnectionFigure conn = FigureFactory.createNewBendableWire(this,
getLink());
-// PointList list = getLink().getPointList();
-// if (list.size() > 0) {
-// conn.setManual(true);
-// conn.setOldPoints(list.getFirstPoint(), list.getLastPoint());
-// conn.setPoints(list);
-// }
+ PointList list = getLink().getPointList();
+ if (list.size() > 0) {
+ conn.setManual(true);
+ conn.setOldPoints(list.getFirstPoint(), list.getLastPoint());
+ conn.setPoints(list);
+ //conn.repaint();
+ }
pathLabel = new GEFLabel(getLink().getName(),
FigureFactory.normalColor);
@@ -134,11 +130,11 @@
public void save() {
PointList list = ((ConnectionFigure) getFigure()).getPoints();
- //getLink().savePointList(list);
+ getLink().savePointList(list);
}
public void clear() {
- //getLink().clearPointList();
+ getLink().clearPointList();
}
public void deactivate() {
@@ -222,15 +218,15 @@
refresh();
}
-// if (getLinkFigure().isManual()
-// && getLink().getPathFromModel().equals("")) {
-// getLinkFigure().setManual(false);
-// refresh();
-// } else if (!getLinkFigure().isManual()
-// && !getLink().getPathFromModel().equals("")) {
-// getLinkFigure().setManual(true);
-// refresh();
-// }
+ if (getLinkFigure().isManual()
+ && getLink().getPathFromModel().equals("")) {
+ getLinkFigure().setManual(false);
+ refresh();
+ } else if (!getLinkFigure().isManual()
+ && !getLink().getPathFromModel().equals("")) {
+ getLinkFigure().setManual(true);
+ refresh();
+ }
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEndpointEditPolicy.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEndpointEditPolicy.java 2008-07-04
00:48:40 UTC (rev 9065)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/LinkEndpointEditPolicy.java 2008-07-04
08:35:56 UTC (rev 9066)
@@ -15,8 +15,6 @@
import org.eclipse.draw2d.ConnectionLocator;
import org.eclipse.draw2d.IFigure;
-import org.eclipse.swt.dnd.DragSourceEvent;
-import org.eclipse.swt.events.MouseEvent;
import org.eclipse.draw2d.PolylineConnection;
import org.eclipse.gef.ConnectionEditPart;
import org.eclipse.gef.DragTracker;
@@ -28,18 +26,19 @@
import org.eclipse.gef.handles.AbstractHandle;
import org.eclipse.gef.handles.ConnectionHandle;
import org.eclipse.gef.tools.ConnectionEndpointTracker;
+import org.eclipse.swt.dnd.DragSourceEvent;
+import org.eclipse.swt.events.MouseEvent;
import org.jboss.tools.seam.ui.pages.editor.dnd.DndHelper;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Link;
import org.jboss.tools.seam.ui.pages.editor.figures.ConnectionFigure;
-import org.jboss.tools.seam.ui.pages.editor.figures.FigureFactory;
public class LinkEndpointEditPolicy
extends org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy {
private List handles = null;
- private void addJSFHandles() {
- removeJSFHandles();
+ private void addPagesHandles() {
+ removePagesHandles();
handles = createHandles();
IFigure layer = getLayer(LayerConstants.HANDLE_LAYER);
for (int i = 0; i < handles.size(); i++)
@@ -47,7 +46,7 @@
}
- private void removeJSFHandles() {
+ private void removePagesHandles() {
if (handles == null)
return;
IFigure layer = getLayer(LayerConstants.HANDLE_LAYER);
@@ -59,7 +58,7 @@
protected void addSelectionHandles() {
super.addSelectionHandles();
- addJSFHandles();
+ addPagesHandles();
getConnectionFigure().setSelected(true);
}
@@ -70,7 +69,7 @@
protected void removeSelectionHandles() {
super.removeSelectionHandles();
- removeJSFHandles();
+ removePagesHandles();
getConnectionFigure().setSelected(false);
}
@@ -162,14 +161,14 @@
public void mouseDown(MouseEvent me, EditPartViewer epv) {
super.mouseDown(me, epv);
- removeJSFHandles();
+ removePagesHandles();
DndHelper.drag(((Link) getHost().getModel()).getData());
}
public void mouseUp(MouseEvent me, EditPartViewer epv) {
super.mouseUp(me, epv);
if (getHost().getSelected() != EditPart.SELECTED_NONE)
- addJSFHandles();
+ addPagesHandles();
}
protected boolean handleNativeDragFinished(DragSourceEvent event) {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java 2008-07-04
00:48:40 UTC (rev 9065)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PageEditPart.java 2008-07-04
08:35:56 UTC (rev 9066)
@@ -116,9 +116,9 @@
if (RequestConstants.REQ_OPEN.equals(req.getType())) {
SelectionRequest request = (SelectionRequest) req;
Point mouseLocation = request.getLocation()
- .translate(-getGroupFigure().getLocation().x,
- -getGroupFigure().getLocation().y);
- if (mouseLocation.x < 16 && mouseLocation.y >
getGroupFigure().getSize().height-16) {
+ .translate(-getPageFigure().getLocation().x,
+ -getPageFigure().getLocation().y);
+ if (mouseLocation.x < 16 && mouseLocation.y >
getPageFigure().getSize().height-16) {
getPageModel().setParamsVisible(!getPageModel().isParamsVisible());
refresh();
fig.repaint();
@@ -141,8 +141,6 @@
super.createEditPolicies();
installEditPolicy(EditPolicy.NODE_ROLE, null);
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, null);
- // installEditPolicy(EditPolicy.COMPONENT_ROLE, new PageEditPolicy());
- // installEditPolicy(EditPolicy.LAYOUT_ROLE, new JSFFlowEditPolicy());
installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE,
new PageEditPolicy());
}
@@ -159,7 +157,7 @@
return fig;
}
- public PageFigure getGroupFigure() {
+ public PageFigure getPageFigure() {
return (PageFigure) getFigure();
}
@@ -225,10 +223,6 @@
return getNodeFigure().getSourceConnectionAnchorAt(pt);
}
- // protected List getModelChildren() {
- // return getPageModel().getChildren();
- // }
-
protected void refreshChildren() {
super.refreshChildren();
for (int i = 0; i < getChildren().size(); i++) {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesEditPart.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesEditPart.java 2008-07-04
00:48:40 UTC (rev 9065)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/PagesEditPart.java 2008-07-04
08:35:56 UTC (rev 9066)
@@ -60,7 +60,6 @@
*
*/
protected void createEditPolicies() {
-// installEditPolicy(EditPolicy.COMPONENT_ROLE, new JSFElementEditPolicy());
installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE,
new PagesNodeEditPolicy());
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ParamEditPart.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ParamEditPart.java 2008-07-04
00:48:40 UTC (rev 9065)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ParamEditPart.java 2008-07-04
08:35:56 UTC (rev 9066)
@@ -108,21 +108,16 @@
}
protected List getModelTargetConnections() {
- return getExceptionModel().getInputLinks();
+ return getParamModel().getInputLinks();
}
protected List getModelSourceConnections() {
- return getExceptionModel().getOutputLinks();
+ return getParamModel().getOutputLinks();
}
protected void createEditPolicies() {
- super.createEditPolicies();
installEditPolicy(EditPolicy.NODE_ROLE, null);
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, null);
- //installEditPolicy(EditPolicy.COMPONENT_ROLE, new PageEditPolicy());
- //installEditPolicy(EditPolicy.LAYOUT_ROLE, new JSFFlowEditPolicy());
- //installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE,
- // new PageEditPolicy());
}
/**
@@ -132,7 +127,7 @@
*/
protected IFigure createFigure() {
- fig = new ParamFigure(getExceptionModel());
+ fig = new ParamFigure(getParamModel());
((ParamFigure) fig).setEditPart(this);
return fig;
}
@@ -142,7 +137,7 @@
*
* @return Model of this as an LED.
*/
- public Param getExceptionModel() {
+ public Param getParamModel() {
return (Param) getModel();
}
@@ -165,37 +160,8 @@
return 21;
}
- public ConnectionAnchor getTargetConnectionAnchor(
- ConnectionEditPart connEditPart) {
- ConnectionAnchor anc = getNodeFigure().getConnectionAnchor("1_IN");
- return anc;
- }
-
- public ConnectionAnchor getTargetConnectionAnchor(Request request) {
- Point pt = new Point(((DropRequest) request).getLocation());
- return getNodeFigure().getTargetConnectionAnchorAt(pt);
- }
-
- public ConnectionAnchor getSourceConnectionAnchor(
- ConnectionEditPart connEditPart) {
- if (single) {
- Link link = (Link) connEditPart.getModel();
- int index = getExceptionModel().getOutputLinks().indexOf(link);
- return getNodeFigure().getConnectionAnchor((index + 1) + "_OUT");
- } else
- return super.getSourceConnectionAnchor(connEditPart);
- }
-
- public ConnectionAnchor getSourceConnectionAnchor(Request request) {
- if (single) {
- Point pt = new Point(((DropRequest) request).getLocation());
- return getNodeFigure().getSourceConnectionAnchorAt(pt);
- } else
- return super.getSourceConnectionAnchor(request);
- }
-
protected List getModelChildren() {
- return getExceptionModel().getChildren();
+ return getParamModel().getChildren();
}
protected void refreshChildren() {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ParamListEditPart.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ParamListEditPart.java 2008-07-04
00:48:40 UTC (rev 9065)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ParamListEditPart.java 2008-07-04
08:35:56 UTC (rev 9066)
@@ -56,13 +56,8 @@
}
protected void createEditPolicies() {
- //super.createEditPolicies();
installEditPolicy(EditPolicy.NODE_ROLE, null);
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, null);
- //installEditPolicy(EditPolicy.COMPONENT_ROLE, new PageEditPolicy());
- //installEditPolicy(EditPolicy.LAYOUT_ROLE, new JSFFlowEditPolicy());
- //installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE,
- // new PageEditPolicy());
}
/**
@@ -72,7 +67,7 @@
*/
protected IFigure createFigure() {
- fig = new ParamListFigure(getExceptionModel());
+ fig = new ParamListFigure(getPageWrapperModel());
((ParamListFigure) fig).setEditPart(this);
return fig;
}
@@ -82,7 +77,7 @@
*
* @return Model of this as an LED.
*/
- public PageWrapper getExceptionModel() {
+ public PageWrapper getPageWrapperModel() {
return (PageWrapper) getModel();
}
@@ -91,9 +86,9 @@
protected void refreshVisuals() {
- Point loc = getExceptionModel().getPage().getLocation().getCopy();
- loc.y +=
25+getExceptionModel().getPage().getOutputLinks().size()*NodeFigure.LINK_HEIGHT;
- size = new Dimension(200, getExceptionModel().getPage().getChildren().size()*19);
+ Point loc = getPageWrapperModel().getPage().getLocation().getCopy();
+ loc.y +=
25+getPageWrapperModel().getPage().getOutputLinks().size()*NodeFigure.LINK_HEIGHT;
+ size = new Dimension(200, getPageWrapperModel().getPage().getChildren().size()*19);
adjustForGrid(loc);
Rectangle r = new Rectangle(loc, size);
@@ -108,27 +103,8 @@
}
- public ConnectionAnchor getTargetConnectionAnchor(
- ConnectionEditPart connEditPart) {
- ConnectionAnchor anc = getNodeFigure().getConnectionAnchor("1_IN");
- return anc;
- }
-
- public ConnectionAnchor getTargetConnectionAnchor(Request request) {
- Point pt = new Point(((DropRequest) request).getLocation());
- return getNodeFigure().getTargetConnectionAnchorAt(pt);
- }
-
- public ConnectionAnchor getSourceConnectionAnchor(Request request) {
- if (single) {
- Point pt = new Point(((DropRequest) request).getLocation());
- return getNodeFigure().getSourceConnectionAnchorAt(pt);
- } else
- return super.getSourceConnectionAnchor(request);
- }
-
protected List getModelChildren() {
- return getExceptionModel().getPage().getChildren();
+ return getPageWrapperModel().getPage().getChildren();
}
protected void refreshChildren() {
@@ -145,14 +121,14 @@
public void activate() {
if (isActive())
return;
- ((Notifier) getExceptionModel().getPage()).eAdapters().add(this);
+ ((Notifier) getPageWrapperModel().getPage()).eAdapters().add(this);
super.activate();
}
public void deactivate(){
if (!isActive())
return;
- ((Notifier) getExceptionModel().getPage()).eAdapters().remove(this);
+ ((Notifier) getPageWrapperModel().getPage()).eAdapters().remove(this);
super.deactivate();
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/xpl/PagesConnectionRouter.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/xpl/PagesConnectionRouter.java 2008-07-04
00:48:40 UTC (rev 9065)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/xpl/PagesConnectionRouter.java 2008-07-04
08:35:56 UTC (rev 9066)
@@ -304,18 +304,18 @@
return;
}
-// if(((ConnectionFigure)conn).isManual()){
-// if(conn.getPoints().size() < 4){
-// PointList list = ((ConnectionFigure)conn).getLinkModel().getPointList();
-// ((ConnectionFigure)conn).setOldPoints(list.getFirstPoint(), list.getLastPoint());
-// conn.setPoints(list);
-// }
-// if(hold((ConnectionFigure)conn)) return;
-// else{
-// ((ConnectionFigure)conn).setManual(false);
-// ((ConnectionFigure)conn).clear();
-// }
-// }
+ if(((ConnectionFigure)conn).isManual()){
+ if(conn.getPoints().size() < 4){
+ PointList list = ((ConnectionFigure)conn).getLinkModel().getPointList();
+ ((ConnectionFigure)conn).setOldPoints(list.getFirstPoint(), list.getLastPoint());
+ conn.setPoints(list);
+ }
+ if(hold((ConnectionFigure)conn)) return;
+ else{
+ ((ConnectionFigure)conn).setManual(false);
+ ((ConnectionFigure)conn).clear();
+ }
+ }
int i;
Point startPoint = getStartPoint(conn);
conn.translateToRelative(startPoint);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ConnectionFigure.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ConnectionFigure.java 2008-07-04
00:48:40 UTC (rev 9065)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ConnectionFigure.java 2008-07-04
08:35:56 UTC (rev 9066)
@@ -12,7 +12,6 @@
import org.eclipse.draw2d.AnchorListener;
import org.eclipse.draw2d.Connection;
-import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.PolylineConnection;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamFigure.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamFigure.java 2008-07-04
00:48:40 UTC (rev 9065)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamFigure.java 2008-07-04
08:35:56 UTC (rev 9066)
@@ -21,7 +21,7 @@
public class ParamFigure extends NodeFigure implements HandleBounds {
private static final Dimension SIZE = new Dimension(56, 100);
- public Param exc;
+ public Param param;
ParamEditPart editPart;
@@ -30,7 +30,7 @@
}
public ParamFigure(Param group) {
- this.exc = group;
+ this.param = group;
setOpaque(true);
}
@@ -65,19 +65,19 @@
g.translate(r.getLocation());
String name;
- if(exc.getName() != null){
- name = dottedString(exc.getName(), getTextWidth()-getTextInset(), nameParamFont);
+ if(param.getName() != null){
+ name = dottedString(param.getName(), getTextWidth()-getTextInset(), nameParamFont);
name += ":";
}else
name = "Param:";
String value;
- if(exc.getValue() != null){
- value = dottedString(exc.getValue(), getTextWidth()-getTextInset(), valueParamFont);
+ if(param.getValue() != null){
+ value = dottedString(param.getValue(), getTextWidth()-getTextInset(),
valueParamFont);
}else
value = "value";
- if(exc != null){
+ if(param != null){
g.setFont(nameParamFont);
g.drawString(name, getTextInset(), 1);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamListFigure.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamListFigure.java 2008-07-04
00:48:40 UTC (rev 9065)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ParamListFigure.java 2008-07-04
08:35:56 UTC (rev 9066)
@@ -13,22 +13,17 @@
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.MouseEvent;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Insets;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.handles.HandleBounds;
import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.common.gef.GEFGraphicalViewer;
import org.jboss.tools.seam.ui.pages.editor.edit.PageWrapper;
import org.jboss.tools.seam.ui.pages.editor.edit.ParamListEditPart;
public class ParamListFigure extends NodeFigure implements HandleBounds {
private static final Dimension SIZE = new Dimension(56, 100);
- private Image icon = null;
-
public PageWrapper paramList;
ParamListEditPart editPart;
@@ -41,12 +36,6 @@
super.setConstraint(child, constraint);
}
- public void setIcon(Image i) {
- //icon = PrintIconHelper.getPrintImage(i);
- }
-
-
-
public ParamListFigure(PageWrapper paramList) {
this.paramList = paramList;
@@ -102,18 +91,7 @@
graphics.drawLine(0, 1, 0, height - 1);
graphics.drawLine(1, height, width-1, height);
graphics.drawLine(width, 1, width, height - 1);
- }
-
- public void mouseDoubleClicked(MouseEvent me) {
- }
-
- public void mousePressed(MouseEvent me) {
- if (me.button == 3) {
- ((GEFGraphicalViewer) editPart.getViewer()).setNoDeselect();
- editPart.getViewer().select(editPart);
}
- }
-
-}
+ }
}
\ No newline at end of file