/** * Creates a <em>basic node</em>. * * @param node Node * @return IVertex */ private IVertex addNode(final Node node) { final String name = node.getName(); final IVertex vertex = dotGraph.newVertex(name, node); if (node.equals(startNode)) { setVertexPreferences(vertex, "start"); } else if (node.hasAttributes(Node.ATTR_MAIN_NODE)) { setVertexPreferences(vertex, "main"); } else if (node.hasAttributes(Node.ATTR_MISSING_NODE)) { setVertexPreferences(vertex, "missing"); } else { setVertexPreferences(vertex, "default"); } if (node.getDescription() != null) { vertex.setAttr(DESCRIPTION_ATTR, node.getDescription()); } if (useBusRouting) { final GrandUiPrefStore preferenceStore = Application.getInstance().getPreferenceStore(); vertex.setAttr("inthreshold", preferenceStore.getInt(PreferenceKeys.GRAPH_BUS_IN_THRESHOLD)); vertex.setAttr( "outthreshold", preferenceStore.getInt(PreferenceKeys.GRAPH_BUS_OUT_THRESHOLD)); } vertexLUT.put(name, vertex); nameDimensions.put(name, vertex); return vertex; }
/** * @param vertex IVertex * @param nodeType String */ private void setVertexPreferences(final IVertex vertex, final String nodeType) { final GrandUiPrefStore preferenceStore = Application.getInstance().getPreferenceStore(); final String keyPrefix = PreferenceKeys.NODE_PREFIX + nodeType; vertex.setAttr(SHAPE_ATTR, preferenceStore.getString(keyPrefix + ".shape")); vertex.setAttr(DRAW2DFGCOLOR_ATTR, preferenceStore.getColor(keyPrefix + ".fgcolor")); vertex.setAttr(DRAW2DFILLCOLOR_ATTR, preferenceStore.getColor(keyPrefix + ".fillcolor")); vertex.setAttr(DRAW2DLINEWIDTH_ATTR, preferenceStore.getInt(keyPrefix + ".linewidth")); }
/** * Method visitNode. * * @param node AntTargetNode * @see net.ggtools.grand.graph.visit.NodeVisitor#visitNode(net.ggtools.grand.ant.AntTargetNode) */ public final void visitNode(final AntTargetNode node) { final IVertex vertex = addNode(node); final String ifCondition = node.getIfCondition(); if (ifCondition != null) { vertex.setAttr(IF_CONDITION_ATTR, ifCondition); } final String unlessCondition = node.getUnlessCondition(); if (unlessCondition != null) { vertex.setAttr(UNLESS_CONDITION_ATTR, unlessCondition); } final String buildFile = node.getBuildFile(); if (buildFile != null) { vertex.setAttr(BUILD_FILE_ATTR, buildFile); } }