svnno****@sourc*****
svnno****@sourc*****
2008年 12月 12日 (金) 01:49:04 JST
Revision: 2250 http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2250 Author: daisuke_m Date: 2008-12-12 01:49:04 +0900 (Fri, 12 Dec 2008) Log Message: ----------- refactor Modified Paths: -------------- artemis/trunk/org.jiemamy.event/src/test/java/org/jiemamy/model/RootModelEventTest.java artemis/trunk/org.jiemamy.event/src/test/java/org/jiemamy/model/node/TableModelEventTest.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/ModelContainer.java Added Paths: ----------- artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/ObservableImpl.java Removed Paths: ------------- artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/AbstractObservable.java artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/ObservableImpl.java artemis/trunk/org.jiemamy.view/src/test/java/org/jiemamy/view/ -------------- next part -------------- Deleted: artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/AbstractObservable.java =================================================================== --- artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/AbstractObservable.java 2008-12-11 16:35:55 UTC (rev 2249) +++ artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/AbstractObservable.java 2008-12-11 16:49:04 UTC (rev 2250) @@ -1,65 +0,0 @@ -/* - * Copyright 2007-2008 MIYAMOTO Daisuke, jiemamy.org and the Others. - * Created on 2008/07/27 - * - * 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.event; - -import java.lang.reflect.Field; -import java.util.List; - -import org.seasar.framework.util.tiger.CollectionsUtil; - -/** - * {@link Observable}の全てのinterfaceを実装した抽象Class。 - * ChangeEventを発火するもの、つまりChangeEventを監視される対象Classはこれを継承できる。 - * - * @author shin1 - */ -public abstract class AbstractObservable implements Observable { - - /** 変更イベントリスナ */ - private transient List<ModelChangeListener> listeners = CollectionsUtil.newArrayList(); - - - /** - * {@inheritDoc} - */ - public void addModelChangeListener(ModelChangeListener listener) { - assert listeners != null; - listeners.add(listener); - } - - /** - * {@inheritDoc} - */ - public void fireModelChange(Object model, Field field) { - assert listeners != null; - ModelChangeEvent e = new ModelChangeEvent(model, field); - for (ModelChangeListener listener : listeners) { - listener.modelChanged(e); - } - } - - /** - * {@inheritDoc} - */ - public void removeModelChangeListener(ModelChangeListener listener) { - assert listeners != null; - listeners.remove(listener); - } - -} Deleted: artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/ObservableImpl.java =================================================================== --- artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/ObservableImpl.java 2008-12-11 16:35:55 UTC (rev 2249) +++ artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/ObservableImpl.java 2008-12-11 16:49:04 UTC (rev 2250) @@ -1,27 +0,0 @@ -/* - * 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.event; - -/** - * {@link Observable}の実装クラス - * @author daisuke - */ -public class ObservableImpl extends AbstractObservable { - -} Copied: artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/ObservableImpl.java (from rev 2248, artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/AbstractObservable.java) =================================================================== --- artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/ObservableImpl.java (rev 0) +++ artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/ObservableImpl.java 2008-12-11 16:49:04 UTC (rev 2250) @@ -0,0 +1,65 @@ +/* + * Copyright 2007-2008 MIYAMOTO Daisuke, jiemamy.org and the Others. + * Created on 2008/07/27 + * + * 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.event; + +import java.lang.reflect.Field; +import java.util.List; + +import org.seasar.framework.util.tiger.CollectionsUtil; + +/** + * {@link Observable}の全てのinterfaceを実装した実装Class。 + * ChangeEventを発火するもの、つまりChangeEventを監視される対象Classはこれをアダプタに持つ。 + * + * @author shin1 + */ +public class ObservableImpl implements Observable { + + /** 変更イベントリスナ */ + private transient List<ModelChangeListener> listeners = CollectionsUtil.newArrayList(); + + + /** + * {@inheritDoc} + */ + public void addModelChangeListener(ModelChangeListener listener) { + assert listeners != null; + listeners.add(listener); + } + + /** + * {@inheritDoc} + */ + public void fireModelChange(Object model, Field field) { + assert listeners != null; + ModelChangeEvent e = new ModelChangeEvent(model, field); + for (ModelChangeListener listener : listeners) { + listener.modelChanged(e); + } + } + + /** + * {@inheritDoc} + */ + public void removeModelChangeListener(ModelChangeListener listener) { + assert listeners != null; + listeners.remove(listener); + } + +} Property changes on: artemis/trunk/org.jiemamy.event/src/main/java/org/jiemamy/event/ObservableImpl.java ___________________________________________________________________ Name: svn:mergeinfo + Modified: artemis/trunk/org.jiemamy.event/src/test/java/org/jiemamy/model/RootModelEventTest.java =================================================================== --- artemis/trunk/org.jiemamy.event/src/test/java/org/jiemamy/model/RootModelEventTest.java 2008-12-11 16:35:55 UTC (rev 2249) +++ artemis/trunk/org.jiemamy.event/src/test/java/org/jiemamy/model/RootModelEventTest.java 2008-12-11 16:49:04 UTC (rev 2250) @@ -50,7 +50,7 @@ private RootModel rootModel; - private RootModelChangeListenerImpl listener; + private RootModelChangeListener listener; /** @@ -60,7 +60,7 @@ public void setUp() { Jiemamy.init(Artemis.EVENT); rootModel = Jiemamy.newRootModel(); - listener = new RootModelChangeListenerImpl(); + listener = new RootModelChangeListener(); } /** @@ -166,7 +166,7 @@ } - private class RootModelChangeListenerImpl implements ModelChangeListener { + private class RootModelChangeListener implements ModelChangeListener { /** Eventの履歴 */ private List<ModelChangeEvent> events = new ArrayList<ModelChangeEvent>(); @@ -184,7 +184,7 @@ */ public void modelChanged(ModelChangeEvent e) { events.add(e); - logger.debug("RootModelChangeListenerImpl:" + e.toString()); + logger.debug("RootModelChangeListener:" + e.toString()); } } @@ -206,7 +206,7 @@ */ public void modelChanged(ModelChangeEvent e) { events.add(e); - logger.debug("RootModelChangeListenerImpl:" + e.toString()); + logger.debug("RootModelChangeListener:" + e.toString()); } } } Modified: artemis/trunk/org.jiemamy.event/src/test/java/org/jiemamy/model/node/TableModelEventTest.java =================================================================== --- artemis/trunk/org.jiemamy.event/src/test/java/org/jiemamy/model/node/TableModelEventTest.java 2008-12-11 16:35:55 UTC (rev 2249) +++ artemis/trunk/org.jiemamy.event/src/test/java/org/jiemamy/model/node/TableModelEventTest.java 2008-12-11 16:49:04 UTC (rev 2250) @@ -46,7 +46,7 @@ private static Logger logger = LoggerFactory.getLogger(TableModelEventTest.class); - private TableModelChangeListenerImpl listener; + private TableModelChangeListener listener; private RootModel rootModel; @@ -58,7 +58,7 @@ public void setUp() { Jiemamy.init(Artemis.EVENT); rootModel = Jiemamy.newRootModel(); - listener = new TableModelChangeListenerImpl(); + listener = new TableModelChangeListener(); } /** @@ -124,7 +124,7 @@ } - private class TableModelChangeListenerImpl implements ModelChangeListener { + private class TableModelChangeListener implements ModelChangeListener { /** Eventの履歴 */ private List<ModelChangeEvent> events = new ArrayList<ModelChangeEvent>(); 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-12-11 16:35:55 UTC (rev 2249) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/ModelContainer.java 2008-12-11 16:49:04 UTC (rev 2250) @@ -23,8 +23,8 @@ import org.seasar.framework.util.tiger.CollectionsUtil; import org.jiemamy.Adaptable; +import org.jiemamy.event.Observable; import org.jiemamy.event.ObservableImpl; -import org.jiemamy.event.Observable; /** * 分類コンテナ。アウトラインツリー用。