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=70350e01c8ff7cf581f2fd112223c6b351fe5d7d;hp=15e2d7789ed9283876bf18586dcc6862faaad8b4;hb=70ee733b25c56bed539b89ff5507ae0af842d68a;hpb=8bceefbdb7316557ee77902cc6ac216f5c1ff160 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 15e2d77..70350e0 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java @@ -11,10 +11,10 @@ package eu.svjatoslav.sixth.e3d.gui; import eu.svjatoslav.sixth.e3d.geometry.Box; import eu.svjatoslav.sixth.e3d.geometry.Point3D; -import eu.svjatoslav.sixth.e3d.math.Transform; import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController; import eu.svjatoslav.sixth.e3d.gui.humaninput.UserInputHandler; import eu.svjatoslav.sixth.e3d.gui.textEditorComponent.KeyboardHelper; +import eu.svjatoslav.sixth.e3d.math.Transform; import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance; import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCompositeShape; import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.WireframeBox; @@ -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,18 +93,20 @@ 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); + viewPanel.getKeyboardFocusStack().pushFocusOwner(this); } @Override @@ -117,7 +121,7 @@ public class GuiComponent extends AbstractCompositeShape implements containingBox.setSizeCentered(size); } - public void showBorder() { + private void showBorder() { if (borderShown) return; borderShown = true;