From 4082549fe417eb372b215e6199ce43b8e223367d Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Thu, 20 Feb 2020 14:35:58 +0200 Subject: [PATCH] Add support for specifying DecimalFormat format for static info gitlab #59 Change-Id: I718671cf0d91ab402e83b7570d3fc2170b1349c2 --- .../StaticDynamicContribution.scl | 2 +- .../model/StaticInformationContribution.java | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/org.simantics.district.network/scl/Simantics/District/DynamicVisualisations/StaticDynamicContribution.scl b/org.simantics.district.network/scl/Simantics/District/DynamicVisualisations/StaticDynamicContribution.scl index 2a82d342..9f461999 100644 --- a/org.simantics.district.network/scl/Simantics/District/DynamicVisualisations/StaticDynamicContribution.scl +++ b/org.simantics.district.network/scl/Simantics/District/DynamicVisualisations/StaticDynamicContribution.scl @@ -5,7 +5,7 @@ importJava "org.simantics.district.network.visualisations.model.StaticInformatio data StaticInformationContribution @JavaName "" - staticInformationContribution :: String -> String -> String -> String -> StaticInformationContribution + staticInformationContribution :: String -> String -> String -> String -> String -> StaticInformationContribution importJava "org.simantics.district.network.visualisations.model.DynamicSymbolContribution" where data DynamicSymbolContribution diff --git a/org.simantics.district.network/src/org/simantics/district/network/visualisations/model/StaticInformationContribution.java b/org.simantics.district.network/src/org/simantics/district/network/visualisations/model/StaticInformationContribution.java index 6e8b9363..a76e6765 100644 --- a/org.simantics.district.network/src/org/simantics/district/network/visualisations/model/StaticInformationContribution.java +++ b/org.simantics.district.network/src/org/simantics/district/network/visualisations/model/StaticInformationContribution.java @@ -6,16 +6,18 @@ public class StaticInformationContribution { private String moduleName; private String attributeName; private String unit; + private String format; // for graph persistence only private boolean used; private boolean useDefault; - public StaticInformationContribution(String label, String moduleName, String attributeName, String unit) { + public StaticInformationContribution(String label, String moduleName, String attributeName, String unit, String format) { this.label = label; this.moduleName = moduleName; this.attributeName = attributeName; this.unit = unit; + this.format = format; } public String getLabel() { @@ -33,7 +35,11 @@ public class StaticInformationContribution { public String getUnit() { return unit; } - + + public String getFormat() { + return format; + } + public boolean isUsed() { return used; } @@ -49,5 +55,4 @@ public class StaticInformationContribution { public void setUseDefault(boolean useDefault) { this.useDefault = useDefault; } - } \ No newline at end of file -- 2.47.1