X-Git-Url: http://www2.svjatoslav.eu/gitweb/?p=sixth-3d.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fgui%2FGuiComponent.java;h=20e08eabb6762e9492e0ffd1bb9949ad0a36b08e;hp=64dc8796315f6b167d0fef366efb73b75c7ca150;hb=59baa428fb2d9e7f0fe5423f4cea47f2d6245914;hpb=e56f9b775bd49c31e8efab7204bee699036942b3 diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java index 64dc879..20e08ea 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Sixth 3D engine. Copyright ©2012-2019, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License @@ -56,13 +56,15 @@ public class GuiComponent extends AbstractCompositeShape implements } @Override - public void focusLost(final ViewPanel viewPanel) { + public boolean focusLost(final ViewPanel viewPanel) { hideBorder(); + return true; } @Override - public void focusReceived(final ViewPanel viewPanel) { + public boolean focusReceived(final ViewPanel viewPanel) { showBorder(); + return true; } public WireframeBox getBorders() { @@ -91,33 +93,37 @@ public class GuiComponent extends AbstractCompositeShape implements } @Override - public void keyPressed(final KeyEvent event, final ViewPanel viewPanel) { + public boolean keyPressed(final KeyEvent event, final ViewPanel viewPanel) { if (event.getKeyChar() == KeyboardHelper.ESC) - viewPanel.getKeyboardFocusTracker().popFocusOwner(); + viewPanel.getKeyboardFocusStack().popFocusOwner(); + return true; } @Override - public void keyReleased(final KeyEvent event, final ViewPanel viewPanel) { + public boolean keyReleased(final KeyEvent event, final ViewPanel viewPanel) { + return false; } @Override - public void mouseClicked() { - viewPanel.getKeyboardFocusTracker().setFocusOwner(this); + public boolean mouseClicked() { + return viewPanel.getKeyboardFocusStack().pushFocusOwner(this); } @Override - public void mouseEntered() { + public boolean mouseEntered() { + return false; } @Override - public void mouseExited() { + public boolean mouseExited() { + return false; } private void setDimensions(final Point3D size) { containingBox.setSizeCentered(size); } - public void showBorder() { + private void showBorder() { if (borderShown) return; borderShown = true;