[Jiemamy-notify:1532] commit [2743] refactor

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 2月 26日 (木) 18:21:50 JST


Revision: 2743
          http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2743
Author:   daisuke_m
Date:     2009-02-26 18:21:50 +0900 (Thu, 26 Feb 2009)

Log Message:
-----------
refactor

Modified Paths:
--------------
    artemis/trunk/jiemamy-artemis-test/src/test/java/org/jiemamy/EventBrokerImplTest.java
    artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/CommandProcessorImpl.java
    artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/impl/ModifyModelPropertyCommand.java
    artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/facade/JiemamyViewFacadeImpl.java


-------------- next part --------------
Modified: artemis/trunk/jiemamy-artemis-test/src/test/java/org/jiemamy/EventBrokerImplTest.java
===================================================================
--- artemis/trunk/jiemamy-artemis-test/src/test/java/org/jiemamy/EventBrokerImplTest.java	2009-02-26 09:17:10 UTC (rev 2742)
+++ artemis/trunk/jiemamy-artemis-test/src/test/java/org/jiemamy/EventBrokerImplTest.java	2009-02-26 09:21:50 UTC (rev 2743)
@@ -113,7 +113,8 @@
 		eventBroker.addListener(rootModelListener);
 		
 		// DiagramPresentationModelを変更する。
-		new ModifyModelPropertyCommand(presentation, "name", "newName").execute(commandProcessor);
+		new ModifyModelPropertyCommand<DiagramPresentationModel>(presentation, "name", "newName")
+			.execute(commandProcessor);
 		assertThat(rootModelListener.commandList.size(), is(1));
 	}
 	

Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/CommandProcessorImpl.java
===================================================================
--- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/CommandProcessorImpl.java	2009-02-26 09:17:10 UTC (rev 2742)
+++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/CommandProcessorImpl.java	2009-02-26 09:21:50 UTC (rev 2743)
@@ -26,6 +26,7 @@
 
 import org.jiemamy.EventBroker;
 import org.jiemamy.EventBrokerImpl;
+import org.jiemamy.JiemamyProperty;
 import org.jiemamy.editcommand.impl.AbstractAddToRootCommand;
 import org.jiemamy.editcommand.impl.AbstractDeleteFromRootCommand;
 import org.jiemamy.editcommand.impl.AddColumnCommand;
@@ -274,10 +275,13 @@
 	 * 
 	 * @param command
 	 */
-	public void process(ModifyModelPropertyCommand command) {
+	public void process(ModifyModelPropertyCommand<?> command) {
 		JiemamyElement target = command.getTarget();
-		String propertyName = command.getProperty().name();
-		if (propertyName == null) {
+		JiemamyProperty<?> property = command.getProperty();
+		String propertyName;
+		if (property != null) {
+			propertyName = property.name();
+		} else {
 			propertyName = command.getPropertyName();
 		}
 		try {

Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/impl/ModifyModelPropertyCommand.java
===================================================================
--- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/impl/ModifyModelPropertyCommand.java	2009-02-26 09:17:10 UTC (rev 2742)
+++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/impl/ModifyModelPropertyCommand.java	2009-02-26 09:21:50 UTC (rev 2743)
@@ -126,7 +126,7 @@
 	
 	public Command getNegateCommand() {
 		if (property == null) {
-			return new ModifyModelPropertyCommand(target, propertyName, oldValue, newValue);
+			return new ModifyModelPropertyCommand<T>(target, propertyName, oldValue, newValue);
 		} else {
 			return new ModifyModelPropertyCommand<T>(target, property, oldValue, newValue);
 		}

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-26 09:17:10 UTC (rev 2742)
+++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/facade/JiemamyViewFacadeImpl.java	2009-02-26 09:21:50 UTC (rev 2743)
@@ -89,7 +89,7 @@
 			figureProfiles.put(nodeAdapter, profile);
 		}
 		NodeProfile nodeProfile = figureProfiles.get(nodeAdapter);
-		Command redoCommand = new ModifyModelPropertyCommand(nodeProfile, "layout", constraint);
+		Command redoCommand = new ModifyModelPropertyCommand<NodeProfile>(nodeProfile, "layout", constraint);
 		redoCommand.execute(commandProcessor);
 		undoStack.push(redoCommand.getNegateCommand());
 		redoStack.push(redoCommand);



Jiemamy-notify メーリングリストの案内
Back to archive index