From 35fa03b35c552fcf1a4a284eee9f695f58a49e4f Mon Sep 17 00:00:00 2001 From: rmaco Date: Sat, 14 Mar 2020 20:59:43 +0200 Subject: [PATCH] working with dirty bit, and manual update --- resources/icons/close/close_black.png | Bin 0 -> 259 bytes resources/icons/close/close_white.png | Bin 0 -> 264 bytes resources/icons/maximize/square_black.png | Bin 0 -> 128 bytes resources/icons/maximize/square_white.png | Bin 0 -> 131 bytes resources/icons/minimize/minimize_black.png | Bin 0 -> 85 bytes resources/icons/minimize/minimize_white.png | Bin 0 -> 88 bytes src/Main.java | 26 ++- src/guiTree/Button.java | 72 +++---- src/guiTree/CustomFrame.java | 3 +- src/guiTree/Visual.java | 227 ++++++++++++-------- src/guiTree/Window.java | 19 +- src/guiTree/events/KeyAdapter.java | 20 ++ src/guiTree/events/MouseAdapter.java | 46 ++++ 13 files changed, 270 insertions(+), 143 deletions(-) create mode 100644 resources/icons/close/close_black.png create mode 100644 resources/icons/close/close_white.png create mode 100644 resources/icons/maximize/square_black.png create mode 100644 resources/icons/maximize/square_white.png create mode 100644 resources/icons/minimize/minimize_black.png create mode 100644 resources/icons/minimize/minimize_white.png create mode 100644 src/guiTree/events/KeyAdapter.java create mode 100644 src/guiTree/events/MouseAdapter.java diff --git a/resources/icons/close/close_black.png b/resources/icons/close/close_black.png new file mode 100644 index 0000000000000000000000000000000000000000..ebaeedeea3b785f3558a0e0659e4812d70507257 GIT binary patch literal 259 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpUtQ=Tr4Ar*{or!}%NI|{hU^G%p^ z$(8G-Q`3|J))>L|DIy0H8yPnw%oF{WoM?E@*q}wgiQ{4ajRx5rm(Md--1@}+fz?j* zqGtWoH{wF7@#~eMp1zKpEn!+Cby1=Is{L!_no9da)4#(g76>n;(%xy>cV(8!xf?_7 z?Z{oid|~=@<(i+Yvjf(hN_744sa4|P>D7Y!_Q*dx{TojG`PEUZcVB9wasl%_;h*a| pm~UwGbOi6xYS)r?;!tF1lz&sm6<0bbx&`Pf22WQ%mvv4FO#u8XXvP2l literal 0 HcmV?d00001 diff --git a/resources/icons/close/close_white.png b/resources/icons/close/close_white.png new file mode 100644 index 0000000000000000000000000000000000000000..dccd2c2ee140cc59852666baf02f9b12df565fd5 GIT binary patch literal 264 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpUt^PVn_Ar*{or!lfMI0(3kGg<|0 zztLPW;ew!*Lpz78ro)Uj(E|>jr~T;fS9l*eL#ai;sbhaaT66wq-vj$s=P!I(o*kpB z6#8%5F)!9VpT3zYO{kCTXt+6NPKU$3+Ur7x-9LP)VbMPiqYeOh8W5fim~siPe6Wp? z@4!8vgv$B-EIRR>+S_K^RCbk5ey&_mY1cIUxpF|I9n*y8$_zixa40?Kcp9v1rj+ny wZsaG&Bk!cUoLyz+KWXL&iQ`ag5n$k#y!~gYj^y{NK(8@)y85}Sb4q9e0OdGrN&o-= literal 0 HcmV?d00001 diff --git a/resources/icons/maximize/square_black.png b/resources/icons/maximize/square_black.png new file mode 100644 index 0000000000000000000000000000000000000000..04e5d1715829c7f96a1ac2a7db8b67033affa1c3 GIT binary patch literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|cTX3`kP60R2}=d}j(Fye^-Mo3 z1==4Qzpxf~&;F>2slxt-fz1Q^2*tzz{;+P@9x0Qo3;9AqPpWI!N}G9==eX``-hBB4 a1B1mw8_pY3Su}x0GI+ZBxvXay-BBRGzvc96M=p2XLyT^`zkHpVYWmMF$lH*}!eGMw d#JGotfgz??TZ3UMKA literal 0 HcmV?d00001 diff --git a/resources/icons/minimize/minimize_black.png b/resources/icons/minimize/minimize_black.png new file mode 100644 index 0000000000000000000000000000000000000000..bea6411469173bbce80b9254298a5106044db444 GIT binary patch literal 85 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|8BZ6-kP61+hUP#6F1Ldk9qf<( hvJ}|d<&mmjV94d<&Gjj+`wdjb;OXk;vd$@?2>{|f6r%tD literal 0 HcmV?d00001 diff --git a/resources/icons/minimize/minimize_white.png b/resources/icons/minimize/minimize_white.png new file mode 100644 index 0000000000000000000000000000000000000000..dbc1c7817d3121a3923ca274285ed504944cbe99 GIT binary patch literal 88 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|c~2L|kP61+hK4``F1LdkKmPx( lw-I=+-thQk+Jytm4C|(N8Y(Ydvlgh7!PC{xWt~$(69AdU8QA~; literal 0 HcmV?d00001 diff --git a/src/Main.java b/src/Main.java index e38a082..141e96b 100644 --- a/src/Main.java +++ b/src/Main.java @@ -10,6 +10,7 @@ public class Main { try{ Window window = XAMLParser.parse("ui.xml"); assert window != null; + window.revalidate(); Button button = (Button)window.findByName("button1"); window.addWindowListener(new WindowAdapter() { @Override @@ -17,7 +18,30 @@ public class Main { window.dispose(); } }); - + long now; + long prev = 0; + while(true) { + now = System.currentTimeMillis(); + if(now - prev >= 1000) { + int x = button.getLocationX(); + int y = button.getLocationY(); + if(x + button.getWidth() >= window.getWidth()) { + x = 0; + if(y + button.getHeight() >= window.getHeight()) { + y = 0; + } + else { + y += 30; + } + } + else { + x += 30; + } + button.setLocation(x, y); + prev = now; + window.revalidate(); + } + } }catch (Exception e){ e.printStackTrace(); } diff --git a/src/guiTree/Button.java b/src/guiTree/Button.java index c728fef..d4ba04a 100644 --- a/src/guiTree/Button.java +++ b/src/guiTree/Button.java @@ -1,6 +1,6 @@ package guiTree; -import guiTree.events.MouseListener; +import guiTree.events.MouseAdapter; import java.awt.*; import java.awt.event.MouseEvent; @@ -8,6 +8,7 @@ import java.awt.image.BufferedImage; public class Button extends Visual { private String label; + private Boolean pressed; public Button() { this(""); @@ -16,45 +17,17 @@ public class Button extends Visual { public Button(String label) { super(); this.label = label; - this.addMouseListener(new MouseListener() { - @Override - public void mouseClicked(MouseEvent mouseEvent) { - if(getBackgroundColor() == Color.BLACK) { - setBackgroundColor(Color.RED); - } - else { - setBackgroundColor(Color.BLACK); - } - } - - @Override - public void mouseReleased(MouseEvent mouseEvent) { - - } - + pressed = false; + this.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent mouseEvent) { - + pressed = true; + revalidate(); } - @Override - public void mouseEntered(MouseEvent mouseEvent) { - - } - - @Override - public void mouseExited(MouseEvent mouseEvent) { - - } - - @Override - public void mouseDragged(MouseEvent mouseEvent) { - - } - - @Override - public void mouseMoved(MouseEvent mouseEvent) { - + public void mouseReleased(MouseEvent mouseEvent) { + pressed = false; + revalidate(); } }); } @@ -62,11 +35,32 @@ public class Button extends Visual { @Override public void paint(BufferedImage imageBuffer) { - Graphics g = imageBuffer.getGraphics(); - g.setColor(this.getBackgroundColor()); + //Get Graphics + Graphics2D g = imageBuffer.createGraphics(); + + //Set Transparency + g.setComposite(AlphaComposite.Clear); + g.fillRect(0, 0, getWidth(), getHeight()); + g.setComposite(AlphaComposite.Src); + + //Choose background + if(pressed) { + g.setColor(Color.GRAY); + } + else { + g.setColor(this.getBackgroundColor()); + } + + //Draw Button g.fillRoundRect(0, 0, this.getWidth(), this.getHeight(), 50, 50); g.setColor(this.getForegroundColor()); - g.drawString(this.label, this.getWidth()/2, this.getHeight()/2); + + //Draw Label + int textWidth = g.getFontMetrics().stringWidth(label); + int textHeight = g.getFontMetrics().getHeight(); + g.drawString(this.label, this.getWidth()/2 - textWidth/2, this.getHeight()/2 + textHeight/2); + + g.dispose(); } public void setLabel(String label) { diff --git a/src/guiTree/CustomFrame.java b/src/guiTree/CustomFrame.java index b0c90c9..cf9edd0 100644 --- a/src/guiTree/CustomFrame.java +++ b/src/guiTree/CustomFrame.java @@ -3,6 +3,7 @@ package guiTree; import guiTree.events.KeyEventGetter; import guiTree.events.MouseWheelGetter; +import javax.swing.*; import javax.swing.event.MouseInputListener; import java.awt.*; import java.awt.event.KeyEvent; @@ -10,7 +11,7 @@ import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.awt.image.BufferedImage; -public class CustomFrame extends Frame { +public class CustomFrame extends JFrame { private BufferedImage imageBuffer; private Window parentWindow; diff --git a/src/guiTree/Visual.java b/src/guiTree/Visual.java index 0dea9ad..1eaaddc 100644 --- a/src/guiTree/Visual.java +++ b/src/guiTree/Visual.java @@ -34,6 +34,8 @@ public class Visual { private Color backgroundColor; private Color foregroundColor; private Boolean active; + private Boolean dirty; + private Boolean pressed; /*-------------------------------------------------------------------- @@ -48,71 +50,42 @@ public class Visual { this.backgroundColor = Color.WHITE; this.foregroundColor = Color.BLACK; + this.dirty = true; this.active = this instanceof Window; } /*-------------------------------------------------------------------- - Attributes Methods + Attributes Setters ---------------------------------------------------------------------*/ - public String getName() { - return name; - } - public void setName(String name) { this.name = name; } - public int getWidth() - { - return this.width; - } - - public int getHeight() - { - return this.height; - } - public void setSize(Integer width, Integer height){ this.width = width; this.height = height; - initializeImageBuffer(width, height); + initializeImageBuffer(); - this.revalidate(); - } - - public int getLocationX(){ - return this.locationX; - } - - public int getLocationY(){ - return this.locationY; + this.dirty = true; } public void setLocation(Integer x, Integer y){ this.locationX = x; this.locationY = y; - this.revalidate(); - } - - public Color getBackgroundColor() { - return backgroundColor; + this.dirty = true; } public void setBackgroundColor(Color backgroundColor) { this.backgroundColor = backgroundColor; - this.revalidate(); - } - - public Color getForegroundColor() { - return foregroundColor; + this.dirty = true; } public void setForegroundColor(Color foregroundColor) { this.foregroundColor = foregroundColor; - this.revalidate(); + this.dirty = true; } private void calculateInitialSize() { @@ -133,6 +106,39 @@ public class Visual { } } + /*-------------------------------------------------------------------- + Attributes Getters + ---------------------------------------------------------------------*/ + + public String getName() { + return name; + } + + public int getWidth() + { + return this.width; + } + + public int getHeight() + { + return this.height; + } + + public int getLocationX(){ + return this.locationX; + } + + public int getLocationY(){ + return this.locationY; + } + + public Color getBackgroundColor() { + return backgroundColor; + } + + public Color getForegroundColor() { + return foregroundColor; + } /*-------------------------------------------------------------------- Tree Methods @@ -159,10 +165,10 @@ public class Visual { child.setParent(this); child.calculateInitialLocation(); child.calculateInitialSize(); - child.imageBuffer = new BufferedImage(child.getWidth(), child.getHeight(), BufferedImage.TYPE_3BYTE_BGR); - child.active = true; - child.revalidate(); + if(this.active) { + child.activate(); + } } public void removeVisual(Visual child) { @@ -171,8 +177,8 @@ public class Visual { child.setSize(0, 0); child.setLocation(0, 0); child.imageBuffer = null; - child.active = false; - revalidate(); + child.deactivate(); + this.dirty = true; } private void setParent(Visual parent) @@ -189,28 +195,36 @@ public class Visual { this.parent.handleNotification(); } - public void callRepaint() - { - this.paint(this.imageBuffer); - this.parent.revalidate(); + private void repaint() { + this.paint(imageBuffer); + if(this.dirty) { + this.revalidate(); + return; + } + for(Visual v: children) { + v.repaint(); + imageBuffer.getGraphics().drawImage(v.imageBuffer, v.locationX, v.locationY, null); + } } public void revalidate() { if(!this.active){ return; } - initializeImageBuffer(width, height); + clearImageBuffer(); this.paint(imageBuffer); - for(Visual v:children){ + for (Visual v : children) { + v.repaint(); this.imageBuffer.getGraphics().drawImage(v.imageBuffer, v.locationX, v.locationY, null); } + this.dirty = false; if(!(this instanceof Window)){ this.parent.revalidate(); + return; } - else{ - Window window = (Window)this; - window.setFrameImageBuffer(this.imageBuffer); - } + Window window = (Window)this; + window.setFrameImageBuffer(imageBuffer); + window.repaint(); } public void paint(BufferedImage imageBuffer) { @@ -261,18 +275,19 @@ public class Visual { for(MouseListener mouseListener: mouseListeners) { mouseListener.mouseClicked(mouseEvent); } + dirty = true; } } void mouseReleased(MouseEvent mouseEvent, int offsetX, int offsetY) { boolean front = true; - int mouseX = mouseEvent.getX() + offsetX; - int mouseY = mouseEvent.getY() + offsetY; + int mouseX = mouseEvent.getX() - offsetX; + int mouseY = mouseEvent.getY() - offsetY; for(Visual v: children) { if(mouseX > v.getLocationX() && - mouseY < v.getLocationY() && - mouseX < v.getWidth() && - mouseY > v.getHeight()) { + mouseY > v.getLocationY() && + mouseX < v.getWidth() + v.getLocationX() && + mouseY < v.getHeight() + v.getLocationY()) { front = false; v.mouseReleased(mouseEvent, offsetX + v.locationX, offsetY + v.locationY); } @@ -281,18 +296,19 @@ public class Visual { for(MouseListener mouseListener: mouseListeners) { mouseListener.mouseReleased(mouseEvent); } + dirty = true; } } void mousePressed(MouseEvent mouseEvent, int offsetX, int offsetY) { boolean front = true; - int mouseX = mouseEvent.getX() + offsetX; - int mouseY = mouseEvent.getY() + offsetY; + int mouseX = mouseEvent.getX() - offsetX; + int mouseY = mouseEvent.getY() - offsetY; for(Visual v: children) { if(mouseX > v.getLocationX() && - mouseY < v.getLocationY() && - mouseX < v.getWidth() && - mouseY > v.getHeight()) { + mouseY > v.getLocationY() && + mouseX < v.getWidth() + v.getLocationX() && + mouseY < v.getHeight() + v.getLocationY()) { front = false; v.mousePressed(mouseEvent, offsetX + v.locationX, offsetY + v.locationY); } @@ -301,18 +317,19 @@ public class Visual { for(MouseListener mouseListener: mouseListeners) { mouseListener.mousePressed(mouseEvent); } + dirty = true; } } void mouseEntered(MouseEvent mouseEvent, int offsetX, int offsetY) { boolean front = true; - int mouseX = mouseEvent.getX() + offsetX; - int mouseY = mouseEvent.getY() + offsetY; + int mouseX = mouseEvent.getX() - offsetX; + int mouseY = mouseEvent.getY() - offsetY; for(Visual v: children) { if(mouseX > v.getLocationX() && - mouseY < v.getLocationY() && - mouseX < v.getWidth() && - mouseY > v.getHeight()) { + mouseY > v.getLocationY() && + mouseX < v.getWidth() + v.getLocationX() && + mouseY < v.getHeight() + v.getLocationY()){ front = false; v.mouseEntered(mouseEvent, offsetX + v.locationX, offsetY + v.locationY); } @@ -321,18 +338,19 @@ public class Visual { for(MouseListener mouseListener: mouseListeners) { mouseListener.mouseEntered(mouseEvent); } + dirty = true; } } void mouseExited(MouseEvent mouseEvent, int offsetX, int offsetY) { boolean front = true; - int mouseX = mouseEvent.getX() + offsetX; - int mouseY = mouseEvent.getY() + offsetY; + int mouseX = mouseEvent.getX() - offsetX; + int mouseY = mouseEvent.getY() - offsetY; for(Visual v: children) { if(mouseX > v.getLocationX() && - mouseY < v.getLocationY() && - mouseX < v.getWidth() && - mouseY > v.getHeight()) { + mouseY > v.getLocationY() && + mouseX < v.getWidth() + v.getLocationX() && + mouseY < v.getHeight() + v.getLocationY()) { front = false; v.mouseExited(mouseEvent, offsetX + v.locationX, offsetY + v.locationY); } @@ -341,18 +359,19 @@ public class Visual { for(MouseListener mouseListener: mouseListeners) { mouseListener.mouseExited(mouseEvent); } + dirty = true; } } void mouseDragged(MouseEvent mouseEvent, int offsetX, int offsetY) { boolean front = true; - int mouseX = mouseEvent.getX() + offsetX; - int mouseY = mouseEvent.getY() + offsetY; + int mouseX = mouseEvent.getX() - offsetX; + int mouseY = mouseEvent.getY() - offsetY; for(Visual v: children) { if(mouseX > v.getLocationX() && - mouseY < v.getLocationY() && - mouseX < v.getWidth() && - mouseY > v.getHeight()) { + mouseY > v.getLocationY() && + mouseX < v.getWidth() + v.getLocationX() && + mouseY < v.getHeight() + v.getLocationY()) { front = false; v.mouseDragged(mouseEvent, offsetX + v.locationX, offsetY + v.locationY); } @@ -361,38 +380,40 @@ public class Visual { for(MouseListener mouseListener: mouseListeners) { mouseListener.mouseDragged(mouseEvent); } + dirty = true; } } void mouseMoved(MouseEvent mouseEvent, int offsetX, int offsetY) { boolean front = true; - int mouseX = mouseEvent.getX() + offsetX; - int mouseY = mouseEvent.getY() + offsetY; + int mouseX = mouseEvent.getX() - offsetX; + int mouseY = mouseEvent.getY() - offsetY; for(Visual v: children) { if(mouseX > v.getLocationX() && - mouseY < v.getLocationY() && - mouseX < v.getWidth() && - mouseY > v.getHeight()) { + mouseY > v.getLocationY() && + mouseX < v.getWidth() + v.getLocationX() && + mouseY < v.getHeight() + v.getLocationY()) { front = false; - v.mouseMoved(mouseEvent, offsetX + v.locationX, offsetY + locationY); + v.mouseMoved(mouseEvent, offsetX + v.locationX, offsetY + v.locationY); } } if(front) { for(MouseListener mouseListener: mouseListeners) { mouseListener.mouseMoved(mouseEvent); } + dirty = true; } } void mouseWheelMoved(MouseWheelEvent mouseWheelEvent, int offsetX, int offsetY) { boolean front = true; - int mouseX = mouseWheelEvent.getX() + offsetX; - int mouseY = mouseWheelEvent.getY() + offsetY; + int mouseX = mouseWheelEvent.getX() - offsetX; + int mouseY = mouseWheelEvent.getY() - offsetY; for(Visual v: children) { if(mouseX > v.getLocationX() && - mouseY < v.getLocationY() && - mouseX < v.getWidth() && - mouseY > v.getHeight()) { + mouseY > v.getLocationY() && + mouseX < v.getWidth() + v.getLocationX() && + mouseY < v.getHeight() + v.getLocationY()) { front = false; v.mouseWheelMoved(mouseWheelEvent, offsetX + v.locationX, offsetY + v.locationY); } @@ -401,15 +422,39 @@ public class Visual { for(MouseWheelListener mouseWheelListener: mouseWheelListeners) { mouseWheelListener.mouseWheelMoved(mouseWheelEvent); } + dirty = true; } } /*-------------------------------------------------------------------- Helper Methods ---------------------------------------------------------------------*/ - private void initializeImageBuffer(Integer width, Integer height){ - this.imageBuffer = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR); - this.imageBuffer.getGraphics().setColor(backgroundColor); - this.imageBuffer.getGraphics().fillRect(0, 0, width, height); + private void initializeImageBuffer(){ + this.imageBuffer = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); + clearImageBuffer(); + } + + private void clearImageBuffer() { + Graphics g = this.imageBuffer.getGraphics(); + g.setColor(backgroundColor); + g.fillRect(0, 0, width, height); + g.dispose(); + } + + private void activate() { + this.active = true; + this.imageBuffer = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); + for(Visual child: children) { + child.activate(); + } + this.dirty = true; + } + + private void deactivate() { + this.active = false; + this.imageBuffer = null; + for(Visual child: children) { + child.deactivate(); + } } } diff --git a/src/guiTree/Window.java b/src/guiTree/Window.java index 39d66c0..0062848 100644 --- a/src/guiTree/Window.java +++ b/src/guiTree/Window.java @@ -4,11 +4,9 @@ import java.awt.*; import java.awt.event.WindowListener; import java.awt.event.WindowStateListener; import java.awt.image.BufferedImage; -import java.util.List; public class Window extends Visual { public CustomFrame frame; - private List listenerList; public Window() { @@ -25,7 +23,6 @@ public class Window extends Visual { { this.frame.setSize(width, height); super.setSize(width, height); - revalidate(); } public void setFrameImageBuffer(BufferedImage imageBuffer){ @@ -33,6 +30,10 @@ public class Window extends Visual { this.frame.repaint(); } + public void repaint() { + this.frame.repaint(); + } + public void setSize(Dimension dimension) { this.setSize(dimension.width, dimension.height); } @@ -57,6 +58,10 @@ public class Window extends Visual { frame.dispose(); } + public void repaint(long tm) { + frame.repaint(tm); + } + public void setPositionRelativeTo(Component c){ frame.setLocationRelativeTo(c); } @@ -66,12 +71,4 @@ public class Window extends Visual { } public void setUndecorated(Boolean undecorated){frame.setUndecorated(undecorated);} - - public void addListener(Visual listener) { - this.listenerList.add(listener); - } - - public void removeListener(Visual listener) { - this.listenerList.remove(listener); - } } diff --git a/src/guiTree/events/KeyAdapter.java b/src/guiTree/events/KeyAdapter.java new file mode 100644 index 0000000..af33dcb --- /dev/null +++ b/src/guiTree/events/KeyAdapter.java @@ -0,0 +1,20 @@ +package guiTree.events; + +import java.awt.event.KeyEvent; + +public abstract class KeyAdapter implements KeyListener{ + @Override + public void keyTyped(KeyEvent keyEvent) { + + } + + @Override + public void keyPressed(KeyEvent keyEvent) { + + } + + @Override + public void keyReleased(KeyEvent keyEvent) { + + } +} diff --git a/src/guiTree/events/MouseAdapter.java b/src/guiTree/events/MouseAdapter.java new file mode 100644 index 0000000..affe0f9 --- /dev/null +++ b/src/guiTree/events/MouseAdapter.java @@ -0,0 +1,46 @@ +package guiTree.events; + +import java.awt.event.MouseEvent; +import java.awt.event.MouseWheelEvent; + +public abstract class MouseAdapter implements MouseListener, MouseWheelListener{ + @Override + public void mouseClicked(MouseEvent mouseEvent) { + + } + + @Override + public void mouseReleased(MouseEvent mouseEvent) { + + } + + @Override + public void mousePressed(MouseEvent mouseEvent) { + + } + + @Override + public void mouseEntered(MouseEvent mouseEvent) { + + } + + @Override + public void mouseExited(MouseEvent mouseEvent) { + + } + + @Override + public void mouseDragged(MouseEvent mouseEvent) { + + } + + @Override + public void mouseMoved(MouseEvent mouseEvent) { + + } + + @Override + public void mouseWheelMoved(MouseWheelEvent mouseWheelEvent) { + + } +}