-
Notifications
You must be signed in to change notification settings - Fork 2
/
ActiveControlText.java
55 lines (43 loc) · 1.56 KB
/
ActiveControlText.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package org.jlab.wedm.widget.html;
import java.awt.Point;
import java.util.Map;
import org.jlab.wedm.persistence.io.TraitParser;
import org.jlab.wedm.persistence.model.ColorPalette;
import org.jlab.wedm.widget.ScreenProperties;
/**
* CONTROL TEXT
*
* @author slominskir
*/
public class ActiveControlText extends ActiveStaticText {
public boolean showUnits = false;
@Override
public void parseTraits(Map<String, String> traits, ScreenProperties properties) {
super.parseTraits(traits, properties);
showUnits = TraitParser.parseBoolean(traits, "showUnits");
}
@Override
public String toHtml(String indent, Point translation) {
if(showUnits) {
attributes.put("data-show-units", "true");
}
if (alarmPv == null && controlPv != null && (fgAlarm || bgAlarm)) {
alarmPv = controlPv;
}
return super.toHtml(indent, translation);
}
@Override
protected void set3DStyles() {
if (motifWidget) {
classes.add("motif");
if (topShadowColor != null) {
threeDStyles.put("border-bottom", "2px solid " + topShadowColor.toColorString());
threeDStyles.put("border-right", "2px solid " + topShadowColor.toColorString());
}
if (botShadowColor != null) {
threeDStyles.put("border-top", "2px solid " + botShadowColor.toColorString());
threeDStyles.put("border-left", "2px solid " + botShadowColor.toColorString());
}
}
}
}