Skip to content

Commit dbabbfd

Browse files
committed
temporary JSProgressBarUI
1 parent 9e97566 commit dbabbfd

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package swingjs.plaf;
2+
3+
4+
import java.awt.Dimension;
5+
6+
import javax.swing.JComponent;
7+
import javax.swing.JRootPane;
8+
import javax.swing.LookAndFeel;
9+
import swingjs.api.js.DOMNode;
10+
11+
public class JSProgressBarUI extends JSLightweightUI {
12+
13+
int frameZ = 10003;
14+
public JSProgressBarUI() {
15+
isContainer = true;
16+
setDoc();
17+
}
18+
19+
@Override
20+
protected DOMNode updateDOMNode() {
21+
if (domNode == null) {
22+
JRootPane root = jc.getRootPane();
23+
isContentPane = (root != null && jc == root.getContentPane());
24+
domNode = newDOMObject("div", id);
25+
if (root != null && root.getGlassPane() == c)
26+
DOMNode.setVisible(domNode, false);
27+
}
28+
return domNode;
29+
}
30+
31+
@Override
32+
protected Dimension setHTMLSize(DOMNode obj, boolean addCSS) {
33+
// SwingJS for now: just designated container width/height
34+
return new Dimension(c.getWidth(), c.getHeight());
35+
}
36+
37+
38+
@Override
39+
public void installUI(JComponent jc) {
40+
LookAndFeel.installColorsAndFont(jc,
41+
"Panel.background",
42+
"Panel.foreground",
43+
"Panel.font");
44+
}
45+
46+
@Override
47+
public void uninstallUI(JComponent jc) {
48+
// TODO Auto-generated method stub
49+
50+
}
51+
52+
@Override
53+
public Dimension getPreferredSize() {
54+
return null;
55+
}
56+
57+
58+
}

0 commit comments

Comments
 (0)