]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.district.network/src/org/simantics/district/network/visualisations/model/DynamicSizeContribution.java
Fixed most warnings from district codebase after JavaSE-11 switch
[simantics/district.git] / org.simantics.district.network / src / org / simantics / district / network / visualisations / model / DynamicSizeContribution.java
1 package org.simantics.district.network.visualisations.model;
2
3 public class DynamicSizeContribution {
4
5     private String label;
6     private String moduleName;
7     private String attributeName;
8     private String unit;
9     private double variableGain;
10     private double variableBias;
11     private DynamicSizeMap defaultSizeMap;
12     private double defaultMin;
13     private double defaultMax;
14     
15     // for graph persistence only
16     private boolean used;
17     private boolean useDefault;
18
19     public DynamicSizeContribution(String label, String moduleName, String attributeName, String unit,
20             double variableGain, double variableBias, DynamicSizeMap defaultSizeMap, double defaultMin, double defaultMax) {
21         this.label = label;
22         this.moduleName = moduleName;
23         this.attributeName = attributeName;
24         this.unit = unit;
25         this.variableGain = variableGain;
26         this.variableBias = variableBias;
27         this.defaultSizeMap = defaultSizeMap;
28         this.defaultMin = defaultMin;
29         this.defaultMax = defaultMax;
30     }
31
32     public String getLabel() {
33         return label;
34     }
35     
36     public String getModuleName() {
37         return moduleName;
38     }
39     
40     public String getAttributeName() {
41         return attributeName;
42     }
43
44     public String getUnit() {
45         return unit;
46     }
47     
48     public double getVariableGain() {
49         return variableGain;
50     }
51     
52     public double getVariableBias() {
53         return variableBias;
54     }
55     
56     public DynamicSizeMap getDefaultSizeMap() {
57         return defaultSizeMap;
58     }
59     
60     public double getDefaultMin() {
61         return defaultMin;
62     }
63     
64     public double getDefaultMax() {
65         return defaultMax;
66     }
67     
68     public boolean isUsed() {
69         return used;
70     }
71     
72     public void setUsed(boolean used) {
73         this.used = used;
74     }
75     
76     public boolean isUseDefault() {
77         return useDefault;
78     }
79     
80     public void setUseDefault(boolean useDefault) {
81         this.useDefault = useDefault;
82     }
83
84     public double adjustedValue(double value) {
85         // here we do the adjusting according to spec in #15038
86         return value * getVariableGain() + getVariableBias();
87     }
88 }