git://git.nikiroo.be
/
fanfix.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
30d336c
)
misc cleanup
author
Kevin Lamonte
<kevin.lamonte@gmail.com>
Sat, 14 Mar 2015 17:40:52 +0000
(13:40 -0400)
committer
Kevin Lamonte
<kevin.lamonte@gmail.com>
Sat, 14 Mar 2015 17:40:52 +0000
(13:40 -0400)
src/jexer/THScroller.java
patch
|
blob
|
blame
|
history
src/jexer/TVScroller.java
patch
|
blob
|
blame
|
history
src/jexer/TWidget.java
patch
|
blob
|
blame
|
history
src/jexer/TWindow.java
patch
|
blob
|
blame
|
history
src/jexer/backend/ECMA48Backend.java
patch
|
blob
|
blame
|
history
src/jexer/bits/Cell.java
patch
|
blob
|
blame
|
history
src/jexer/io/ECMA48Screen.java
patch
|
blob
|
blame
|
history
src/jexer/io/ECMA48Terminal.java
patch
|
blob
|
blame
|
history
src/jexer/menu/TMenuSeparator.java
patch
|
blob
|
blame
|
history
src/jexer/menu/TSubMenu.java
patch
|
blob
|
blame
|
history
diff --git
a/src/jexer/THScroller.java
b/src/jexer/THScroller.java
index b705fe22c86683081163a28ec9e1fd99194ef375..62f6075a5de202a400ab045df125b0df97113d30 100644
(file)
--- a/
src/jexer/THScroller.java
+++ b/
src/jexer/THScroller.java
@@
-33,6
+33,6
@@
package jexer;
/**
* THScroller implements a simple horizontal scroll bar.
*/
/**
* THScroller implements a simple horizontal scroll bar.
*/
-public class THScroller extends TWidget {
+public
final
class THScroller extends TWidget {
}
}
diff --git
a/src/jexer/TVScroller.java
b/src/jexer/TVScroller.java
index 50a08a12dc4a020f74a93c8e08b84ce0a358dbf5..a0a591540fe4bcb68d66cd0857a0b84fdb36380f 100644
(file)
--- a/
src/jexer/TVScroller.java
+++ b/
src/jexer/TVScroller.java
@@
-33,6
+33,6
@@
package jexer;
/**
* TVScroller implements a simple vertical scroll bar.
*/
/**
* TVScroller implements a simple vertical scroll bar.
*/
-public class TVScroller extends TWidget {
+public
final
class TVScroller extends TWidget {
}
}
diff --git
a/src/jexer/TWidget.java
b/src/jexer/TWidget.java
index 17f7849631f5bd087f536cf48f4068bf211447b7..2ca7108146c0090809d543b91233da31adda130b 100644
(file)
--- a/
src/jexer/TWidget.java
+++ b/
src/jexer/TWidget.java
@@
-48,7
+48,7
@@
import static jexer.TKeypress.*;
* TWidget is the base class of all objects that can be drawn on screen or
* handle user input events.
*/
* TWidget is the base class of all objects that can be drawn on screen or
* handle user input events.
*/
-public abstract class TWidget {
+public abstract class TWidget
implements Comparable<TWidget>
{
/**
* Every widget has a parent widget that it may be "contained" in. For
/**
* Every widget has a parent widget that it may be "contained" in. For
@@
-332,12
+332,19
@@
public abstract class TWidget {
private int cursorY = 0;
/**
private int cursorY = 0;
/**
- * Comparison operator sorts on tabOrder.
+ * Comparison operator sorts on tabOrder
for TWidgets and z for TWindows
.
*
*
- * @param that another TWidget instance
- * @return difference between this.tabOrder and that.tabOrder
+ * @param that another TWidget or TWindow instance
+ * @return difference between this.tabOrder and that.tabOrder, or
+ * difference between this.z and that.z
*/
*/
- public final int compare(final TWidget that) {
+ @Override
+ public final int compareTo(final TWidget that) {
+ if ((this instanceof TWindow)
+ && (that instanceof TWindow)
+ ) {
+ return (((TWindow) this).getZ() - ((TWindow) that).getZ());
+ }
return (this.tabOrder - that.tabOrder);
}
return (this.tabOrder - that.tabOrder);
}
diff --git
a/src/jexer/TWindow.java
b/src/jexer/TWindow.java
index d57b844d7d4408c4c14c70e4076914782bc90f4a..e15092e5c07c29894be0cfa08e182914765689c4 100644
(file)
--- a/
src/jexer/TWindow.java
+++ b/
src/jexer/TWindow.java
@@
-46,7
+46,7
@@
import static jexer.TKeypress.*;
/**
* TWindow is the top-level container and drawing surface for other widgets.
*/
/**
* TWindow is the top-level container and drawing surface for other widgets.
*/
-public class TWindow extends TWidget
implements Comparable<TWindow>
{
+public class TWindow extends TWidget {
/**
* Window's parent TApplication.
/**
* Window's parent TApplication.
@@
-305,17
+305,6
@@
public class TWindow extends TWidget implements Comparable<TWindow> {
return true;
}
return true;
}
- /**
- * Comparison operator sorts on z.
- *
- * @param that another TWindow instance
- * @return difference between this.z and that.z
- */
- @Override
- public final int compareTo(final TWindow that) {
- return (this.z - that.z);
- }
-
/**
* Returns true if the mouse is currently on the close button.
*
/**
* Returns true if the mouse is currently on the close button.
*
diff --git
a/src/jexer/backend/ECMA48Backend.java
b/src/jexer/backend/ECMA48Backend.java
index a6ae361c791d975c152587aaaebbf62a11e85d14..99c0200325354308dfb2f78c72f73313990a3c6a 100644
(file)
--- a/
src/jexer/backend/ECMA48Backend.java
+++ b/
src/jexer/backend/ECMA48Backend.java
@@
-43,7
+43,7
@@
import jexer.io.ECMA48Terminal;
* This class uses an xterm/ANSI X3.64/ECMA-48 type terminal to provide a
* screen, keyboard, and mouse to TApplication.
*/
* This class uses an xterm/ANSI X3.64/ECMA-48 type terminal to provide a
* screen, keyboard, and mouse to TApplication.
*/
-public class ECMA48Backend extends Backend {
+public
final
class ECMA48Backend extends Backend {
/**
* Input events are processed by this Terminal.
/**
* Input events are processed by this Terminal.
@@
-84,7
+84,7
@@
public class ECMA48Backend extends Backend {
* Sync the logical screen to the physical device.
*/
@Override
* Sync the logical screen to the physical device.
*/
@Override
- public
final
void flushScreen() {
+ public void flushScreen() {
screen.flushPhysical();
}
screen.flushPhysical();
}
@@
-130,7
+130,7
@@
public class ECMA48Backend extends Backend {
* Close the I/O, restore the console, etc.
*/
@Override
* Close the I/O, restore the console, etc.
*/
@Override
- public
final
void shutdown() {
+ public void shutdown() {
terminal.shutdown();
}
terminal.shutdown();
}
diff --git
a/src/jexer/bits/Cell.java
b/src/jexer/bits/Cell.java
index f110d3362e6c61b3fe67ff94802d66afc57043c5..3c0eb14a04a4c0969b4a778b6d54050379a2c89d 100644
(file)
--- a/
src/jexer/bits/Cell.java
+++ b/
src/jexer/bits/Cell.java
@@
-33,7
+33,7
@@
package jexer.bits;
/**
* This class represents a single text cell on the screen.
*/
/**
* This class represents a single text cell on the screen.
*/
-public class Cell extends CellAttributes {
+public
final
class Cell extends CellAttributes {
/**
* The character at this cell.
/**
* The character at this cell.
@@
-45,7
+45,7
@@
public class Cell extends CellAttributes {
*
* @return cell character
*/
*
* @return cell character
*/
- public
final
char getChar() {
+ public char getChar() {
return ch;
}
return ch;
}
@@
-54,7
+54,7
@@
public class Cell extends CellAttributes {
*
* @param ch new cell character
*/
*
* @param ch new cell character
*/
- public
final
void setChar(final char ch) {
+ public void setChar(final char ch) {
this.ch = ch;
}
this.ch = ch;
}
@@
-62,7
+62,7
@@
public class Cell extends CellAttributes {
* Reset this cell to a blank.
*/
@Override
* Reset this cell to a blank.
*/
@Override
- public
final
void reset() {
+ public void reset() {
super.reset();
ch = ' ';
}
super.reset();
ch = ' ';
}
@@
-74,7
+74,7
@@
public class Cell extends CellAttributes {
*
* @return true if this cell has default attributes.
*/
*
* @return true if this cell has default attributes.
*/
- public
final
boolean isBlank() {
+ public boolean isBlank() {
if ((getForeColor().equals(Color.WHITE))
&& (getBackColor().equals(Color.BLACK))
&& !getBold()
if ((getForeColor().equals(Color.WHITE))
&& (getBackColor().equals(Color.BLACK))
&& !getBold()
@@
-97,7
+97,7
@@
public class Cell extends CellAttributes {
* @return true if all fields are equal
*/
@Override
* @return true if all fields are equal
*/
@Override
- public
final
boolean equals(final Object rhs) {
+ public boolean equals(final Object rhs) {
if (!(rhs instanceof Cell)) {
return false;
}
if (!(rhs instanceof Cell)) {
return false;
}
@@
-113,7
+113,7
@@
public class Cell extends CellAttributes {
* @param rhs an instance of either Cell or CellAttributes
*/
@Override
* @param rhs an instance of either Cell or CellAttributes
*/
@Override
- public
final
void setTo(final Object rhs) {
+ public void setTo(final Object rhs) {
// Let this throw a ClassCastException
CellAttributes thatAttr = (CellAttributes) rhs;
super.setTo(thatAttr);
// Let this throw a ClassCastException
CellAttributes thatAttr = (CellAttributes) rhs;
super.setTo(thatAttr);
@@
-129,7
+129,7
@@
public class Cell extends CellAttributes {
*
* @param that a CellAttributes instance
*/
*
* @param that a CellAttributes instance
*/
- public
final
void setAttr(final CellAttributes that) {
+ public void setAttr(final CellAttributes that) {
super.setTo(that);
}
super.setTo(that);
}
@@
-161,7
+161,7
@@
public class Cell extends CellAttributes {
* @return displayable String
*/
@Override
* @return displayable String
*/
@Override
- public
final
String toString() {
+ public String toString() {
return String.format("fore: %d back: %d bold: %s blink: %s ch %c",
getForeColor(), getBackColor(), getBold(), getBlink(), ch);
}
return String.format("fore: %d back: %d bold: %s blink: %s ch %c",
getForeColor(), getBackColor(), getBold(), getBlink(), ch);
}
diff --git
a/src/jexer/io/ECMA48Screen.java
b/src/jexer/io/ECMA48Screen.java
index 659d132a96190131f64c3e1926b4c0559bae4abf..57fa88f60bf1a1e76d6777fe739ac6ae3a59c4f5 100644
(file)
--- a/
src/jexer/io/ECMA48Screen.java
+++ b/
src/jexer/io/ECMA48Screen.java
@@
-34,9
+34,10
@@
import jexer.bits.Cell;
import jexer.bits.CellAttributes;
/**
import jexer.bits.CellAttributes;
/**
- * This Screen class draws to an xterm/ANSI X3.64/ECMA-48 type terminal.
+ * This Screen implementation draws to an xterm/ANSI X3.64/ECMA-48 type
+ * terminal.
*/
*/
-public class ECMA48Screen extends Screen {
+public
final
class ECMA48Screen extends Screen {
/**
* Emit debugging to stderr.
/**
* Emit debugging to stderr.
diff --git
a/src/jexer/io/ECMA48Terminal.java
b/src/jexer/io/ECMA48Terminal.java
index 687d7a2e00fbc1728ce5a37a610167845336593b..f6bc0b3a076c03f358c4c811f0c9a3c8450e46c6 100644
(file)
--- a/
src/jexer/io/ECMA48Terminal.java
+++ b/
src/jexer/io/ECMA48Terminal.java
@@
-61,7
+61,7
@@
import static jexer.TKeypress.*;
* This class reads keystrokes and mouse events and emits output to ANSI
* X3.64 / ECMA-48 type terminals e.g. xterm, linux, vt100, ansi.sys, etc.
*/
* This class reads keystrokes and mouse events and emits output to ANSI
* X3.64 / ECMA-48 type terminals e.g. xterm, linux, vt100, ansi.sys, etc.
*/
-public class ECMA48Terminal implements Runnable {
+public
final
class ECMA48Terminal implements Runnable {
/**
* The session information.
/**
* The session information.
@@
-73,7
+73,7
@@
public class ECMA48Terminal implements Runnable {
*
* @return the SessionInfo
*/
*
* @return the SessionInfo
*/
- public
final
SessionInfo getSessionInfo() {
+ public SessionInfo getSessionInfo() {
return sessionInfo;
}
return sessionInfo;
}
@@
-243,7
+243,7
@@
public class ECMA48Terminal implements Runnable {
};
try {
Process process;
};
try {
Process process;
- if (mode
== true
) {
+ if (mode) {
process = Runtime.getRuntime().exec(cmdRaw);
} else {
process = Runtime.getRuntime().exec(cmdCooked);
process = Runtime.getRuntime().exec(cmdRaw);
} else {
process = Runtime.getRuntime().exec(cmdCooked);
diff --git
a/src/jexer/menu/TMenuSeparator.java
b/src/jexer/menu/TMenuSeparator.java
index b9dc979d6d75a5a5f827556332aa1c0cf3e8e111..e945cc7c77f0f64ed3e602fd88058ec6d96cc75f 100644
(file)
--- a/
src/jexer/menu/TMenuSeparator.java
+++ b/
src/jexer/menu/TMenuSeparator.java
@@
-36,7
+36,7
@@
import jexer.bits.GraphicsChars;
/**
* TMenuSeparator is a special case menu item.
*/
/**
* TMenuSeparator is a special case menu item.
*/
-public class TMenuSeparator extends TMenuItem {
+public
final
class TMenuSeparator extends TMenuItem {
/**
* Package private constructor.
/**
* Package private constructor.
diff --git
a/src/jexer/menu/TSubMenu.java
b/src/jexer/menu/TSubMenu.java
index c37bf3a1fcca4975185d083740189ad2708b9d9d..4720a701e3c90e787614c8f263014b8ff8cbb3e3 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.
@@
-182,7
+182,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
+195,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
+206,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
+224,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);
}