[Jiemamy-notify:1540] commit [2748] viewコンポーネントにConnectionProfileを追加。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 2月 28日 (土) 17:10:00 JST


Revision: 2748
          http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2748
Author:   daisuke_m
Date:     2009-02-28 17:10:00 +0900 (Sat, 28 Feb 2009)

Log Message:
-----------
viewコンポーネントにConnectionProfileを追加。

Modified Paths:
--------------
    artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/UUIDUtil.java
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ViewDomSerializerEnhancer.java
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ViewFactoryExtensionEnhancer.java
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/editcommand/AddConnectionToDiagramCommand.java
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/editcommand/DeleteConnectionFromDiagramCommand.java
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/facade/JiemamyViewFacadeImpl.java
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/processor/GetBendpointsProcessor.java
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/processor/ResetBendpointProcessor.java
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/model/DiagramPresentationModelImpl.java
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/test/ViewTestModelBuilder.java
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/utils/model/PresentationUtil.java
    artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/internal/processor/ResetBendpointProcessorTest.java
    artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/model/DiagramPresentationModelImplTest.java
    artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/util/model/DiagramPresentationUtil.java
    vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/action/AutoLayoutAction.java
    vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/AbstractMovePositionCommand.java
    vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/ChangeNodeConstraintCommand.java
    vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/CreateBendpointCommand.java
    vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/CreateConnectionCommand.java
    vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/DeleteBendpointCommand.java
    vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/MoveBendpointCommand.java
    vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/AbstractJmConnectionEditPart.java
    vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/AbstractJmNodeEditPart.java
    zeus/trunk/jiemamy-spec-core/src/main/resources/jiemamy-view.xsd
    zeus/trunk/jiemamy-spec-core/src/main/resources/sample.xml
    zeus/trunk/jiemamy-spec-view/src/main/java/org/jiemamy/model/DiagramPresentationModel.java

Added Paths:
-----------
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ConnectionProfileImpl.java

Removed Paths:
-------------
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/processor/SetBendpointsProcessor.java


-------------- next part --------------
Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/UUIDUtil.java
===================================================================
--- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/UUIDUtil.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/UUIDUtil.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -36,6 +36,14 @@
 	private static Logger logger = LoggerFactory.getLogger(UUIDUtil.class);
 	
 
+	public static void main(String[] args) {
+		System.out.println(UUID.randomUUID());
+		System.out.println(UUID.randomUUID());
+		System.out.println(UUID.randomUUID());
+		System.out.println(UUID.randomUUID());
+		System.out.println(UUID.randomUUID());
+	}
+	
 	/**
 	 * 文字列からUUIDを生成する。もし生成に失敗した場合は、ランダム生成を行う。
 	 * 

Added: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ConnectionProfileImpl.java
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ConnectionProfileImpl.java	                        (rev 0)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ConnectionProfileImpl.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2007-2009 Jiemamy Project and the Others.
+ * Created on 2009/02/28
+ *
+ * This file is part of Jiemamy.
+ *
+ * Licensed 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.jiemamy;
+
+import java.util.List;
+import java.util.UUID;
+
+import org.jiemamy.model.AbstractJiemamyElement;
+import org.jiemamy.model.ConnectionProfile;
+import org.jiemamy.model.geometory.JmColor;
+import org.jiemamy.model.geometory.JmPoint;
+import org.jiemamy.utils.ValidateUtil;
+
+/**
+ * TODO for daisuke
+ * 
+ * @author daisuke
+ */
+public class ConnectionProfileImpl extends AbstractJiemamyElement implements ConnectionProfile {
+	
+	/** コネクションの色情報 */
+	private JmColor color;
+	
+	/** コネクションのレイアウト情報 */
+	private List<JmPoint> bendpoints;
+	
+
+	/**
+	 * インスタンスを生成する。
+	 * 
+	 * @param jiemamy
+	 * @param id
+	 */
+	public ConnectionProfileImpl(Jiemamy jiemamy, UUID id) {
+		super(jiemamy, id);
+	}
+	
+	public List<JmPoint> getBendpoints() {
+		return bendpoints;
+	}
+	
+	public JmColor getColor() {
+		return color;
+	}
+	
+	/**
+	 * TODO for daisuke
+	 * 
+	 * @param bendpoints
+	 */
+	public void setBendpoints(List<JmPoint> bendpoints) {
+		ValidateUtil.injectionSetter(this.bendpoints);
+		this.bendpoints = bendpoints;
+	}
+	
+	public void setColor(JmColor color) {
+		this.color = color;
+	}
+}


Property changes on: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ConnectionProfileImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Modified: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ViewDomSerializerEnhancer.java
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ViewDomSerializerEnhancer.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ViewDomSerializerEnhancer.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -15,8 +15,6 @@
  */
 package org.jiemamy;
 
-import java.util.ArrayList;
-import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
@@ -31,6 +29,7 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
+import org.jiemamy.model.ConnectionProfile;
 import org.jiemamy.model.DiagramPresentationModel;
 import org.jiemamy.model.DiagramPresentations;
 import org.jiemamy.model.JiemamyElement;
@@ -155,12 +154,14 @@
 				}
 				Element connectionLayoutsElement = DomUtil.newChild(presentationElement, ViewQName.CONNECTION_LAYOUTS);
 				logger.trace("    connectionLayouts");
