mouseDragged event

This commit is contained in:
yugecin 2017-01-18 21:48:27 +01:00
parent c4560ae9f1
commit f214841359
5 changed files with 23 additions and 1 deletions

View File

@ -386,7 +386,9 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen
public void mouseMoved(int oldx, int oldy, int newx, int newy) { } public void mouseMoved(int oldx, int oldy, int newx, int newy) { }
@Override @Override
public void mouseDragged(int oldx, int oldy, int newx, int newy) { } public void mouseDragged(int oldx, int oldy, int newx, int newy) {
state.mouseDragged(oldx, oldy, newx, newy);
}
@Override @Override
public void setInput(Input input) { } public void setInput(Input input) { }

View File

@ -107,6 +107,11 @@ public abstract class BaseOpsuState implements OpsuState, EventListener<Resoluti
return false; return false;
} }
@Override
public boolean mouseDragged(int oldx, int oldy, int newx, int newy) {
return false;
}
@Override @Override
public void writeErrorDump(StringWriter dump) { public void writeErrorDump(StringWriter dump) {
dump.append("> BaseOpsuState dump\n"); dump.append("> BaseOpsuState dump\n");

View File

@ -58,4 +58,9 @@ public interface OpsuState extends ErrorDumpable {
*/ */
boolean mouseReleased(int button, int x, int y); boolean mouseReleased(int button, int x, int y);
/**
* @return false to stop event bubbling
*/
boolean mouseDragged(int oldx, int oldy, int newx, int newy);
} }

View File

@ -100,6 +100,11 @@ public class EmptyRedState implements OpsuState {
return false; return false;
} }
@Override
public boolean mouseDragged(int oldx, int oldy, int newx, int newy) {
return false;
}
@Override @Override
public void writeErrorDump(StringWriter dump) { public void writeErrorDump(StringWriter dump) {
dump.append("> EmptyRedState dump\n"); dump.append("> EmptyRedState dump\n");

View File

@ -92,6 +92,11 @@ public class EmptyState implements OpsuState {
return false; return false;
} }
@Override
public boolean mouseDragged(int oldx, int oldy, int newx, int newy) {
return false;
}
@Override @Override
public void writeErrorDump(StringWriter dump) { public void writeErrorDump(StringWriter dump) {
dump.append("> EmptyState dump\n"); dump.append("> EmptyState dump\n");