path.closePath();\r
return path;\r
}\r
- \r
+\r
@Override\r
protected ElementClass compileElementClass(Resource elementType, Collection<ObjectTerminal> terminals) {\r
return ElementClass.compile(\r
Builtins b = graph.getBuiltins();\r
ModelingResources mr = ModelingResources.getInstance(graph);\r
SysdynResource sr = SysdynResource.getInstance(graph);\r
-\r
Resource component = null;\r
Resource dependency = null;\r
Resource refersTo = null;\r
refersTo = graph.getPossibleObject(dependency, sr.RefersTo);\r
module = graph.getPossibleObject(dependency, sr.HasTail);\r
}\r
+ \r
String inputReference = null;\r
if (module != null && refersTo != null) {\r
inputReference = (String) graph.getPossibleRelatedValue(module, b.HasName);\r
inputReference += (String) graph.getPossibleRelatedValue(refersTo, b.HasName);\r
}\r
if (inputReference == null) {\r
- inputReference = "\"\"";\r
+ inputReference = "";\r
}\r
\r
- SysdynElementUtils.setInputReference(e, inputReference);\r
+ SysdynElementUtils.setInputReference(e, inputReference);\r
+\r
}\r
- \r
- \r
+\r
+\r
public static class InputSceneGraph extends TextElementNoBounds implements InternalSize {\r
\r
private static final long serialVersionUID = -3713275157729126409L;\r
- public static final Key SG_NODE = new SceneGraphNodeKey(TextNode.class, "INPUT_SG_NODE");\r
+ public static final Key INPUT_SG_NODE = new SceneGraphNodeKey(TextNode.class, "INPUT_SG_NODE");\r
\r
private final double originX;\r
private final Alignment horizontalAlignment;\r
- \r
+\r
public InputSceneGraph(double originX, double originY, Alignment horizontalAlignment) {\r
- super(originX, originY, horizontalAlignment, 0, true);\r
+ super(originX, originY, horizontalAlignment, (double) 0.0, true);\r
this.originX = originX;\r
this.horizontalAlignment = horizontalAlignment;\r
}\r
- \r
+\r
@Override\r
public void init(final IElement e, G2DParentNode parent) {\r
super.init(e, parent);\r
- TextNode node = ElementUtils.getOrCreateNode(e, parent, SG_NODE, "input", TextNode.class);\r
- Font font = ElementUtils.getTextFont(e);\r
+ TextNode name = (TextNode) e.getHint(SG_NODE);\r
+ Font font = name.getFont().deriveFont(Font.ITALIC);\r
+ name.setFont(font);\r
+ TextNode node = ElementUtils.getOrCreateNode(e, parent, INPUT_SG_NODE, "input", TextNode.class);\r
+ font = ElementUtils.getTextFont(e);\r
font = font.deriveFont((float) 10.0);\r
font = font.deriveFont(Font.ITALIC);\r
Color color = new Color(150, 150, 150);\r
\r
@Override\r
public Rectangle2D getBounds(IElement e, Rectangle2D size) {\r
- TextNode node = (TextNode) e.getHint(SG_NODE);\r
+ TextNode name = (TextNode) e.getHint(SG_NODE);\r
+ TextNode reference = (TextNode) e.getHint(INPUT_SG_NODE);\r
if (size == null)\r
size = new Rectangle2D.Double();\r
- if (node != null)\r
- size.setRect(node.getBoundsInLocal());\r
+ if (name != null)\r
+ size.setRect(name.getBoundsInLocal());\r
+ if(reference != null) {\r
+ if (reference.getBoundsInLocal().getWidth() > size.getWidth())\r
+ size.setRect(size.getX(), size.getY(), reference.getBoundsInLocal().getWidth(), size.getHeight());\r
+ }\r
else\r
size.setFrame(0, 0, 0, 0);\r
return size;\r