X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.debug.ui%2Fsrc%2Forg%2Fsimantics%2Fdebug%2Fui%2Fgraph%2FGraphicalDebugger.java;h=c8a89fa9e619327ce221c7465f8161e4b8675b96;hp=fef011b8d4efdcc754d314d23f8df5003ce53b59;hb=59724aa55a75a4efc3ec17e3b4a4ef62f463526e;hpb=1fe7ef332a6f996a13b4dda38bc85a743a154baa diff --git a/bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/graph/GraphicalDebugger.java b/bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/graph/GraphicalDebugger.java index fef011b8d..c8a89fa9e 100644 --- a/bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/graph/GraphicalDebugger.java +++ b/bundles/org.simantics.debug.ui/src/org/simantics/debug/ui/graph/GraphicalDebugger.java @@ -19,6 +19,7 @@ import java.util.Set; import javax.swing.SwingUtilities; import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.osgi.util.NLS; import org.eclipse.swt.SWT; import org.eclipse.swt.browser.Browser; import org.eclipse.swt.layout.GridData; @@ -114,7 +115,7 @@ public class GraphicalDebugger extends GraphDebugger { public GraphvizComponent2 createGraph(Composite parent) { graph = new Graph(); - graph.setRankdir("LR"); + graph.setRankdir("LR"); //$NON-NLS-1$ graphVizComponent = new GraphvizComponent2(parent, SWT.NONE); SwingUtilities.invokeLater(new Runnable() { @@ -195,8 +196,8 @@ public class GraphicalDebugger extends GraphDebugger { if (n == null) { n = new Node(graph); if (!r.isPersistent()) { - n.setShape("box"); - n.setFontColor("blue"); + n.setShape("box"); //$NON-NLS-1$ + n.setFontColor("blue"); //$NON-NLS-1$ } nodeMap.map(r, n); } @@ -205,20 +206,20 @@ public class GraphicalDebugger extends GraphDebugger { @SuppressWarnings("unused") protected void appendLabel(Node node, String text) { - String label = node.get("label"); + String label = node.get("label"); //$NON-NLS-1$ if (true) { if (label == null || label.length() == 0) label = text;//escape(text); else { label = label.substring(1,label.length()-1); - label += "
"+text; + label += "
"+text; //$NON-NLS-1$ } - label = "<" + label + ">"; + label = "<" + label + ">"; //$NON-NLS-1$ //$NON-NLS-2$ } else { if (label == null || label.length() == 0) label = text; else { - label += " "+text; + label += " "+text; //$NON-NLS-1$ } } @@ -232,7 +233,7 @@ public class GraphicalDebugger extends GraphDebugger { L0 = Layer0.getInstance(g); graph = new Graph(); - graph.setRankdir("LR"); + graph.setRankdir("LR"); //$NON-NLS-1$ nodeMap.clear(); edgeMap.clear(); @@ -266,8 +267,8 @@ public class GraphicalDebugger extends GraphDebugger { continue; Node node = getResourceRef(g, r); if (r.equals(getDebuggerLocation())) { - node.setFillColor("#aaffaa"); - node.setStyle("filled"); + node.setFillColor("#aaffaa"); //$NON-NLS-1$ + node.setStyle("filled"); //$NON-NLS-1$ } //Node node = getOrCreate(r); processed.add(r); @@ -279,10 +280,10 @@ public class GraphicalDebugger extends GraphDebugger { uri = g.syncRequest(new ResourceToPossibleURI(r)); } catch (Exception e) { e.printStackTrace(); - uri = "Cannot get URI: " + e.getMessage(); + uri = "Cannot get URI: " + e.getMessage(); //$NON-NLS-1$ } if (uri != null) - appendLabel(node, "URI: " + uri); + appendLabel(node, "URI: " + uri); //$NON-NLS-1$ //content.append("\t\t
" + uri + "

"); Collection statements = g.getStatements(r, L0.IsWeaklyRelatedTo); @@ -298,12 +299,12 @@ public class GraphicalDebugger extends GraphDebugger { map.add(predicate, new Resource[] {subject, obj}); } catch (Throwable e) { e.printStackTrace(); - ErrorLogger.defaultLogError("Cannot find statement " + subject + " " + predicate + " " + obj, e); + ErrorLogger.defaultLogError("Cannot find statement " + subject + " " + predicate + " " + obj, e); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ } } ClusteringSupport support = g.getSession().getService(ClusteringSupport.class); //content.append("

" + " ["+ r.getResourceId() + "-" + support.getCluster(r) + "] " + "

\n"); - appendLabel(node, " ["+ r.getResourceId() + "-" + support.getCluster(r) + "]"); + appendLabel(node, " ["+ r.getResourceId() + "-" + support.getCluster(r) + "]"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //content.append("\n"); //content.append(""); @@ -324,7 +325,7 @@ public class GraphicalDebugger extends GraphDebugger { //content.append(""); for(Statement stm : statements) { if(stm.getSubject().equals(stm.getObject())) { - updateTag(node, g, r, stm.getPredicate(), "Tag"); + updateTag(node, g, r, stm.getPredicate(), "Tag"); //$NON-NLS-1$ map.remove(stm.getPredicate()); } } @@ -334,7 +335,7 @@ public class GraphicalDebugger extends GraphDebugger { for(Statement stm : statements) { Resource predicate = stm.getPredicate(); if(g.isInstanceOf(stm.getPredicate(), L0.OrderedSet)) { - updateTag(node, g, r, stm.getPredicate(), "Ordered Set"); + updateTag(node, g, r, stm.getPredicate(), "Ordered Set"); //$NON-NLS-1$ map.remove(stm.getPredicate()); } Resource inverse = g.getPossibleInverse(predicate); @@ -366,7 +367,7 @@ public class GraphicalDebugger extends GraphDebugger { for(Resource pred : preds) { String str = htmlEscape(getResourceName(g, pred)); if(str == null) - str = ""; + str = ""; //$NON-NLS-1$ strmap.put(pred, str); } Arrays.sort(preds, new Comparator() { @@ -429,10 +430,10 @@ public class GraphicalDebugger extends GraphDebugger { if(!stmSubject.equals(subj)) { Node asserted = getResourceRef(graph, stmSubject); Edge e = new Edge(this.graph, objects[i].node, asserted); - e.setLabel("Asserted in"); + e.setLabel(Messages.GraphicalDebugger_AssertedIn); - objects[i].node.setFillColor("#ffaaaa"); - objects[i].node.setStyle("filled"); + objects[i].node.setFillColor("#ffaaaa"); //$NON-NLS-1$ + objects[i].node.setStyle("filled"); //$NON-NLS-1$ } } @@ -506,7 +507,7 @@ public class GraphicalDebugger extends GraphDebugger { cur = OrderedSetUtils.next(graph, subj, cur); } catch(DatabaseException e) { Edge edge = new Edge(this.graph, node, node); - edge.setLabel("Broken Ordered Set"); + edge.setLabel(Messages.GraphicalDebugger_BrockenOrderedSet); //list.add("BROKEN ORDERED SET:
" + e.getMessage() + ""); // Resource inv = graph.getPossibleInverse(subj); // for(Statement stat : graph.getStatements(cur, L0.IsRelatedTo)) { @@ -528,7 +529,7 @@ public class GraphicalDebugger extends GraphDebugger { } for (int i = 0; i < list.size() ; ++i) { Edge e = new Edge(this.graph, node, list.get(i)); - e.setLabel("Oredered set item " + i); + e.setLabel(NLS.bind(Messages.GraphicalDebugger_OrderedSetItem , i)); } // Output table rows
PredicateObject
Tags