|
@ -7,11 +7,14 @@ public class Card { |
|
|
public final static String PROPERTY_COLOR = "color"; |
|
|
public final static String PROPERTY_COLOR = "color"; |
|
|
public final static String PROPERTY_VALUE = "value"; |
|
|
public final static String PROPERTY_VALUE = "value"; |
|
|
|
|
|
|
|
|
|
|
|
public final static String PROPERTY_SELECTED = "selected"; |
|
|
|
|
|
|
|
|
protected PropertyChangeSupport listeners; |
|
|
protected PropertyChangeSupport listeners; |
|
|
|
|
|
|
|
|
private Color color; |
|
|
private Color color; |
|
|
private Value value; |
|
|
private Value value; |
|
|
private boolean facedown = false; |
|
|
private boolean facedown = false; |
|
|
|
|
|
private boolean selected; |
|
|
|
|
|
|
|
|
public enum Color { |
|
|
public enum Color { |
|
|
RED, BLUE, GREEN, YELLOW, BLACK; |
|
|
RED, BLUE, GREEN, YELLOW, BLACK; |
|
@ -51,6 +54,17 @@ public class Card { |
|
|
return this; |
|
|
return this; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isSelected() { |
|
|
|
|
|
return selected; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Card setSelected(boolean selected) { |
|
|
|
|
|
final boolean oldValue = this.selected; |
|
|
|
|
|
this.selected = selected; |
|
|
|
|
|
this.firePropertyChange(PROPERTY_SELECTED, oldValue, selected); |
|
|
|
|
|
return this; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public PropertyChangeSupport listeners() { |
|
|
public PropertyChangeSupport listeners() { |
|
|
if(this.listeners == null) { |
|
|
if(this.listeners == null) { |
|
|
this.listeners = new PropertyChangeSupport(this); |
|
|
this.listeners = new PropertyChangeSupport(this); |
|
|