/*
- * 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.KeyboardHelper;
+import eu.svjatoslav.sixth.e3d.gui.humaninput.KeyboardInputHandler;
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 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;
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);
}
}
@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() {