*/
public class ResourceSCLTextGridStyle extends TextGridStyle {
- final Resource style;
final Font font;
public ResourceSCLTextGridStyle(ReadGraph graph, Resource style) throws DatabaseException {
- this.style = style;
+ super(style);
G2DResource G2D = G2DResource.getInstance(graph);
- Resource fontR = graph.getPossibleObject(style, G2D.HasFont);
+ Resource fontR = graph.getPossibleObject(style, G2D.HasFont);
if(fontR != null) {
font = G2DUtils.getFont(graph, fontR);
} else {
@Override
protected Object getIdentity(Resource entry) {
- return new Pair<Resource, Resource>(style, entry);
+ return new Pair<Resource, Resource>(getResource(), entry);
}
@Override
public MonitorTextGridResult calculateStyle(ReadGraph graph, Resource runtimeDiagram, Resource entry, Resource element, Variable configuration) throws DatabaseException {
DiagramResource DIA = DiagramResource.getInstance(graph);
- Variable styleVariable = Variables.getVariable(graph, style);
+ Variable styleVariable = Variables.getVariable(graph, getResource());
Function1<Resource,Tuple3> function = styleVariable.getPossiblePropertyValue(graph, DIA.ResourceSCLTextGridStyle_texts);
Tuple3 result = Simantics.applySCLRead(graph, function, element);
-
+
AffineTransform transform = DiagramGraphUtil.getAffineTransform(graph, element);
Vec2d offset = DiagramGraphUtil.getOffset(graph, element);
boolean enabled = !DiagramGraphUtil.getProfileMonitorsHidden(graph, element);
@Override
public String getNodeName() {
- return "" + style.getResourceId();
+ return "" + getResource().getResourceId();
}
}