From: lehtonen Date: Mon, 8 Mar 2010 13:51:52 +0000 (+0000) Subject: Organized imports in SysdynBrowser to make it compile. X-Git-Tag: simantics-1.0~49 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=a2359ada61e38de4850ad8a5c6d72fc53719a31a;p=simantics%2Fsysdyn.git Organized imports in SysdynBrowser to make it compile. git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@14667 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/SysdynBrowser.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/SysdynBrowser.java index 5ded8b86..da8dfdd0 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/SysdynBrowser.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/browser/SysdynBrowser.java @@ -10,17 +10,17 @@ import org.simantics.browsing.ui.NodeContext; import org.simantics.browsing.ui.PrimitiveQueryUpdater; import org.simantics.browsing.ui.BuiltinKeys.LabelerKey; import org.simantics.browsing.ui.common.ColumnKeys; -import org.simantics.browsing.ui.common.ContextMenuInitializer; import org.simantics.browsing.ui.common.EvaluatorData; import org.simantics.browsing.ui.common.EvaluatorDataImpl; import org.simantics.browsing.ui.common.EvaluatorImpl; -import org.simantics.browsing.ui.common.IContextMenuInitializer; import org.simantics.browsing.ui.common.EvaluatorData.Evaluator; import org.simantics.browsing.ui.content.Labeler; import org.simantics.browsing.ui.content.LabelerFactory; import org.simantics.browsing.ui.graph.GraphExplorerView; -import org.simantics.browsing.ui.graph.GraphViewpointFactory; -import org.simantics.browsing.ui.graph.LazyGraphLabeler; +import org.simantics.browsing.ui.graph.impl.GraphViewpointFactory; +import org.simantics.browsing.ui.graph.impl.LazyGraphLabeler; +import org.simantics.browsing.ui.swt.ContextMenuInitializer; +import org.simantics.browsing.ui.swt.IContextMenuInitializer; import org.simantics.db.Builtins; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; @@ -38,13 +38,13 @@ public class SysdynBrowser extends GraphExplorerView { protected IContextMenuInitializer getContextMenuInitializer() { return new ContextMenuInitializer("#OntologyExplorerPopup"); } - + @Override protected EvaluatorData createEvaluatorData(Session session) { HintContext factoryHints = new HintContext(); //if (sessionContext != null) //factoryHints.setHint(IGraphExplorerHints.KEY_SESSION_CONTEXT, sessionContext); - + EvaluatorData data = new EvaluatorDataImpl(); data.addEvaluator(Resource.class, createResourceEvaluator(session, factoryHints)); return data; @@ -52,34 +52,34 @@ public class SysdynBrowser extends GraphExplorerView { private Evaluator createResourceEvaluator(Session session, HintContext factoryHints) { Evaluator evaluator = new EvaluatorImpl(); - evaluator.addViewpoint(new GraphViewpointFactory() { + evaluator.addViewpoint(new GraphViewpointFactory() { @Override protected Collection getChildren(ReadGraph g, Resource r) - throws DatabaseException { + throws DatabaseException { Builtins b = g.getBuiltins(); SysdynResource sr = SysdynResource.getInstance(g); - ArrayList result = new ArrayList(); + ArrayList result = new ArrayList(); for(Resource c : g.getObjects(r, b.ConsistsOf)) { - if( g.isInstanceOf(c, sr.Configuration) - || (g.isInstanceOf(c, sr.Variable) && - !g.isInstanceOf(c, sr.Cloud) - ) - ) + if( g.isInstanceOf(c, sr.Configuration) + || (g.isInstanceOf(c, sr.Variable) && + !g.isInstanceOf(c, sr.Cloud) + ) + ) result.add(c); } return result; } }, 1.0); - evaluator.addLabeler(new LabelerFactory() { + evaluator.addLabeler(new LabelerFactory() { @Override public Labeler create(PrimitiveQueryUpdater updater, final NodeContext context, LabelerKey key) { return new LazyGraphLabeler(updater, context, key) { - + Resource nameResource; - + @Override public Map labels(ReadGraph g) - throws DatabaseException { + throws DatabaseException { Builtins b = g.getBuiltins(); nameResource = b.HasName; Resource el = (Resource) context.getConstant(BuiltinKeys.INPUT); @@ -87,12 +87,12 @@ public class SysdynBrowser extends GraphExplorerView { for(Resource r : g.getObjects(el, b.HasName)) sb.append(g.getValue(r)); sb.append(" : "); - for(Resource t : g.getObjects(el, b.InstanceOf)) + for(Resource t : g.getObjects(el, b.InstanceOf)) for(Resource r : g.getObjects(t, b.HasName)) sb.append(g.getValue(r)); return Collections.singletonMap(ColumnKeys.SINGLE, sb.toString()); } - + @Override public Modifier getModifier(String key) { LabelModifier modifier = new LabelModifier(SimanticsUI.getSession(), (Resource) context.getConstant(BuiltinKeys.INPUT), nameResource) { @@ -107,11 +107,11 @@ public class SysdynBrowser extends GraphExplorerView { }; return modifier; } - }; - } - + }; + } + }, 1.0); - /*evaluator.addImager(new ImagerFactory() { + /*evaluator.addImager(new ImagerFactory() { @Override public Imager create(PrimitiveQueryUpdater updater, INodeContext context) { // TODO Auto-generated method stub @@ -119,6 +119,6 @@ public class SysdynBrowser extends GraphExplorerView { } });*/ return evaluator; - } + } }