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 (parent:
4b257bd
)
checkstyle sweep
author
Kevin Lamonte
<kevin.lamonte@gmail.com>
Thu, 2 Apr 2015 17:44:56 +0000
(13:44 -0400)
committer
Kevin Lamonte
<kevin.lamonte@gmail.com>
Thu, 2 Apr 2015 17:44:56 +0000
(13:44 -0400)
19 files changed:
src/jexer/TApplication.java
patch
|
blob
|
blame
|
history
src/jexer/TButton.java
patch
|
blob
|
blame
|
history
src/jexer/TCheckbox.java
patch
|
blob
|
blame
|
history
src/jexer/TDirectoryList.java
patch
|
blob
|
blame
|
history
src/jexer/TDirectoryTreeItem.java
patch
|
blob
|
blame
|
history
src/jexer/TFileOpenBox.java
patch
|
blob
|
blame
|
history
src/jexer/THScroller.java
patch
|
blob
|
blame
|
history
src/jexer/TMessageBox.java
patch
|
blob
|
blame
|
history
src/jexer/TTreeItem.java
patch
|
blob
|
blame
|
history
src/jexer/TTreeView.java
patch
|
blob
|
blame
|
history
src/jexer/TVScroller.java
patch
|
blob
|
blame
|
history
src/jexer/TWidget.java
patch
|
blob
|
blame
|
history
src/jexer/bits/MnemonicString.java
patch
|
blob
|
blame
|
history
src/jexer/demos/DemoApplication.java
patch
|
blob
|
blame
|
history
src/jexer/demos/DemoTreeViewWindow.java
patch
|
blob
|
blame
|
history
src/jexer/io/SwingScreen.java
patch
|
blob
|
blame
|
history
src/jexer/menu/TMenu.java
patch
|
blob
|
blame
|
history
src/jexer/menu/TMenuItem.java
patch
|
blob
|
blame
|
history
src/jexer/tterminal/ECMA48.java
patch
|
blob
|
blame
|
history
diff --git
a/src/jexer/TApplication.java
b/src/jexer/TApplication.java
index 51566287286b7ef5af238a4ec1f22dae5df08a51..d06d0d659b0ed7dfd474743e0a43bb55edc9b8fe 100644
(file)
--- a/
src/jexer/TApplication.java
+++ b/
src/jexer/TApplication.java
@@
-89,7
+89,7
@@
public class TApplication implements Runnable {
ECMA48,
/**
ECMA48,
/**
- * Synonym for ECMA48
+ * Synonym for ECMA48
.
*/
XTERM
}
*/
XTERM
}
@@
-518,6
+518,10
@@
public class TApplication implements Runnable {
// Fall through...
case ECMA48:
backend = new ECMA48Backend(this, null, null);
// Fall through...
case ECMA48:
backend = new ECMA48Backend(this, null, null);
+ break;
+ default:
+ throw new IllegalArgumentException("Invalid backend type: "
+ + backendType);
}
TApplicationImpl();
}
}
TApplicationImpl();
}
@@
-1003,7
+1007,7
@@
public class TApplication implements Runnable {
// secondary thread locks again. When it gives up, we have the
// single lock back.
boolean oldLock = unlockHandleEvent();
// secondary thread locks again. When it gives up, we have the
// single lock back.
boolean oldLock = unlockHandleEvent();
- assert (oldLock
== true
);
+ assert (oldLock);
while (secondaryEventReceiver != null) {
synchronized (primaryEventHandler) {
while (secondaryEventReceiver != null) {
synchronized (primaryEventHandler) {
@@
-1905,6
+1909,7
@@
public class TApplication implements Runnable {
*
* @param path path of selected file
* @return the result of the new file open box
*
* @param path path of selected file
* @return the result of the new file open box
+ * @throws IOException if java.io operation throws
*/
public final String fileOpenBox(final String path) throws IOException {
*/
public final String fileOpenBox(final String path) throws IOException {
@@
-1918,6
+1923,7
@@
public class TApplication implements Runnable {
* @param path path of selected file
* @param type one of the Type constants
* @return the result of the new file open box
* @param path path of selected file
* @param type one of the Type constants
* @return the result of the new file open box
+ * @throws IOException if java.io operation throws
*/
public final String fileOpenBox(final String path,
final TFileOpenBox.Type type) throws IOException {
*/
public final String fileOpenBox(final String path,
final TFileOpenBox.Type type) throws IOException {
diff --git
a/src/jexer/TButton.java
b/src/jexer/TButton.java
index fb8c08e35c4c3a48b6361036837d308c7eb3b9cc..064e927566effd281321502a7ad02031012fff84 100644
(file)
--- a/
src/jexer/TButton.java
+++ b/
src/jexer/TButton.java
@@
-56,7
+56,7
@@
public final class TButton extends TWidget {
*
* @return mnemonic string
*/
*
* @return mnemonic string
*/
- public
final
MnemonicString getMnemonic() {
+ public MnemonicString getMnemonic() {
return mnemonic;
}
return mnemonic;
}
diff --git
a/src/jexer/TCheckbox.java
b/src/jexer/TCheckbox.java
index 816138b88b5be198389f716fca30acf4cd5093b4..6819bcd04cb21f1ade9099b75fd5a633d3703ec0 100644
(file)
--- a/
src/jexer/TCheckbox.java
+++ b/
src/jexer/TCheckbox.java
@@
-51,7
+51,7
@@
public final class TCheckbox extends TWidget {
*
* @return if true, this is checked
*/
*
* @return if true, this is checked
*/
- public
final
boolean isChecked() {
+ public boolean isChecked() {
return checked;
}
return checked;
}
@@
-60,7
+60,7
@@
public final class TCheckbox extends TWidget {
*
* @param checked new checked value.
*/
*
* @param checked new checked value.
*/
- public
final
void setChecked(final boolean checked) {
+ public void setChecked(final boolean checked) {
this.checked = checked;
}
this.checked = checked;
}
diff --git
a/src/jexer/TDirectoryList.java
b/src/jexer/TDirectoryList.java
index 1b94a18d4b8aa20eef9ebb7ce4be7af7b2fba4aa..50cc88b7dfd969f4683cc5934e6e1b41914c0d37 100644
(file)
--- a/
src/jexer/TDirectoryList.java
+++ b/
src/jexer/TDirectoryList.java
@@
-64,7
+64,7
@@
public final class TDirectoryList extends TWidget {
*
* @param path new path to list files for
*/
*
* @param path new path to list files for
*/
- public void setPath(String path) {
+ public void setPath(
final
String path) {
this.path = new File(path);
reflow();
}
this.path = new File(path);
reflow();
}
@@
-115,7
+115,7
@@
public final class TDirectoryList extends TWidget {
* @param index index into files
* @return the line to draw
*/
* @param index index into files
* @return the line to draw
*/
- private String renderFile(int index) {
+ private String renderFile(
final
int index) {
File file = files.get(index);
String name = file.getName();
if (name.length() > 20) {
File file = files.get(index);
String name = file.getName();
if (name.length() > 20) {
diff --git
a/src/jexer/TDirectoryTreeItem.java
b/src/jexer/TDirectoryTreeItem.java
index 0d02232e952afe4761a84cfac57fe38decd7b41d..456ad9259c4f1acc641de437b7d88330cbbe8111 100644
(file)
--- a/
src/jexer/TDirectoryTreeItem.java
+++ b/
src/jexer/TDirectoryTreeItem.java
@@
-60,7
+60,7
@@
public class TDirectoryTreeItem extends TTreeItem {
* true if this item was just expanded from a mouse click or keypress.
*/
@Override
* true if this item was just expanded from a mouse click or keypress.
*/
@Override
- public void onExpand() {
+ public
final
void onExpand() {
// System.err.printf("onExpand() %s\n", file);
if (file == null) {
// System.err.printf("onExpand() %s\n", file);
if (file == null) {
@@
-77,7
+77,7
@@
public class TDirectoryTreeItem extends TTreeItem {
assert (file.isDirectory());
setExpandable(true);
assert (file.isDirectory());
setExpandable(true);
- if (
(isExpanded() == false) || (isExpandable() == false
)) {
+ if (
!isExpanded() || !isExpandable(
)) {
getTreeView().reflow();
return;
}
getTreeView().reflow();
return;
}
@@
-118,7
+118,9
@@
public class TDirectoryTreeItem extends TTreeItem {
* @throws IllegalArgumentException if this function is called
*/
@Override
* @throws IllegalArgumentException if this function is called
*/
@Override
- public final TTreeItem addChild(final String text, final boolean expanded) {
+ public final TTreeItem addChild(final String text,
+ final boolean expanded) throws IllegalArgumentException {
+
throw new IllegalArgumentException("Do not call addChild(), use onExpand() instead");
}
throw new IllegalArgumentException("Do not call addChild(), use onExpand() instead");
}
@@
-127,6
+129,7
@@
public class TDirectoryTreeItem extends TTreeItem {
*
* @param view root TTreeView
* @param text text for this item
*
* @param view root TTreeView
* @param text text for this item
+ * @throws IOException if a java.io operation throws
*/
public TDirectoryTreeItem(final TTreeView view,
final String text) throws IOException {
*/
public TDirectoryTreeItem(final TTreeView view,
final String text) throws IOException {
@@
-140,6
+143,7
@@
public class TDirectoryTreeItem extends TTreeItem {
* @param view root TTreeView
* @param text text for this item
* @param expanded if true, have it expanded immediately
* @param view root TTreeView
* @param text text for this item
* @param expanded if true, have it expanded immediately
+ * @throws IOException if a java.io operation throws
*/
public TDirectoryTreeItem(final TTreeView view, final String text,
final boolean expanded) throws IOException {
*/
public TDirectoryTreeItem(final TTreeView view, final String text,
final boolean expanded) throws IOException {
@@
-155,6
+159,7
@@
public class TDirectoryTreeItem extends TTreeItem {
* @param expanded if true, have it expanded immediately
* @param openParents if true, expand all paths up the root path and
* return the root path entry
* @param expanded if true, have it expanded immediately
* @param openParents if true, expand all paths up the root path and
* return the root path entry
+ * @throws IOException if a java.io operation throws
*/
public TDirectoryTreeItem(final TTreeView view, final String text,
final boolean expanded, final boolean openParents) throws IOException {
*/
public TDirectoryTreeItem(final TTreeView view, final String text,
final boolean expanded, final boolean openParents) throws IOException {
@@
-168,7
+173,7
@@
public class TDirectoryTreeItem extends TTreeItem {
File rootFile = new File(text);
rootFile = rootFile.getCanonicalFile();
File rootFile = new File(text);
rootFile = rootFile.getCanonicalFile();
- if (openParents
== true
) {
+ if (openParents) {
setExpanded(true);
// Go up the directory tree
setExpanded(true);
// Go up the directory tree
@@
-186,12
+191,12
@@
public class TDirectoryTreeItem extends TTreeItem {
} else {
// This is a relative path. We got here because openParents was
// false.
} else {
// This is a relative path. We got here because openParents was
// false.
- assert (
openParents == false
);
+ assert (
!openParents
);
setText(rootFile.getName());
}
onExpand();
setText(rootFile.getName());
}
onExpand();
- if (openParents
== true
) {
+ if (openParents) {
TDirectoryTreeItem childFile = this;
Collections.reverse(parentFiles);
for (String p: parentFiles) {
TDirectoryTreeItem childFile = this;
Collections.reverse(parentFiles);
for (String p: parentFiles) {
diff --git
a/src/jexer/TFileOpenBox.java
b/src/jexer/TFileOpenBox.java
index 96085b8cb336c124a641d14602dd7d434668431b..9a0437ccc5618ab01baffd29cc1c24295339a936 100644
(file)
--- a/
src/jexer/TFileOpenBox.java
+++ b/
src/jexer/TFileOpenBox.java
@@
-59,7
+59,14
@@
public final class TFileOpenBox extends TWindow {
* TFileOpenBox can be called for either Open or Save actions.
*/
public enum Type {
* TFileOpenBox can be called for either Open or Save actions.
*/
public enum Type {
+ /**
+ * Button will be labeled "Open".
+ */
OPEN,
OPEN,
+
+ /**
+ * Button will be labeled "Save".
+ */
SAVE
}
SAVE
}
@@
-107,6
+114,7
@@
public final class TFileOpenBox extends TWindow {
* directory, then
*
* @param newFilename the filename to check and return
* directory, then
*
* @param newFilename the filename to check and return
+ * @throws IOException of a java.io operation throws
*/
private void checkFilename(final String newFilename) throws IOException {
File newFile = new File(newFilename);
*/
private void checkFilename(final String newFilename) throws IOException {
File newFile = new File(newFilename);
@@
-133,6
+141,7
@@
public final class TFileOpenBox extends TWindow {
* @param application the TApplication that manages this window
* @param path path of selected file
* @param type one of the Type constants
* @param application the TApplication that manages this window
* @param path path of selected file
* @param type one of the Type constants
+ * @throws IOException of a java.io operation throws
*/
public TFileOpenBox(final TApplication application, final String path,
final Type type) throws IOException {
*/
public TFileOpenBox(final TApplication application, final String path,
final Type type) throws IOException {
diff --git
a/src/jexer/THScroller.java
b/src/jexer/THScroller.java
index eb7256bcab8e8f181185e9e50c03453db9f9b6db..54f3c0b90054aec0511f933751e533664966c1f7 100644
(file)
--- a/
src/jexer/THScroller.java
+++ b/
src/jexer/THScroller.java
@@
-297,7
+297,8
@@
public final class THScroller extends TWidget {
&& (mouse.getX() < getWidth() - 1)
) {
// Recompute value based on new box position
&& (mouse.getX() < getWidth() - 1)
) {
// Recompute value based on new box position
- value = (rightValue - leftValue) * (mouse.getX()) / (getWidth() - 3) + leftValue;
+ value = (rightValue - leftValue)
+ * (mouse.getX()) / (getWidth() - 3) + leftValue;
return;
}
inScroll = false;
return;
}
inScroll = false;
diff --git
a/src/jexer/TMessageBox.java
b/src/jexer/TMessageBox.java
index 9de90dcdf4c2197aba6fb40a8c45e344bc4d983c..eac37aa8b876aed699fd43d8428715b881f9b9af 100644
(file)
--- a/
src/jexer/TMessageBox.java
+++ b/
src/jexer/TMessageBox.java
@@
-88,7
+88,7
@@
public class TMessageBox extends TWindow {
/**
* My buttons.
*/
/**
* My buttons.
*/
- List<TButton> buttons;
+
private
List<TButton> buttons;
/**
* Message boxes have these possible results.
/**
* Message boxes have these possible results.
diff --git
a/src/jexer/TTreeItem.java
b/src/jexer/TTreeItem.java
index 2770c463bbd026e5893a01ec8e72b153dabdf5ab..e6bf2790f8c2b584d89e8040ccba786c1a62579c 100644
(file)
--- a/
src/jexer/TTreeItem.java
+++ b/
src/jexer/TTreeItem.java
@@
-101,7
+101,7
@@
public class TTreeItem extends TWidget {
*
* @param expanded new value
*/
*
* @param expanded new value
*/
- public final void setExpanded(boolean expanded) {
+ public final void setExpanded(
final
boolean expanded) {
this.expanded = expanded;
}
this.expanded = expanded;
}
@@
-124,7
+124,7
@@
public class TTreeItem extends TWidget {
*
* @param expandable new value
*/
*
* @param expandable new value
*/
- public final void setExpandable(boolean expandable) {
+ public final void setExpandable(
final
boolean expandable) {
this.expandable = expandable;
}
this.expandable = expandable;
}
@@
-162,7
+162,7
@@
public class TTreeItem extends TWidget {
*
* @param invisible new value
*/
*
* @param invisible new value
*/
- public final void setInvisible(boolean invisible) {
+ public final void setInvisible(
final
boolean invisible) {
this.invisible = invisible;
}
this.invisible = invisible;
}
@@
-185,7
+185,7
@@
public class TTreeItem extends TWidget {
*
* @param selected new value
*/
*
* @param selected new value
*/
- public final void setSelected(boolean selected) {
+ public final void setSelected(
final
boolean selected) {
this.selected = selected;
}
this.selected = selected;
}
@@
-199,7
+199,7
@@
public class TTreeItem extends TWidget {
*
* @param selectable new value
*/
*
* @param selectable new value
*/
- public final void setSelectable(boolean selectable) {
+ public final void setSelectable(
final
boolean selectable) {
this.selectable = selectable;
}
this.selectable = selectable;
}
@@
-276,7
+276,7
@@
public class TTreeItem extends TWidget {
this.prefix = prefix;
array.add(this);
this.prefix = prefix;
array.add(this);
- if ((getChildren().size() == 0) ||
(expanded == false)
) {
+ if ((getChildren().size() == 0) ||
!expanded
) {
return array;
}
return array;
}
diff --git
a/src/jexer/TTreeView.java
b/src/jexer/TTreeView.java
index 7aaee43fa9c08854a7b2057fa1c1d01454834165..aaed4d1351dbddb260064bfc809aeb2d518c6114 100644
(file)
--- a/
src/jexer/TTreeView.java
+++ b/
src/jexer/TTreeView.java
@@
-52,6
+52,8
@@
public class TTreeView extends TWidget {
/**
* Get the horizontal scrollbar. This is used by TTreeItem.draw(), and
* potentially subclasses.
/**
* Get the horizontal scrollbar. This is used by TTreeItem.draw(), and
* potentially subclasses.
+ *
+ * @return the horizontal scrollbar
*/
public final THScroller getHScroller() {
return hScroller;
*/
public final THScroller getHScroller() {
return hScroller;
@@
-94,7
+96,7
@@
public class TTreeView extends TWidget {
* If true, move the window to put the selected item in view. This
* normally only happens once after setting treeRoot.
*/
* If true, move the window to put the selected item in view. This
* normally only happens once after setting treeRoot.
*/
- p
ublic
boolean centerWindow = false;
+ p
rivate
boolean centerWindow = false;
/**
* The action to perform when the user selects an item.
/**
* The action to perform when the user selects an item.
@@
-107,7
+109,9
@@
public class TTreeView extends TWidget {
* @param treeRoot ultimate root of tree
* @param centerWindow if true, move the window to put the root in view
*/
* @param treeRoot ultimate root of tree
* @param centerWindow if true, move the window to put the root in view
*/
- public void setTreeRoot(final TTreeItem treeRoot, final boolean centerWindow) {
+ public void setTreeRoot(final TTreeItem treeRoot,
+ final boolean centerWindow) {
+
this.treeRoot = treeRoot;
this.centerWindow = centerWindow;
}
this.treeRoot = treeRoot;
this.centerWindow = centerWindow;
}
@@
-239,12
+243,12
@@
public class TTreeView extends TWidget {
if (item == selectedItem) {
foundSelectedRow = true;
}
if (item == selectedItem) {
foundSelectedRow = true;
}
- if (
foundSelectedRow == false
) {
+ if (
!foundSelectedRow
) {
selectedRow++;
}
int lineWidth = item.getText().length()
selectedRow++;
}
int lineWidth = item.getText().length()
- + item.getPrefix().length() + 4;
+
+ item.getPrefix().length() + 4;
if (lineWidth > maxLineWidth) {
maxLineWidth = lineWidth;
}
if (lineWidth > maxLineWidth) {
maxLineWidth = lineWidth;
}
@@
-360,7
+364,7
@@
public class TTreeView extends TWidget {
* @param mouse mouse button release event
*/
@Override
* @param mouse mouse button release event
*/
@Override
- public void onMouseUp(TMouseEvent mouse) {
+ public void onMouseUp(
final
TMouseEvent mouse) {
// Pass to children
super.onMouseDown(mouse);
// Pass to children
super.onMouseDown(mouse);
diff --git
a/src/jexer/TVScroller.java
b/src/jexer/TVScroller.java
index 681a12347e2134513640994c30ec9a2bb1647b13..9b69f691593a4ed0ae9c78d65039eb968c40b0d7 100644
(file)
--- a/
src/jexer/TVScroller.java
+++ b/
src/jexer/TVScroller.java
@@
-328,13
+328,14
@@
public final class TVScroller extends TWidget {
return;
}
return;
}
- if ((mouse.isMouse1())
&&
- (inScroll) &&
- (mouse.getY() > 0) &&
- (mouse.getY() < getHeight() - 1)
+ if ((mouse.isMouse1())
+ && (inScroll)
+ && (mouse.getY() > 0)
+
&&
(mouse.getY() < getHeight() - 1)
) {
// Recompute value based on new box position
) {
// Recompute value based on new box position
- value = (bottomValue - topValue) * (mouse.getY()) / (getHeight() - 3) + topValue;
+ value = (bottomValue - topValue)
+ * (mouse.getY()) / (getHeight() - 3) + topValue;
return;
}
return;
}
diff --git
a/src/jexer/TWidget.java
b/src/jexer/TWidget.java
index 85910abea53e83d203bcda7b450ff1ea489dd2b1..564cc522f5865be46ad38ab8b64a3854271a7719 100644
(file)
--- a/
src/jexer/TWidget.java
+++ b/
src/jexer/TWidget.java
@@
-371,7
+371,7
@@
public abstract class TWidget implements Comparable<TWidget> {
}
/**
}
/**
- * Comparison operator sorts on:
+ * Comparison operator
. For various subclasses it
sorts on:
* <ul>
* <li>tabOrder for TWidgets</li>
* <li>z for TWindows</li>
* <ul>
* <li>tabOrder for TWidgets</li>
* <li>z for TWindows</li>
@@
-1289,6
+1289,7
@@
public abstract class TWidget implements Comparable<TWidget> {
* @param y row relative to parent
* @param width width of tree view
* @param height height of tree view
* @param y row relative to parent
* @param width width of tree view
* @param height height of tree view
+ * @return the new tree view
*/
public final TTreeView addTreeView(final int x, final int y,
final int width, final int height) {
*/
public final TTreeView addTreeView(final int x, final int y,
final int width, final int height) {
@@
-1304,6
+1305,7
@@
public abstract class TWidget implements Comparable<TWidget> {
* @param width width of tree view
* @param height height of tree view
* @param action action to perform when an item is selected
* @param width width of tree view
* @param height height of tree view
* @param action action to perform when an item is selected
+ * @return the new tree view
*/
public final TTreeView addTreeView(final int x, final int y,
final int width, final int height, final TAction action) {
*/
public final TTreeView addTreeView(final int x, final int y,
final int width, final int height, final TAction action) {
@@
-1316,6
+1318,7
@@
public abstract class TWidget implements Comparable<TWidget> {
*
* @param path path of selected file
* @return the result of the new file open box
*
* @param path path of selected file
* @return the result of the new file open box
+ * @throws IOException if a java.io operation throws
*/
public final String fileOpenBox(final String path) throws IOException {
return getApplication().fileOpenBox(path);
*/
public final String fileOpenBox(final String path) throws IOException {
return getApplication().fileOpenBox(path);
@@
-1327,6
+1330,7
@@
public abstract class TWidget implements Comparable<TWidget> {
* @param path path of selected file
* @param type one of the Type constants
* @return the result of the new file open box
* @param path path of selected file
* @param type one of the Type constants
* @return the result of the new file open box
+ * @throws IOException if a java.io operation throws
*/
public final String fileOpenBox(final String path,
final TFileOpenBox.Type type) throws IOException {
*/
public final String fileOpenBox(final String path,
final TFileOpenBox.Type type) throws IOException {
@@
-1341,6
+1345,7
@@
public abstract class TWidget implements Comparable<TWidget> {
* @param y row relative to parent
* @param width width of text area
* @param height height of text area
* @param y row relative to parent
* @param width width of text area
* @param height height of text area
+ * @return the new directory list
*/
public final TDirectoryList addDirectoryList(final String path, final int x,
final int y, final int width, final int height) {
*/
public final TDirectoryList addDirectoryList(final String path, final int x,
final int y, final int width, final int height) {
@@
-1357,6
+1362,7
@@
public abstract class TWidget implements Comparable<TWidget> {
* @param width width of text area
* @param height height of text area
* @param action action to perform when an item is selected
* @param width width of text area
* @param height height of text area
* @param action action to perform when an item is selected
+ * @return the new directory list
*/
public final TDirectoryList addDirectoryList(final String path, final int x,
final int y, final int width, final int height, final TAction action) {
*/
public final TDirectoryList addDirectoryList(final String path, final int x,
final int y, final int width, final int height, final TAction action) {
diff --git
a/src/jexer/bits/MnemonicString.java
b/src/jexer/bits/MnemonicString.java
index 08770acc8e806faad6813270c9c35b0f40ad0e81..2cfe125f32f0e59376651046344c533d317213e8 100644
(file)
--- a/
src/jexer/bits/MnemonicString.java
+++ b/
src/jexer/bits/MnemonicString.java
@@
-79,7
+79,7
@@
public final class MnemonicString {
public String getRawLabel() {
return rawLabel;
}
public String getRawLabel() {
return rawLabel;
}
-
+
/**
* Public constructor.
*
/**
* Public constructor.
*
diff --git
a/src/jexer/demos/DemoApplication.java
b/src/jexer/demos/DemoApplication.java
index d9bbeb765db92d45aca5537fe274f9b288c42c92..f0bdacd3fab241f82b4922287ada4259048c5a5c 100644
(file)
--- a/
src/jexer/demos/DemoApplication.java
+++ b/
src/jexer/demos/DemoApplication.java
@@
-104,7
+104,7
@@
public class DemoApplication extends TApplication {
* a window
*/
@Override
* a window
*/
@Override
- public boolean onMenu(TMenuEvent menu) {
+ public boolean onMenu(
final
TMenuEvent menu) {
if (menu.getId() == TMenu.MID_OPEN_FILE) {
try {
String filename = fileOpenBox(".");
if (menu.getId() == TMenu.MID_OPEN_FILE) {
try {
String filename = fileOpenBox(".");
@@
-116,7
+116,7
@@
public class DemoApplication extends TApplication {
String EOL = System.getProperty("line.separator");
try {
String EOL = System.getProperty("line.separator");
try {
- while(scanner.hasNextLine()) {
+ while
(scanner.hasNextLine()) {
fileContents.append(scanner.nextLine() + EOL);
}
new DemoTextWindow(this, filename,
fileContents.append(scanner.nextLine() + EOL);
}
new DemoTextWindow(this, filename,
@@
-142,7
+142,7
@@
public class DemoApplication extends TApplication {
* @param backendType one of the TApplication.BackendType values
* @throws Exception if TApplication can't instantiate the Backend.
*/
* @param backendType one of the TApplication.BackendType values
* @throws Exception if TApplication can't instantiate the Backend.
*/
- public DemoApplication(BackendType backendType) throws Exception {
+ public DemoApplication(
final
BackendType backendType) throws Exception {
super(backendType);
addAllWidgets();
}
super(backendType);
addAllWidgets();
}
diff --git
a/src/jexer/demos/DemoTreeViewWindow.java
b/src/jexer/demos/DemoTreeViewWindow.java
index 0fc5dfe5747678f59adbac0604f32e12cf32687d..6101d27dc637bd1d6a0137781d64df470b10d479 100644
(file)
--- a/
src/jexer/demos/DemoTreeViewWindow.java
+++ b/
src/jexer/demos/DemoTreeViewWindow.java
@@
-49,8
+49,9
@@
public class DemoTreeViewWindow extends TWindow {
* Public constructor.
*
* @param parent the main application
* Public constructor.
*
* @param parent the main application
+ * @throws IOException if a java.io operation throws
*/
*/
- public DemoTreeViewWindow(TApplication parent) throws IOException {
+ public DemoTreeViewWindow(
final
TApplication parent) throws IOException {
super(parent, "Tree View", 0, 0, 44, 16, TWindow.RESIZABLE);
// Load the treeview with "stuff"
super(parent, "Tree View", 0, 0, 44, 16, TWindow.RESIZABLE);
// Load the treeview with "stuff"
@@
-64,7
+65,7
@@
public class DemoTreeViewWindow extends TWindow {
* @param resize resize event
*/
@Override
* @param resize resize event
*/
@Override
- public void onResize(TResizeEvent resize) {
+ public void onResize(
final
TResizeEvent resize) {
if (resize.getType() == TResizeEvent.Type.WIDGET) {
// Resize the text field
treeView.setWidth(resize.getWidth() - 4);
if (resize.getType() == TResizeEvent.Type.WIDGET) {
// Resize the text field
treeView.setWidth(resize.getWidth() - 4);
diff --git
a/src/jexer/io/SwingScreen.java
b/src/jexer/io/SwingScreen.java
index 3c949c1b8016866d4e36641d1afe1c0e1837a2c6..cdca714bb1cff6765144cc381c5bfef20ae6c16c 100644
(file)
--- a/
src/jexer/io/SwingScreen.java
+++ b/
src/jexer/io/SwingScreen.java
@@
-519,6
+519,8
@@
public final class SwingScreen extends Screen {
Cell lCell = screen.logical[cursorX][cursorY];
gr.setColor(attrToForegroundColor(lCell));
switch (cursorStyle) {
Cell lCell = screen.logical[cursorX][cursorY];
gr.setColor(attrToForegroundColor(lCell));
switch (cursorStyle) {
+ default:
+ // Fall through...
case UNDERLINE:
gr.fillRect(xPixel, yPixel + textHeight - 2,
textWidth, 2);
case UNDERLINE:
gr.fillRect(xPixel, yPixel + textHeight - 2,
textWidth, 2);
@@
-571,7
+573,7
@@
public final class SwingScreen extends Screen {
SwingScreen.this.frame.resizeToScreen();
SwingScreen.this.frame.setVisible(true);
}
SwingScreen.this.frame.resizeToScreen();
SwingScreen.this.frame.setVisible(true);
}
- }
);
+ });
} catch (Exception e) {
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
}
diff --git
a/src/jexer/menu/TMenu.java
b/src/jexer/menu/TMenu.java
index 6dfb5fcfabe71f2f1d961572c0a877045b0e85a2..c1509d55bafa220805b74ecc7f3a1045b8d8de84 100644
(file)
--- a/
src/jexer/menu/TMenu.java
+++ b/
src/jexer/menu/TMenu.java
@@
-315,7
+315,7
@@
public final class TMenu extends TWindow {
* @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) {
assert (id >= 1024);
return addItemInternal(id, label, null);
}
assert (id >= 1024);
return addItemInternal(id, label, null);
}
@@
-328,7
+328,7
@@
public final class TMenu extends TWindow {
* @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) {
assert (id >= 1024);
final TKeypress key) {
assert (id >= 1024);
@@
-371,7
+371,7
@@
public final class TMenu extends TWindow {
* (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) {
assert (id >= 0);
assert (id < 1024);
assert (id >= 0);
assert (id < 1024);
@@
-451,7
+451,7
@@
public final class TMenu extends TWindow {
/**
* Convenience function to add a menu separator.
*/
/**
* Convenience function to add a menu separator.
*/
- public
final
void addSeparator() {
+ public void addSeparator() {
int newY = getChildren().size() + 1;
assert (newY < getHeight());
int newY = getChildren().size() + 1;
assert (newY < getHeight());
@@
-468,7
+468,7
@@
public final class TMenu extends TWindow {
* 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) {
int newY = getChildren().size() + 1;
assert (newY < getHeight());
int newY = getChildren().size() + 1;
assert (newY < getHeight());
diff --git
a/src/jexer/menu/TMenuItem.java
b/src/jexer/menu/TMenuItem.java
index e3600bca4f9c79a2cd9ca2ef1f5460cca7cea999..089887006d1f15bc8400c4b0b73319ecd75f5123 100644
(file)
--- a/
src/jexer/menu/TMenuItem.java
+++ b/
src/jexer/menu/TMenuItem.java
@@
-196,6
+196,7
@@
public class TMenuItem extends TWidget {
* Returns true if the mouse is currently on the menu item.
*
* @param mouse mouse event
* Returns true if the mouse is currently on the menu item.
*
* @param mouse mouse event
+ * @return if true then the mouse is currently on this item
*/
private boolean mouseOnMenuItem(final TMouseEvent mouse) {
if ((mouse.getY() == 0)
*/
private boolean mouseOnMenuItem(final TMouseEvent mouse) {
if ((mouse.getY() == 0)
@@
-262,21
+263,6
@@
public class TMenuItem extends TWidget {
}
}
}
}
- /**
- * Handle mouse button presses.
- *
- * @param event mouse button press event
- */
- /* TODO: this was commented out in d-tui, why?
- @Override
- public void onMouseDown(final TMouseEvent event) {
- if ((mouseOnMenuItem(event)) && (event.mouse1)) {
- dispatch();
- return;
- }
- }
- */
-
/**
* Handle mouse button releases.
*
/**
* Handle mouse button releases.
*
diff --git
a/src/jexer/tterminal/ECMA48.java
b/src/jexer/tterminal/ECMA48.java
index 80f733b132c2e7024f131f6a8232fddbbcabbdcb..ca3ce5c80ea952877578c001128b58f8a7a1cc03 100644
(file)
--- a/
src/jexer/tterminal/ECMA48.java
+++ b/
src/jexer/tterminal/ECMA48.java
@@
-2185,8
+2185,9
@@
public class ECMA48 implements Runnable {
}
/**
}
/**
- * Set or unset a toggle. value is 'true' for set ('h'), false for reset
- * ('l').
+ * Set or unset a toggle.
+ *
+ * @param value true for set ('h'), false for reset ('l')
*/
private void setToggle(final boolean value) {
boolean decPrivateModeFlag = false;
*/
private void setToggle(final boolean value) {
boolean decPrivateModeFlag = false;
@@
-5534,8
+5535,8
@@
public class ECMA48 implements Runnable {
collect(ch);
}
if (ch == 0x5C) {
collect(ch);
}
if (ch == 0x5C) {
- if ((collectBuffer.length() > 0)
&&
- (collectBuffer.charAt(collectBuffer.length() - 1) == 0x1B)
+ if ((collectBuffer.length() > 0)
+
&&
(collectBuffer.charAt(collectBuffer.length() - 1) == 0x1B)
) {
toGround();
}
) {
toGround();
}
@@
-5566,8
+5567,8
@@
public class ECMA48 implements Runnable {
collect(ch);
}
if (ch == 0x5C) {
collect(ch);
}
if (ch == 0x5C) {
- if ((collectBuffer.length() > 0)
&&
- (collectBuffer.charAt(collectBuffer.length() - 1) == 0x1B)
+ if ((collectBuffer.length() > 0)
+
&&
(collectBuffer.charAt(collectBuffer.length() - 1) == 0x1B)
) {
toGround();
}
) {
toGround();
}
@@
-5719,7
+5720,7
@@
public class ECMA48 implements Runnable {
/**
* Read function runs on a separate thread.
*/
/**
* Read function runs on a separate thread.
*/
- public void run() {
+ public
final
void run() {
boolean utf8 = false;
boolean done = false;
boolean utf8 = false;
boolean done = false;