aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-awt
diff options
context:
space:
mode:
authorJulien Gouesse <[email protected]>2014-08-01 20:44:31 +0200
committerJulien Gouesse <[email protected]>2014-08-01 20:44:31 +0200
commit64e8a1e3e1a085ea362cff13f13ea022547d0f16 (patch)
tree4e80ed6e191afd06bf64678dbb6fcf8040f5a867 /ardor3d-awt
parenta41878ff9b079d62512054bd3722fe01a7fddf40 (diff)
Adds some 'override' annotations into ardor3d-awt
Diffstat (limited to 'ardor3d-awt')
-rw-r--r--ardor3d-awt/src/main/java/com/ardor3d/image/util/awt/AWTImageLoader.java1
-rw-r--r--ardor3d-awt/src/main/java/com/ardor3d/image/util/awt/ScreenShotImageExporter.java2
-rw-r--r--ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtFocusWrapper.java6
-rw-r--r--ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtKeyboardWrapper.java7
-rw-r--r--ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtMouseManager.java7
-rw-r--r--ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtMouseWrapper.java15
6 files changed, 35 insertions, 3 deletions
diff --git a/ardor3d-awt/src/main/java/com/ardor3d/image/util/awt/AWTImageLoader.java b/ardor3d-awt/src/main/java/com/ardor3d/image/util/awt/AWTImageLoader.java
index 839d03a..9835bb4 100644
--- a/ardor3d-awt/src/main/java/com/ardor3d/image/util/awt/AWTImageLoader.java
+++ b/ardor3d-awt/src/main/java/com/ardor3d/image/util/awt/AWTImageLoader.java
@@ -61,6 +61,7 @@ public class AWTImageLoader implements ImageLoader {
ImageLoaderUtil.registerHandler(new AWTImageLoader(), supportedFormats);
}
+ @Override
public Image load(final InputStream is, final boolean flipImage) throws IOException {
final BufferedImage image = ImageIO.read(is);
if (image == null) {
diff --git a/ardor3d-awt/src/main/java/com/ardor3d/image/util/awt/ScreenShotImageExporter.java b/ardor3d-awt/src/main/java/com/ardor3d/image/util/awt/ScreenShotImageExporter.java
index e3a8e8f..d7e6795 100644
--- a/ardor3d-awt/src/main/java/com/ardor3d/image/util/awt/ScreenShotImageExporter.java
+++ b/ardor3d-awt/src/main/java/com/ardor3d/image/util/awt/ScreenShotImageExporter.java
@@ -67,6 +67,7 @@ public class ScreenShotImageExporter implements ScreenExportable {
_useAlpha = useAlpha;
}
+ @Override
public void export(final ByteBuffer data, final int width, final int height) {
final BufferedImage img = new BufferedImage(width, height, _useAlpha ? BufferedImage.TYPE_INT_ARGB
: BufferedImage.TYPE_INT_RGB);
@@ -105,6 +106,7 @@ public class ScreenShotImageExporter implements ScreenExportable {
}
}
+ @Override
public ImageDataFormat getFormat() {
if (_useAlpha) {
return ImageDataFormat.RGBA;
diff --git a/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtFocusWrapper.java b/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtFocusWrapper.java
index 5514856..9675af0 100644
--- a/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtFocusWrapper.java
+++ b/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtFocusWrapper.java
@@ -28,14 +28,17 @@ public class AwtFocusWrapper implements FocusWrapper, FocusListener {
_component = component;
}
+ @Override
public void focusGained(final FocusEvent e) {
- // do nothing
+ // do nothing
}
+ @Override
public void focusLost(final FocusEvent e) {
_focusLost = true;
}
+ @Override
public boolean getAndClearFocusLost() {
final boolean result = _focusLost;
@@ -44,6 +47,7 @@ public class AwtFocusWrapper implements FocusWrapper, FocusListener {
return result;
}
+ @Override
public void init() {
_component.addFocusListener(this);
}
diff --git a/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtKeyboardWrapper.java b/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtKeyboardWrapper.java
index 5aa9a4d..1b58724 100644
--- a/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtKeyboardWrapper.java
+++ b/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtKeyboardWrapper.java
@@ -46,17 +46,21 @@ public class AwtKeyboardWrapper implements KeyboardWrapper, KeyListener {
_component = Preconditions.checkNotNull(component, "component");
}
+ @Override
public void init() {
_component.addKeyListener(this);
_component.addFocusListener(new FocusListener() {
+ @Override
public void focusLost(final FocusEvent e) {}
+ @Override
public void focusGained(final FocusEvent e) {
_pressedList.clear();
}
});
}
+ @Override
public synchronized PeekingIterator<KeyEvent> getEvents() {
if (_currentIterator == null || !_currentIterator.hasNext()) {
_currentIterator = new AwtKeyboardIterator();
@@ -65,6 +69,7 @@ public class AwtKeyboardWrapper implements KeyboardWrapper, KeyListener {
return _currentIterator;
}
+ @Override
public synchronized void keyTyped(final java.awt.event.KeyEvent e) {
if (_consumeEvents) {
e.consume();
@@ -72,6 +77,7 @@ public class AwtKeyboardWrapper implements KeyboardWrapper, KeyListener {
}
}
+ @Override
public synchronized void keyPressed(final java.awt.event.KeyEvent e) {
final Key pressed = fromKeyEventToKey(e);
if (!_pressedList.contains(pressed)) {
@@ -83,6 +89,7 @@ public class AwtKeyboardWrapper implements KeyboardWrapper, KeyListener {
}
}
+ @Override
public synchronized void keyReleased(final java.awt.event.KeyEvent e) {
final Key released = fromKeyEventToKey(e);
_upcomingEvents.add(new KeyEvent(released, KeyState.UP, e.getKeyChar()));
diff --git a/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtMouseManager.java b/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtMouseManager.java
index 194b729..963407d 100644
--- a/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtMouseManager.java
+++ b/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtMouseManager.java
@@ -61,6 +61,7 @@ public class AwtMouseManager implements MouseManager {
}
}
+ @Override
public void setCursor(final MouseCursor cursor) {
if (cursor == MouseCursor.SYSTEM_DEFAULT) {
if (_grabbedState == GrabbedState.GRABBED) {
@@ -87,6 +88,7 @@ public class AwtMouseManager implements MouseManager {
}
}
+ @Override
public void setPosition(final int x, final int y) {
if (!isSetPositionSupported()) {
throw new UnsupportedOperationException();
@@ -98,6 +100,7 @@ public class AwtMouseManager implements MouseManager {
setMousePosition(x, y);
} else {
SwingUtilities.invokeAndWait(new Runnable() {
+ @Override
public void run() {
setMousePosition(x, y);
}
@@ -118,6 +121,7 @@ public class AwtMouseManager implements MouseManager {
_robot.mouseMove(p.x, p.y);
}
+ @Override
public void setGrabbed(final GrabbedState grabbedState) {
if (!isSetGrabbedSupported()) {
throw new UnsupportedOperationException();
@@ -153,14 +157,17 @@ public class AwtMouseManager implements MouseManager {
return _transparentCursor;
}
+ @Override
public boolean isSetPositionSupported() {
return _robot != null;
}
+ @Override
public boolean isSetGrabbedSupported() {
return _robot != null;
}
+ @Override
public GrabbedState getGrabbed() {
return _grabbedState;
}
diff --git a/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtMouseWrapper.java b/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtMouseWrapper.java
index c64b70b..c2c2a91 100644
--- a/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtMouseWrapper.java
+++ b/ardor3d-awt/src/main/java/com/ardor3d/input/awt/AwtMouseWrapper.java
@@ -76,12 +76,14 @@ public class AwtMouseWrapper implements MouseWrapper, MouseListener, MouseWheelL
}
}
+ @Override
public void init() {
_component.addMouseListener(this);
_component.addMouseMotionListener(this);
_component.addMouseWheelListener(this);
}
+ @Override
public synchronized PeekingIterator<MouseState> getEvents() {
expireClickEvents();
@@ -102,6 +104,7 @@ public class AwtMouseWrapper implements MouseWrapper, MouseListener, MouseWheelL
}
}
+ @Override
public synchronized void mousePressed(final MouseEvent e) {
final MouseButton b = getButtonForEvent(e);
if (_clickArmed.contains(b)) {
@@ -122,6 +125,7 @@ public class AwtMouseWrapper implements MouseWrapper, MouseListener, MouseWheelL
addNewState(e, buttons, null);
}
+ @Override
public synchronized void mouseReleased(final MouseEvent e) {
initState(e);
if (_consumeEvents) {
@@ -145,11 +149,13 @@ public class AwtMouseWrapper implements MouseWrapper, MouseListener, MouseWheelL
addNewState(e, buttons, null);
}
+ @Override
public synchronized void mouseDragged(final MouseEvent e) {
// forward to mouseMoved.
mouseMoved(e);
}
+ @Override
public synchronized void mouseMoved(final MouseEvent e) {
_clickArmed.clear();
_clicks.clear();
@@ -206,6 +212,7 @@ public class AwtMouseWrapper implements MouseWrapper, MouseListener, MouseWheelL
}
}
+ @Override
public void mouseWheelMoved(final MouseWheelEvent e) {
initState(e);
@@ -224,8 +231,9 @@ public class AwtMouseWrapper implements MouseWrapper, MouseListener, MouseWheelL
private void addNewState(final MouseEvent mouseEvent, final EnumMap<MouseButton, ButtonState> enumMap,
final Multiset<MouseButton> clicks) {
final MouseState newState = new MouseState(mouseEvent.getX(), getArdor3DY(mouseEvent), getDX(mouseEvent),
- getDY(mouseEvent), (mouseEvent instanceof MouseWheelEvent ? ((MouseWheelEvent) mouseEvent)
- .getWheelRotation() : 0), enumMap, clicks);
+ getDY(mouseEvent),
+ (mouseEvent instanceof MouseWheelEvent ? ((MouseWheelEvent) mouseEvent).getWheelRotation() : 0),
+ enumMap, clicks);
synchronized (AwtMouseWrapper.this) {
_upcomingEvents.add(newState);
@@ -293,6 +301,7 @@ public class AwtMouseWrapper implements MouseWrapper, MouseListener, MouseWheelL
// -- The following interface methods are not used. --
+ @Override
public synchronized void mouseClicked(final MouseEvent e) {
// Yes, we could use the click count here, but in the interests of this working the same way as SWT and Native,
// we
@@ -302,6 +311,7 @@ public class AwtMouseWrapper implements MouseWrapper, MouseListener, MouseWheelL
}
}
+ @Override
public synchronized void mouseEntered(final MouseEvent e) {
// ignore this
if (_consumeEvents) {
@@ -309,6 +319,7 @@ public class AwtMouseWrapper implements MouseWrapper, MouseListener, MouseWheelL
}
}
+ @Override
public synchronized void mouseExited(final MouseEvent e) {
// ignore this
if (_consumeEvents) {