Resource inputResource = getInputResource();
Variable context = Variables.getPossibleVariable(graph, inputResource);
if(context == null)
- return createErrorGraph("Couldn't create variable for the resource.");
+ return createErrorGraph(Messages.ProceduralComponentInstanceViewer_CouldnotCreateVariableForResource);
try {
List<SubstructureElement> proceduralDesc =
Functions.getProceduralDesc(graph, context);
if(proceduralDesc == null)
- return createErrorGraph("Component does not have a procedural substructure.");
+ return createErrorGraph(Messages.ProceduralComponentInstanceViewer_NoProceduralSubstructure);
return createGraph(graph, proceduralDesc);
} catch(DatabaseException e) {
e.printStackTrace();
private static Graph createErrorGraph(String description) {
Graph graph = new Graph();
- new Node(graph, description).setShape("rectangle");
+ new Node(graph, description).setShape("rectangle"); //$NON-NLS-1$
return graph;
}
Node node = connectionPoints.get(interface_.relation);
if(node == null) {
node = new Node(graph);
- node.setShape("diamond");
+ node.setShape("diamond"); //$NON-NLS-1$
node.setLabel(nameOf(g, interface_.relation));
connectionPoints.put(interface_.relation, node);
}
private static Graph createGraph(ReadGraph g, List<SubstructureElement> proceduralDesc) throws DatabaseException {
Graph graph = new Graph();
- graph.setRankdir("LR");
+ graph.setRankdir("LR"); //$NON-NLS-1$
THashMap<String, Node> components = new THashMap<String, Node>();
for(SubstructureElement element : proceduralDesc)
if(element instanceof Component) {
Component component = (Component)element;
Record record = new Record();
- record.add(component.name + " : " + nameOf(g, component.type));
+ record.add(component.name + " : " + nameOf(g, component.type)); //$NON-NLS-1$
StringBuilder b = new StringBuilder();
boolean first = true;
for(Property property : component.properties) {
if(first)
first = false;
else
- b.append("\\n");
- b.append(nameOf(g, property.relation) + " = " + property.value);
+ b.append("\\n"); //$NON-NLS-1$
+ b.append(nameOf(g, property.relation) + " = " + property.value); //$NON-NLS-1$
}
record.add(b.toString());
components.put(component.name, record.toNode(graph));
Edge edge = new Edge(cp1.first, cp2.first);
if(cp1.second != null) {
if(cp2.second != null)
- edge.setLabel(cp1.second + "-" + cp2.second);
+ edge.setLabel(cp1.second + "-" + cp2.second); //$NON-NLS-1$
else
edge.setLabel(cp1.second);
}
}
else {
Node p = new Node(graph);
- p.setShape("point");
+ p.setShape("point"); //$NON-NLS-1$
boolean first = true;
for(ConnectionPoint cp : cps) {
Pair<Node, String> cp1 = getCp(g, graph, components, connectionPoints, cp);