svnno****@sourc*****
svnno****@sourc*****
2008年 9月 18日 (木) 01:02:38 JST
Revision: 1928 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=jiemamy&view=rev&rev=1928 Author: daisuke_m Date: 2008-09-18 01:02:38 +0900 (Thu, 18 Sep 2008) Log Message: ----------- org.jiemamy.core.eventパッケージ内は、modelに非依存であるべき。 Modified Paths: -------------- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/event/ObservableCollectionChangeEvent.java artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/event/ObservableCollectionChangeListener.java artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/event/SetterInterceptor.java artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/event/collectionimpl/ObservableMap.java -------------- next part -------------- Modified: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/event/ObservableCollectionChangeEvent.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/event/ObservableCollectionChangeEvent.java 2008-09-17 13:52:54 UTC (rev 1927) +++ artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/event/ObservableCollectionChangeEvent.java 2008-09-17 16:02:38 UTC (rev 1928) @@ -16,8 +16,6 @@ import java.util.Collection; -import org.jiemamy.core.model.AbstractModel; - /** * {@link Observable}のCollectionが発火する変更Event。 * @param <C> Collectionの実装Class (e.g. java.util.Map, java.util.List) @@ -32,7 +30,7 @@ /** Eventが発生した対象の{@link Collection} */ private C collection; - /** {@link #collection}に対する操作が行われた{@link AbstractModel} */ + /** {@link #collection}に対する操作が行われた{@link Observable} */ private M model; /** {@link #collection}に対する操作の対象Index */ @@ -44,7 +42,7 @@ * @param timing イベントが発生したタイミングを表す * @param collection Eventが発生した対象の{@link Collection} * @param index {@link #collection}に対する操作の対象Index - * @param model {@link #collection}に対する操作が行われた{@link AbstractModel} + * @param model {@link #collection}に対する操作が行われた{@link Observable} * @category instance creation */ public ObservableCollectionChangeEvent(Timing timing, C collection, int index, M model) { @@ -71,8 +69,8 @@ } /** - * {@link #collection}に対する操作が行われた{@link AbstractModel}を取得する。 - * @return {@link #collection}に対する操作が行われた{@link AbstractModel} + * {@link #collection}に対する操作が行われた{@link Observable}を取得する。 + * @return {@link #collection}に対する操作が行われた{@link Observable} */ public M getModel() { return model; @@ -103,8 +101,8 @@ } /** - * {@link #collection}に対する操作が行われた{@link AbstractModel}を設定する。 - * @param model {@link #collection}に対する操作が行われた{@link AbstractModel} + * {@link #collection}に対する操作が行われた{@link Observable}を設定する。 + * @param model {@link #collection}に対する操作が行われた{@link Observable} */ public void setModel(M model) { this.model = model; Modified: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/event/ObservableCollectionChangeListener.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/event/ObservableCollectionChangeListener.java 2008-09-17 13:52:54 UTC (rev 1927) +++ artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/event/ObservableCollectionChangeListener.java 2008-09-17 16:02:38 UTC (rev 1928) @@ -14,12 +14,11 @@ */ package org.jiemamy.core.event; -import org.jiemamy.core.model.typedef.ColumnModel; /** * {@link Observable}のCollectionに対する変更のリスナ。 * @param <C> Listの実装Class - * @param <M> Listに保持するModelClass ({@link ColumnModel}など) + * @param <M> Listに保持するModelClass (ColumnModelなど) * @author shin1ogawa */ public interface ObservableCollectionChangeListener<C, M> { Modified: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/event/SetterInterceptor.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/event/SetterInterceptor.java 2008-09-17 13:52:54 UTC (rev 1927) +++ artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/event/SetterInterceptor.java 2008-09-17 16:02:38 UTC (rev 1928) @@ -21,9 +21,6 @@ import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; -import org.jiemamy.core.model.AbstractModel; -import org.jiemamy.core.model.JiemamyModel; - /** * {@link org.jiemamy.core.model.AbstractModel}のSetterをInterceptし、Setter動作後に * {@link org.jiemamy.core.model.AbstractModel#fireModelChange(Field)}を実行する。 @@ -39,7 +36,7 @@ */ public Object invoke(MethodInvocation invocation) throws Throwable { Object target = invocation.getThis(); - if ((target instanceof JiemamyModel) == false) { + if ((target instanceof Observable) == false) { return invocation.proceed(); } Method method = invocation.getMethod(); @@ -61,7 +58,7 @@ // Object newValue = field.get(invocation.getThis()); // Eventを発火する。 - ((AbstractModel) target).fireModelChange(field); + ((Observable) target).fireModelChange(field); return result; } Modified: artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/event/collectionimpl/ObservableMap.java =================================================================== --- artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/event/collectionimpl/ObservableMap.java 2008-09-17 13:52:54 UTC (rev 1927) +++ artemis/trunk/org.jiemamy.core/src/main/java/org/jiemamy/core/event/collectionimpl/ObservableMap.java 2008-09-17 16:02:38 UTC (rev 1928) @@ -29,10 +29,9 @@ import org.jiemamy.core.event.ModelChangeEvent; import org.jiemamy.core.event.ModelChangeListener; +import org.jiemamy.core.event.Observable; import org.jiemamy.core.event.ObservableCollectionChangeEvent; import org.jiemamy.core.event.ObservableCollectionChangeListener; -import org.jiemamy.core.model.AbstractModel; -import org.jiemamy.core.model.JiemamyModel; /** * {@link ObservableCollectionChangeEvent}を通知する{@link Map}の実装。。 @@ -113,8 +112,8 @@ for (V value : removedList) { fireChange(new ObservableCollectionChangeEvent<Map<K, V>, V>( ObservableCollectionChangeEvent.Timing.AFTER_REMOVE, this, index++, value)); - if (value instanceof JiemamyModel) { - AbstractModel abstractModel = (AbstractModel) value; + if (value instanceof Observable) { + Observable abstractModel = (Observable) value; abstractModel.removeModelChangeListener(modelChangeListener); } } @@ -171,8 +170,8 @@ fireChange(new ObservableCollectionChangeEvent<Map<K, V>, V>(ObservableCollectionChangeEvent.Timing.BEFORE_ADD, this, index, value)); V result = map.put(key, value); - if (value instanceof JiemamyModel) { - AbstractModel abstractModel = (AbstractModel) value; + if (value instanceof Observable) { + Observable abstractModel = (Observable) value; abstractModel.addModelChangeListener(modelChangeListener); } fireChange(new ObservableCollectionChangeEvent<Map<K, V>, V>(ObservableCollectionChangeEvent.Timing.AFTER_ADD, @@ -203,8 +202,8 @@ V result = map.remove(key); fireChange(new ObservableCollectionChangeEvent<Map<K, V>, V>( ObservableCollectionChangeEvent.Timing.AFTER_REMOVE, this, index, result)); - if (result instanceof JiemamyModel) { - AbstractModel abstractModel = (AbstractModel) result; + if (result instanceof Observable) { + Observable abstractModel = (Observable) result; abstractModel.removeModelChangeListener(modelChangeListener); } return result;