private Node createChemNode(String label, Graph2D graph) { Node chem = createNode(label, graph); NodeRealizer nodeRealizer = graph.getRealizer(chem); nodeRealizer.setTransparent(false); NodeLabel nl = nodeRealizer.getLabel(0); // nodeRealizer.setSize(_layoutMetrics.getChemNodeSize(), // _layoutMetrics.getChemNodeSize()); nodeRealizer.setSize(nl.getBox().getWidth() + 10, nl.getBox().getHeight()); nl.setFontSize(_layoutMetrics.getChemNodeFontSize()); nl.setFontStyle(Font.BOLD); nl.setModel(NodeLabel.INTERNAL); nl.setPosition(NodeLabel.CENTER); nl.setAlignment(NodeLabel.ALIGN_CENTER); nl.setTextColor(Color.BLACK); return chem; }
private Node createErrorNode(String label, Graph2D graph) { Node node = createNode(label, graph); NodeRealizer nodeRealizer = graph.getRealizer(node); nodeRealizer.setTransparent(true); nodeRealizer.setLineColor(Color.white); NodeLabel nl = nodeRealizer.getLabel(0); nl.setFontSize(_layoutMetrics.getLabelFontSize() + 15); nl.setFontStyle(Font.PLAIN); nl.setModel(NodeLabel.INTERNAL); nl.setPosition(NodeLabel.CENTER); nl.setAlignment(NodeLabel.ALIGN_LEFT); nl.setTextColor(Color.cyan); nodeRealizer.setSize(nl.getBox().getWidth(), nl.getBox().getHeight()); return node; }