-				for (Map.Entry<ConnectionAdapter, List<JmPoint>> entry : presentation.getConnectionLayouts().entrySet()) {
+				for (Map.Entry<ConnectionAdapter, ConnectionProfile> entry : presentation.getConnectionProfiles()
+					.entrySet()) {
 					logger.trace("      connectionLayout");
 					ConnectionAdapter connection = entry.getKey();
-					List<JmPoint> points = entry.getValue();
+					ConnectionProfile connectionProfile = entry.getValue();
 					Element connectionLayoutElement =
 							DomUtil.newChild(connectionLayoutsElement, ViewQName.CONNECTION_LAYOUT);
+					connectionLayoutElement.setAttribute("id", connectionProfile.getId().toString());
 					if (connection.unwrap() == null) {
 						logger.warn("      Unknown connection: " + connection.getClass().getName());
 						continue;
@@ -170,10 +171,10 @@
 						connectionObjectRef.setAttribute("ref", connection.unwrap().getId().toString());
 						logger.trace("      FK");
 					}
-					if (points.size() > 0) {
+					if (connectionProfile.getBendpoints().size() > 0) {
 						Element bendpointsElement = DomUtil.newChild(connectionLayoutElement, ViewQName.BENDPOINTS);
 						logger.trace("      bendpoints");
-						for (JmPoint point : points) {
+						for (JmPoint point : connectionProfile.getBendpoints()) {
 							Element bendpointElement = DomUtil.newChild(bendpointsElement, ViewQName.BENDPOINT);
 							bendpointElement.setAttribute("x", Integer.toString(point.x));
 							bendpointElement.setAttribute("y", Integer.toString(point.y));
@@ -261,18 +262,24 @@
 				for (Node connectionLayoutNode : connectionLayoutNodeListIterable) {
 					ConnectionAdapter connectionAdapter;
 					Node objectRefNode = XpathUtil.getNode(connectionLayoutNode, "view:connectionObjectRef");
-					UUID refId = DomUtil.getUUID(objectRefNode, CoreQName.REF);
-					JiemamyElement jElement = RootModelUtil.findJiemamyElement(rootModel, refId);
-					if (jElement == null) {
-						logger.error("null element: " + refId.toString());
+					if (objectRefNode != null) {
+						UUID refId = DomUtil.getUUID(objectRefNode, CoreQName.REF);
+						JiemamyElement jElement = RootModelUtil.findJiemamyElement(rootModel, refId);
+						if (jElement == null) {
+							logger.error("null element: " + refId.toString());
+							continue;
+						}
+						connectionAdapter = jElement.getAdapter(ConnectionAdapter.class);
+						if (connectionAdapter == null) {
+							logger.error("null connection: " + jElement.getId().toString());
+							continue;
+						}
+					} else {
 						continue;
 					}
-					connectionAdapter = jElement.getAdapter(ConnectionAdapter.class);
-					if (connectionAdapter == null) {
-						logger.error("null connection: " + jElement.getId().toString());
-						continue;
-					}
-					List<JmPoint> bendpoints = new ArrayList<JmPoint>();
+					ConnectionProfile connectionProfile =
+							factory.newModel(ConnectionProfile.class, DomUtil.getUUID(connectionLayoutNode,
+									CoreQName.ID));
 					
 					NodeList bendpointNodeList =
 							XpathUtil.getNodes(connectionLayoutNode, "view:bendpoints/view:bendpoint");
@@ -280,9 +287,9 @@
 					for (Node bendpointNode : bendpointNodeListIterable) {
 						int x = Integer.valueOf(XpathUtil.getAttr(bendpointNode, "@x").getValue());
 						int y = Integer.valueOf(XpathUtil.getAttr(bendpointNode, "@y").getValue());
-						bendpoints.add(new JmPoint(x, y));
+						connectionProfile.getBendpoints().add(new JmPoint(x, y));
 					}
-					presentation.getConnectionLayouts().put(connectionAdapter, bendpoints);
+					presentation.getConnectionProfiles().put(connectionAdapter, connectionProfile);
 				}
 				
 				rootModel.getAdapter(DiagramPresentations.class).add(presentation);

Modified: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ViewFactoryExtensionEnhancer.java
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ViewFactoryExtensionEnhancer.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ViewFactoryExtensionEnhancer.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -17,10 +17,10 @@
 
 import java.util.ArrayList;
 import java.util.Comparator;
-import java.util.List;
 import java.util.TreeMap;
 import java.util.UUID;
 
+import org.jiemamy.model.ConnectionProfile;
 import org.jiemamy.model.DiagramPresentationModel;
 import org.jiemamy.model.DiagramPresentationModelImpl;
 import org.jiemamy.model.DiagramPresentationsImpl;
@@ -78,14 +78,19 @@
 			} else if (clazz == DiagramPresentationModel.class) {
 				assert product == null;
 				DiagramPresentationModelImpl presentation = new DiagramPresentationModelImpl(jiemamy, id);
-				presentation.setConnectionLayouts(new TreeMap<ConnectionAdapter, List<JmPoint>>(
+				presentation.setConnectionProfiles(new TreeMap<ConnectionAdapter, ConnectionProfile>(
 						ConnectionComparator.INSTANCE));
-				presentation.setNodeLayouts(new TreeMap<NodeAdapter, NodeProfile>(NodeComparator.INSTANCE));
+				presentation.setNodeProfiles(new TreeMap<NodeAdapter, NodeProfile>(NodeComparator.INSTANCE));
 				product = clazz.cast(presentation);
 			} else if (clazz == NodeProfile.class) {
 				assert product == null;
 				NodeProfileImpl nodeProfile = new NodeProfileImpl(jiemamy, id);
 				product = clazz.cast(nodeProfile);
+			} else if (clazz == ConnectionProfile.class) {
+				assert product == null;
+				ConnectionProfileImpl connectionProfile = new ConnectionProfileImpl(jiemamy, id);
+				connectionProfile.setBendpoints(new ArrayList<JmPoint>());
+				product = clazz.cast(connectionProfile);
 			} else if (clazz == StickyModel.class) {
 				assert product == null;
 				StickyModelImpl stickyModel = new StickyModelImpl(jiemamy, id);

Modified: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/editcommand/AddConnectionToDiagramCommand.java
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/editcommand/AddConnectionToDiagramCommand.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/editcommand/AddConnectionToDiagramCommand.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -19,6 +19,7 @@
 package org.jiemamy.editcommand;
 
 import org.jiemamy.editcommand.impl.AbstractCommand;
+import org.jiemamy.model.ConnectionProfile;
 import org.jiemamy.model.DiagramPresentations;
 import org.jiemamy.model.JiemamyElement;
 import org.jiemamy.model.RootModel;
@@ -37,6 +38,8 @@
 	
 	private final ConnectionAdapter connectionAdapter;
 	
+	private final ConnectionProfile connectionProfile;
+	
 	private final int diagramIndex;
 	
 
@@ -46,14 +49,26 @@
 	 * @param rootModel {@link DiagramPresentations}がアダプトされた{@link RootModel}
 	 * @param diagramIndex ダイアグラムエディタのタブインデックス
 	 * @param connectionAdapter ノードを識別するための{@link NodeAdapter}
+	 * @param connectionProfile 
 	 */
-	public AddConnectionToDiagramCommand(RootModel rootModel, int diagramIndex, ConnectionAdapter connectionAdapter) {
+	public AddConnectionToDiagramCommand(RootModel rootModel, int diagramIndex, ConnectionAdapter connectionAdapter,
+			ConnectionProfile connectionProfile) {
 		this.rootModel = rootModel;
 		this.diagramIndex = diagramIndex;
 		this.connectionAdapter = connectionAdapter;
+		this.connectionProfile = connectionProfile;
 	}
 	
 	/**
+	 * TODO for daisuke
+	 * 
+	 * @return
+	 */
+	public ConnectionProfile getConnectionProfile() {
+		return connectionProfile;
+	}
+	
+	/**
 	 * @return the diagramIndex
 	 */
 	public int getDiagramIndex() {
@@ -61,7 +76,8 @@
 	}
 	
 	public Command getNegateCommand() {
-		return new DeleteConnectionFromDiagramCommand(rootModel, getDiagramIndex(), connectionAdapter);
+		return new DeleteConnectionFromDiagramCommand(rootModel, getDiagramIndex(), connectionAdapter,
+				connectionProfile);
 	}
 	
 	/**

Modified: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/editcommand/DeleteConnectionFromDiagramCommand.java
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/editcommand/DeleteConnectionFromDiagramCommand.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/editcommand/DeleteConnectionFromDiagramCommand.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -19,6 +19,7 @@
 package org.jiemamy.editcommand;
 
 import org.jiemamy.editcommand.impl.AbstractCommand;
+import org.jiemamy.model.ConnectionProfile;
 import org.jiemamy.model.DiagramPresentations;
 import org.jiemamy.model.JiemamyElement;
 import org.jiemamy.model.NodeProfile;
@@ -40,6 +41,8 @@
 	
 	private final int diagramIndex;
 	
+	private final ConnectionProfile connectionProfile;
+	
 
 	/**
 	 * インスタンスを生成する。
@@ -47,11 +50,14 @@
 	 * @param root {@link DiagramPresentations}がアダプトされた{@link RootModel}
 	 * @param diagramIndex ダイアグラムエディタのタブインデックス
 	 * @param connectionAdapter ノードを識別するための{@link NodeAdapter}
+	 * @param connectionProfile 
 	 */
-	public DeleteConnectionFromDiagramCommand(RootModel root, int diagramIndex, ConnectionAdapter connectionAdapter) {
+	public DeleteConnectionFromDiagramCommand(RootModel root, int diagramIndex, ConnectionAdapter connectionAdapter,
+			ConnectionProfile connectionProfile) {
 		this.root = root;
 		this.diagramIndex = diagramIndex;
 		this.connectionAdapter = connectionAdapter;
+		this.connectionProfile = connectionProfile;
 	}
 	
 	/**
@@ -62,7 +68,7 @@
 	}
 	
 	public Command getNegateCommand() {
-		return new AddConnectionToDiagramCommand(root, getDiagramIndex(), connectionAdapter);
+		return new AddConnectionToDiagramCommand(root, getDiagramIndex(), connectionAdapter, connectionProfile);
 	}
 	
 	/**

Modified: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/facade/JiemamyViewFacadeImpl.java
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/facade/JiemamyViewFacadeImpl.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/facade/JiemamyViewFacadeImpl.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -18,7 +18,6 @@
  */
 package org.jiemamy.facade;
 
-import java.util.ArrayList;
 import java.util.Map;
 
 import org.jiemamy.EventBroker;
@@ -31,12 +30,12 @@
 import org.jiemamy.editcommand.DeleteConnectionFromDiagramCommand;
 import org.jiemamy.editcommand.DeleteNodeFromDiagramCommand;
 import org.jiemamy.editcommand.impl.ModifyModelPropertyCommand;
+import org.jiemamy.model.ConnectionProfile;
 import org.jiemamy.model.DiagramPresentationModel;
 import org.jiemamy.model.DiagramPresentations;
 import org.jiemamy.model.NodeProfile;
 import org.jiemamy.model.RootModel;
 import org.jiemamy.model.connection.ConnectionAdapter;
-import org.jiemamy.model.geometory.JmPoint;
 import org.jiemamy.model.geometory.JmRectangle;
 import org.jiemamy.model.node.NodeAdapter;
 
@@ -62,9 +61,11 @@
 		commandProcessor = new ViewCommandProcessorImpl(jiemamy.getEventBroker());
 	}
 	
-	public void addConnectionProfile(int diagramIndex, ConnectionAdapter connectionAdapter) {
+	public void addConnectionProfile(int diagramIndex, ConnectionAdapter connectionAdapter,
+			ConnectionProfile connectionProfile) {
 		RootModel rootModel = jiemamy.getFactory().getRootModel();
-		Command command = new AddConnectionToDiagramCommand(rootModel, diagramIndex, connectionAdapter);
+		Command command =
+				new AddConnectionToDiagramCommand(rootModel, diagramIndex, connectionAdapter, connectionProfile);
 		command.execute(commandProcessor);
 		undoStack.push(command.getNegateCommand());
 		redoStack.push(command);
@@ -147,7 +148,8 @@
 		public void process(AddConnectionToDiagramCommand command) {
 			DiagramPresentations diagramPresentations = command.getRootModel().getAdapter(DiagramPresentations.class);
 			DiagramPresentationModel diagramPresentationModel = diagramPresentations.get(command.getDiagramIndex());
-			diagramPresentationModel.getConnectionLayouts().put(command.getNodeAdapter(), new ArrayList<JmPoint>());
+			diagramPresentationModel.getConnectionProfiles().put(command.getNodeAdapter(),
+					command.getConnectionProfile());
 			eventBroker.fireCommandProcessed(command);
 		}
 		
@@ -171,7 +173,7 @@
 		public void process(DeleteConnectionFromDiagramCommand command) {
 			DiagramPresentations diagramPresentations = command.getRoot().getAdapter(DiagramPresentations.class);
 			DiagramPresentationModel diagramPresentationModel = diagramPresentations.get(command.getDiagramIndex());
-			diagramPresentationModel.getConnectionLayouts().remove(command.getNodeAdapter());
+			diagramPresentationModel.getConnectionProfiles().remove(command.getNodeAdapter());
 			eventBroker.fireCommandProcessed(command);
 		}
 		

Modified: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/processor/GetBendpointsProcessor.java
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/processor/GetBendpointsProcessor.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/processor/GetBendpointsProcessor.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -57,7 +57,7 @@
 		Validate.notNull(rootModel);
 		DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class);
 		DiagramPresentationModel presentationModel = diagramPresentations.get(index);
-		return presentationModel.getConnectionLayouts().get(connection);
+		return presentationModel.getConnectionProfiles().get(connection).getBendpoints();
 	}
 	
 }

Modified: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/processor/ResetBendpointProcessor.java
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/processor/ResetBendpointProcessor.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/processor/ResetBendpointProcessor.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -22,6 +22,7 @@
 
 import org.apache.commons.lang.Validate;
 
+import org.jiemamy.model.ConnectionProfile;
 import org.jiemamy.model.DiagramPresentationModel;
 import org.jiemamy.model.NodeProfile;
 import org.jiemamy.model.connection.ConnectionAdapter;
@@ -54,10 +55,11 @@
 	
 	public Void process(DiagramPresentationModel diagramPresentation) {
 		Validate.notNull(diagramPresentation);
-		List<JmPoint> bendpoints = diagramPresentation.getConnectionLayouts().get(connection);
-		if (bendpoints == null) {
+		ConnectionProfile connectionProfile = diagramPresentation.getConnectionProfiles().get(connection);
+		if (connectionProfile == null) {
 			throw new IllegalStateException("表示されていないレイアウトをリセットしようとしました。");
 		}
+		List<JmPoint> bendpoints = connectionProfile.getBendpoints();
 		bendpoints.clear();
 		if (connection.isSelfConnection()) {
 			// 自己コネクション時の、bendpoint自動作成
@@ -69,10 +71,8 @@
 				throw new IllegalStateException("表示されていないノードのコネクションを操作しようとしました。");
 			}
 			
-			diagramPresentation.getConnectionLayouts().get(connection).add(0,
-					new JmPoint(Math.max(rect.x - AUTO_BENDPOINT_OFFSET, 0), rect.y));
-			diagramPresentation.getConnectionLayouts().get(connection).add(1,
-					new JmPoint(rect.x, Math.max(rect.y - AUTO_BENDPOINT_OFFSET, 0)));
+			bendpoints.add(0, new JmPoint(Math.max(rect.x - AUTO_BENDPOINT_OFFSET, 0), rect.y));
+			bendpoints.add(1, new JmPoint(rect.x, Math.max(rect.y - AUTO_BENDPOINT_OFFSET, 0)));
 		}
 		return null;
 	}

Deleted: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/processor/SetBendpointsProcessor.java
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/processor/SetBendpointsProcessor.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/processor/SetBendpointsProcessor.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -1,69 +0,0 @@
-/*
- * Copyright 2007-2009 Jiemamy Project and the Others.
- * Created on 2008/08/03
- *
- * This file is part of Jiemamy.
- *
- * Licensed 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.jiemamy.internal.processor;
-
-import java.util.List;
-
-import org.apache.commons.lang.Validate;
-
-import org.jiemamy.model.DiagramPresentationModel;
-import org.jiemamy.model.DiagramPresentations;
-import org.jiemamy.model.RootModel;
-import org.jiemamy.model.connection.ConnectionAdapter;
-import org.jiemamy.model.geometory.JmPoint;
-
-/**
- * ベンドポイントの座標を設定する。
- * 
- * @author daisuke
- */
-public class SetBendpointsProcessor extends AbstractProcessor<RootModel, Void, RuntimeException> {
-	
-	private int index;
-	
-	private ConnectionAdapter connection;
-	
-	private List<JmPoint> bendpoints;
-	
-
-	/**
-	 * インスタンスを生成する。
-	 * 
-	 * @param index ベンドポイントインデックス
-	 * @param connection 対象のコネクション
-	 * @param bendpoints 座標のリスト
-	 * @throws IllegalArgumentException 引数に{@code null}を与えた場合
-	 */
-	public SetBendpointsProcessor(int index, ConnectionAdapter connection, List<JmPoint> bendpoints) {
-		Validate.notNull(connection);
-		Validate.notNull(bendpoints);
-		this.index = index;
-		this.connection = connection;
-		this.bendpoints = bendpoints;
-	}
-	
-	public Void process(RootModel rootModel) {
-		Validate.notNull(rootModel);
-		DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class);
-		DiagramPresentationModel presentationModel = diagramPresentations.get(index);
-		presentationModel.getConnectionLayouts().put(connection, bendpoints);
-		return null;
-	}
-	
-}

Modified: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/model/DiagramPresentationModelImpl.java
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/model/DiagramPresentationModelImpl.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/model/DiagramPresentationModelImpl.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -18,7 +18,6 @@
  */
 package org.jiemamy.model;
 
-import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
@@ -27,7 +26,6 @@
 import org.jiemamy.Jiemamy;
 import org.jiemamy.internal.processor.ResetBendpointProcessor;
 import org.jiemamy.model.connection.ConnectionAdapter;
-import org.jiemamy.model.geometory.JmPoint;
 import org.jiemamy.model.node.NodeAdapter;
 import org.jiemamy.utils.ProcessorUtil;
 import org.jiemamy.utils.ValidateUtil;
@@ -54,7 +52,7 @@
 	 * 
 	 * ベンドポイントがあれば座標のリストを持ち、なければエントリを持たない。
 	 */
-	private Map<ConnectionAdapter, List<JmPoint>> connectionLayouts;
+	private Map<ConnectionAdapter, ConnectionProfile> connectionProfiles;
 	
 	/** 論理モデルかどうか */
 	private Mode mode = Mode.PHYSICAL;
@@ -73,9 +71,9 @@
 		super(jiemamy, id);
 	}
 	
-	public Map<ConnectionAdapter, List<JmPoint>> getConnectionLayouts() {
-		assert connectionLayouts != null;
-		return connectionLayouts;
+	public Map<ConnectionAdapter, ConnectionProfile> getConnectionProfiles() {
+		assert connectionProfiles != null;
+		return connectionProfiles;
 	}
 	
 	public Map<NodeAdapter, NodeProfile> getFigureProfiles() {
@@ -101,25 +99,16 @@
 		ProcessorUtil.process(this, new ResetBendpointProcessor(connection));
 	}
 	
-	@Deprecated
-	public void setBendpoints(ConnectionAdapter connection, List<JmPoint> bendpoints) {
-		assert connectionLayouts != null;
-		Validate.notNull(connection);
-		Validate.notNull(bendpoints);
-		
-		connectionLayouts.put(connection, bendpoints);
-	}
-	
 	/**
 	 * コネクションのベンドポイント情報を設定する。
 	 * 
-	 * @param connectionLayouts コネクションのベンドポイント情報
+	 * @param connectionProfiles コネクションのベンドポイント情報
 	 * @throws IllegalArgumentException 引数に{@code null}を与えた場合
 	 */
-	public void setConnectionLayouts(Map<ConnectionAdapter, List<JmPoint>> connectionLayouts) {
-		Validate.notNull(connectionLayouts);
-		ValidateUtil.injectionSetter(this.connectionLayouts);
-		this.connectionLayouts = connectionLayouts;
+	public void setConnectionProfiles(Map<ConnectionAdapter, ConnectionProfile> connectionProfiles) {
+		Validate.notNull(connectionProfiles);
+		ValidateUtil.injectionSetter(this.connectionProfiles);
+		this.connectionProfiles = connectionProfiles;
 	}
 	
 	public void setLevel(Level level) {
@@ -142,7 +131,7 @@
 	 * @param nodeProfiles ノードのレイアウト情報
 	 * @throws IllegalArgumentException 引数に{@code null}を与えた場合
 	 */
-	public void setNodeLayouts(Map<NodeAdapter, NodeProfile> nodeProfiles) {
+	public void setNodeProfiles(Map<NodeAdapter, NodeProfile> nodeProfiles) {
 		Validate.notNull(nodeProfiles);
 		ValidateUtil.injectionSetter(this.nodeProfiles);
 		this.nodeProfiles = nodeProfiles;

Modified: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/test/ViewTestModelBuilder.java
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/test/ViewTestModelBuilder.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/test/ViewTestModelBuilder.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -18,11 +18,11 @@
  */
 package org.jiemamy.test;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import org.jiemamy.Jiemamy;
 import org.jiemamy.OfficialSpecs;
+import org.jiemamy.model.ConnectionProfile;
 import org.jiemamy.model.DiagramPresentationModel;
 import org.jiemamy.model.DiagramPresentations;
 import org.jiemamy.model.NodeProfile;
@@ -32,7 +32,6 @@
 import org.jiemamy.model.geometory.JmRectangle;
 import org.jiemamy.model.node.NodeAdapter;
 import org.jiemamy.model.node.StickyModel;
-import org.jiemamy.utils.model.PresentationUtil;
 
 /**
  * Jiemamy VIEW仕様範囲を含めたJiemamyテストモデル1(EMP-DEPTテーブル)を組み立てるビルダ。
@@ -146,10 +145,10 @@
 					factory.newModel(DiagramPresentationModel.class, uuid.get("1deca0e8-6153-47ad-abe8-ac764f768d96"));
 			presentation1.setName("全部表示する");
 			
-			NodeProfile empLayout =
+			NodeProfile empProfile =
 					factory.newModel(NodeProfile.class, uuid.get("aa7caa23-7958-4bd0-a356-8f09d4b74f08"));
-			presentation1.getFigureProfiles().put(tableEmp.getAdapter(NodeAdapter.class), empLayout);
-			empLayout.setLayout(new JmRectangle(360, 60));
+			presentation1.getFigureProfiles().put(tableEmp.getAdapter(NodeAdapter.class), empProfile);
+			empProfile.setLayout(new JmRectangle(360, 60));
 			
 			NodeProfile deptLayout =
 					factory.newModel(NodeProfile.class, uuid.get("eb6506ef-4a25-4296-b6d7-c08741f19d5a"));
@@ -167,14 +166,19 @@
 			stickyLayout.setLayout(new JmRectangle(360, 270));
 			stickyLayout.setColor(new JmColor(10, 11, 12));
 			
-			List<JmPoint> bendpoints = new ArrayList<JmPoint>();
+			ConnectionProfile connectionProfile1 =
+					factory.newModel(ConnectionProfile.class, uuid.get("66b547f-a2a6-42b2-a3a4-38745436c425"));
+			List<JmPoint> bendpoints = connectionProfile1.getBendpoints();
 			NodeProfile nodeProf = presentation1.getFigureProfiles().get(tableEmp.getAdapter(NodeAdapter.class));
 			JmRectangle rect = nodeProf.getLayout();
 			bendpoints.add(0, new JmPoint(Math.max(rect.x - offset, 0), rect.y));
 			bendpoints.add(1, new JmPoint(rect.x, Math.max(rect.y - offset, 0)));
-			presentation1.getConnectionLayouts().put(fkEmpEmp.getAdapter(ConnectionAdapter.class), bendpoints);
-			presentation1.getConnectionLayouts().put(fkEmpDept.getAdapter(ConnectionAdapter.class),
-					new ArrayList<JmPoint>()); // bendpount無し
+			presentation1.getConnectionProfiles().put(fkEmpEmp.getAdapter(ConnectionAdapter.class), connectionProfile1);
+			
+			ConnectionProfile connectionProfile2 =
+					factory.newModel(ConnectionProfile.class, uuid.get("e5b3d709-2aea-4e26-a90c-b8f438d2da9d"));
+			presentation1.getConnectionProfiles()
+				.put(fkEmpDept.getAdapter(ConnectionAdapter.class), connectionProfile2);
 			diagramPresentations.add(presentation1);
 			
 			// ダイアグラム表現の生成・追加(2)
@@ -182,18 +186,19 @@
 					factory.newModel(DiagramPresentationModel.class, uuid.get("53c7cdb7-1512-46c7-8ee3-aadec6007896"));
 			presentation2.setName("一部表示する");
 			
-			NodeProfile empLayout2 =
+			NodeProfile nodeProfile1 =
 					factory.newModel(NodeProfile.class, uuid.get("d71ff015-101c-4669-8745-312d1da34efe"));
-			presentation2.getFigureProfiles().put(tableEmp.getAdapter(NodeAdapter.class), empLayout2);
-			empLayout2.setLayout(new JmRectangle(60, 60));
+			presentation2.getFigureProfiles().put(tableEmp.getAdapter(NodeAdapter.class), nodeProfile1);
+			nodeProfile1.setLayout(new JmRectangle(60, 60));
 			
-			NodeProfile viewLayout2 =
+			NodeProfile nodeProfile2 =
 					factory.newModel(NodeProfile.class, uuid.get("2df7718f-d71e-4dbf-8327-e0ad36f03d5d"));
-			presentation2.getFigureProfiles().put(viewHighSal.getAdapter(NodeAdapter.class), viewLayout2);
-			viewLayout2.setLayout(new JmRectangle(270, 270));
+			presentation2.getFigureProfiles().put(viewHighSal.getAdapter(NodeAdapter.class), nodeProfile2);
+			nodeProfile2.setLayout(new JmRectangle(270, 270));
 			
-			PresentationUtil.setLayout(presentation2, fkEmpDept.getAdapter(ConnectionAdapter.class),
-					new ArrayList<JmPoint>()); // bendpount無し
+			ConnectionProfile connectionProfile =
+					factory.newModel(ConnectionProfile.class, uuid.get("b615f111-5143-4b12-bfdb-9a06806a9ace"));
+			presentation2.getConnectionProfiles().put(fkEmpDept.getAdapter(ConnectionAdapter.class), connectionProfile);
 			diagramPresentations.add(presentation2);
 		}
 	}

Modified: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/utils/model/PresentationUtil.java
===================================================================
--- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/utils/model/PresentationUtil.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/utils/model/PresentationUtil.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -18,14 +18,10 @@
  */
 package org.jiemamy.utils.model;
 
-import java.util.List;
-
 import org.jiemamy.JiemamyFactory;
 import org.jiemamy.model.DiagramPresentationModel;
 import org.jiemamy.model.NodeProfile;
-import org.jiemamy.model.connection.ConnectionAdapter;
 import org.jiemamy.model.geometory.JmColor;
-import org.jiemamy.model.geometory.JmPoint;
 import org.jiemamy.model.geometory.JmRectangle;
 import org.jiemamy.model.node.NodeAdapter;
 
@@ -57,18 +53,6 @@
 	 * TODO for daisuke
 	 * 
 	 * @param presentation
-	 * @param adapter
-	 * @param bendpoints
-	 */
-	public static void setLayout(DiagramPresentationModel presentation, ConnectionAdapter adapter,
-			List<JmPoint> bendpoints) {
-		presentation.getConnectionLayouts().put(adapter, bendpoints);
-	}
-	
-	/**
-	 * TODO for daisuke
-	 * 
-	 * @param presentation
 	 * @param nodeAdapter
 	 * @param rect
 	 */

Modified: artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/internal/processor/ResetBendpointProcessorTest.java
===================================================================
--- artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/internal/processor/ResetBendpointProcessorTest.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/internal/processor/ResetBendpointProcessorTest.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -83,11 +83,11 @@
 		DiagramPresentationModel presentationModel = diagramPresentations.get(Migration.DIAGRAM_INDEX);
 		
 		DiagramPresentationUtil.resetBenpoinsts(presentationModel, mb.fkEmpDept.getAdapter(ConnectionAdapter.class));
-		bendpoints = diagramPresentations.get(0).getConnectionLayouts().get(mb.fkEmpDept);
+		bendpoints = diagramPresentations.get(0).getConnectionProfiles().get(mb.fkEmpDept).getBendpoints();
 		assertThat(bendpoints.size(), is(0));
 		
 		DiagramPresentationUtil.resetBenpoinsts(presentationModel, mb.fkEmpEmp.getAdapter(ConnectionAdapter.class));
-		bendpoints = diagramPresentations.get(0).getConnectionLayouts().get(mb.fkEmpEmp);
+		bendpoints = diagramPresentations.get(0).getConnectionProfiles().get(mb.fkEmpEmp).getBendpoints();
 		assertThat(bendpoints.size(), is(2));
 	}
 }

Modified: artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/model/DiagramPresentationModelImplTest.java
===================================================================
--- artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/model/DiagramPresentationModelImplTest.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/model/DiagramPresentationModelImplTest.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -83,7 +83,7 @@
 	@Test
 	public void test01_各プロパティが正常に初期化されていること() throws Exception {
 		assertThat(presentation.getFigureProfiles(), is(notNullValue()));
-		assertThat(presentation.getConnectionLayouts(), is(notNullValue()));
+		assertThat(presentation.getConnectionProfiles(), is(notNullValue()));
 		assertThat(presentation.getMode(), is(notNullValue()));
 		assertThat(presentation.getLevel(), is(notNullValue()));
 		assertThat(presentation.getName(), is("testPresentation"));

Modified: artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/util/model/DiagramPresentationUtil.java
===================================================================
--- artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/util/model/DiagramPresentationUtil.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ artemis/trunk/jiemamy-view/src/test/java/org/jiemamy/util/model/DiagramPresentationUtil.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -35,7 +35,7 @@
 	 * @param connection
 	 */
 	public static void resetBenpoinsts(DiagramPresentationModel diagramPresentationModel, ConnectionAdapter connection) {
-		diagramPresentationModel.getConnectionLayouts().get(connection).clear();
+		diagramPresentationModel.getConnectionProfiles().get(connection).getBendpoints().clear();
 	}
 	
 	private DiagramPresentationUtil() {

Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/action/AutoLayoutAction.java
===================================================================
--- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/action/AutoLayoutAction.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/action/AutoLayoutAction.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -18,6 +18,7 @@
  */
 package org.jiemamy.eclipse.action;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
@@ -37,6 +38,7 @@
 
 import org.jiemamy.Migration;
 import org.jiemamy.eclipse.editor.editpart.diagram.AbstractJmNodeEditPart;
+import org.jiemamy.model.ConnectionProfile;
 import org.jiemamy.model.DiagramPresentationModel;
 import org.jiemamy.model.DiagramPresentations;
 import org.jiemamy.model.NodeProfile;
@@ -199,9 +201,10 @@
 			PresentationUtil.setLayout(presentation, target, new JmRectangle(x, y, -1, -1));
 			oldBendpoints.clear();
 			for (ConnectionAdapter conn : target.getSourceConnections()) {
-				List<JmPoint> points = presentation.getConnectionLayouts().get(conn);
-				oldBendpoints.put(conn, points);
-				presentation.resetBendpoints(conn);
+				ConnectionProfile connectionProfile = presentation.getConnectionProfiles().get(conn);
+				List<JmPoint> bendpoints = connectionProfile.getBendpoints();
+				oldBendpoints.put(conn, new ArrayList<JmPoint>(bendpoints));
+				bendpoints.clear();
 			}
 		}
 		
@@ -210,7 +213,12 @@
 			DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class);
 			DiagramPresentationModel presentation = diagramPresentations.get(Migration.DIAGRAM_INDEX);
 			for (ConnectionAdapter conn : target.getSourceConnections()) {
-				presentation.getConnectionLayouts().put(conn, oldBendpoints.get(conn));
+				ConnectionProfile connectionProfile = presentation.getConnectionProfiles().get(conn);
+				List<JmPoint> bendpoints = connectionProfile.getBendpoints();
+				bendpoints.clear();
+				for (JmPoint bendpoint : oldBendpoints.get(conn)) {
+					bendpoints.add(bendpoint);
+				}
 			}
 			PresentationUtil.setLayout(presentation, target, new JmRectangle(oldX, oldY, -1, -1));
 		}

Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/AbstractMovePositionCommand.java
===================================================================
--- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/AbstractMovePositionCommand.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/AbstractMovePositionCommand.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -87,8 +87,10 @@
 			
 			// ベンドポイントの移動
 			for (ConnectionAdapter connection : node.getSourceConnections()) {
-				List<JmPoint> newBendpoints = new ArrayList<JmPoint>();
-				List<JmPoint> oldBendpoints = presentation.getConnectionLayouts().get(connection);
+				List<JmPoint> oldBendpoints =
+						new ArrayList<JmPoint>(presentation.getConnectionProfiles().get(connection).getBendpoints());
+				List<JmPoint> bendpoints = presentation.getConnectionProfiles().get(connection).getBendpoints();
+				bendpoints.clear();
 				for (JmPoint bendpoint : oldBendpoints) {
 					JmPoint newBendpoint;
 					if (negative) {
@@ -97,9 +99,8 @@
 						newBendpoint = new JmPoint(bendpoint.x + shift.x, bendpoint.y + shift.y);
 					}
 					
-					newBendpoints.add(newBendpoint);
+					bendpoints.add(newBendpoint);
 				}
-				presentation.getConnectionLayouts().put(connection, newBendpoints);
 			}
 			// FIXME
 		}

Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/ChangeNodeConstraintCommand.java
===================================================================
--- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/ChangeNodeConstraintCommand.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/ChangeNodeConstraintCommand.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -137,7 +137,7 @@
 			if (selectedModels.contains(connection.getSource()) && selectedModels.contains(connection.getTarget())) {
 				DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class);
 				DiagramPresentationModel presentationModel = diagramPresentations.get(Migration.DIAGRAM_INDEX);
-				List<JmPoint> bendpoints = presentationModel.getConnectionLayouts().get(connection);
+				List<JmPoint> bendpoints = presentationModel.getConnectionProfiles().get(connection).getBendpoints();
 				for (JmPoint bendpoint : bendpoints) {
 					if (positive) {
 						JmPointUtil.shiftPositive(bendpoint, delta);

Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/CreateBendpointCommand.java
===================================================================
--- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/CreateBendpointCommand.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/CreateBendpointCommand.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -73,7 +73,7 @@
 	public void execute() {
 		DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class);
 		DiagramPresentationModel presentation = diagramPresentations.get(Migration.DIAGRAM_INDEX);
-		presentation.getConnectionLayouts().get(relation).add(index, ConvertUtil.convert(location));
+		presentation.getConnectionProfiles().get(relation).getBendpoints().add(index, ConvertUtil.convert(location));
 		shiftPosition(false);
 	}
 	
@@ -81,7 +81,7 @@
 	public void undo() {
 		DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class);
 		DiagramPresentationModel presentation = diagramPresentations.get(Migration.DIAGRAM_INDEX);
-		presentation.getConnectionLayouts().get(relation).remove(index);
+		presentation.getConnectionProfiles().get(relation).getBendpoints().remove(index);
 		shiftPosition(true);
 	}
 	

Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/CreateConnectionCommand.java
===================================================================
--- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/CreateConnectionCommand.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/CreateConnectionCommand.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -30,6 +30,7 @@
 import org.jiemamy.ReferenceResolver;
 import org.jiemamy.eclipse.JiemamyPlugin;
 import org.jiemamy.facade.JiemamyViewFacadeImpl;
+import org.jiemamy.model.ConnectionProfile;
 import org.jiemamy.model.RootModel;
 import org.jiemamy.model.attribute.ColumnModel;
 import org.jiemamy.model.attribute.ColumnRef;
@@ -138,7 +139,8 @@
 			}
 			
 			jiemamyFacade.addForeignKey(sourceTable, foreignKeyModel);
-			jiemamyFacade.addConnectionProfile(Migration.DIAGRAM_INDEX, connection);
+			jiemamyFacade.addConnectionProfile(Migration.DIAGRAM_INDEX, connection, factory
+				.newModel(ConnectionProfile.class));
 		} else {
 			// TODO wrapping connectionしか対応していない。
 		}

Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/DeleteBendpointCommand.java
===================================================================
--- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/DeleteBendpointCommand.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/DeleteBendpointCommand.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -66,15 +66,15 @@
 	public void execute() {
 		DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class);
 		DiagramPresentationModel presentation = diagramPresentations.get(Migration.DIAGRAM_INDEX);
-		JmPoint oldLocation = presentation.getConnectionLayouts().get(relation).get(index);
+		JmPoint oldLocation = presentation.getConnectionProfiles().get(relation).getBendpoints().get(index);
 		this.oldLocation = new Point(oldLocation.x, oldLocation.y);
-		presentation.getConnectionLayouts().get(relation).remove(index);
+		presentation.getConnectionProfiles().get(relation).getBendpoints().remove(index);
 	}
 	
 	@Override
 	public void undo() {
 		DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class);
 		DiagramPresentationModel presentation = diagramPresentations.get(Migration.DIAGRAM_INDEX);
-		presentation.getConnectionLayouts().get(relation).add(index, ConvertUtil.convert(oldLocation));
+		presentation.getConnectionProfiles().get(relation).getBendpoints().add(index, ConvertUtil.convert(oldLocation));
 	}
 }

Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/MoveBendpointCommand.java
===================================================================
--- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/MoveBendpointCommand.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/MoveBendpointCommand.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -60,7 +60,7 @@
 	public MoveBendpointCommand(RootModel rootModel, ConnectionAdapter relation, int index, Point newLocation) {
 		DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class);
 		DiagramPresentationModel presentation = diagramPresentations.get(Migration.DIAGRAM_INDEX);
-		JmPoint oldLocation = presentation.getConnectionLayouts().get(relation).get(index);
+		JmPoint oldLocation = presentation.getConnectionProfiles().get(relation).getBendpoints().get(index);
 		
 		this.rootModel = rootModel;
 		this.relation = relation;
@@ -79,7 +79,7 @@
 	public void execute() {
 		DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class);
 		DiagramPresentationModel presentation = diagramPresentations.get(Migration.DIAGRAM_INDEX);
-		presentation.getConnectionLayouts().get(relation).set(index, ConvertUtil.convert(newLocation));
+		presentation.getConnectionProfiles().get(relation).getBendpoints().set(index, ConvertUtil.convert(newLocation));
 		shiftPosition(false);
 	}
 	
@@ -88,6 +88,6 @@
 		shiftPosition(true);
 		DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class);
 		DiagramPresentationModel presentation = diagramPresentations.get(Migration.DIAGRAM_INDEX);
-		presentation.getConnectionLayouts().get(relation).set(index, ConvertUtil.convert(oldLocation));
+		presentation.getConnectionProfiles().get(relation).getBendpoints().set(index, ConvertUtil.convert(oldLocation));
 	}
 }

Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/AbstractJmConnectionEditPart.java
===================================================================
--- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/AbstractJmConnectionEditPart.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/AbstractJmConnectionEditPart.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -35,6 +35,7 @@
 import org.jiemamy.eclipse.editor.editpolicy.JmConnectionEditPolicy;
 import org.jiemamy.editcommand.Command;
 import org.jiemamy.editcommand.CommandListener;
