String name = graph.getPossibleRelatedValue(config, getPropertyRelation(graph,element), Bindings.STRING);
return name;
}
-
+
public AffineTransform getTransform(INode node, AffineTransform parentTransform, Rectangle2D elementBounds, int location, boolean up) {
return getTransform(parentTransform, elementBounds, location, up);
}
at.scale(0.15, 0.15);
return at;
-
+
}
protected String rowId() {
String value2 = result != null ? result.getText2() : null;
String value3 = result != null ? result.getText3() : null;
-
+
double spacing = result.getSpacing();
final Function1<String, String> modifier = result != null ? result.getModifier() : null;
node.setCache(1, row, result);
boolean isConnection = _node instanceof ConnectionNode;
-
+
Rectangle2D elementBounds = isConnection ? EMPTY_BOUNDS : NodeUtil.getLocalElementBounds(_node);
if(elementBounds == null) {
new Exception("Cannot get local element bounds for node " + _node.toString()).printStackTrace();
Vec2d offset = result.getOffset();
Point2D[] cellOffsets = getCellOffsets();
-
+
AffineTransform at1 = new AffineTransform(at);
at1.translate(cellOffsets[0].getX(),cellOffsets[0].getY());
AffineTransform at2 = new AffineTransform(at);
at2.translate(cellOffsets[1].getX()+spacing,cellOffsets[1].getY());
AffineTransform at3 = new AffineTransform(at);
at3.translate(cellOffsets[2].getX()+spacing,cellOffsets[2].getY());
-
+
at1.translate(offset.x, offset.y);
at2.translate(offset.x, offset.y);
at3.translate(offset.x, offset.y);
node.setHorizontalAlignment(2, row, (byte) getAlignment(2).ordinal());
node.setHorizontalAlignment(3, row, (byte) getAlignment(3).ordinal());
}
-
+
Alignment[] verticalAlignments = result.getVerticalAlignments();
if(verticalAlignments != null) {
node.setVerticalAlignment(1, row, (byte) verticalAlignments[0].ordinal());
node.setZIndex(3000);
org.simantics.common.color.Color color = result.getColor();
- java.awt.Color awtColor = color != null ? Colors.awt(color) : Color.DARK_GRAY;
+ Color awtColor = color != null ? Colors.awt(color) : Color.DARK_GRAY;
+ Color bgColor = getBackgroundColor();
+ Font font = getFont();
- setTextNodeData(node, 1, row, value, FONT, awtColor, BACKGROUND_COLOR);
- setTextNodeData(node, 2, row, value2, result.getPending(), FONT, awtColor, BACKGROUND_COLOR);
- setTextNodeData(node, 3, row, value3, FONT, awtColor, BACKGROUND_COLOR);
+ setTextNodeData(node, 1, row, value, font, awtColor, bgColor);
+ setTextNodeData(node, 2, row, value2, result.getPending(), font, awtColor, bgColor);
+ setTextNodeData(node, 3, row, value3, font, awtColor, bgColor);
node.setEditable(1, row, false);
node.setForceEventListening(2, row, true);
node.setInputValidator(2, row, validator);
node.setTranslator(translator);
-
+
node.setRVI(2, row, rvi);
postProcessNode(node, row);
node.setPending(x, y, pending);
}
+ protected Font getFont() {
+ return FONT;
+ }
+
+ protected Color getBackgroundColor() {
+ return BACKGROUND_COLOR;
+ }
+
protected Alignment getAlignment(int column) {
switch(column) {
case 1: return Alignment.TRAILING;