X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fprofile%2FSCLTextGridStyle.java;h=16b205388733c0ba5f3d86fea0b22b6781632012;hp=4401f2213c51aa0a58b0b0c8170ab5e9636d281c;hb=ab9fcfe016ef75da40eb00a46d4a54b50e534511;hpb=6c70e409e03187c96b057aa5705d49800c6b8b07 diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/SCLTextGridStyle.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/SCLTextGridStyle.java index 4401f2213..16b205388 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/SCLTextGridStyle.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/profile/SCLTextGridStyle.java @@ -25,13 +25,12 @@ 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 { @@ -53,7 +52,7 @@ public class SCLTextGridStyle extends TextGridStyle { @Override protected Object getIdentity(Resource entry) { - return new Pair(style, entry); + return new Pair(getResource(), entry); } @Override @@ -81,7 +80,7 @@ public class SCLTextGridStyle extends TextGridStyle { if (moduleVariable == null) return null; - Variable styleVariable = Variables.getVariable(graph, style); + Variable styleVariable = Variables.getVariable(graph, getResource()); Function1 function = styleVariable.getPossiblePropertyValue(graph, DIA.SCLTextGridStyle_texts); Tuple3 result = Simantics.applySCLRead(graph, function, moduleVariable); @@ -97,7 +96,7 @@ public class SCLTextGridStyle extends TextGridStyle { @Override public String getNodeName() { - return "" + style.getResourceId(); + return "" + getResource().getResourceId(); } }