Skip to content

Commit c6f23d2

Browse files
hansonrhansonr
authored andcommitted
mouse-up outside application
1 parent 62706dd commit c6f23d2

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

sources/net.sf.j2s.java.core/src/swingjs/plaf/JSScrollBarUI.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public Dimension getPreferredSize(JComponent jc) {
9393
// thin because we are implementing jquery slider here
9494
int wh = (myScrollPaneUI == null ? 15 : myScrollPaneUI.scrollBarUIDisabled ? 0 : 13);
9595
// just used for width or height, but not both. I think....
96+
System.out.println("JSSCrollbarUI dim " + wh + " " + myScrollPaneUI);
9697
return new Dimension(wh, wh);
9798
}
9899

sources/net.sf.j2s.java.core/src/swingjs/plaf/JSScrollPaneUI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ public Insets getInsets() {
575575
if (b == null)
576576
return null;
577577
Insets i = b.getBorderInsets(scrollpane);
578-
if (!layingOut) {
578+
if (false && !layingOut) {
579579
// AWT includes scrollbars in visibility, but the layout manager does not
580580
i.right += scrollpane.getVerticalScrollBar().isVisible() ? 12 : 0;
581581
i.bottom += scrollpane.getHorizontalScrollBar().isVisible() ? 12 : 0;

sources/net.sf.j2s.java.core/src/test/Test_Applet_Scroll.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,10 @@
3636
import javax.swing.JTextArea;
3737
import javax.swing.JTextField;
3838
import javax.swing.JToggleButton;
39-
import javax.swing.JViewport;
4039
import javax.swing.SwingConstants;
4140
import javax.swing.event.ChangeEvent;
4241
import javax.swing.event.ChangeListener;
43-
import javax.swing.plaf.ViewportUI;
4442

45-
@SuppressWarnings("serial")
4643
public class Test_Applet_Scroll extends JApplet implements ChangeListener, MouseListener, MouseMotionListener {
4744

4845
static {
@@ -58,9 +55,9 @@ public class Test_Applet_Scroll extends JApplet implements ChangeListener, Mouse
5855

5956
boolean preferred = true;
6057

61-
private JScrollBar hsb;
62-
63-
private JScrollBar sbar;
58+
// private JScrollBar hsb;
59+
//
60+
// private JScrollBar sbar;
6461

6562
private JPanel panel2;
6663

@@ -202,7 +199,7 @@ public void actionPerformed(ActionEvent event) {
202199
sp.getViewport().add(p);
203200
getContentPane().add(sp);
204201
sp.getViewport().addChangeListener(this);
205-
hsb = sp.getHorizontalScrollBar();
202+
// hsb = sp.getHorizontalScrollBar();
206203

207204
sp.getViewport().setBackground(Color.blue);
208205
p.setOpaque(false);
@@ -249,7 +246,7 @@ public void mouseWheelMoved(MouseWheelEvent e) {
249246
bar.setForeground(Color.green);
250247
bar.setOpaque(true);
251248
p.add(bar);
252-
sbar = bar;
249+
// sbar = bar;
253250
bar.setVisibleAmount(80);
254251
return bar;
255252
}

sources/net.sf.j2s.java.core/src/test/Test_Applet_Scroll_AWT.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
import java.awt.event.MouseWheelListener;
3636
import java.text.DecimalFormat;
3737

38-
import javax.swing.JTextArea;
39-
4038
/**
4139
* Creates a ScrollPane with a mix of SwingJS and AWT components.
4240
*
@@ -304,13 +302,13 @@ public void mouseMoved(MouseEvent e) {
304302
// p.setLayout(new GridLayout(2, 2, 2, 2));
305303
ScrollPane sp = new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS);
306304
sp.add(p);
307-
sp.setBackground(Color.yellow);
305+
308306

309307
sp.setSize(500, 250);
310308

311-
Dimension d = sp.getPreferredSize();
312309
add(sp);
313310

311+
setBackground(Color.yellow);
314312
mysp = sp;
315313

316314
mkSlider(p, tf, Adjustable.VERTICAL, 20, 200);

sources/net.sf.j2s.java.core/srcjs/js/j2sApplet.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ console.log("J2S._getRawDataFromServer " + J2S._serverUrl + " for " + query);
975975
case "java.io.File":
976976
var f = Clazz.new_(Clazz.load("java.io.File").c$$S,
977977
[ file.name ]);
978-
f.?bytes = J2S._toBytes(data);
978+
f.秘bytes = J2S._toBytes(data);
979979
return fDone(f);
980980
case "ArrayBuffer":
981981
break;
@@ -2908,7 +2908,8 @@ if (ev.keyCode == 9 && ev.target["data-focuscomponent"]) {
29082908
}, 502);
29092909
return false;
29102910
} else {
2911-
setTimeout(function(){document.body.dispatchEvent(ev.ev0.originalEvent)},50)
2911+
// if (ev.ev0)
2912+
// setTimeout(function(){document.body.dispatchEvent(ev.ev0.originalEvent)},50)
29122913
}
29132914
};
29142915

0 commit comments

Comments
 (0)