import org.simantics.diagram.synchronization.graph.DiagramGraphUtil;
import org.simantics.modeling.ModelingResources;
import org.simantics.scl.runtime.function.Function1;
-import org.simantics.scl.runtime.tuple.Tuple3;
+import org.simantics.scl.runtime.tuple.Tuple4;
import org.simantics.utils.datastructures.Pair;
/**
*/
public class SCLTextGridStyle extends TextGridStyle {
- final Resource style;
final Font font;
public SCLTextGridStyle(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
if (moduleVariable == null)
return null;
- Variable styleVariable = Variables.getVariable(graph, style);
- Function1<Variable,Tuple3> function = styleVariable.getPossiblePropertyValue(graph, DIA.SCLTextGridStyle_texts);
- Tuple3 result = Simantics.applySCLRead(graph, function, moduleVariable);
+ Variable styleVariable = Variables.getVariable(graph, getResource());
+ Function1<Variable,Tuple4> function = styleVariable.getPossiblePropertyValue(graph, DIA.SCLTextGridStyle_texts);
+ Tuple4 result = Simantics.applySCLRead(graph, function, moduleVariable);
AffineTransform transform = DiagramGraphUtil.getAffineTransform(graph, element);
Vec2d offset = DiagramGraphUtil.getOffset(graph, element);
@Override
public String getNodeName() {
- return "" + style.getResourceId();
+ return "" + getResource().getResourceId();
}
}