// resources.
closeAllWindows();
+ // Close the desktop.
+ if (desktop != null) {
+ setDesktop(null);
+ }
+
// Give the overarching application an opportunity to release
// resources.
onExit();
mouse.getAbsoluteX(), mouse.getAbsoluteY(),
mouse.isMouse1(), mouse.isMouse2(),
mouse.isMouse3(),
- mouse.isMouseWheelUp(), mouse.isMouseWheelDown());
+ mouse.isMouseWheelUp(), mouse.isMouseWheelDown(),
+ mouse.isAlt(), mouse.isCtrl(), mouse.isShift());
} else {
// The first click of a potential double-click.
mouse.getAbsoluteX(), mouse.getAbsoluteY(),
mouse.isMouse1(), mouse.isMouse2(),
mouse.isMouse3(),
- mouse.isMouseWheelUp(), mouse.isMouseWheelDown());
+ mouse.isMouseWheelUp(), mouse.isMouseWheelDown(),
+ mouse.isAlt(), mouse.isCtrl(), mouse.isShift());
} else {
// The first click of a potential double-click.
*/
public final void setDesktop(final TDesktop desktop) {
if (this.desktop != null) {
+ this.desktop.onPreClose();
+ this.desktop.onUnfocus();
this.desktop.onClose();
}
this.desktop = desktop;
String version = getClass().getPackage().getImplementationVersion();
if (version == null) {
// This is Java 9+, use a hardcoded string here.
- version = "0.3.2";
+ version = "1.0.0";
}
messageBox(i18n.getString("aboutDialogTitle"),
MessageFormat.format(i18n.getString("aboutDialogText"), version),
// ------------------------------------------------------------------------
/**
- * Invert the cell color at a position. This is used to track the mouse.
- *
- * @param x column position
- * @param y row position
- */
- private void invertCell(final int x, final int y) {
- invertCell(x, y, false);
- }
-
- /**
- * Invert the cell color at a position. This is used to track the mouse.
+ * Draw the text mouse at position.
*
* @param x column position
* @param y row position
- * @param onlyThisCell if true, only invert this cell
*/
- private void invertCell(final int x, final int y,
- final boolean onlyThisCell) {
+ private void drawTextMouse(final int x, final int y) {
if (debugThreads) {
- System.err.printf("%d %s invertCell() %d %d\n",
+ System.err.printf("%d %s drawTextMouse() %d %d\n",
System.currentTimeMillis(), Thread.currentThread(), x, y);
if (activeWindow != null) {
}
}
- Cell cell = getScreen().getCharXY(x, y);
- if (cell.isImage()) {
- cell.invertImage();
- }
- if (cell.getForeColorRGB() < 0) {
- cell.setForeColor(cell.getForeColor().invert());
- } else {
- cell.setForeColorRGB(cell.getForeColorRGB() ^ 0x00ffffff);
- }
- if (cell.getBackColorRGB() < 0) {
- cell.setBackColor(cell.getBackColor().invert());
- } else {
- cell.setBackColorRGB(cell.getBackColorRGB() ^ 0x00ffffff);
- }
- getScreen().putCharXY(x, y, cell);
- if ((onlyThisCell == true) || (cell.getWidth() == Cell.Width.SINGLE)) {
- return;
- }
-
- // This cell is one half of a fullwidth glyph. Invert the other
- // half.
- if (cell.getWidth() == Cell.Width.LEFT) {
- if (x < getScreen().getWidth() - 1) {
- Cell rightHalf = getScreen().getCharXY(x + 1, y);
- if (rightHalf.getWidth() == Cell.Width.RIGHT) {
- invertCell(x + 1, y, true);
- return;
- }
- }
- }
- if (cell.getWidth() == Cell.Width.RIGHT) {
- if (x > 0) {
- Cell leftHalf = getScreen().getCharXY(x - 1, y);
- if (leftHalf.getWidth() == Cell.Width.LEFT) {
- invertCell(x - 1, y, true);
- }
+ // If this cell is on top of the desktop, and the desktop has
+ // requested a hidden mouse, bail out.
+ if ((desktop != null) && (activeWindow == null) && (activeMenu == null)) {
+ if ((desktop.hasHiddenMouse() == true)
+ && (x > desktop.getX())
+ && (x < desktop.getX() + desktop.getWidth() - 1)
+ && (y > desktop.getY())
+ && (y < desktop.getY() + desktop.getHeight() - 1)
+ ) {
+ return;
}
}
+
+ getScreen().invertCell(x, y);
}
/**
if ((textMouse == true) && (typingHidMouse == false)) {
// Draw mouse at the new position.
- invertCell(mouseX, mouseY);
+ drawTextMouse(mouseX, mouseY);
}
oldDrawnMouseX = mouseX;
}
}
if ((textMouse == true) && (typingHidMouse == false)) {
- invertCell(mouseX, mouseY);
+ drawTextMouse(mouseX, mouseY);
}
oldDrawnMouseX = mouseX;
oldDrawnMouseY = mouseY;
assert (!window.isActive());
if (activeWindow != null) {
- // TODO: see if this assertion is really necessary.
- // assert (activeWindow.getZ() == 0);
-
activeWindow.setActive(false);
// Increment every window Z that is on top of window