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
/
menu
/
TSubMenu.java
diff --git
a/src/jexer/menu/TSubMenu.java
b/src/jexer/menu/TSubMenu.java
index c37bf3a1fcca4975185d083740189ad2708b9d9d..1f1b11971a550a20a1d08a2b838e7258e2441db3 100644
(file)
--- a/
src/jexer/menu/TSubMenu.java
+++ b/
src/jexer/menu/TSubMenu.java
@@
-40,7
+40,7
@@
import static jexer.TKeypress.*;
/**
* TSubMenu is a special case menu item that wraps another TMenu.
*/
/**
* TSubMenu is a special case menu item that wraps another TMenu.
*/
-public class TSubMenu extends TMenuItem {
+public
final
class TSubMenu extends TMenuItem {
/**
* The menu window. Note package private access.
/**
* The menu window. Note package private access.
@@
-76,19
+76,14
@@
public class TSubMenu extends TMenuItem {
public void draw() {
super.draw();
public void draw() {
super.draw();
- CellAttributes background = getTheme().getColor("tmenu");
CellAttributes menuColor;
CellAttributes menuColor;
- CellAttributes menuMnemonicColor;
- if (getAbsoluteActive()) {
+ if (isAbsoluteActive()) {
menuColor = getTheme().getColor("tmenu.highlighted");
menuColor = getTheme().getColor("tmenu.highlighted");
- menuMnemonicColor = getTheme().getColor("tmenu.mnemonic.highlighted");
} else {
} else {
- if (
get
Enabled()) {
+ if (
is
Enabled()) {
menuColor = getTheme().getColor("tmenu");
menuColor = getTheme().getColor("tmenu");
- menuMnemonicColor = getTheme().getColor("tmenu.mnemonic");
} else {
menuColor = getTheme().getColor("tmenu.disabled");
} else {
menuColor = getTheme().getColor("tmenu.disabled");
- menuMnemonicColor = getTheme().getColor("tmenu.disabled");
}
}
}
}
@@
-105,7
+100,7
@@
public class TSubMenu extends TMenuItem {
@Override
public void onKeypress(final TKeypressEvent keypress) {
@Override
public void onKeypress(final TKeypressEvent keypress) {
- if (menu.
get
Active()) {
+ if (menu.
is
Active()) {
menu.onKeypress(keypress);
return;
}
menu.onKeypress(keypress);
return;
}
@@
-151,9
+146,9
@@
public class TSubMenu extends TMenuItem {
*/
@Override
public void dispatch() {
*/
@Override
public void dispatch() {
- assert (
get
Enabled());
- if (
get
AbsoluteActive()) {
- if (!menu.
get
Active()) {
+ assert (
is
Enabled());
+ if (
is
AbsoluteActive()) {
+ if (!menu.
is
Active()) {
getApplication().addSubMenu(menu);
menu.setActive(true);
}
getApplication().addSubMenu(menu);
menu.setActive(true);
}
@@
-167,7
+162,7
@@
public class TSubMenu extends TMenuItem {
*/
@Override
public TWidget getActiveChild() {
*/
@Override
public TWidget getActiveChild() {
- if (menu.
get
Active()) {
+ if (menu.
is
Active()) {
return menu;
}
// Menu not active, return me
return menu;
}
// Menu not active, return me
@@
-182,7
+177,7
@@
public class TSubMenu extends TMenuItem {
* @param key global keyboard accelerator
* @return the new menu item
*/
* @param key global keyboard accelerator
* @return the new menu item
*/
- public
final
TMenuItem addItem(final int id, final String label,
+ public TMenuItem addItem(final int id, final String label,
final TKeypress key) {
return menu.addItem(id, label, key);
final TKeypress key) {
return menu.addItem(id, label, key);
@@
-195,7
+190,7
@@
public class TSubMenu extends TMenuItem {
* @param label menu item label
* @return the new menu item
*/
* @param label menu item label
* @return the new menu item
*/
- public
final
TMenuItem addItem(final int id, final String label) {
+ public TMenuItem addItem(final int id, final String label) {
return menu.addItem(id, label);
}
return menu.addItem(id, label);
}
@@
-206,14
+201,14
@@
public class TSubMenu extends TMenuItem {
* (inclusive).
* @return the new menu item
*/
* (inclusive).
* @return the new menu item
*/
- public
final
TMenuItem addDefaultItem(final int id) {
+ public TMenuItem addDefaultItem(final int id) {
return menu.addDefaultItem(id);
}
/**
* Convenience function to add a menu separator.
*/
return menu.addDefaultItem(id);
}
/**
* Convenience function to add a menu separator.
*/
- public
final
void addSeparator() {
+ public void addSeparator() {
menu.addSeparator();
}
menu.addSeparator();
}
@@
-224,7
+219,7
@@
public class TSubMenu extends TMenuItem {
* denoted by prefixing a letter with "&", e.g. "&File"
* @return the new sub-menu
*/
* denoted by prefixing a letter with "&", e.g. "&File"
* @return the new sub-menu
*/
- public
final
TSubMenu addSubMenu(final String title) {
+ public TSubMenu addSubMenu(final String title) {
return menu.addSubMenu(title);
}
return menu.addSubMenu(title);
}