svnno****@sourc*****
svnno****@sourc*****
2009年 5月 20日 (水) 17:25:26 JST
Revision: 3409 http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=3409 Author: shin1 Date: 2009-05-20 17:25:26 +0900 (Wed, 20 May 2009) Log Message: ----------- [ECL-53]自動レイアウト後に再描画を行うように修正した。 再描画処理は自動レイアウトタスクのスレッドの中に含めつつも、UIスレッドで処理されるようにしてみた。 Modified Paths: -------------- hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/action/AutoLayoutAction.java -------------- next part -------------- Modified: hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/action/AutoLayoutAction.java =================================================================== --- hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/action/AutoLayoutAction.java 2009-05-20 08:20:28 UTC (rev 3408) +++ hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/action/AutoLayoutAction.java 2009-05-20 08:25:26 UTC (rev 3409) @@ -208,8 +208,8 @@ } public void run(IProgressMonitor monitor) { - // 0:assemble nodes, 1:assemble edges, 2:analyze graph, 3:execute commands - int totalWork = 4; + // 0:assemble nodes, 1:assemble edges, 2:analyze graph, 3:execute commands, 4:refresh views + int totalWork = 5; int worked = 0; monitor.beginTask(Messages.AutoLayoutAction_name, totalWork); @@ -247,8 +247,22 @@ viewer.getEditDomain().getCommandStack().execute(commands); monitor.worked(++worked); + monitor.setTaskName(Messages.AutoLayoutAction_name + " - refresh views."); + refreshViews(editParts); + monitor.worked(++worked); monitor.done(); } + + private void refreshViews(final List<EditPart> editParts) { + viewer.getControl().getDisplay().syncExec(new Runnable() { + + public void run() { + for (EditPart editPart : editParts) { + editPart.refresh(); + } + } + }); + } private void analyzeGraph(final List<Node> graphNodes, final List<Edge> graphEdges, CompoundCommand commands, RootModel rootModel) {