Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified sources/net.sf.j2s.core/dist/swingjs/SwingJS-site.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion sources/net.sf.j2s.core/dist/swingjs/timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20190702213116
20190703083607
Binary file modified sources/net.sf.j2s.core/dist/swingjs/ver/3.2.4/SwingJS-site.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion sources/net.sf.j2s.core/dist/swingjs/ver/3.2.4/timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20190702213116
20190703083607
1 change: 1 addition & 0 deletions sources/net.sf.j2s.java.core/TODO.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
2019.07.03 bypass ButtonListener.verifyButtonClick if "checked" is set programmatically
2019.07.01 working on JSEditorPaneUI tab business
2019.07.01 AppContext.getApplet(name) initial work
2019.07.01 working on JTable key navigation events
Binary file modified sources/net.sf.j2s.java.core/dist/SwingJS-site.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,9 @@ public void mouseExited(MouseEvent e) {
}

/**
* Just ensure the button is in sync by forcing the HTML5 DOM button to the same
* setting as Java.
* It is necessary that this method be called any time the "CHECKED" attribute
* of a toggle button is changed. Otherwise it may fire for a previous state
* after the state is changed in code directly.
*
* @param m
*
Expand All @@ -339,12 +340,13 @@ public void mouseExited(MouseEvent e) {
boolean verifyButtonClick(AbstractButton b) {
ButtonModel m = b.getModel();
DOMNode btn = ui.actionNode;
// BH: I don't know that this is necessary anymore
boolean state = m.isSelected();// && !ui.isRadio;
boolean state = m.isSelected();
/**
* @j2sNative
*
* setTimeout(function(){btn && (btn.checked = state)}, 0);
* setTimeout(function(){
* btn && btn.checked != state && (btn.checked = state);
* }, 0);
*/
{
System.out.println("" + btn + state);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,7 @@ protected DOMNode setCssFont(DOMNode obj, Font font) {
"font-weight", ((istyle & Font.BOLD) == 0 ? "normal" : "bold"));
}

// force the issue
enabled = !c.isEnabled();
setEnabled(c.isEnabled());
return obj;
Expand Down Expand Up @@ -2110,7 +2111,7 @@ protected void enableNode(DOMNode node, boolean b) {
if (node == null)
return;

DOMNode.setAttr(node, "disabled", (b ? null : TRUE));
DOMNode.setAttr(node, "disabled", (b ? FALSE : TRUE));
if (!b && inactiveForeground == colorUNKNOWN)
getDisabledColors(buttonNode == null ? getPropertyPrefix() : "Button");
if (jc.isOpaque()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ public boolean handleJSEvent(Object target, int eventType, Object jQueryEvent) {

protected void setupButton(JToggleButton b, boolean doAll) {
// actionNode, iconNode, textNode, centeringNode, buttonNode

DOMNode.setAttr(actionNode, "checked", b.isSelected() ? TRUE : null);

DOMNode.setAttr(actionNode, "checked", b.isSelected() ? TRUE : FALSE);
buttonListener.verifyButtonClick(b); // necessary!
setCssFont(textNode, c.getFont());
// TODO: not allowing radio/checkbox icons (custom buttons)
setIconAndText("radio", (ImageIcon) null/* button.getIcon() */, button.getIconTextGap(), button.getText());
Expand Down
4 changes: 2 additions & 2 deletions sources/net.sf.j2s.java.core/src/swingjs/plaf/JSTextUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public abstract class JSTextUI extends JSLightweightUI {// implements {ViewFacto
protected static final EditorKit defaultKit = new DefaultEditorKit();

static final Point markDot = new Point();

transient JTextComponent editor;
protected boolean editable = true;
protected RootView rootView = new RootView();
Expand Down Expand Up @@ -293,7 +293,7 @@ protected void setColors(String prefix) {
if ((dfg == null) || (dfg instanceof UIResource)) {
editor.setDisabledTextColor(UIManager.getColor(prefix + ".inactiveForeground"));
}
dfg = UIManager.getColor(prefix + ".inactiveBackground");
dfg = UIManager.getColor(editor.秘isAWT() ? "control" : prefix + ".inactiveBackground");
if (dfg != null)
inactiveBackground = dfg;

Expand Down