* Draft - Added possibility to hide (and show again) cards from the picked cards area.

This commit is contained in:
LevelX2 2014-11-22 18:19:59 +01:00
parent 4622973639
commit bf3fa37e5d
6 changed files with 217 additions and 31 deletions

View file

@ -28,6 +28,7 @@
package mage.client.util;
import java.awt.Component;
import java.io.Serializable;
/**
@ -36,8 +37,11 @@ import java.io.Serializable;
*/
public class Event implements Serializable {
private final Object source;
private final Component component;
private final String eventName;
private final int number;
private final int xPos;
private final int yPos;
public Event(Object source, String eventName) {
this(source, eventName, 0);
@ -47,6 +51,18 @@ public class Event implements Serializable {
this.source = source;
this.eventName = eventName;
this.number = number;
this.xPos = 0;
this.yPos = 0;
this.component = null;
}
public Event(Object source, String eventName, int xPos, int yPos, Component component) {
this.source = source;
this.eventName = eventName;
this.number =0;
this.xPos = xPos;
this.yPos = yPos;
this.component = component;
}
public Object getSource() {
@ -60,5 +76,17 @@ public class Event implements Serializable {
public int getNumber() {
return number;
}
public int getxPos() {
return xPos;
}
public int getyPos() {
return yPos;
}
public Component getComponent() {
return component;
}
}

View file

@ -35,10 +35,11 @@ import java.util.concurrent.CopyOnWriteArrayList;
/**
*
* @author BetaSteward_at_googlemail.com
* @param <E>
*/
public abstract class EventDispatcher<E extends Event> implements Serializable {
private List<Listener<E>> listeners = new CopyOnWriteArrayList<Listener<E>>();
private final List<Listener<E>> listeners = new CopyOnWriteArrayList<>();
public void addListener(Listener<E> listener) {
if (!listeners.contains(listener)) {