0.0.5
-- TDesktop (#14)
+
+- Scrollable:
+ - TTreeView
+ - TText
+ - TList
+ - TTerminalWindow
+ - TScrollableWindow
+
- TWindow:
- UNCLOSABLE (#8)
- Refactor SwingBackend to be embeddable
- jexer.Swing.blockMousePointer: false = do not invert cell, true
(default) is current behavior
- - Make Demo4 with two separate Swing demos in a single JFrame.
- - Make Demo5 mixing Swing and Jexer components
+ - Make Demo5 with two separate Swing demos in a single JFrame.
+ - Make Demo6 mixing Swing and Jexer components
- THelpWindow
- TText + clickable links
Jexer Work Log
==============
+July 15, 2017
+
+I think I have cleaned up most of the window show/hide/activate mess
+in TApplication. Demo4 has some cool interactions between a
+background TDesktop and several foreground TWindows, which helped
+expose bugs.
+
+July 9, 2017
+
+While working on TWindow.hide/show I decided that I am sick of
+TApplication's active window handling. TApplication makes lots of
+assumptions, things are too fragile between modal and not, and one
+cannot easily say window.activate(). So I will also be changing that
+too. ... Code is still a bit of a mess, but hooks are in place at
+least for show/hide/activate.
+
+July 8, 2017
+
+Qodem 1.0.0 released last month, I had a vacation, and a Jexer user
+(nikiroo) started opening up pull requests. :-) So back unto the
+breach we go!
+
+TButton is now animated so that there is some feedback when selected
+via keyboard. StringJustifier was written which permits TText's to
+have left/centered/right and full justification. TDesktop is now in
+too which can act as a permanent max-sized window without borders.
+
+Next up is Viewport, an interface to collect scrollbar API, and then a
+cleaner API for scrollable widgets and windows. After that is more
+window API: hide/show/maximize/restore, and unclosable windows. I am
+cherry-picking bits from @nikiroo's PRs, which will likely break them
+before it fixes things, but I will find some way to get Niki credited
+with those pieces.
+
March 21, 2017
I am starting to gear up for making Jexer a serious project now. I've
}
/**
- * Return the number of windows that are visible.
+ * Return the number of windows that are showing.
*
- * @return the number of windows that are visible
+ * @return the number of windows that are showing on screen
*/
public final int shownWindowCount() {
int n = 0;
return n;
}
+ /**
+ * Return the number of windows that are hidden.
+ *
+ * @return the number of windows that are hidden
+ */
+ public final int hiddenWindowCount() {
+ int n = 0;
+ for (TWindow w: windows) {
+ if (w.isHidden()) {
+ n++;
+ }
+ }
+ return n;
+ }
+
/**
* Check if a window instance is in this application's window list.
*
}
for (TWindow w: windows) {
if (w == window) {
+ assert (window.getApplication() == this);
return true;
}
}
* otherwise switch to the previous window in the list
*/
public final void switchWindow(final boolean forward) {
- // Only switch if there are multiple windows
- if (windows.size() < 2) {
+ // Only switch if there are multiple visible windows
+ if (shownWindowCount() < 2) {
return;
}
assert (activeWindow != null);
return;
}
- int nextWindowI;
- if (forward) {
- nextWindowI = (activeWindowI + 1) % windows.size();
- } else {
- if (activeWindowI == 0) {
- nextWindowI = windows.size() - 1;
+ int nextWindowI = activeWindowI;
+ for (;;) {
+ if (forward) {
+ nextWindowI++;
+ nextWindowI %= windows.size();
} else {
- nextWindowI = activeWindowI - 1;
+ nextWindowI--;
+ if (nextWindowI < 0) {
+ nextWindowI = windows.size() - 1;
+ }
}
- }
- activateWindow(windows.get(nextWindowI));
+ if (windows.get(nextWindowI).isShown()) {
+ activateWindow(windows.get(nextWindowI));
+ break;
+ }
+ }
} // synchronized (windows)
}
continue;
}
for (int x = w.getX(); x < w.getX() + w.getWidth(); x++) {
- if (x == width) {
+ if (x >= width) {
continue;
}
for (int y = w.getY(); y < w.getY() + w.getHeight(); y++) {
- if (y == height) {
+ if (y >= height) {
continue;
}
overlapMatrix[x][y]++;
long newOverlapN = 0;
// Start by adding each new cell.
for (int wx = x; wx < x + window.getWidth(); wx++) {
- if (wx == width) {
+ if (wx >= width) {
continue;
}
for (int wy = y; wy < y + window.getHeight(); wy++) {
- if (wy == height) {
+ if (wy >= height) {
continue;
}
newMatrix[wx][wy]++;
}
);
- final TWindow windowA = addWindow("Window A", 20, 14);
- final TWindow windowB = addWindow("Window B", 20, 14);
+ final TWindow windowA = addWindow("Window A", 25, 14);
+ final TWindow windowB = addWindow("Window B", 25, 14);
windowA.addButton("&Show Window B", 2, 2,
new TAction() {
public void DO() {
}
}
);
+ windowA.addButton("&Maximize Window B", 2, 6,
+ new TAction() {
+ public void DO() {
+ windowB.maximize();
+ }
+ }
+ );
+ windowA.addButton("&Restore Window B", 2, 8,
+ new TAction() {
+ public void DO() {
+ windowB.restore();
+ }
+ }
+ );
windowB.addButton("&Show Window A", 2, 2,
new TAction() {
public void DO() {
}
}
);
+ windowB.addButton("&Maximize Window A", 2, 6,
+ new TAction() {
+ public void DO() {
+ windowA.maximize();
+ }
+ }
+ );
+ windowB.addButton("&Restore Window A", 2, 8,
+ new TAction() {
+ public void DO() {
+ windowA.restore();
+ }
+ }
+ );
- desktop.addButton("&Show Window B", 25, 2,
+ desktop.addButton("S&how Window B", 25, 2,
new TAction() {
public void DO() {
windowB.show();
}
}
);
+ desktop.addButton("&Create Window C", 25, 15,
+ new TAction() {
+ public void DO() {
+ desktop.getApplication().addWindow("Window C",
+ 30, 20);
+ }
+ }
+ );
}