svnno****@sourc*****
svnno****@sourc*****
2009年 2月 28日 (土) 17:53:55 JST
Revision: 2749 http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2749 Author: daisuke_m Date: 2009-02-28 17:53:55 +0900 (Sat, 28 Feb 2009) Log Message: ----------- 名称変更リファクタリング Modified Paths: -------------- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/NodeProfileImpl.java artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ViewDomSerializerEnhancer.java artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/facade/JiemamyViewFacadeImpl.java artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/processor/ResetBendpointProcessor.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 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/FitNodeConstraintAction.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/editpart/diagram/StickyEditPart.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/TableEditPart.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/ViewEditPart.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/utils/ConvertUtil.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/NodeProfile.java zeus/trunk/jiemamy-spec-view/src/main/java/org/jiemamy/xml/ViewQName.java -------------- next part -------------- Modified: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/NodeProfileImpl.java =================================================================== --- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/NodeProfileImpl.java 2009-02-28 08:10:00 UTC (rev 2748) +++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/NodeProfileImpl.java 2009-02-28 08:53:55 UTC (rev 2749) @@ -36,7 +36,7 @@ private JmColor color; /** ノードのレイアウト情報 */ - private JmRectangle layout; + private JmRectangle boundary; /** @@ -49,20 +49,20 @@ super(jiemamy, id); } + public JmRectangle getBoundary() { + return boundary; + } + public JmColor getColor() { return color; } - public JmRectangle getLayout() { - return layout; + public void setBoundary(JmRectangle boundary) { + this.boundary = boundary; } public void setColor(JmColor color) { this.color = color; } - public void setLayout(JmRectangle layout) { - this.layout = layout; - } - } 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 08:10:00 UTC (rev 2748) +++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/ViewDomSerializerEnhancer.java 2009-02-28 08:53:55 UTC (rev 2749) @@ -121,58 +121,59 @@ DomUtil.newChild(presentationElement, ViewQName.MODE, presentation.getMode()); logger.trace(" level: " + presentation.getLevel()); DomUtil.newChild(presentationElement, ViewQName.LEVEL, presentation.getLevel()); - logger.trace(" nodeLayouts"); - Element nodeLayoutsElement = DomUtil.newChild(presentationElement, ViewQName.NODE_LAYOUTS); + logger.trace(" nodeProfiles"); + Element nodeProfilesElement = DomUtil.newChild(presentationElement, ViewQName.NODE_PROFILES); for (Map.Entry<NodeAdapter, NodeProfile> entry : presentation.getFigureProfiles().entrySet()) { NodeAdapter node = entry.getKey(); NodeProfile nodeProfile = entry.getValue(); - logger.trace(" nodeLayout"); - Element nodeLayoutElement = DomUtil.newChild(nodeLayoutsElement, ViewQName.NODE_LAYOUT); - nodeLayoutElement.setAttribute("id", nodeProfile.getId().toString()); + logger.trace(" nodeProfile"); + Element nodeProfileElement = DomUtil.newChild(nodeProfilesElement, ViewQName.NODE_PROFILE); + nodeProfileElement.setAttribute("id", nodeProfile.getId().toString()); Element nodeElement; if (node.unwrap() == null) { - nodeElement = DomUtil.newChild(nodeLayoutElement, ViewQName.STICKY); + nodeElement = DomUtil.newChild(nodeProfileElement, ViewQName.STICKY); StickyModel stickyModel = (StickyModel) node; nodeElement.setAttribute("id", stickyModel.getId().toString()); DomUtil.newChild(nodeElement, ViewQName.CONTENTS, stickyModel.getContents()); logger.trace(" sticky: " + stickyModel.getContents()); } else { - nodeElement = DomUtil.newChild(nodeLayoutElement, ViewQName.NODE_OBJECT_REF); + nodeElement = DomUtil.newChild(nodeProfileElement, ViewQName.NODE_OBJECT_REF); nodeElement.setAttribute("ref", node.unwrap().getId().toString()); logger.trace(" node ref: " + node.unwrap().getId().toString()); } - Element boundaryElement = DomUtil.newChild(nodeLayoutElement, ViewQName.BOUNDARY); - boundaryElement.setAttribute("x", Integer.toString(nodeProfile.getLayout().x)); - boundaryElement.setAttribute("y", Integer.toString(nodeProfile.getLayout().y)); - boundaryElement.setAttribute("width", Integer.toString(nodeProfile.getLayout().width)); - boundaryElement.setAttribute("height", Integer.toString(nodeProfile.getLayout().height)); + Element boundaryElement = DomUtil.newChild(nodeProfileElement, ViewQName.BOUNDARY); + boundaryElement.setAttribute("x", Integer.toString(nodeProfile.getBoundary().x)); + boundaryElement.setAttribute("y", Integer.toString(nodeProfile.getBoundary().y)); + boundaryElement.setAttribute("width", Integer.toString(nodeProfile.getBoundary().width)); + boundaryElement.setAttribute("height", Integer.toString(nodeProfile.getBoundary().height)); JmColor color = nodeProfile.getColor(); if (color != null) { boundaryElement.setAttribute("color", color.toString()); } logger.trace(" boundary: " + boundaryElement); } - Element connectionLayoutsElement = DomUtil.newChild(presentationElement, ViewQName.CONNECTION_LAYOUTS); - logger.trace(" connectionLayouts"); + Element connectionProfilesElement = + DomUtil.newChild(presentationElement, ViewQName.CONNECTION_PROFILES); + logger.trace(" connectionProfiles"); for (Map.Entry<ConnectionAdapter, ConnectionProfile> entry : presentation.getConnectionProfiles() .entrySet()) { - logger.trace(" connectionLayout"); + logger.trace(" connectionProfile"); ConnectionAdapter connection = entry.getKey(); ConnectionProfile connectionProfile = entry.getValue(); - Element connectionLayoutElement = - DomUtil.newChild(connectionLayoutsElement, ViewQName.CONNECTION_LAYOUT); - connectionLayoutElement.setAttribute("id", connectionProfile.getId().toString()); + Element connectionProfileElement = + DomUtil.newChild(connectionProfilesElement, ViewQName.CONNECTION_PROFILE); + connectionProfileElement.setAttribute("id", connectionProfile.getId().toString()); if (connection.unwrap() == null) { logger.warn(" Unknown connection: " + connection.getClass().getName()); continue; } else { Element connectionObjectRef = - DomUtil.newChild(connectionLayoutElement, ViewQName.CONNECTION_OBJECT_REF); + DomUtil.newChild(connectionProfileElement, ViewQName.CONNECTION_OBJECT_REF); connectionObjectRef.setAttribute("ref", connection.unwrap().getId().toString()); logger.trace(" FK"); } if (connectionProfile.getBendpoints().size() > 0) { - Element bendpointsElement = DomUtil.newChild(connectionLayoutElement, ViewQName.BENDPOINTS); + Element bendpointsElement = DomUtil.newChild(connectionProfileElement, ViewQName.BENDPOINTS); logger.trace(" bendpoints"); for (JmPoint point : connectionProfile.getBendpoints()) { Element bendpointElement = DomUtil.newChild(bendpointsElement, ViewQName.BENDPOINT); @@ -216,11 +217,11 @@ presentation.setLevel(Level.valueOf(levelString)); } - NodeList nodeLayoutNodeList = XpathUtil.getNodes(dpElement, "view:nodeLayouts/view:nodeLayout"); - Iterable<Node> nodeLayoutNodeListIterable = new IterableNodeList(nodeLayoutNodeList); - for (Node nodeLayoutNode : nodeLayoutNodeListIterable) { + NodeList nodeProfileNodeList = XpathUtil.getNodes(dpElement, "view:nodeProfiles/view:nodeProfile"); + Iterable<Node> nodeProfileNodeListIterable = new IterableNodeList(nodeProfileNodeList); + for (Node nodeProfileNode : nodeProfileNodeListIterable) { NodeAdapter nodeAdapter; - Node objectRefNode = XpathUtil.getNode(nodeLayoutNode, "view:nodeObjectRef"); + Node objectRefNode = XpathUtil.getNode(nodeProfileNode, "view:nodeObjectRef"); if (objectRefNode != null) { UUID refId = DomUtil.getUUID(objectRefNode, CoreQName.REF); JiemamyElement jElement = RootModelUtil.findJiemamyElement(rootModel, refId); @@ -234,34 +235,35 @@ continue; } } else { - Node stickytNode = XpathUtil.getNode(nodeLayoutNode, "view:sticky"); + Node stickytNode = XpathUtil.getNode(nodeProfileNode, "view:sticky"); StickyModel stickyModel = factory.newModel(StickyModel.class, DomUtil.getUUID(stickytNode, CoreQName.ID)); stickyModel.setContents(XpathUtil.getTextContent(stickytNode, "view:contents")); nodeAdapter = stickyModel; } - int x = Integer.valueOf(XpathUtil.getAttr(nodeLayoutNode, "view:boundary/@x").getValue()); - int y = Integer.valueOf(XpathUtil.getAttr(nodeLayoutNode, "view:boundary/@y").getValue()); - int width = Integer.valueOf(XpathUtil.getAttr(nodeLayoutNode, "view:boundary/@width").getValue()); - int height = Integer.valueOf(XpathUtil.getAttr(nodeLayoutNode, "view:boundary/@height").getValue()); + int x = Integer.valueOf(XpathUtil.getAttr(nodeProfileNode, "view:boundary/@x").getValue()); + int y = Integer.valueOf(XpathUtil.getAttr(nodeProfileNode, "view:boundary/@y").getValue()); + int width = Integer.valueOf(XpathUtil.getAttr(nodeProfileNode, "view:boundary/@width").getValue()); + int height = + Integer.valueOf(XpathUtil.getAttr(nodeProfileNode, "view:boundary/@height").getValue()); - Attr colorAttr = XpathUtil.getAttr(nodeLayoutNode, "view:boundary/@color"); + Attr colorAttr = XpathUtil.getAttr(nodeProfileNode, "view:boundary/@color"); JmColor color = colorAttr == null ? null : JmColor.parse(colorAttr.getValue()); NodeProfile nodeProfile = - factory.newModel(NodeProfile.class, DomUtil.getUUID(nodeLayoutNode, CoreQName.ID)); - nodeProfile.setLayout(new JmRectangle(x, y, width, height)); + factory.newModel(NodeProfile.class, DomUtil.getUUID(nodeProfileNode, CoreQName.ID)); + nodeProfile.setBoundary(new JmRectangle(x, y, width, height)); nodeProfile.setColor(color); presentation.getFigureProfiles().put(nodeAdapter, nodeProfile); } presentation.setName(XpathUtil.getTextContent(dpElement, "core:name")); - NodeList connectionLayoutNodeList = - XpathUtil.getNodes(dpElement, "view:connectionLayouts/view:connectionLayout"); - Iterable<Node> connectionLayoutNodeListIterable = new IterableNodeList(connectionLayoutNodeList); - for (Node connectionLayoutNode : connectionLayoutNodeListIterable) { + NodeList connectionProfileNodeList = + XpathUtil.getNodes(dpElement, "view:connectionProfiles/view:connectionProfile"); + Iterable<Node> connectionProfileNodeListIterable = new IterableNodeList(connectionProfileNodeList); + for (Node connectionProfileNode : connectionProfileNodeListIterable) { ConnectionAdapter connectionAdapter; - Node objectRefNode = XpathUtil.getNode(connectionLayoutNode, "view:connectionObjectRef"); + Node objectRefNode = XpathUtil.getNode(connectionProfileNode, "view:connectionObjectRef"); if (objectRefNode != null) { UUID refId = DomUtil.getUUID(objectRefNode, CoreQName.REF); JiemamyElement jElement = RootModelUtil.findJiemamyElement(rootModel, refId); @@ -278,11 +280,11 @@ continue; } ConnectionProfile connectionProfile = - factory.newModel(ConnectionProfile.class, DomUtil.getUUID(connectionLayoutNode, + factory.newModel(ConnectionProfile.class, DomUtil.getUUID(connectionProfileNode, CoreQName.ID)); NodeList bendpointNodeList = - XpathUtil.getNodes(connectionLayoutNode, "view:bendpoints/view:bendpoint"); + XpathUtil.getNodes(connectionProfileNode, "view:bendpoints/view:bendpoint"); Iterable<Node> bendpointNodeListIterable = new IterableNodeList(bendpointNodeList); for (Node bendpointNode : bendpointNodeListIterable) { int x = Integer.valueOf(XpathUtil.getAttr(bendpointNode, "@x").getValue()); 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 08:10:00 UTC (rev 2748) +++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/facade/JiemamyViewFacadeImpl.java 2009-02-28 08:53:55 UTC (rev 2749) @@ -91,9 +91,9 @@ * * @param diagramIndex * @param nodeAdapter - * @param constraint + * @param boundary */ - public void changeNodeConstraint(int diagramIndex, NodeAdapter nodeAdapter, JmRectangle constraint) { + public void changeNodeConstraint(int diagramIndex, NodeAdapter nodeAdapter, JmRectangle boundary) { RootModel rootModel = jiemamy.getFactory().getRootModel(); DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class); DiagramPresentationModel diagramPresentationModel = diagramPresentations.get(diagramIndex); @@ -103,7 +103,7 @@ figureProfiles.put(nodeAdapter, profile); } NodeProfile nodeProfile = figureProfiles.get(nodeAdapter); - Command redoCommand = new ModifyModelPropertyCommand<NodeProfile>(nodeProfile, "layout", constraint); + Command redoCommand = new ModifyModelPropertyCommand<NodeProfile>(nodeProfile, "boudary", boundary); redoCommand.execute(commandProcessor); undoStack.push(redoCommand.getNegateCommand()); redoStack.push(redoCommand); 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 08:10:00 UTC (rev 2748) +++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/processor/ResetBendpointProcessor.java 2009-02-28 08:53:55 UTC (rev 2749) @@ -65,14 +65,14 @@ // 自己コネクション時の、bendpoint自動作成 NodeProfile profile = diagramPresentation.getFigureProfiles().get(connection.getSource()); - JmRectangle rect = profile.getLayout(); + JmRectangle boundary = profile.getBoundary(); - if (rect == null) { + if (boundary == null) { throw new IllegalStateException("表示されていないノードのコネクションを操作しようとしました。"); } - 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))); + bendpoints.add(0, new JmPoint(Math.max(boundary.x - AUTO_BENDPOINT_OFFSET, 0), boundary.y)); + bendpoints.add(1, new JmPoint(boundary.x, Math.max(boundary.y - AUTO_BENDPOINT_OFFSET, 0))); } return null; } 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 08:10:00 UTC (rev 2748) +++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/test/ViewTestModelBuilder.java 2009-02-28 08:53:55 UTC (rev 2749) @@ -148,31 +148,31 @@ NodeProfile empProfile = factory.newModel(NodeProfile.class, uuid.get("aa7caa23-7958-4bd0-a356-8f09d4b74f08")); presentation1.getFigureProfiles().put(tableEmp.getAdapter(NodeAdapter.class), empProfile); - empProfile.setLayout(new JmRectangle(360, 60)); + empProfile.setBoundary(new JmRectangle(360, 60)); - NodeProfile deptLayout = + NodeProfile deptProfile = factory.newModel(NodeProfile.class, uuid.get("eb6506ef-4a25-4296-b6d7-c08741f19d5a")); - presentation1.getFigureProfiles().put(tableDept.getAdapter(NodeAdapter.class), deptLayout); - deptLayout.setLayout(new JmRectangle(60, 60)); + presentation1.getFigureProfiles().put(tableDept.getAdapter(NodeAdapter.class), deptProfile); + deptProfile.setBoundary(new JmRectangle(60, 60)); - NodeProfile viewLayout = + NodeProfile viewProfile = factory.newModel(NodeProfile.class, uuid.get("2387bfd0-7106-44ad-a34e-24231bbea6d5")); - presentation1.getFigureProfiles().put(viewHighSal.getAdapter(NodeAdapter.class), viewLayout); - viewLayout.setLayout(new JmRectangle(60, 270)); + presentation1.getFigureProfiles().put(viewHighSal.getAdapter(NodeAdapter.class), viewProfile); + viewProfile.setBoundary(new JmRectangle(60, 270)); - NodeProfile stickyLayout = + NodeProfile stickyProfile = factory.newModel(NodeProfile.class, uuid.get("2689d193-52a1-4fd4-a14c-9857274518c5")); - presentation1.getFigureProfiles().put(sticky, stickyLayout); - stickyLayout.setLayout(new JmRectangle(360, 270)); - stickyLayout.setColor(new JmColor(10, 11, 12)); + presentation1.getFigureProfiles().put(sticky, stickyProfile); + stickyProfile.setBoundary(new JmRectangle(360, 270)); + stickyProfile.setColor(new JmColor(10, 11, 12)); 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))); + JmRectangle boundary = nodeProf.getBoundary(); + bendpoints.add(0, new JmPoint(Math.max(boundary.x - offset, 0), boundary.y)); + bendpoints.add(1, new JmPoint(boundary.x, Math.max(boundary.y - offset, 0))); presentation1.getConnectionProfiles().put(fkEmpEmp.getAdapter(ConnectionAdapter.class), connectionProfile1); ConnectionProfile connectionProfile2 = @@ -189,12 +189,12 @@ NodeProfile nodeProfile1 = factory.newModel(NodeProfile.class, uuid.get("d71ff015-101c-4669-8745-312d1da34efe")); presentation2.getFigureProfiles().put(tableEmp.getAdapter(NodeAdapter.class), nodeProfile1); - nodeProfile1.setLayout(new JmRectangle(60, 60)); + nodeProfile1.setBoundary(new JmRectangle(60, 60)); NodeProfile nodeProfile2 = factory.newModel(NodeProfile.class, uuid.get("2df7718f-d71e-4dbf-8327-e0ad36f03d5d")); presentation2.getFigureProfiles().put(viewHighSal.getAdapter(NodeAdapter.class), nodeProfile2); - nodeProfile2.setLayout(new JmRectangle(270, 270)); + nodeProfile2.setBoundary(new JmRectangle(270, 270)); ConnectionProfile connectionProfile = factory.newModel(ConnectionProfile.class, uuid.get("b615f111-5143-4b12-bfdb-9a06806a9ace")); 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 08:10:00 UTC (rev 2748) +++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/utils/model/PresentationUtil.java 2009-02-28 08:53:55 UTC (rev 2749) @@ -54,16 +54,16 @@ * * @param presentation * @param nodeAdapter - * @param rect + * @param boundary */ - public static void setLayout(DiagramPresentationModel presentation, NodeAdapter nodeAdapter, JmRectangle rect) { + public static void setProfile(DiagramPresentationModel presentation, NodeAdapter nodeAdapter, JmRectangle boundary) { NodeProfile nodeProfile = presentation.getFigureProfiles().get(nodeAdapter); if (nodeProfile == null) { JiemamyFactory factory = presentation.getJiemamy().getFactory(); nodeProfile = factory.newModel(NodeProfile.class); presentation.getFigureProfiles().put(nodeAdapter, nodeProfile); } - nodeProfile.setLayout(rect); + nodeProfile.setBoundary(boundary); } 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 08:10:00 UTC (rev 2748) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/action/AutoLayoutAction.java 2009-02-28 08:53:55 UTC (rev 2749) @@ -121,7 +121,7 @@ graph.setDefaultPadding(new Insets(40)); graph.nodes = graphNodes; graph.edges = graphEdges; - (new DirectedGraphLayout()).visit(graph); + new DirectedGraphLayout().visit(graph); for (Object obj : graph.nodes) { EntityNode node = (EntityNode) obj; commands.add(new LayoutCommand(rootModel, node.model, node.x, node.y)); @@ -176,6 +176,7 @@ /** * インスタンスを生成する。 + * * @param rootModel * @param target * @param x @@ -189,16 +190,16 @@ DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class); DiagramPresentationModel presentation = diagramPresentations.get(Migration.DIAGRAM_INDEX); NodeProfile nodeProfile = presentation.getFigureProfiles().get(target); - JmRectangle layout = nodeProfile.getLayout(); - oldX = layout.x; - oldY = layout.y; + JmRectangle boundary = nodeProfile.getBoundary(); + oldX = boundary.x; + oldY = boundary.y; } @Override public void execute() { DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class); DiagramPresentationModel presentation = diagramPresentations.get(Migration.DIAGRAM_INDEX); - PresentationUtil.setLayout(presentation, target, new JmRectangle(x, y, -1, -1)); + PresentationUtil.setProfile(presentation, target, new JmRectangle(x, y, -1, -1)); oldBendpoints.clear(); for (ConnectionAdapter conn : target.getSourceConnections()) { ConnectionProfile connectionProfile = presentation.getConnectionProfiles().get(conn); @@ -220,7 +221,7 @@ bendpoints.add(bendpoint); } } - PresentationUtil.setLayout(presentation, target, new JmRectangle(oldX, oldY, -1, -1)); + PresentationUtil.setProfile(presentation, target, new JmRectangle(oldX, oldY, -1, -1)); } } } Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/action/FitNodeConstraintAction.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/action/FitNodeConstraintAction.java 2009-02-28 08:10:00 UTC (rev 2748) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/action/FitNodeConstraintAction.java 2009-02-28 08:53:55 UTC (rev 2749) @@ -58,11 +58,11 @@ CommandStack stack = getViewer().getEditDomain().getCommandStack(); DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class); DiagramPresentationModel presentation = diagramPresentations.get(Migration.DIAGRAM_INDEX); - JmRectangle constraint = presentation.getFigureProfiles().get(nodeAdapter).getLayout(); + JmRectangle boundary = presentation.getFigureProfiles().get(nodeAdapter).getBoundary(); - JmRectangle newConstraint = new JmRectangle(constraint.x, constraint.y, -1, -1); + JmRectangle newBoundary = new JmRectangle(boundary.x, boundary.y, -1, -1); - Command command = new ChangeNodeConstraintCommand(rootModel, nodeAdapter, newConstraint, getViewer()); + Command command = new ChangeNodeConstraintCommand(rootModel, nodeAdapter, newBoundary, getViewer()); stack.execute(command); } 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 08:10:00 UTC (rev 2748) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/AbstractMovePositionCommand.java 2009-02-28 08:53:55 UTC (rev 2749) @@ -76,14 +76,14 @@ for (NodeAdapter node : presentation.getFigureProfiles().keySet()) { // エンティティの移動 - JmRectangle rect = presentation.getFigureProfiles().get(node).getLayout(); - JmRectangle newRect; + JmRectangle old = presentation.getFigureProfiles().get(node).getBoundary(); + JmRectangle newBoundary; if (negative) { - newRect = new JmRectangle(rect.x - shift.x, rect.y - shift.y, rect.width, rect.height); + newBoundary = new JmRectangle(old.x - shift.x, old.y - shift.y, old.width, old.height); } else { - newRect = new JmRectangle(rect.x + shift.x, rect.y + shift.y, rect.width, rect.height); + newBoundary = new JmRectangle(old.x + shift.x, old.y + shift.y, old.width, old.height); } - presentation.getFigureProfiles().get(node).setLayout(newRect); + presentation.getFigureProfiles().get(node).setBoundary(newBoundary); // ベンドポイントの移動 for (ConnectionAdapter connection : node.getSourceConnections()) { 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 08:10:00 UTC (rev 2748) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/ChangeNodeConstraintCommand.java 2009-02-28 08:53:55 UTC (rev 2749) @@ -53,9 +53,9 @@ private NodeAdapter nodeAdapter; - private JmRectangle constraint; + private JmRectangle boundary; - private JmRectangle oldConstraint; + private JmRectangle oldBoundary; private EditPartViewer viewer; @@ -67,22 +67,22 @@ * * @param rootModel * @param nodeAdapter - * @param rectangle + * @param boundary * @param viewer */ - public ChangeNodeConstraintCommand(RootModel rootModel, NodeAdapter nodeAdapter, JmRectangle rectangle, + public ChangeNodeConstraintCommand(RootModel rootModel, NodeAdapter nodeAdapter, JmRectangle boundary, EditPartViewer viewer) { this.rootModel = rootModel; this.nodeAdapter = nodeAdapter; DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class); DiagramPresentationModel presentationModel = diagramPresentations.get(Migration.DIAGRAM_INDEX); - oldConstraint = presentationModel.getFigureProfiles().get(nodeAdapter).getLayout(); - constraint = rectangle; + oldBoundary = presentationModel.getFigureProfiles().get(nodeAdapter).getBoundary(); + this.boundary = boundary; this.viewer = viewer; // 移動量の計算 - int shiftX = rectangle.x < 0 ? Math.abs(rectangle.x) : 0; - int shiftY = rectangle.y < 0 ? Math.abs(rectangle.y) : 0; + int shiftX = boundary.x < 0 ? Math.abs(boundary.x) : 0; + int shiftY = boundary.y < 0 ? Math.abs(boundary.y) : 0; setShift(new JmPoint(shiftX, shiftY)); jiemamyFacade = new JiemamyViewFacadeImpl(rootModel.getJiemamy()); @@ -106,7 +106,7 @@ logger.debug(LogMarker.LIFECYCLE, "execute"); // 本体の移動 - jiemamyFacade.changeNodeConstraint(Migration.DIAGRAM_INDEX, nodeAdapter, constraint); + jiemamyFacade.changeNodeConstraint(Migration.DIAGRAM_INDEX, nodeAdapter, boundary); // ベンドポイントの移動 shiftBendpoints(false); @@ -123,7 +123,7 @@ } private void shiftBendpoints(boolean positive) { - JmPoint delta = JmPointUtil.delta(oldConstraint, constraint); + JmPoint delta = JmPointUtil.delta(oldBoundary, boundary); // 選択されたモデルのリストを得る List<Object> selectedModels = new ArrayList<Object>(); Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/StickyEditPart.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/StickyEditPart.java 2009-02-28 08:10:00 UTC (rev 2748) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/StickyEditPart.java 2009-02-28 08:53:55 UTC (rev 2749) @@ -129,8 +129,8 @@ if (nodeProfile == null) { // TODO 表示しない } else { - JmRectangle constraint = nodeProfile.getLayout(); - editPart.setLayoutConstraint(this, getFigure(), ConvertUtil.convert(constraint)); + JmRectangle boundary = nodeProfile.getBoundary(); + editPart.setLayoutConstraint(this, getFigure(), ConvertUtil.convert(boundary)); } updateFigure(getFigure()); Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/TableEditPart.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/TableEditPart.java 2009-02-28 08:10:00 UTC (rev 2748) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/TableEditPart.java 2009-02-28 08:53:55 UTC (rev 2749) @@ -124,8 +124,8 @@ if (nodeProfile == null) { // TODO 表示しない } else { - JmRectangle constraint = nodeProfile.getLayout(); - editPart.setLayoutConstraint(this, getFigure(), ConvertUtil.convert(constraint)); + JmRectangle boundary = nodeProfile.getBoundary(); + editPart.setLayoutConstraint(this, getFigure(), ConvertUtil.convert(boundary)); } updateFigure(getFigure()); } Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/ViewEditPart.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/ViewEditPart.java 2009-02-28 08:10:00 UTC (rev 2748) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/ViewEditPart.java 2009-02-28 08:53:55 UTC (rev 2749) @@ -121,8 +121,8 @@ if (nodeProfile == null) { // TODO 表示しない } else { - JmRectangle constraint = nodeProfile.getLayout(); - editPart.setLayoutConstraint(this, getFigure(), ConvertUtil.convert(constraint)); + JmRectangle boundary = nodeProfile.getBoundary(); + editPart.setLayoutConstraint(this, getFigure(), ConvertUtil.convert(boundary)); } updateFigure(getFigure()); Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/utils/ConvertUtil.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/utils/ConvertUtil.java 2009-02-28 08:10:00 UTC (rev 2748) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/utils/ConvertUtil.java 2009-02-28 08:53:55 UTC (rev 2749) @@ -63,11 +63,11 @@ * * <p>{@code null}を与えた場合、{@code null}を返す。</p> * - * @param rect 変換元 + * @param rectangle 変換元 * @return {@link Rectangle}のインスタンス */ - public static Rectangle convert(JmRectangle rect) { - return rect == null ? null : (new Rectangle(rect.x, rect.y, rect.width, rect.height)); + public static Rectangle convert(JmRectangle rectangle) { + return rectangle == null ? null : (new Rectangle(rectangle.x, rectangle.y, rectangle.width, rectangle.height)); } /** @@ -87,11 +87,11 @@ * * <p>{@code null}を与えた場合、{@code null}を返す。</p> * - * @param rect 変換元 + * @param rectangle 変換元 * @return {@link JmRectangle}のインスタンス */ - public static JmRectangle convert(Rectangle rect) { - return rect == null ? null : (new JmRectangle(rect.x, rect.y, rect.width, rect.height)); + public static JmRectangle convert(Rectangle rectangle) { + return rectangle == null ? null : (new JmRectangle(rectangle.x, rectangle.y, rectangle.width, rectangle.height)); } /** 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 08:10:00 UTC (rev 2748) +++ zeus/trunk/jiemamy-spec-core/src/main/resources/jiemamy-view.xsd 2009-02-28 08:53:55 UTC (rev 2749) @@ -30,17 +30,17 @@ <xsd:element ref="core:name" /> <xsd:element name="mode" type="modeType" /> <xsd:element name="level" type="levelType" /> - <xsd:element name="nodeLayouts" minOccurs="0"> + <xsd:element name="nodeProfiles" minOccurs="0"> <xsd:complexType> <xsd:sequence minOccurs="0" maxOccurs="unbounded"> - <xsd:element ref="nodeLayout" maxOccurs="unbounded" /> + <xsd:element ref="nodeProfile" maxOccurs="unbounded" /> </xsd:sequence> </xsd:complexType> </xsd:element> - <xsd:element name="connectionLayouts" minOccurs="0"> + <xsd:element name="connectionProfiles" minOccurs="0"> <xsd:complexType> <xsd:choice minOccurs="0" maxOccurs="unbounded"> - <xsd:element ref="connectionLayout" maxOccurs="unbounded" /> + <xsd:element ref="connectionProfile" maxOccurs="unbounded" /> </xsd:choice> </xsd:complexType> </xsd:element> @@ -49,7 +49,7 @@ </xsd:complexType> </xsd:element> - <xsd:element name="nodeLayout"> + <xsd:element name="nodeProfile"> <xsd:complexType> <xsd:sequence> <xsd:choice> @@ -70,7 +70,7 @@ </xsd:complexType> </xsd:element> - <xsd:element name="connectionLayout"> + <xsd:element name="connectionProfile"> <xsd:complexType> <xsd:sequence> <xsd:choice> Modified: zeus/trunk/jiemamy-spec-core/src/main/resources/sample.xml =================================================================== --- zeus/trunk/jiemamy-spec-core/src/main/resources/sample.xml 2009-02-28 08:10:00 UTC (rev 2748) +++ zeus/trunk/jiemamy-spec-core/src/main/resources/sample.xml 2009-02-28 08:53:55 UTC (rev 2749) @@ -402,58 +402,58 @@ <name>全部表示する</name> <view:mode>PHYSICAL</view:mode> <view:level>ATTRTYPE</view:level> - <view:nodeLayouts> - <view:nodeLayout id="aa7caa23-7958-4bd0-a356-8f09d4b74f08"> + <view:nodeProfiles> + <view:nodeProfile id="aa7caa23-7958-4bd0-a356-8f09d4b74f08"> <view:nodeObjectRef ref="9f522e56-809c-45fd-8416-39201014218b"/> <view:boundary height="-1" width="-1" x="360" y="60"/> - </view:nodeLayout> - <view:nodeLayout id="eb6506ef-4a25-4296-b6d7-c08741f19d5a"> + </view:nodeProfile> + <view:nodeProfile id="eb6506ef-4a25-4296-b6d7-c08741f19d5a"> <view:nodeObjectRef ref="d7489ed6-0add-443d-95cf-234376eb0455"/> <view:boundary height="-1" width="-1" x="60" y="60"/> - </view:nodeLayout> - <view:nodeLayout id="2387bfd0-7106-44ad-a34e-24231bbea6d5"> + </view:nodeProfile> + <view:nodeProfile id="2387bfd0-7106-44ad-a34e-24231bbea6d5"> <view:nodeObjectRef ref="516f7961-cb7b-48e2-990b-7fb0c750c3a4"/> <view:boundary height="-1" width="-1" x="60" y="270"/> - </view:nodeLayout> - <view:nodeLayout id="2689d193-52a1-4fd4-a14c-9857274518c5"> + </view:nodeProfile> + <view:nodeProfile id="2689d193-52a1-4fd4-a14c-9857274518c5"> <view:sticky id="43beb884-2562-4480-8030-bb797f701783"> <view:contents>メモーー</view:contents> </view:sticky> <view:boundary color="#0a0b0c" height="-1" width="-1" x="360" y="270"/> - </view:nodeLayout> - </view:nodeLayouts> - <view:connectionLayouts> - <view:connectionLayout id="366b547f-a2a6-42b2-a3a4-38745436c425"> + </view:nodeProfile> + </view:nodeProfiles> + <view:connectionProfiles> + <view:connectionProfile 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 id="e5b3d709-2aea-4e26-a90c-b8f438d2da9d"> + </view:connectionProfile> + <view:connectionProfile id="e5b3d709-2aea-4e26-a90c-b8f438d2da9d"> <view:connectionObjectRef ref="e7dd92b4-1d97-4be6-bab6-fa9fe26eb6ed"/> - </view:connectionLayout> - </view:connectionLayouts> + </view:connectionProfile> + </view:connectionProfiles> </view:diagramPresentation> <view:diagramPresentation id="53c7cdb7-1512-46c7-8ee3-aadec6007896"> <name>一部表示する</name> <view:mode>PHYSICAL</view:mode> <view:level>ATTRTYPE</view:level> - <view:nodeLayouts> - <view:nodeLayout id="d71ff015-101c-4669-8745-312d1da34efe"> + <view:nodeProfiles> + <view:nodeProfile id="d71ff015-101c-4669-8745-312d1da34efe"> <view:nodeObjectRef ref="9f522e56-809c-45fd-8416-39201014218b"/> <view:boundary height="-1" width="-1" x="60" y="60"/> - </view:nodeLayout> - <view:nodeLayout id="2df7718f-d71e-4dbf-8327-e0ad36f03d5d"> + </view:nodeProfile> + <view:nodeProfile id="2df7718f-d71e-4dbf-8327-e0ad36f03d5d"> <view:nodeObjectRef ref="516f7961-cb7b-48e2-990b-7fb0c750c3a4"/> <view:boundary height="-1" width="-1" x="270" y="270"/> - </view:nodeLayout> - </view:nodeLayouts> - <view:connectionLayouts> - <view:connectionLayout id="b615f111-5143-4b12-bfdb-9a06806a9ace"> + </view:nodeProfile> + </view:nodeProfiles> + <view:connectionProfiles> + <view:connectionProfile id="b615f111-5143-4b12-bfdb-9a06806a9ace"> <view:connectionObjectRef ref="e7dd92b4-1d97-4be6-bab6-fa9fe26eb6ed"/> - </view:connectionLayout> - </view:connectionLayouts> + </view:connectionProfile> + </view:connectionProfiles> </view:diagramPresentation> </view:diagramPresentations> </rootModel> Modified: zeus/trunk/jiemamy-spec-view/src/main/java/org/jiemamy/model/NodeProfile.java =================================================================== --- zeus/trunk/jiemamy-spec-view/src/main/java/org/jiemamy/model/NodeProfile.java 2009-02-28 08:10:00 UTC (rev 2748) +++ zeus/trunk/jiemamy-spec-view/src/main/java/org/jiemamy/model/NodeProfile.java 2009-02-28 08:53:55 UTC (rev 2749) @@ -29,6 +29,13 @@ public interface NodeProfile extends JiemamyElement { /** + * ノードのレイアウト情報を取得する。 + * + * @return ノードのレイアウト情報 + */ + JmRectangle getBoundary(); + + /** * ノードの色情報を取得する。 * * @return ノードの色情報 @@ -36,11 +43,11 @@ JmColor getColor(); /** - * ノードのレイアウト情報を取得する。 + * ノードのレイアウト情報を設定する。 * - * @return ノードのレイアウト情報 + * @param boundary ノードのレイアウト情報 */ - JmRectangle getLayout(); + void setBoundary(JmRectangle boundary); /** * ノードの色情報を設定する。 @@ -49,11 +56,4 @@ */ void setColor(JmColor color); - /** - * ノードのレイアウト情報を設定する。 - * - * @param layout ノードのレイアウト情報 - */ - void setLayout(JmRectangle layout); - } Modified: zeus/trunk/jiemamy-spec-view/src/main/java/org/jiemamy/xml/ViewQName.java =================================================================== --- zeus/trunk/jiemamy-spec-view/src/main/java/org/jiemamy/xml/ViewQName.java 2009-02-28 08:10:00 UTC (rev 2748) +++ zeus/trunk/jiemamy-spec-view/src/main/java/org/jiemamy/xml/ViewQName.java 2009-02-28 08:53:55 UTC (rev 2749) @@ -34,10 +34,10 @@ DIAGRAM_PRESENTATION(CoreNamespace.NS_VIEW, "diagramPresentation"), /***/ - NODE_LAYOUTS(CoreNamespace.NS_VIEW, "nodeLayouts"), + NODE_PROFILES(CoreNamespace.NS_VIEW, "nodeProfiles"), /***/ - NODE_LAYOUT(CoreNamespace.NS_VIEW, "nodeLayout"), + NODE_PROFILE(CoreNamespace.NS_VIEW, "nodeProfile"), /***/ NODE_OBJECT_REF(CoreNamespace.NS_VIEW, "nodeObjectRef"), @@ -52,10 +52,10 @@ BOUNDARY(CoreNamespace.NS_VIEW, "boundary"), /***/ - CONNECTION_LAYOUTS(CoreNamespace.NS_VIEW, "connectionLayouts"), + CONNECTION_PROFILES(CoreNamespace.NS_VIEW, "connectionProfiles"), /***/ - CONNECTION_LAYOUT(CoreNamespace.NS_VIEW, "connectionLayout"), + CONNECTION_PROFILE(CoreNamespace.NS_VIEW, "connectionProfile"), /***/ CONNECTION_OBJECT_REF(CoreNamespace.NS_VIEW, "connectionObjectRef"),