X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjexer%2FTButton.java;h=c05a4b1025be40ec9bf7e76c858a9c0bba404c78;hb=daa4106c096cd4d2b92c3cbae6491edccd25fcc4;hp=24ee94c1abb9c0ff942ddeb90ef1a2c232cc356c;hpb=30d336cc33e26af877f7950b93f3b77d9c3a3bd3;p=fanfix.git diff --git a/src/jexer/TButton.java b/src/jexer/TButton.java index 24ee94c..c05a4b1 100644 --- a/src/jexer/TButton.java +++ b/src/jexer/TButton.java @@ -1,4 +1,4 @@ -/** +/* * Jexer - Java Text User Interface * * License: LGPLv3 or later @@ -51,6 +51,15 @@ public final class TButton extends TWidget { */ private MnemonicString mnemonic; + /** + * Get the mnemonic string for this button. + * + * @return mnemonic string + */ + public final MnemonicString getMnemonic() { + return mnemonic; + } + /** * Remember mouse state. */ @@ -136,10 +145,10 @@ public final class TButton extends TWidget { shadowColor.setForeColor(Color.BLACK); shadowColor.setBold(false); - if (!getEnabled()) { + if (!isEnabled()) { buttonColor = getTheme().getColor("tbutton.disabled"); menuMnemonicColor = getTheme().getColor("tbutton.disabled"); - } else if (getAbsoluteActive()) { + } else if (isAbsoluteActive()) { buttonColor = getTheme().getColor("tbutton.active"); menuMnemonicColor = getTheme().getColor("tbutton.mnemonic.highlighted"); } else { @@ -149,11 +158,11 @@ public final class TButton extends TWidget { if (inButtonPress) { getScreen().putCharXY(1, 0, ' ', buttonColor); - getScreen().putStrXY(2, 0, mnemonic.getRawLabel(), buttonColor); + getScreen().putStringXY(2, 0, mnemonic.getRawLabel(), buttonColor); getScreen().putCharXY(getWidth() - 1, 0, ' ', buttonColor); } else { getScreen().putCharXY(0, 0, ' ', buttonColor); - getScreen().putStrXY(1, 0, mnemonic.getRawLabel(), buttonColor); + getScreen().putStringXY(1, 0, mnemonic.getRawLabel(), buttonColor); getScreen().putCharXY(getWidth() - 2, 0, ' ', buttonColor); getScreen().putCharXY(getWidth() - 1, 0, @@ -182,7 +191,7 @@ public final class TButton extends TWidget { public void onMouseDown(final TMouseEvent mouse) { this.mouse = mouse; - if ((mouseOnButton()) && (mouse.getMouse1())) { + if ((mouseOnButton()) && (mouse.isMouse1())) { // Begin button press inButtonPress = true; } @@ -197,7 +206,7 @@ public final class TButton extends TWidget { public void onMouseUp(final TMouseEvent mouse) { this.mouse = mouse; - if (inButtonPress && mouse.getMouse1()) { + if (inButtonPress && mouse.isMouse1()) { inButtonPress = false; // Dispatch the event if (action != null) {