svnno****@sourc*****
svnno****@sourc*****
2008年 11月 30日 (日) 23:51:50 JST
Revision: 2196 http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2196 Author: daisuke_m Date: 2008-11-30 23:51:49 +0900 (Sun, 30 Nov 2008) Log Message: ----------- 細かい調整。 Modified Paths: -------------- artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/core/model/JiemamyModelCommand.java artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/core/model/NodesCommand.java artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/core/model/RootCommand.java Added Paths: ----------- artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/core/model/ConnectionsCommand.java -------------- next part -------------- Added: artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/core/model/ConnectionsCommand.java =================================================================== --- artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/core/model/ConnectionsCommand.java (rev 0) +++ artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/core/model/ConnectionsCommand.java 2008-11-30 14:51:49 UTC (rev 2196) @@ -0,0 +1,40 @@ +/* + * Copyright 2007-2008 MIYAMOTO Daisuke, jiemamy.org and the Others. + * Created on 2008/11/09 + * + * 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 org.xml.sax.Attributes; + +/** + * connection要素を読み込むクラス。 + * @author daisuke + */ +class ConnectionsCommand extends XmlElementCommandAdapter { + + /** + * {@inheritDoc} + */ + @Override + public XmlElementCommand startChild(XmlElement element, ModelInfo modelInfo, Attributes attributes) { + if (element.getName().equals("foreignKey")) { + return new ForeignKeyCommand(); + } + throw new IllegalStateException(); + } + +} Property changes on: artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/core/model/ConnectionsCommand.java ___________________________________________________________________ Name: svn:mime-type + text/plain Modified: artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/core/model/JiemamyModelCommand.java =================================================================== --- artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/core/model/JiemamyModelCommand.java 2008-11-30 14:38:27 UTC (rev 2195) +++ artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/core/model/JiemamyModelCommand.java 2008-11-30 14:51:49 UTC (rev 2196) @@ -25,7 +25,10 @@ import org.jiemamy.spec.model.DomainModel; import org.jiemamy.spec.model.RootModel; import org.jiemamy.spec.model.connection.AbstractConnectionModel; +import org.jiemamy.spec.model.dataset.InsertDataSetModel; import org.jiemamy.spec.model.node.AbstractNodeModel; +import org.jiemamy.spec.view.model.DiagramPresentationModel; +import org.jiemamy.spec.view.model.DiagramPresentations; /** * IDを持つJiemamyModelのXmlElementCommand。 @@ -46,6 +49,10 @@ rootModel.appendModel((AbstractConnectionModel) child); } else if (child instanceof AbstractNodeModel) { rootModel.appendModel((AbstractNodeModel) child); + } else if (child instanceof InsertDataSetModel) { + rootModel.appendModel((InsertDataSetModel) child); + } else if (child instanceof DiagramPresentationModel) { + rootModel.getAdapter(DiagramPresentations.class).appendModel((DiagramPresentationModel) child); } } Modified: artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/core/model/NodesCommand.java =================================================================== --- artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/core/model/NodesCommand.java 2008-11-30 14:38:27 UTC (rev 2195) +++ artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/core/model/NodesCommand.java 2008-11-30 14:51:49 UTC (rev 2196) @@ -41,7 +41,7 @@ return new StickyCommand(); } - return null; + throw new IllegalStateException(); } } Modified: artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/core/model/RootCommand.java =================================================================== --- artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/core/model/RootCommand.java 2008-11-30 14:38:27 UTC (rev 2195) +++ artemis/trunk/org.jiemamy.serializer/src/main/java/org/jiemamy/core/model/RootCommand.java 2008-11-30 14:51:49 UTC (rev 2196) @@ -98,17 +98,7 @@ } else if (elementName.equals("nodes")) { return new NodesCommand(); } else if (elementName.equals("connections")) { - return new XmlElementCommandAdapter() { - - @Override - public XmlElementCommand startChild(XmlElement element, ModelInfo modelInfo, Attributes attributes) { - if (!element.getName().equals("foreignKey")) { - throw new IllegalStateException(); - } - return new ForeignKeyCommand(); - } - }; - + return new ConnectionsCommand(); } else if (elementName.equals("insertDataSetModels")) { return new XmlElementCommandAdapter() { @@ -120,11 +110,13 @@ if (!element.getName().equals("dataSet")) { throw new IllegalStateException(); } + // TODO // return new DataSetCommand(); return new NullCommand(); } }; } else if (element.getUri().equals(Namespaces.VIEW) && elementName.equals("diagramPresentations")) { + // TODO return new NullCommand(); }