X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTRadioButton.java;h=94f1d19e1a0d507ca1931fe7abc873e58ef54fa1;hb=8582f35a3ffb8212463076217eb89278f42331d4;hp=23663bb2c84d6ec0894d36bd033a3b47037711e8;hpb=00d2622b0fff2411dc81ee2a0cc43a5f3f52564c;p=fanfix.git diff --git a/src/jexer/TRadioButton.java b/src/jexer/TRadioButton.java index 23663bb..94f1d19 100644 --- a/src/jexer/TRadioButton.java +++ b/src/jexer/TRadioButton.java @@ -1,4 +1,4 @@ -/** +/* * Jexer - Java Text User Interface * * License: LGPLv3 or later @@ -52,7 +52,7 @@ public final class TRadioButton extends TWidget { * @return if true then this is the one button in the group that is * selected */ - public boolean getSelected() { + public boolean isSelected() { return selected; } @@ -101,16 +101,12 @@ public final class TRadioButton extends TWidget { final String label, final int id) { // Set parent and window - super(parent); + super(parent, x, y, label.length() + 4, 1); - setX(x); - setY(y); - setHeight(1); this.label = label; - setWidth(label.length() + 4); this.id = id; - setHasCursor(true); + setCursorVisible(true); setCursorX(1); } @@ -137,7 +133,7 @@ public final class TRadioButton extends TWidget { public void draw() { CellAttributes radioButtonColor; - if (getAbsoluteActive()) { + if (isAbsoluteActive()) { radioButtonColor = getTheme().getColor("tradiobutton.active"); } else { radioButtonColor = getTheme().getColor("tradiobutton.inactive"); @@ -151,7 +147,7 @@ public final class TRadioButton extends TWidget { getScreen().putCharXY(1, 0, ' ', radioButtonColor); } getScreen().putCharXY(2, 0, ')', radioButtonColor); - getScreen().putStrXY(4, 0, label, radioButtonColor); + getScreen().putStringXY(4, 0, label, radioButtonColor); } /** @@ -161,7 +157,7 @@ public final class TRadioButton extends TWidget { */ @Override public void onMouseDown(final TMouseEvent mouse) { - if ((mouseOnRadioButton(mouse)) && (mouse.getMouse1())) { + if ((mouseOnRadioButton(mouse)) && (mouse.isMouse1())) { // Switch state selected = !selected; if (selected) {