git://git.nikiroo.be
/
fanfix.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactoring - boolean getters and miscellaneous
[fanfix.git]
/
src
/
jexer
/
TWidget.java
diff --git
a/src/jexer/TWidget.java
b/src/jexer/TWidget.java
index 6cb0f98b1fe4c6634334c13f081a07fbd78a7e0e..7ea1a427cbb78227e40c9b4935139631a66b3919 100644
(file)
--- a/
src/jexer/TWidget.java
+++ b/
src/jexer/TWidget.java
@@
-133,7
+133,7
@@
public abstract class TWidget implements Comparable<TWidget> {
*
* @return if true, this widget will receive events
*/
*
* @return if true, this widget will receive events
*/
- public final boolean
get
Active() {
+ public final boolean
is
Active() {
return active;
}
return active;
}
@@
-267,7
+267,7
@@
public abstract class TWidget implements Comparable<TWidget> {
*
* @return if true, this widget can be tabbed to or receive events
*/
*
* @return if true, this widget can be tabbed to or receive events
*/
- public final boolean
get
Enabled() {
+ public final boolean
is
Enabled() {
return enabled;
}
return enabled;
}
@@
-303,15
+303,15
@@
public abstract class TWidget implements Comparable<TWidget> {
/**
* If true, this widget has a cursor.
*/
/**
* If true, this widget has a cursor.
*/
- private boolean
hasCursor
= false;
+ private boolean
cursorVisible
= false;
/**
* Set visible cursor flag.
*
/**
* Set visible cursor flag.
*
- * @param
hasCursor
if true, this widget has a cursor
+ * @param
cursorVisible
if true, this widget has a cursor
*/
*/
- public final void set
HasCursor(final boolean hasCursor
) {
- this.
hasCursor = hasCursor
;
+ public final void set
CursorVisible(final boolean cursorVisible
) {
+ this.
cursorVisible = cursorVisible
;
}
/**
}
/**
@@
-319,8
+319,8
@@
public abstract class TWidget implements Comparable<TWidget> {
*
* @return if true, this widget has a visible cursor
*/
*
* @return if true, this widget has a visible cursor
*/
- public final boolean
visibleCursor
() {
- return
hasCursor
;
+ public final boolean
isCursorVisible
() {
+ return
cursorVisible
;
}
/**
}
/**
@@
-392,11
+392,11
@@
public abstract class TWidget implements Comparable<TWidget> {
* @return true if this widget is active and all of its parents are
* active.
*/
* @return true if this widget is active and all of its parents are
* active.
*/
- public final boolean
get
AbsoluteActive() {
+ public final boolean
is
AbsoluteActive() {
if (parent == this) {
return active;
}
if (parent == this) {
return active;
}
- return (active && parent.
get
AbsoluteActive());
+ return (active && parent.
is
AbsoluteActive());
}
/**
}
/**
@@
-405,7
+405,7
@@
public abstract class TWidget implements Comparable<TWidget> {
* @return absolute screen column number for the cursor's X position
*/
public final int getCursorAbsoluteX() {
* @return absolute screen column number for the cursor's X position
*/
public final int getCursorAbsoluteX() {
- assert (
hasCursor
);
+ assert (
cursorVisible
);
return getAbsoluteX() + cursorX;
}
return getAbsoluteX() + cursorX;
}
@@
-415,7
+415,7
@@
public abstract class TWidget implements Comparable<TWidget> {
* @return absolute screen row number for the cursor's Y position
*/
public final int getCursorAbsoluteY() {
* @return absolute screen row number for the cursor's Y position
*/
public final int getCursorAbsoluteY() {
- assert (
hasCursor
);
+ assert (
cursorVisible
);
return getAbsoluteY() + cursorY;
}
return getAbsoluteY() + cursorY;
}
@@
-781,12
+781,12
@@
public abstract class TWidget implements Comparable<TWidget> {
for (TWidget widget: children) {
if (widget instanceof TButton) {
TButton button = (TButton) widget;
for (TWidget widget: children) {
if (widget instanceof TButton) {
TButton button = (TButton) widget;
- if (button.
get
Enabled()
- && !keypress.getKey().
getIs
Key()
- && keypress.getKey().
get
Alt()
- && !keypress.getKey().
get
Ctrl()
+ if (button.
is
Enabled()
+ && !keypress.getKey().
isFn
Key()
+ && keypress.getKey().
is
Alt()
+ && !keypress.getKey().
is
Ctrl()
&& (Character.toLowerCase(button.getMnemonic().getShortcut())
&& (Character.toLowerCase(button.getMnemonic().getShortcut())
- == Character.toLowerCase(keypress.getKey().getCh()))
+ == Character.toLowerCase(keypress.getKey().getCh
ar
()))
) {
widget.handleEvent(new TKeypressEvent(kbEnter));
) {
widget.handleEvent(new TKeypressEvent(kbEnter));