X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fgui%2FGuiComponent.java;h=3f16d26928f384e58a49e4e979fcffea21034343;hb=3e2b906bd05617a4d9725de39ac14c9ea1f8736c;hp=70350e01c8ff7cf581f2fd112223c6b351fe5d7d;hpb=70ee733b25c56bed539b89ff5507ae0af842d68a;p=sixth-3d.git 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 70350e0..3f16d26 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java @@ -1,19 +1,14 @@ /* - * Sixth 3D engine. Copyright ©2012-2018, 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 - * or later as published by the Free Software Foundation. - * + * Sixth 3D engine. Author: Svjatoslav Agejenko. + * This project is released under Creative Commons Zero (CC0) license. */ - 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.gui.humaninput.MouseInteractionController; -import eu.svjatoslav.sixth.e3d.gui.humaninput.UserInputHandler; -import eu.svjatoslav.sixth.e3d.gui.textEditorComponent.KeyboardHelper; +import eu.svjatoslav.sixth.e3d.gui.humaninput.KeyboardInputHandler; +import eu.svjatoslav.sixth.e3d.gui.humaninput.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; @@ -22,7 +17,7 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.Wirefr import java.awt.event.KeyEvent; public class GuiComponent extends AbstractCompositeShape implements - UserInputHandler, MouseInteractionController { + KeyboardInputHandler, MouseInteractionController { private static final String GROUP_GUI_FOCUS = "gui.focus"; public final ViewPanel viewPanel; @@ -38,19 +33,13 @@ public class GuiComponent extends AbstractCompositeShape implements setDimensions(size); } - @Override - public boolean beforeRender(final ViewPanel viewPanel, - final int millisecondsSinceLastFrame) { - return false; - } - private WireframeBox createBorder() { final LineAppearance appearance = new LineAppearance(10, new eu.svjatoslav.sixth.e3d.renderer.raster.Color(255, 0, 0, 100)); final double borderSize = 10; - final Box borderArea = containingBox.clone().addBorder(borderSize); + final Box borderArea = containingBox.clone().enlarge(borderSize); return new WireframeBox(borderArea, appearance); } @@ -105,20 +94,22 @@ public class GuiComponent extends AbstractCompositeShape implements } @Override - public void mouseClicked() { - viewPanel.getKeyboardFocusStack().pushFocusOwner(this); + public boolean mouseClicked(int button) { + 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); + containingBox.setBoxSize(size); } private void showBorder() {