From: Kevin Lamonte Date: Sat, 21 Mar 2015 15:30:03 +0000 (-0400) Subject: fix eclipse warnings X-Git-Url: http://git.nikiroo.be/?a=commitdiff_plain;h=cf9af8df455c0ea5390e4c0ed2555506a051a379;p=nikiroo-utils.git fix eclipse warnings --- diff --git a/.gitignore b/.gitignore index 1b71ff2..61a8a45 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,6 @@ hs_err_pid* # Editor backup files *.java~ *.xml~ -*Makefile~ + +# Scratch space +misc/** diff --git a/README.md b/README.md index dc1b8f8..583957c 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,7 @@ Many tasks remain before calling this version 1.0: 0.0.3: +- TStatusBar - TEditor 0.0.4: @@ -168,6 +169,5 @@ Screenshots ![Several Windows Open Including A Terminal](/screenshots/screenshot1.png?raw=true "Several Windows Open Including A Terminal") -![Yo Dawg...](/screenshots/yodawg.png?raw=true "Yo Dawg, I heard you - like text windowing systems, so I ran a text windowing system inside your - text windowing system so you can have a terminal in your terminal.") +![Yo Dawg...](/screenshots/yodawg.png?raw=true "Yo Dawg, I heard you like text windowing systems, so I ran a text windowing system inside your text windowing system so you can have a terminal in your terminal.") + diff --git a/build.xml b/build.xml index e6d7bbb..35d82d3 100644 --- a/build.xml +++ b/build.xml @@ -70,13 +70,15 @@ + + diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index 0e5020a..6bec900 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -57,7 +57,6 @@ import jexer.io.Screen; import jexer.menu.TMenu; import jexer.menu.TMenuItem; import static jexer.TCommand.*; -import static jexer.TKeypress.*; /** * TApplication sets up a full Text User Interface application. diff --git a/src/jexer/bits/ColorTheme.java b/src/jexer/bits/ColorTheme.java index 6f40699..60f706e 100644 --- a/src/jexer/bits/ColorTheme.java +++ b/src/jexer/bits/ColorTheme.java @@ -129,6 +129,8 @@ public final class ColorTheme { color.setBackColor(Color.getColor(backColor)); colors.put(key, color); } + // All done. + reader.close(); } /** diff --git a/src/jexer/io/AWTScreen.java b/src/jexer/io/AWTScreen.java index 308a285..20bd440 100644 --- a/src/jexer/io/AWTScreen.java +++ b/src/jexer/io/AWTScreen.java @@ -38,7 +38,6 @@ import java.awt.Color; import java.awt.Cursor; import java.awt.Font; import java.awt.FontMetrics; -import java.awt.Frame; import java.awt.Graphics; import java.awt.Insets; import java.awt.Point; @@ -107,6 +106,11 @@ public final class AWTScreen extends Screen { */ class AWTFrame extends JFrame { + /** + * Serializable version. + */ + private static final long serialVersionUID = 1; + /** * The terminus font resource filename. */ diff --git a/src/jexer/io/AWTTerminal.java b/src/jexer/io/AWTTerminal.java index 38f6734..da521dd 100644 --- a/src/jexer/io/AWTTerminal.java +++ b/src/jexer/io/AWTTerminal.java @@ -91,11 +91,6 @@ public final class AWTTerminal implements ComponentListener, KeyListener, */ private List eventQueue; - /** - * The reader thread. - */ - private Thread readerThread; - /** * The last reported mouse X position. */ @@ -212,7 +207,6 @@ public final class AWTTerminal implements ComponentListener, KeyListener, boolean ctrl = false; char ch = ' '; boolean isKey = false; - int fnKey = 0; if (key.isActionKey()) { isKey = true; } else { @@ -386,7 +380,7 @@ public final class AWTTerminal implements ComponentListener, KeyListener, break; default: if (!alt && ctrl && !shift) { - ch = key.getKeyText(key.getKeyCode()).charAt(0); + ch = KeyEvent.getKeyText(key.getKeyCode()).charAt(0); } // Not a special key, put it together keypress = new TKeypress(false, 0, ch, alt, ctrl, shift); diff --git a/src/jexer/io/ECMA48Terminal.java b/src/jexer/io/ECMA48Terminal.java index 7721330..14ea20f 100644 --- a/src/jexer/io/ECMA48Terminal.java +++ b/src/jexer/io/ECMA48Terminal.java @@ -711,8 +711,6 @@ public final class ECMA48Terminal implements Runnable { boolean ctrl = false; boolean alt = false; boolean shift = false; - char keyCh = ch; - TKeypress key; // System.err.printf("state: %s ch %c\r\n", state, ch); diff --git a/src/jexer/io/Screen.java b/src/jexer/io/Screen.java index 1ecc4b1..a0497b8 100644 --- a/src/jexer/io/Screen.java +++ b/src/jexer/io/Screen.java @@ -644,8 +644,6 @@ public abstract class Screen { final CellAttributes border, final CellAttributes background, final int borderType, final boolean shadow) { - int boxTop = top; - int boxLeft = left; int boxWidth = right - left; int boxHeight = bottom - top; diff --git a/src/jexer/menu/TMenu.java b/src/jexer/menu/TMenu.java index ee1af55..56cbad5 100644 --- a/src/jexer/menu/TMenu.java +++ b/src/jexer/menu/TMenu.java @@ -126,15 +126,8 @@ public final class TMenu extends TWindow { */ @Override public void draw() { - CellAttributes menuColor; CellAttributes background = getTheme().getColor("tmenu"); - if (getAbsoluteActive()) { - menuColor = getTheme().getColor("tmenu.highlighted"); - } else { - menuColor = getTheme().getColor("tmenu"); - } - assert (getAbsoluteActive()); // Fill in the interior background @@ -490,7 +483,9 @@ public final class TMenu extends TWindow { int newY = getChildren().size() + 1; assert (newY < getHeight()); - TMenuItem menuItem = new TMenuSeparator(this, 1, newY); + // We just have to construct it, don't need to hang onto what it + // makes. + new TMenuSeparator(this, 1, newY); setHeight(getHeight() + 1); } diff --git a/src/jexer/menu/TSubMenu.java b/src/jexer/menu/TSubMenu.java index 4720a70..bd1815f 100644 --- a/src/jexer/menu/TSubMenu.java +++ b/src/jexer/menu/TSubMenu.java @@ -76,19 +76,14 @@ public final class TSubMenu extends TMenuItem { public void draw() { super.draw(); - CellAttributes background = getTheme().getColor("tmenu"); CellAttributes menuColor; - CellAttributes menuMnemonicColor; if (getAbsoluteActive()) { menuColor = getTheme().getColor("tmenu.highlighted"); - menuMnemonicColor = getTheme().getColor("tmenu.mnemonic.highlighted"); } else { if (getEnabled()) { menuColor = getTheme().getColor("tmenu"); - menuMnemonicColor = getTheme().getColor("tmenu.mnemonic"); } else { menuColor = getTheme().getColor("tmenu.disabled"); - menuMnemonicColor = getTheme().getColor("tmenu.disabled"); } } diff --git a/src/jexer/tterminal/ECMA48.java b/src/jexer/tterminal/ECMA48.java index d148b39..22867e1 100644 --- a/src/jexer/tterminal/ECMA48.java +++ b/src/jexer/tterminal/ECMA48.java @@ -179,7 +179,7 @@ public class ECMA48 implements Runnable { * @param deviceType DeviceType.VT100, DeviceType, XTERM, etc. * @param baseLang a base language without UTF-8 flag such as "C" or * "en_US" - * @return "LANG=en_US", "LANG=en_US.UTF-8", etc. + * @return "en_US", "en_US.UTF-8", etc. */ public static String deviceTypeLang(final DeviceType deviceType, final String baseLang) { @@ -690,6 +690,15 @@ public class ECMA48 implements Runnable { private boolean columns132 = false; /** + * Get 132 columns value. + * + * @return if true, the terminal is in 132 column mode + */ + public final boolean isColumns132() { + return columns132; + } + + /** * true = reverse video. Set by DECSCNM. */ private boolean reverseVideo = false; @@ -891,7 +900,7 @@ public class ECMA48 implements Runnable { * @param type one of the DeviceType constants to select VT100, VT102, * VT220, or XTERM * @param inputStream an InputStream connected to the remote side. For - * type == XTERM, inputStrem is converted to a Reader with UTF-8 + * type == XTERM, inputStream is converted to a Reader with UTF-8 * encoding. * @param outputStream an OutputStream connected to the remote user. For * type == XTERM, outputStream is converted to a Writer with UTF-8 @@ -978,7 +987,6 @@ public class ECMA48 implements Runnable { * Handle a linefeed. */ private void linefeed() { - int i; if (currentState.cursorY < scrollRegionBottom) { // Increment screen y @@ -3697,7 +3705,7 @@ public class ECMA48 implements Runnable { * * @param ch character from the remote side */ - public void consume(char ch) { + private void consume(char ch) { // DEBUG // System.err.printf("%c", ch);