Skip to content

Commit 3aa4a3b

Browse files
committed
JTree working, JEditorPane fix for HTML text, ScrollPaneLayout fixed for
miscalculation of border
1 parent 914d7a1 commit 3aa4a3b

File tree

13 files changed

+173
-39
lines changed

13 files changed

+173
-39
lines changed
361 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200205213103
1+
20200206154055
361 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20200205213103
1+
20200206154055
361 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/src/javax/swing/JEditorPane.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ public void setPage(URL page) throws IOException {
476476
// Either we do not have POST data, or should submit the data
477477
// synchronously.
478478
InputStream in = getStream(page);
479-
if (kit != null) {
479+
if (getEditorKit() != null) { // BH SwingJS was just kit != null, but then initial page in TreeDemo does not load
480480
Document doc = initializeModel(kit, page);
481481

482482
// At this point, one could either load up the model with no

sources/net.sf.j2s.java.core/src/javax/swing/ScrollPaneLayout.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,9 @@ public Dimension preferredLayoutSize(Container parent)
476476
vsbPolicy = scrollPane.getVerticalScrollBarPolicy();
477477
hsbPolicy = scrollPane.getHorizontalScrollBarPolicy();
478478

479-
Insets insets = parent.getInsets();
479+
// BH -- this was a problem when the scrollpane was in a split pane in SetXMLControlElement test OSP
480+
Insets insets = new Insets(0,0,0,0);//
481+
// parent.getInsets(); because these are interior?
480482
int prefWidth = insets.left + insets.right;
481483
int prefHeight = insets.top + insets.bottom;
482484

sources/net.sf.j2s.java.core/src/javax/swing/tree/DefaultTreeCellEditor.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -738,11 +738,11 @@ public void paint(Graphics g) {
738738
}
739739

740740
// Border selection color
741-
Color background = getBorderSelectionColor();
742-
if(background != null) {
743-
g.setColor(background);
744-
g.drawRect(0, 0, width - 1, height - 1);
745-
}
741+
// Color background = getBorderSelectionColor();
742+
// if(background != null) {
743+
// g.setColor(background);
744+
// g.drawRect(0, 0, width - 1, height - 1);
745+
// }
746746
super.paint(g);
747747
}
748748

sources/net.sf.j2s.java.core/src/javax/swing/tree/DefaultTreeCellRenderer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,9 @@ else if (imageOffset == -1) {
512512
}
513513

514514
private void paintFocus(Graphics g, int x, int y, int w, int h, Color notColor) {
515+
516+
if (true)
517+
return;
515518
Color bsColor = getBorderSelectionColor();
516519

517520
if (bsColor != null && (selected || !drawDashedFocusIndicator)) {

sources/net.sf.j2s.java.core/src/swingjs/api/js/JQueryObject.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ public interface J2SCB extends JQueryObject {
100100

101101

102102
}
103+
104+
public static DOMNode getDOMNode(JQueryObject jnode) {
105+
return (jnode == null ? null : ((DOMNode[]) (Object) jnode)[0]);
106+
}
103107

104108

105109
}

0 commit comments

Comments
 (0)