File tree Expand file tree Collapse file tree 3 files changed +11
-10
lines changed
sources/net.sf.j2s.java.core/src Expand file tree Collapse file tree 3 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,7 @@ private PaintHeavyweightComponentsCallback() {}
121121 @ Override
122122 public void run (Component comp , Graphics cg ) {
123123 if (comp .isLightweight ()) {
124+ // never true in SwingJS
124125// if (comp.peer instanceof LightweightPeer) {
125126 comp .paintHeavyweightComponents (cg );
126127 } else {
Original file line number Diff line number Diff line change @@ -1153,6 +1153,11 @@ public Rectangle getViewRect() {
11531153 * @param blitPaint the area to blit
11541154 * @return true if the parameters are modified and we're ready to blit;
11551155 * false otherwise
1156+ *
1157+ * SwingJS cannot blit, as there is only one canvas for the entire JFrame or JApplet.
1158+ *
1159+ * @j2sNative
1160+ * return false;
11561161 */
11571162 protected boolean computeBlit (
11581163 int dx ,
@@ -1162,6 +1167,7 @@ protected boolean computeBlit(
11621167 Dimension blitSize ,
11631168 Rectangle blitPaint )
11641169 {
1170+
11651171 int dxAbs = Math .abs (dx );
11661172 int dyAbs = Math .abs (dy );
11671173 Dimension extentSize = getExtentSize ();
Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ public class JSSliderUI extends JSLightweightUI implements PropertyChangeListene
2727
2828 static {
2929 Object jqueryui = JQueryUI .class ; // loads jQuery.ui
30+ // this static call allows for the CSS to be loaded only once and only when needed
31+ JSUtil .loadStaticResource ("swingjs/jquery/jquery-ui-j2sslider.css" );
32+ JSUtil .loadStaticResource ("swingjs/jquery/jquery-ui-j2sslider.js" );
3033 }
3134
3235 JSlider jSlider ;
@@ -55,16 +58,7 @@ public class JSSliderUI extends JSLightweightUI implements PropertyChangeListene
5558 private boolean isVerticalScrollBar ;
5659 private boolean isInverted ;
5760
58- private static boolean cssLoaded = false ;
59-
60- public JSSliderUI () {
61-
62- if (!cssLoaded ) {
63- // this static call allows for the CSS to be loaded only once and only when needed
64- JSUtil .loadStaticResource ("swingjs/jquery/jquery-ui-j2sslider.css" );
65- JSUtil .loadStaticResource ("swingjs/jquery/jquery-ui-j2sslider.js" );
66- cssLoaded = true ;
67- }
61+ public JSSliderUI () {
6862 needPreferred = true ;
6963 setDoc ();
7064 }
You can’t perform that action at this time.
0 commit comments