svnno****@sourc*****
svnno****@sourc*****
2008年 9月 29日 (月) 01:07:35 JST
Revision: 1971 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=jiemamy&view=rev&rev=1971 Author: daisuke_m Date: 2008-09-29 01:07:35 +0900 (Mon, 29 Sep 2008) Log Message: ----------- コケているテストを幾つか通過させた。 Modified Paths: -------------- artemis/trunk/org.jiemamy.composer/src/test/java/org/jiemamy/composer/importer/DatabaseImporterTest.java artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/RootModelImpl.java artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/connection/ForeignKeyModelImpl.java artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/node/TableModelImpl.java artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/node/ViewModelImpl.java artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/processor/root/ProvideEntityNameProcessor.java artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/utils/processor/base/ForeignKeyTestBase.java artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/utils/processor/root/GenerateEntityNameProcessorTest.java artemis/trunk/org.jiemamy.view/META-INF/MANIFEST.MF artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/DiagramPresentationModelImpl.java artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/package-info.java artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/GetBendpointsProcessor.java artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/GetColorProcessor.java artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/GetConstraintProcessor.java artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/RemoveFromDiagramProcessor.java artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/ResetBendpointProcessor.java artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/SetBendpointsProcessor.java artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/SetColorProcessor.java artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/SetConstraintProcessor.java artemis/trunk/org.jiemamy.view/src/main/resources/jiemamy-view.dicon artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/core/utils/processor/root/presentation/ResetBendpointProcessorTest.java artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/core/utils/processor/root/presentation/SetColorProcessorTest.java artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/core/utils/processor/root/presentation/SetConstraintProcessorTest.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/ModelContainer.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/outlinetree/AbstractModelTreeEditPart.java zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/connection/ForeignKeyModel.java zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/node/TableModel.java zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/node/ViewModel.java Added Paths: ----------- artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/model/RootModelImplTest.java artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/DiagramPresentationsImpl.java artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/JmPointUtil.java artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/ Removed Paths: ------------- artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/model/presentation/ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/utils/JmPointUtil.java artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/utils/processor/root/presentation/ -------------- next part -------------- Modified: artemis/trunk/org.jiemamy.composer/src/test/java/org/jiemamy/composer/importer/DatabaseImporterTest.java =================================================================== --- artemis/trunk/org.jiemamy.composer/src/test/java/org/jiemamy/composer/importer/DatabaseImporterTest.java 2008-09-28 15:45:40 UTC (rev 1970) +++ artemis/trunk/org.jiemamy.composer/src/test/java/org/jiemamy/composer/importer/DatabaseImporterTest.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -63,7 +63,7 @@ @Before @SuppressWarnings("unchecked") public void setUp() throws Exception { - RootModelFactory.init(new S2FactoryStrategy("jiemamy-core.dicon")); + RootModelFactory.init(new S2FactoryStrategy("jiemamy-composer.dicon")); URLClassLoader classLoader = new URLClassLoader(new URL[] { new File("../org.jiemamy.dialect/target/classes").toURL(), Modified: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/RootModelImpl.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/RootModelImpl.java 2008-09-28 15:45:40 UTC (rev 1970) +++ artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/RootModelImpl.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -62,9 +62,11 @@ private String schemaName; /** ドメインのリスト */ + @Binding("list") private List<DomainModel> domains; /** ノードのリスト */ + @Binding("list") private List<AbstractNodeModel> nodes; /** Modified: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/connection/ForeignKeyModelImpl.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/connection/ForeignKeyModelImpl.java 2008-09-28 15:45:40 UTC (rev 1970) +++ artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/connection/ForeignKeyModelImpl.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -21,7 +21,6 @@ import java.util.List; import org.jiemamy.core.utils.processor.connection.foreignkey.GetMappingProcessor; -import org.jiemamy.core.utils.processor.connection.foreignkey.ProvideForeignKeyNameProcessor; import org.jiemamy.core.utils.processor.connection.foreignkey.UpdateMappingsProcessor; import org.jiemamy.spec.model.ColumnModel; import org.jiemamy.spec.model.RootModel; @@ -205,19 +204,19 @@ /** * {@inheritDoc} */ - public ForeignKeyModel init(String fkName, TableModel source, TableModel target) { - setName(fkName); - setSource(source); - setTarget(target); + public ForeignKeyModel init(RootModel rootModel, TableModel source, TableModel target) { + init((String) null, source, target); + rootModel.provideValidName(this, null); return this; } /** * {@inheritDoc} */ - public ForeignKeyModel init(TableModel source, TableModel target) { - init(null, source, target); - process(new ProvideForeignKeyNameProcessor(this, null)); + public ForeignKeyModel init(String fkName, TableModel source, TableModel target) { + setName(fkName); + setSource(source); + setTarget(target); return this; } Modified: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/node/TableModelImpl.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/node/TableModelImpl.java 2008-09-28 15:45:40 UTC (rev 1970) +++ artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/node/TableModelImpl.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -24,9 +24,9 @@ import org.jiemamy.core.utils.processor.entity.table.GetColumnProcessor; import org.jiemamy.core.utils.processor.entity.table.GetPrimaryKeyColumnsProcessor; -import org.jiemamy.core.utils.processor.root.ProvideEntityNameProcessor; import org.jiemamy.spec.exception.TooManyElementsException; import org.jiemamy.spec.model.ColumnModel; +import org.jiemamy.spec.model.RootModel; import org.jiemamy.spec.model.constraint.CheckConstraintModel; import org.jiemamy.spec.model.index.IndexModel; import org.jiemamy.spec.model.node.TableModel; @@ -118,8 +118,8 @@ /** * {@inheritDoc} */ - public TableModel init() { - process(new ProvideEntityNameProcessor(this, null)); + public TableModel init(RootModel rootModel) { + rootModel.provideValidName(this, null); return this; } Modified: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/node/ViewModelImpl.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/node/ViewModelImpl.java 2008-09-28 15:45:40 UTC (rev 1970) +++ artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/model/node/ViewModelImpl.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -18,7 +18,7 @@ */ package org.jiemamy.core.model.node; -import org.jiemamy.core.utils.processor.root.ProvideEntityNameProcessor; +import org.jiemamy.spec.model.RootModel; import org.jiemamy.spec.model.node.ViewModel; /** @@ -64,8 +64,8 @@ /** * {@inheritDoc} */ - public ViewModel init() { - process(new ProvideEntityNameProcessor(this, null)); + public ViewModel init(RootModel rootModel) { + rootModel.provideValidName(this, null); return this; } Modified: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/processor/root/ProvideEntityNameProcessor.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/processor/root/ProvideEntityNameProcessor.java 2008-09-28 15:45:40 UTC (rev 1970) +++ artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/utils/processor/root/ProvideEntityNameProcessor.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -60,7 +60,7 @@ entityHead = "UNKNOWN_"; } - int entityNumber = rootModel.getNodes().size(); + int entityNumber = rootModel.getNodes().size() + 1; entityModel.setName(entityHead + entityNumber); return entityHead + entityNumber; } Added: artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/model/RootModelImplTest.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/model/RootModelImplTest.java (rev 0) +++ artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/model/RootModelImplTest.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -0,0 +1,68 @@ +/* + * Copyright 2007-2008 MIYAMOTO Daisuke, jiemamy.org and the Others. + * Created on 2008/09/29 + * + * 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.core.model; + +import static org.hamcrest.core.Is.is; +import static org.hamcrest.core.IsNot.not; +import static org.hamcrest.core.IsNull.nullValue; +import static org.junit.Assert.assertThat; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; + +import org.jiemamy.core.S2FactoryStrategy; +import org.jiemamy.spec.RootModelFactory; +import org.jiemamy.spec.model.RootModel; + +/** + * TODO for daisuke + * @author daisuke + */ +public class RootModelImplTest { + + private RootModel rootModel; + + + /** + * TODO for daisuke + * @throws java.lang.Exception + */ + @Before + public void setUp() throws Exception { + RootModelFactory.init(new S2FactoryStrategy("jiemamy-core.dicon")); + rootModel = RootModelFactory.createInstance(); + } + + /** + * TODO for daisuke + * @throws java.lang.Exception + */ + @After + public void tearDown() throws Exception { + rootModel = null; + } + + @Test + public void testname() throws Exception { + assertThat(rootModel.getAdapters(), not(nullValue())); + assertThat(rootModel.getNodes(), not(nullValue())); + assertThat(rootModel.getNodes().size(), is(0)); + } +} Property changes on: artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/model/RootModelImplTest.java ___________________________________________________________________ Name: svn:mime-type + text/plain Modified: artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/utils/processor/base/ForeignKeyTestBase.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/utils/processor/base/ForeignKeyTestBase.java 2008-09-28 15:45:40 UTC (rev 1970) +++ artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/utils/processor/base/ForeignKeyTestBase.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -54,12 +54,16 @@ rootModel = RootModelFactory.createInstance(); empTableModel = rootModel.createJiemamyModel(TableModel.class).init("T_EMP"); - rootModel.getNodes().add(empTableModel); + rootModel.appendModel(empTableModel); deptTableModel = rootModel.createJiemamyModel(TableModel.class).init("T_DEPT"); - rootModel.getNodes().add(deptTableModel); + rootModel.appendModel(deptTableModel); - foreignKeyModel = rootModel.createJiemamyModel(ForeignKeyModel.class).init(empTableModel, deptTableModel); - selfRefFkModel = rootModel.createJiemamyModel(ForeignKeyModel.class).init(empTableModel, empTableModel); + foreignKeyModel = + rootModel.createJiemamyModel(ForeignKeyModel.class).init(rootModel, empTableModel, deptTableModel); + rootModel.appendModel(foreignKeyModel); + selfRefFkModel = + rootModel.createJiemamyModel(ForeignKeyModel.class).init(rootModel, empTableModel, empTableModel); + rootModel.appendModel(selfRefFkModel); } /** Modified: artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/utils/processor/root/GenerateEntityNameProcessorTest.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/utils/processor/root/GenerateEntityNameProcessorTest.java 2008-09-28 15:45:40 UTC (rev 1970) +++ artemis/trunk/org.jiemamy.core/src/test/java/org/jiemamy/core/utils/processor/root/GenerateEntityNameProcessorTest.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -68,19 +68,19 @@ */ @Test public void test01_() throws Exception { - TableModel tableModel1 = rootModel.createJiemamyModel(TableModel.class).init(); + TableModel tableModel1 = rootModel.createJiemamyModel(TableModel.class).init(rootModel); rootModel.appendModel(tableModel1); assertThat(tableModel1.getName(), is("TABLE_1")); - TableModel tableModel2 = rootModel.createJiemamyModel(TableModel.class).init(); + TableModel tableModel2 = rootModel.createJiemamyModel(TableModel.class).init(rootModel); rootModel.appendModel(tableModel2); assertThat(tableModel2.getName(), is("TABLE_2")); - ViewModel viewModel1 = rootModel.createJiemamyModel(ViewModel.class).init(); + ViewModel viewModel1 = rootModel.createJiemamyModel(ViewModel.class).init(rootModel); rootModel.appendModel(viewModel1); assertThat(viewModel1.getName(), is("VIEW_3")); - ViewModel viewModel2 = rootModel.createJiemamyModel(ViewModel.class).init(); + ViewModel viewModel2 = rootModel.createJiemamyModel(ViewModel.class).init(rootModel); rootModel.appendModel(viewModel2); assertThat(viewModel2.getName(), is("VIEW_4")); } Modified: artemis/trunk/org.jiemamy.view/META-INF/MANIFEST.MF =================================================================== --- artemis/trunk/org.jiemamy.view/META-INF/MANIFEST.MF 2008-09-28 15:45:40 UTC (rev 1970) +++ artemis/trunk/org.jiemamy.view/META-INF/MANIFEST.MF 2008-09-28 16:07:35 UTC (rev 1971) @@ -32,6 +32,6 @@ Require-Bundle: org.jiemamy.spec.core, org.jiemamy.spec.view, org.jiemamy.core -Export-Package: org.jiemamy.core.model.presentation, - org.jiemamy.core.utils, - org.jiemamy.core.utils.processor.root.presentation +Export-Package: org.jiemamy.view, + org.jiemamy.view.utils, + org.jiemamy.view.utils.processor.root.presentation Deleted: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/utils/JmPointUtil.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/utils/JmPointUtil.java 2008-09-28 15:45:40 UTC (rev 1970) +++ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/utils/JmPointUtil.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -1,79 +0,0 @@ -package org.jiemamy.core.utils; - - -import org.jiemamy.spec.geometory.JmPoint; -import org.jiemamy.spec.geometory.JmRectangle; - -/** - * 座標操作ユーティリティクラス。 - * @author daisuke - */ -public class JmPointUtil { - - /** - * 2点の差を求める。 - * - * @param from 基準点 - * @param to 対象点 - * @return 差 - */ - public static JmPoint delta(JmPoint from, JmPoint to) { - return new JmPoint(from.x - to.x, from.y - to.y); - } - - /** - * 矩形の配置点(左上)2点の差を求める。 - * - * @param from 基準矩形 - * @param to 対象矩形 - * @return 差 - */ - public static JmPoint delta(JmRectangle from, JmRectangle to) { - return new JmPoint(from.x - to.x, from.y - to.y); - } - - /** - * 位置を負方向に移動させる。 - * @param target 移動対象 - * @param x X軸移動量 - * @param y Y軸移動量 - */ - public static void shiftNegative(JmPoint target, int x, int y) { - target.x -= x; - target.y -= y; - } - - /** - * 位置を負方向に移動させる。 - * @param target 移動対象 - * @param delta 移動量 - */ - public static void shiftNegative(JmPoint target, JmPoint delta) { - target.x -= delta.x; - target.y -= delta.y; - } - - /** - * 位置を正方向に移動させる。 - * @param target 移動対象 - * @param x X軸移動量 - * @param y Y軸移動量 - */ - public static void shiftPositive(JmPoint target, int x, int y) { - target.x += x; - target.y += y; - } - - /** - * 位置を正方向に移動させる。 - * @param target 移動対象 - * @param delta 移動量 - */ - public static void shiftPositive(JmPoint target, JmPoint delta) { - target.x += delta.x; - target.y += delta.y; - } - - private JmPointUtil() { - } -} Copied: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view (from rev 1969, artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/model/presentation) Modified: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/DiagramPresentationModelImpl.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/model/presentation/DiagramPresentationModelImpl.java 2008-09-28 15:28:23 UTC (rev 1969) +++ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/DiagramPresentationModelImpl.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -16,20 +16,20 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.jiemamy.core.model.presentation; +package org.jiemamy.view; import java.util.List; import java.util.Map; import java.util.Set; import org.jiemamy.core.model.AbstractModel; -import org.jiemamy.core.utils.processor.root.presentation.ResetBendpointProcessor; import org.jiemamy.spec.geometory.JmColor; import org.jiemamy.spec.geometory.JmPoint; import org.jiemamy.spec.geometory.JmRectangle; import org.jiemamy.spec.model.connection.AbstractConnectionModel; import org.jiemamy.spec.model.node.AbstractNodeModel; import org.jiemamy.spec.model.presentation.DiagramPresentationModel; +import org.jiemamy.view.utils.processor.root.presentation.ResetBendpointProcessor; /** * ダイアグラム表現(レイアウト等)モデル。 Added: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/DiagramPresentationsImpl.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/DiagramPresentationsImpl.java (rev 0) +++ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/DiagramPresentationsImpl.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -0,0 +1,202 @@ +/* + * Copyright 2007-2008 MIYAMOTO Daisuke, jiemamy.org and the Others. + * Created on 2008/09/29 + * + * 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.view; + +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; + +import org.seasar.framework.container.annotation.tiger.Binding; + +import org.jiemamy.spec.model.presentation.DiagramPresentationModel; +import org.jiemamy.spec.view.DiagramPresentations; + +/** + * TODO for daisuke + * @author daisuke + */ +public class DiagramPresentationsImpl implements DiagramPresentations { + + @Binding("list") + private List<DiagramPresentationModel> composite; + + + /** + * {@inheritDoc} + */ + public boolean add(DiagramPresentationModel o) { + return composite.add(o); + } + + /** + * {@inheritDoc} + */ + public void add(int index, DiagramPresentationModel element) { + composite.add(index, element); + } + + /** + * {@inheritDoc} + */ + public boolean addAll(Collection<? extends DiagramPresentationModel> c) { + return composite.addAll(c); + } + + /** + * {@inheritDoc} + */ + public boolean addAll(int index, Collection<? extends DiagramPresentationModel> c) { + return composite.addAll(index, c); + } + + /** + * {@inheritDoc} + */ + public void clear() { + composite.clear(); + } + + /** + * {@inheritDoc} + */ + public boolean contains(Object o) { + return composite.contains(o); + } + + /** + * {@inheritDoc} + */ + public boolean containsAll(Collection<?> c) { + return composite.containsAll(c); + } + + /** + * {@inheritDoc} + */ + public DiagramPresentationModel get(int index) { + return composite.get(index); + } + + /** + * {@inheritDoc} + */ + public int indexOf(Object o) { + return composite.indexOf(o); + } + + /** + * {@inheritDoc} + */ + public boolean isEmpty() { + return composite.isEmpty(); + } + + /** + * {@inheritDoc} + */ + public Iterator<DiagramPresentationModel> iterator() { + return composite.iterator(); + } + + /** + * {@inheritDoc} + */ + public int lastIndexOf(Object o) { + return composite.lastIndexOf(o); + } + + /** + * {@inheritDoc} + */ + public ListIterator<DiagramPresentationModel> listIterator() { + return composite.listIterator(); + } + + /** + * {@inheritDoc} + */ + public ListIterator<DiagramPresentationModel> listIterator(int index) { + return composite.listIterator(index); + } + + /** + * {@inheritDoc} + */ + public DiagramPresentationModel remove(int index) { + return composite.remove(index); + } + + /** + * {@inheritDoc} + */ + public boolean remove(Object o) { + return composite.remove(o); + } + + /** + * {@inheritDoc} + */ + public boolean removeAll(Collection<?> c) { + return composite.removeAll(c); + } + + /** + * {@inheritDoc} + */ + public boolean retainAll(Collection<?> c) { + return composite.retainAll(c); + } + + /** + * {@inheritDoc} + */ + public DiagramPresentationModel set(int index, DiagramPresentationModel element) { + return composite.set(index, element); + } + + /** + * {@inheritDoc} + */ + public int size() { + return composite.size(); + } + + /** + * {@inheritDoc} + */ + public List<DiagramPresentationModel> subList(int fromIndex, int toIndex) { + return composite.subList(fromIndex, toIndex); + } + + /** + * {@inheritDoc} + */ + public Object[] toArray() { + return composite.toArray(); + } + + /** + * {@inheritDoc} + */ + public <T>T[] toArray(T[] a) { + return composite.toArray(a); + } + +} Property changes on: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/DiagramPresentationsImpl.java ___________________________________________________________________ Name: svn:mime-type + text/plain Modified: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/package-info.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/model/presentation/package-info.java 2008-09-28 15:28:23 UTC (rev 1969) +++ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/package-info.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -1,2 +1,2 @@ -package org.jiemamy.core.model.presentation; +package org.jiemamy.view; Copied: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/JmPointUtil.java (from rev 1969, artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/utils/JmPointUtil.java) =================================================================== --- artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/JmPointUtil.java (rev 0) +++ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/JmPointUtil.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -0,0 +1,79 @@ +package org.jiemamy.view.utils; + + +import org.jiemamy.spec.geometory.JmPoint; +import org.jiemamy.spec.geometory.JmRectangle; + +/** + * 座標操作ユーティリティクラス。 + * @author daisuke + */ +public class JmPointUtil { + + /** + * 2点の差を求める。 + * + * @param from 基準点 + * @param to 対象点 + * @return 差 + */ + public static JmPoint delta(JmPoint from, JmPoint to) { + return new JmPoint(from.x - to.x, from.y - to.y); + } + + /** + * 矩形の配置点(左上)2点の差を求める。 + * + * @param from 基準矩形 + * @param to 対象矩形 + * @return 差 + */ + public static JmPoint delta(JmRectangle from, JmRectangle to) { + return new JmPoint(from.x - to.x, from.y - to.y); + } + + /** + * 位置を負方向に移動させる。 + * @param target 移動対象 + * @param x X軸移動量 + * @param y Y軸移動量 + */ + public static void shiftNegative(JmPoint target, int x, int y) { + target.x -= x; + target.y -= y; + } + + /** + * 位置を負方向に移動させる。 + * @param target 移動対象 + * @param delta 移動量 + */ + public static void shiftNegative(JmPoint target, JmPoint delta) { + target.x -= delta.x; + target.y -= delta.y; + } + + /** + * 位置を正方向に移動させる。 + * @param target 移動対象 + * @param x X軸移動量 + * @param y Y軸移動量 + */ + public static void shiftPositive(JmPoint target, int x, int y) { + target.x += x; + target.y += y; + } + + /** + * 位置を正方向に移動させる。 + * @param target 移動対象 + * @param delta 移動量 + */ + public static void shiftPositive(JmPoint target, JmPoint delta) { + target.x += delta.x; + target.y += delta.y; + } + + private JmPointUtil() { + } +} Copied: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation (from rev 1969, artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/utils/processor/root/presentation) Modified: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/GetBendpointsProcessor.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/utils/processor/root/presentation/GetBendpointsProcessor.java 2008-09-28 15:28:23 UTC (rev 1969) +++ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/GetBendpointsProcessor.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -16,7 +16,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.jiemamy.core.utils.processor.root.presentation; +package org.jiemamy.view.utils.processor.root.presentation; import java.util.List; Modified: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/GetColorProcessor.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/utils/processor/root/presentation/GetColorProcessor.java 2008-09-28 15:28:23 UTC (rev 1969) +++ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/GetColorProcessor.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -16,7 +16,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.jiemamy.core.utils.processor.root.presentation; +package org.jiemamy.view.utils.processor.root.presentation; import org.jiemamy.spec.geometory.JmColor; import org.jiemamy.spec.model.RootModel; Modified: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/GetConstraintProcessor.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/utils/processor/root/presentation/GetConstraintProcessor.java 2008-09-28 15:28:23 UTC (rev 1969) +++ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/GetConstraintProcessor.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -16,7 +16,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.jiemamy.core.utils.processor.root.presentation; +package org.jiemamy.view.utils.processor.root.presentation; import org.jiemamy.spec.geometory.JmRectangle; import org.jiemamy.spec.model.RootModel; Modified: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/RemoveFromDiagramProcessor.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/utils/processor/root/presentation/RemoveFromDiagramProcessor.java 2008-09-28 15:28:23 UTC (rev 1969) +++ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/RemoveFromDiagramProcessor.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -16,7 +16,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.jiemamy.core.utils.processor.root.presentation; +package org.jiemamy.view.utils.processor.root.presentation; import org.jiemamy.spec.model.RootModel; import org.jiemamy.spec.model.node.AbstractNodeModel; Modified: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/ResetBendpointProcessor.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/utils/processor/root/presentation/ResetBendpointProcessor.java 2008-09-28 15:28:23 UTC (rev 1969) +++ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/ResetBendpointProcessor.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -16,7 +16,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.jiemamy.core.utils.processor.root.presentation; +package org.jiemamy.view.utils.processor.root.presentation; import java.util.List; Modified: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/SetBendpointsProcessor.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/utils/processor/root/presentation/SetBendpointsProcessor.java 2008-09-28 15:28:23 UTC (rev 1969) +++ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/SetBendpointsProcessor.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -16,7 +16,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.jiemamy.core.utils.processor.root.presentation; +package org.jiemamy.view.utils.processor.root.presentation; import java.util.List; Modified: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/SetColorProcessor.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/utils/processor/root/presentation/SetColorProcessor.java 2008-09-28 15:28:23 UTC (rev 1969) +++ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/SetColorProcessor.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -16,7 +16,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.jiemamy.core.utils.processor.root.presentation; +package org.jiemamy.view.utils.processor.root.presentation; import org.jiemamy.spec.geometory.JmColor; import org.jiemamy.spec.model.RootModel; Modified: artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/SetConstraintProcessor.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/core/utils/processor/root/presentation/SetConstraintProcessor.java 2008-09-28 15:28:23 UTC (rev 1969) +++ artemis/trunk/org.jiemamy.view/src/main/java/org/jiemamy/view/utils/processor/root/presentation/SetConstraintProcessor.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -16,7 +16,7 @@ * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ -package org.jiemamy.core.utils.processor.root.presentation; +package org.jiemamy.view.utils.processor.root.presentation; import org.jiemamy.spec.geometory.JmRectangle; import org.jiemamy.spec.model.RootModel; Modified: artemis/trunk/org.jiemamy.view/src/main/resources/jiemamy-view.dicon =================================================================== --- artemis/trunk/org.jiemamy.view/src/main/resources/jiemamy-view.dicon 2008-09-28 15:45:40 UTC (rev 1970) +++ artemis/trunk/org.jiemamy.view/src/main/resources/jiemamy-view.dicon 2008-09-28 16:07:35 UTC (rev 1971) @@ -3,4 +3,6 @@ "http://www.seasar.org/dtd/components24.dtd"> <components> <include path="jiemamy-core.dicon"/> + <component class="org.jiemamy.view.DiagramPresentationsImpl" instance="prototype"/> + <component class="org.jiemamy.view.DiagramPresentationModelImpl" instance="prototype"/> </components> Modified: artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/core/utils/processor/root/presentation/ResetBendpointProcessorTest.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/core/utils/processor/root/presentation/ResetBendpointProcessorTest.java 2008-09-28 15:45:40 UTC (rev 1970) +++ artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/core/utils/processor/root/presentation/ResetBendpointProcessorTest.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -36,6 +36,7 @@ import org.jiemamy.spec.model.connection.ForeignKeyModel; import org.jiemamy.spec.model.node.TableModel; import org.jiemamy.spec.view.DiagramPresentations; +import org.jiemamy.view.utils.processor.root.presentation.ResetBendpointProcessor; /** * {@link ResetBendpointProcessor}のテストクラス。 @@ -71,8 +72,10 @@ deptTableModel.setName("T_DEPT"); rootModel.appendModel(deptTableModel); - foreignKeyModel = rootModel.createJiemamyModel(ForeignKeyModel.class).init(empTableModel, deptTableModel); - selfRefFkModel = rootModel.createJiemamyModel(ForeignKeyModel.class).init(empTableModel, empTableModel); + foreignKeyModel = + rootModel.createJiemamyModel(ForeignKeyModel.class).init(rootModel, empTableModel, deptTableModel); + selfRefFkModel = + rootModel.createJiemamyModel(ForeignKeyModel.class).init(rootModel, empTableModel, empTableModel); } /** Modified: artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/core/utils/processor/root/presentation/SetColorProcessorTest.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/core/utils/processor/root/presentation/SetColorProcessorTest.java 2008-09-28 15:45:40 UTC (rev 1970) +++ artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/core/utils/processor/root/presentation/SetColorProcessorTest.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -36,6 +36,7 @@ import org.jiemamy.spec.model.node.TableModel; import org.jiemamy.spec.model.presentation.DiagramPresentationModel; import org.jiemamy.spec.view.DiagramPresentations; +import org.jiemamy.view.utils.processor.root.presentation.SetColorProcessor; /** * {@link SetColorProcessor}のテストクラス。 @@ -58,6 +59,7 @@ RootModelFactory.init(new S2FactoryStrategy("jiemamy-view.dicon")); rootModel = RootModelFactory.createInstance(); DiagramPresentationModel presentation = rootModel.createJiemamyModel(DiagramPresentationModel.class); + rootModel.appendModel(presentation); presentation.setName("テスト"); rootModel.appendModel(presentation); Modified: artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/core/utils/processor/root/presentation/SetConstraintProcessorTest.java =================================================================== --- artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/core/utils/processor/root/presentation/SetConstraintProcessorTest.java 2008-09-28 15:45:40 UTC (rev 1970) +++ artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/core/utils/processor/root/presentation/SetConstraintProcessorTest.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -36,6 +36,7 @@ import org.jiemamy.spec.model.node.TableModel; import org.jiemamy.spec.model.presentation.DiagramPresentationModel; import org.jiemamy.spec.view.DiagramPresentations; +import org.jiemamy.view.utils.processor.root.presentation.SetConstraintProcessor; /** * {@link SetConstraintProcessor}のテストクラス。 Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/ModelContainer.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/ModelContainer.java 2008-09-28 15:45:40 UTC (rev 1970) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/ModelContainer.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -22,7 +22,7 @@ import org.seasar.framework.util.tiger.CollectionsUtil; -import org.jiemamy.core.event.AbstractObservable; +import org.jiemamy.event.AbstractObservable; import org.jiemamy.spec.model.JiemamyModel; /** 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 2008-09-28 15:45:40 UTC (rev 1970) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/ChangeNodeConstraintCommand.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -27,7 +27,6 @@ import org.jiemamy.core.MustBeMulti; import org.jiemamy.core.model.AbstractModel; -import org.jiemamy.core.utils.JmPointUtil; import org.jiemamy.eclipse.utils.ConvertUtil; import org.jiemamy.spec.geometory.JmPoint; import org.jiemamy.spec.geometory.JmRectangle; @@ -36,6 +35,7 @@ import org.jiemamy.spec.model.connection.AbstractConnectionModel; import org.jiemamy.spec.model.node.AbstractNodeModel; import org.jiemamy.spec.view.DiagramPresentations; +import org.jiemamy.view.utils.JmPointUtil; /** * ノードの位置・サイズ変更コマンド Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/outlinetree/AbstractModelTreeEditPart.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/outlinetree/AbstractModelTreeEditPart.java 2008-09-28 15:45:40 UTC (rev 1970) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/outlinetree/AbstractModelTreeEditPart.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -20,8 +20,8 @@ import org.eclipse.gef.editparts.AbstractTreeEditPart; -import org.jiemamy.core.event.AbstractObservable; import org.jiemamy.core.model.AbstractModel; +import org.jiemamy.event.AbstractObservable; import org.jiemamy.spec.model.RootModel; import org.jiemamy.spec.util.ModelChangeEvent; import org.jiemamy.spec.util.ModelChangeListener; Modified: zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/connection/ForeignKeyModel.java =================================================================== --- zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/connection/ForeignKeyModel.java 2008-09-28 15:45:40 UTC (rev 1970) +++ zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/connection/ForeignKeyModel.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -101,20 +101,21 @@ /** * TODO for daisuke - * @param fkName - * @param source + * @param rootModel + * @param source * @param target - * @return + * @return */ - public ForeignKeyModel init(String fkName, TableModel source, TableModel target); + public ForeignKeyModel init(RootModel rootModel, TableModel source, TableModel target); /** * TODO for daisuke - * @param source + * @param fkName + * @param source * @param target - * @return + * @return */ - public ForeignKeyModel init(TableModel source, TableModel target); + public ForeignKeyModel init(String fkName, TableModel source, TableModel target); /** * 遅延評価可能性。を取得する。 Modified: zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/node/TableModel.java =================================================================== --- zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/node/TableModel.java 2008-09-28 15:45:40 UTC (rev 1970) +++ zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/node/TableModel.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -24,6 +24,7 @@ import org.jiemamy.spec.exception.ElementNotFoundException; import org.jiemamy.spec.exception.TooManyElementsException; import org.jiemamy.spec.model.ColumnModel; +import org.jiemamy.spec.model.RootModel; import org.jiemamy.spec.model.constraint.CheckConstraintModel; import org.jiemamy.spec.model.index.IndexModel; @@ -68,9 +69,10 @@ /** * TODO for daisuke + * @param rootModel * @return */ - TableModel init(); + TableModel init(RootModel rootModel); /** * TODO for daisuke Modified: zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/node/ViewModel.java =================================================================== --- zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/node/ViewModel.java 2008-09-28 15:45:40 UTC (rev 1970) +++ zeus/trunk/org.jiemamy.spec.core/src/main/java/org/jiemamy/spec/model/node/ViewModel.java 2008-09-28 16:07:35 UTC (rev 1971) @@ -18,6 +18,8 @@ */ package org.jiemamy.spec.model.node; +import org.jiemamy.spec.model.RootModel; + /** * TODO for daisuke * @author daisuke @@ -32,9 +34,10 @@ /** * TODO for daisuke + * @param rootModel * @return */ - ViewModel init(); + ViewModel init(RootModel rootModel); /** * TODO for daisuke