Skip to content

Commit b44fad9

Browse files
hansonrhansonr
authored andcommitted
table work
- fixed use of save/restore of ui nodes in tables - default background white - inadvertent resetting of table background via JPopupMenu
1 parent da5e964 commit b44fad9

13 files changed

Lines changed: 44 additions & 93 deletions

File tree

-272 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181217180014
1+
20181217223342
-272 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181217180014
1+
20181217223342
-272 Bytes
Binary file not shown.

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -847,9 +847,10 @@ public Component getInvoker() {
847847
public void setInvoker(Component invoker) {
848848
Component oldInvoker = this.invoker;
849849
this.invoker = invoker;
850-
if ((oldInvoker != this.invoker) && (ui != null)) {
851-
((JSComponentUI) ui).reinstallUI(this, (JComponent) invoker);
852-
}
850+
// SwingJS does not do this
851+
// if ((oldInvoker != this.invoker) && (ui != null)) {
852+
// ((JSComponentUI) ui).reinstallUI(this, (JComponent) invoker);
853+
// }
853854
invalidate();
854855
}
855856

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,16 +1018,7 @@ private static String layoutCompoundLabelImpl(
10181018
textR.width = fm.stringWidth(text);
10191019
textR.height = fm.getHeight();
10201020
} else {
1021-
1022-
System.out.println("laying out " + /** @j2sNative document.body.children.length ||*/null);
1023-
System.out.println("laying out " + /** @j2sNative ui.text ||*/null);
1024-
1025-
10261021
Dimension d = ui.getHTMLSize(ui.textNode);
1027-
System.out.println("laying out done " + /** @j2sNative document.body.children.length ||*/null);
1028-
System.out.println("laying out done " + /** @j2sNative ui.text ||*/null);
1029-
1030-
10311022
textR.width = d.width;
10321023
textR.height = d.height;
10331024
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static String getRowColumnID(JSComponentUI holder, int row, int col) {
1717
return holder.id + "_tab" + (row >= 0 ? "_row" + row : "") + "_col" + col;
1818
}
1919

20-
static DOMNode getCellOuterNode(JSComponentUI tableOrHeader, int row, int col) {
20+
static DOMNode createCellOuterNode(JSComponentUI tableOrHeader, int row, int col) {
2121
String rcID = getRowColumnID(tableOrHeader, row, col);
2222
DOMNode td = findCellNode(null, rcID, row, col);
2323
if (td == null) {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,8 +1589,7 @@ public Object createValue(UIDefaults table) {
15891589
// *** Table
15901590
"Table.font", dialogPlain12,
15911591
"Table.foreground", controlText, // cell text color
1592-
"Table.background",
1593-
window, // cell background color
1592+
"Table.background", white, // cell background color
15941593
"Table.selectionForeground", textHighlightText,
15951594
"Table.selectionBackground", textHighlight,
15961595
"Table.dropLineColor", controlShadow,

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

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -247,55 +247,6 @@ protected void restoreCellNodes(DOMNode td) {
247247
scrollNode = nodes[13];
248248
}
249249

250-
251-
//
252-
// protected void setCellNodes(DOMNode td) {
253-
// DOMNode[] nodes = new DOMNode[] {
254-
// domNode,
255-
// innerNode,
256-
// centeringNode,
257-
//
258-
// iconNode,
259-
// textNode,
260-
// buttonNode,
261-
// enableNode,
262-
//
263-
// (enableNodes == null ? null : enableNodes[0]),
264-
// (enableNodes == null ? null : enableNodes[1]),
265-
// (enableNodes == null ? null : enableNodes[2]),
266-
//
267-
// focusNode,
268-
// actionNode,
269-
// valueNode,
270-
// scrollNode,
271-
// };
272-
// DOMNode.setAttr(td, "data-nodes", nodes);
273-
// }
274-
//
275-
// protected void getCellNodes(DOMNode td) {
276-
// DOMNode[] nodes = (DOMNode[]) DOMNode.getAttr(td, "data-nodes");
277-
// domNode = nodes[0];
278-
// innerNode = nodes[1];
279-
// centeringNode = nodes[2];
280-
//
281-
// iconNode = nodes[3];
282-
// textNode = nodes[4];
283-
// buttonNode = nodes[5];
284-
// enableNode = nodes[6];
285-
//
286-
// if (nodes[7] != null) {
287-
// enableNodes[0] = nodes[7];
288-
// enableNodes[1] = nodes[8];
289-
// enableNodes[2] = nodes[9];
290-
// }
291-
//
292-
// focusNode = nodes[10];
293-
// actionNode = nodes[11];
294-
// valueNode = nodes[12];
295-
// scrollNode = nodes[13];
296-
// }
297-
//
298-
299250
/**
300251
* inner node for JButtonUI that needs to be cleared prior to calculating
301252
* preferred size

0 commit comments

Comments
 (0)