import java.util.Set;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Shell;
import org.simantics.browsing.ui.BuiltinKeys;
import org.simantics.browsing.ui.CheckedState;
import org.simantics.browsing.ui.NodeContext;
import org.simantics.db.exception.ResourceNotFoundException;
import org.simantics.db.layer0.variable.Variable;
import org.simantics.db.request.Read;
-import org.simantics.graphviz.Graph;
-import org.simantics.graphviz.Node;
-import org.simantics.graphviz.ui.GraphvizComponent;
import org.simantics.scl.reflection.OntologyVersions;
import org.simantics.viewpoint.ontology.ViewpointResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
* BrowseContext holds all contributions related to given set of browse contexts.
* @author Hannu Niemistö
*/
public class BrowseContext {
-
+
+ private static final Logger LOGGER = LoggerFactory.getLogger(BrowseContext.class);
public static final boolean DEBUG = false;
NodeTypeMultiMap<ChildContribution> childContributions = new NodeTypeMultiMap<ChildContribution>();
try {
browseContextResources.add(graph.getResource(browseContext));
} catch (ResourceNotFoundException e) {
- // Expected result, if no modelled contributions exist.
- //System.err.println("Didn't find " + browseContext + " while loading model browser.");
+ LOGGER.error("Didn't find " + browseContext + " while loading model browser.", e);
}
}
Collection<Resource> allBrowseContextResources = BrowseContext.findSubcontexts(graph, browseContextResources);
Collection<NodeContext> children = contribution.getChildren(graph, parent);
result.addAll(children);
if(DEBUG) {
- System.err.println("contribution: " + contribution.getIdentifier());
+ LOGGER.info("contribution: " + contribution.getIdentifier());
for(NodeContext ctx : children)
- System.err.println("-" + ctx);
+ LOGGER.info("-" + ctx);
}
}
return tooltip;
return null;
}
-
- private Graph toGraph() {
- Graph graph = new Graph();
- new Node(graph, "Foo");
- return graph;
- }
-
- @SuppressWarnings("unused")
- private void visualize() {
- final Graph graph = toGraph();
-
- // Show it
- new Thread() {
- public void run() {
- final Display display = new Display();
- final Shell shell = new Shell(display);
-
- GraphvizComponent comp = new GraphvizComponent(shell, 0);
- comp.setGraph(graph);
-
- comp.setBounds(0, 0, 800, 600);
- shell.pack();
- shell.open ();
- while (!shell.isDisposed()) {
- if (!display.readAndDispatch()) display.sleep();
- }
- display.dispose();
- }
- }.start();
- }
@Override
public int hashCode() {