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 @@
20190703083607
20190703091927
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 @@
20190703083607
20190703091927
6 changes: 4 additions & 2 deletions sources/net.sf.j2s.java.core/TODO.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
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
2019.07.01 working on JTable key navigation events


2019.07.03 DONE: bypass ButtonListener.verifyButtonClick delay if "checked" is set programmatically
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 @@ -243,7 +243,7 @@ void updateMnemonicBinding(AbstractButton b) {
@Override
public void stateChanged(ChangeEvent e) {
AbstractButton b = (AbstractButton) e.getSource();
verifyButtonClick(b);
verifyButtonClick(b, false);
}

@Override
Expand Down Expand Up @@ -290,7 +290,7 @@ public void mouseReleased(MouseEvent e) {
if (checkHideMenus(b))
return;
b.doClick(0);
verifyButtonClick(b);
verifyButtonClick(b, true);
}
}

Expand Down Expand Up @@ -337,16 +337,18 @@ public void mouseExited(MouseEvent e) {
*
* @return true
*/
boolean verifyButtonClick(AbstractButton b) {
boolean verifyButtonClick(AbstractButton b, boolean delayed) {
ButtonModel m = b.getModel();
DOMNode btn = ui.actionNode;
if (btn == null)
return true;
boolean state = m.isSelected();
/**
* @j2sNative
*
* setTimeout(function(){
* btn && btn.checked != state && (btn.checked = state);
* }, 0);
* if (delayed) { setTimeout(function(){ btn && btn.checked != state
* && (btn.checked = state); }, 0); } else { btn.checked = state; }
*
*/
{
System.out.println("" + btn + state);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ 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 : 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