+import org.jiemamy.model.ConnectionProfile;
 import org.jiemamy.model.DiagramPresentationModel;
 import org.jiemamy.model.DiagramPresentations;
 import org.jiemamy.model.RootModel;
@@ -111,12 +112,13 @@
 		RootModel rootModel = (RootModel) getRoot().getContents().getModel();
 		DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class);
 		DiagramPresentationModel diagramPresentationModel = diagramPresentations.get(Migration.DIAGRAM_INDEX);
-		Map<ConnectionAdapter, List<JmPoint>> connectionLayouts = diagramPresentationModel.getConnectionLayouts();
+		Map<ConnectionAdapter, ConnectionProfile> connectionProfiles = diagramPresentationModel.getConnectionProfiles();
 		ConnectionAdapter connection = getModel();
-		if (connectionLayouts.containsKey(connection) == false) {
-			diagramPresentationModel.getConnectionLayouts().put(connection, new ArrayList<JmPoint>());
+		
+		List<JmPoint> bendpoints = diagramPresentationModel.getConnectionProfiles().get(connection).getBendpoints();
+		if (connectionProfiles.containsKey(connection) == false) {
+			bendpoints.clear();
 		}
-		List<JmPoint> bendpoints = diagramPresentationModel.getConnectionLayouts().get(connection);
 		List<AbsoluteBendpoint> constraint = new ArrayList<AbsoluteBendpoint>(bendpoints.size());
 		
 		for (JmPoint bendpoint : bendpoints) {

Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/AbstractJmNodeEditPart.java
===================================================================
--- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/AbstractJmNodeEditPart.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/AbstractJmNodeEditPart.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -43,11 +43,11 @@
 import org.jiemamy.eclipse.editor.editpolicy.JmGraphicalNodeEditPolicy;
 import org.jiemamy.editcommand.Command;
 import org.jiemamy.editcommand.CommandListener;
+import org.jiemamy.model.ConnectionProfile;
 import org.jiemamy.model.DiagramPresentationModel;
 import org.jiemamy.model.DiagramPresentations;
 import org.jiemamy.model.RootModel;
 import org.jiemamy.model.connection.ConnectionAdapter;
-import org.jiemamy.model.geometory.JmPoint;
 import org.jiemamy.model.node.NodeAdapter;
 import org.jiemamy.utils.CollectionsUtil;
 import org.jiemamy.utils.LogMarker;
@@ -159,12 +159,12 @@
 		RootModel rootModel = (RootModel) getRoot().getContents().getModel();
 		DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class);
 		DiagramPresentationModel diagramPresentationModel = diagramPresentations.get(Migration.DIAGRAM_INDEX);
-		Map<ConnectionAdapter, List<JmPoint>> connectionLayouts = diagramPresentationModel.getConnectionLayouts();
+		Map<ConnectionAdapter, ConnectionProfile> connectionProfiles = diagramPresentationModel.getConnectionProfiles();
 		
 		List<ConnectionAdapter> result = CollectionsUtil.newArrayList();
 		Collection<ConnectionAdapter> connections = getModel().getSourceConnections();
 		for (ConnectionAdapter connectionAdapter : connections) {
-			if (connectionLayouts.containsKey(connectionAdapter)) {
+			if (connectionProfiles.containsKey(connectionAdapter)) {
 				result.add(connectionAdapter);
 			}
 		}
@@ -179,12 +179,12 @@
 		RootModel rootModel = (RootModel) getRoot().getContents().getModel();
 		DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class);
 		DiagramPresentationModel diagramPresentationModel = diagramPresentations.get(Migration.DIAGRAM_INDEX);
-		Map<ConnectionAdapter, List<JmPoint>> connectionLayouts = diagramPresentationModel.getConnectionLayouts();
+		Map<ConnectionAdapter, ConnectionProfile> connectionProfiles = diagramPresentationModel.getConnectionProfiles();
 		
 		List<ConnectionAdapter> result = CollectionsUtil.newArrayList();
 		Collection<ConnectionAdapter> connections = getModel().getTargetConnections();
 		for (ConnectionAdapter connectionAdapter : connections) {
-			if (connectionLayouts.containsKey(connectionAdapter)) {
+			if (connectionProfiles.containsKey(connectionAdapter)) {
 				result.add(connectionAdapter);
 			}
 		}

Modified: zeus/trunk/jiemamy-spec-core/src/main/resources/jiemamy-view.xsd
===================================================================
--- zeus/trunk/jiemamy-spec-core/src/main/resources/jiemamy-view.xsd	2009-02-28 07:26:28 UTC (rev 2747)
+++ zeus/trunk/jiemamy-spec-core/src/main/resources/jiemamy-view.xsd	2009-02-28 08:10:00 UTC (rev 2748)
@@ -78,6 +78,7 @@
 				</xsd:choice>
 				<xsd:element ref="bendpoints" minOccurs="0" maxOccurs="unbounded"/>
 			</xsd:sequence>
+			<xsd:attribute name="id" type="core:uuidType" use="required" />
 		</xsd:complexType>
 	</xsd:element>
 	

Modified: zeus/trunk/jiemamy-spec-core/src/main/resources/sample.xml
===================================================================
--- zeus/trunk/jiemamy-spec-core/src/main/resources/sample.xml	2009-02-28 07:26:28 UTC (rev 2747)
+++ zeus/trunk/jiemamy-spec-core/src/main/resources/sample.xml	2009-02-28 08:10:00 UTC (rev 2748)
@@ -423,14 +423,14 @@
         </view:nodeLayout>
       </view:nodeLayouts>
       <view:connectionLayouts>
-        <view:connectionLayout>
+        <view:connectionLayout id="366b547f-a2a6-42b2-a3a4-38745436c425">
           <view:connectionObjectRef ref="e43d3c43-33c8-4b02-aa42-83f2d868cfe6"/>
           <view:bendpoints>
             <view:bendpoint x="310" y="60"/>
             <view:bendpoint x="360" y="10"/>
           </view:bendpoints>
         </view:connectionLayout>
-        <view:connectionLayout>
+        <view:connectionLayout id="e5b3d709-2aea-4e26-a90c-b8f438d2da9d">
           <view:connectionObjectRef ref="e7dd92b4-1d97-4be6-bab6-fa9fe26eb6ed"/>
         </view:connectionLayout>
       </view:connectionLayouts>
@@ -450,7 +450,7 @@
         </view:nodeLayout>
       </view:nodeLayouts>
       <view:connectionLayouts>
-        <view:connectionLayout>
+        <view:connectionLayout id="b615f111-5143-4b12-bfdb-9a06806a9ace">
           <view:connectionObjectRef ref="e7dd92b4-1d97-4be6-bab6-fa9fe26eb6ed"/>
         </view:connectionLayout>
       </view:connectionLayouts>

Modified: zeus/trunk/jiemamy-spec-view/src/main/java/org/jiemamy/model/DiagramPresentationModel.java
===================================================================
--- zeus/trunk/jiemamy-spec-view/src/main/java/org/jiemamy/model/DiagramPresentationModel.java	2009-02-28 07:26:28 UTC (rev 2747)
+++ zeus/trunk/jiemamy-spec-view/src/main/java/org/jiemamy/model/DiagramPresentationModel.java	2009-02-28 08:10:00 UTC (rev 2748)
@@ -18,11 +18,9 @@
  */
 package org.jiemamy.model;
 
-import java.util.List;
 import java.util.Map;
 
 import org.jiemamy.model.connection.ConnectionAdapter;
-import org.jiemamy.model.geometory.JmPoint;
 import org.jiemamy.model.node.NodeAdapter;
 
 /**
@@ -37,7 +35,7 @@
 	 * 
 	 * @return コネクションのベンドポイント情報
 	 */
-	Map<ConnectionAdapter, List<JmPoint>> getConnectionLayouts();
+	Map<ConnectionAdapter, ConnectionProfile> getConnectionProfiles();
 	
 	/**
 	 * ノードのレイアウト情報を取得する。
@@ -81,18 +79,6 @@
 	void resetBendpoints(ConnectionAdapter connection);
 	
 	/**
-	 * コネクションのベンドポイント情報を設定する。
-	 * 
-	 * <p>ベンドポイント情報のリストは、source側を起点とした順番で格納されたリストである。</p>
-	 * 
-	 * @param connection 設定対象コネクション
-	 * @param bendpoints ベンドポイント情報のリスト
-	 * @throws IllegalArgumentException 引数に{@code null}を与えた場合
-	 */
-	@Deprecated
-	void setBendpoints(ConnectionAdapter connection, List<JmPoint> bendpoints);
-	
-	/**
 	 * 表示レベルを取得する。
 	 * 
 	 * @param level 表示レベル



Jiemamy-notify メーリングリストの案内
Back to archive index