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;
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() {
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);
}
@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 += "<br/>"+text;
+ label += "<br/>"+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$
}
}
L0 = Layer0.getInstance(g);
graph = new Graph();
- graph.setRankdir("LR");
+ graph.setRankdir("LR"); //$NON-NLS-1$
nodeMap.clear();
edgeMap.clear();
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);
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<div class=\"monospaced\">" + uri + "</div><br/>");
Collection<Statement> statements = g.getStatements(r, L0.IsWeaklyRelatedTo);
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("<h3>" + " ["+ r.getResourceId() + "-" + support.getCluster(r) + "] " + "</h3>\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("<table>\n");
//content.append("<tr><th>Predicate</th><th>Object</th></tr>");
//content.append("<tr><td class=\"subtitle\" colspan=\"2\">Tags</td></tr>");
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());
}
}
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);
for(Resource pred : preds) {
String str = htmlEscape(getResourceName(g, pred));
if(str == null)
- str = "<null>";
+ str = "<null>"; //$NON-NLS-1$
strmap.put(pred, str);
}
Arrays.sort(preds, new Comparator<Resource>() {
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$
}
}
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("<span style=\"color:red;font-weight:bold\">BROKEN ORDERED SET:<br/></span><span style=\"color:red\">" + e.getMessage() + "</span>");
// Resource inv = graph.getPossibleInverse(subj);
// for(Statement stat : graph.getStatements(cur, L0.IsRelatedTo)) {
}
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