1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package net.sf.magicproject.zone;
21
22 import java.awt.FlowLayout;
23 import java.awt.event.HierarchyBoundsListener;
24 import java.awt.event.HierarchyEvent;
25
26 import javax.swing.JScrollPane;
27
28 import net.sf.magicproject.clickable.targetable.card.DelayedCard;
29 import net.sf.magicproject.clickable.targetable.card.MCard;
30 import net.sf.magicproject.token.IdZones;
31 import net.sf.magicproject.token.Visibility;
32 import net.sf.magicproject.ui.component.TableTop;
33
34 /***
35 * @author <a href="mailto:fabdouglas@users.sourceforge.net">Fabrice Daugan </a>
36 * @since 0.80
37 */
38 public class DelayedBuffer extends MZone {
39
40 /***
41 * The zone name.
42 */
43 public static final String ZONE_NAME = "dbz";
44
45 /***
46 * create a new instance of DelayedBuffer
47 *
48 * @param superPanel
49 * scroll panel containing this panel
50 * @param you
51 * is this zone is controlled by you.
52 * @since 0.3 feature "reverseImage" implemented
53 * @since 0.80 feature "reverseImage" removed, since this panel has been moved
54 * in a JTabbedPanel with the stack
55 * @see IdZones
56 */
57 DelayedBuffer(JScrollPane superPanel, boolean you) {
58 super(IdZones.DELAYED, new FlowLayout(FlowLayout.LEFT, 2, 2), superPanel,
59 !you, ZONE_NAME);
60 this.you = you;
61 this.reverseImage = false;
62 addHierarchyBoundsListener(new HierarchyBoundsListener() {
63
64 public void ancestorMoved(HierarchyEvent evt) {
65
66 }
67
68 public void ancestorResized(HierarchyEvent evt) {
69 updatePanel();
70 }
71 });
72 visibility = Visibility.PUBLIC;
73 }
74
75 @Override
76 public void updatePanel() {
77
78
79 }
80
81 /***
82 * Add a delayed ability to this zone
83 *
84 * @param delayed
85 * the delayed to add
86 */
87 public void add(DelayedCard delayed) {
88 super.add(delayed);
89 updatePanel();
90 }
91
92 @Override
93 public int getControllerIdPlayer() {
94 return you ? 0 : 1;
95 }
96
97 @Override
98 public void disHighLight() {
99 TableTop.getInstance().tabbedPane.setBackgroundAt(
100 TableTop.getInstance().tabbedPane.indexOfComponent(superPanel), null);
101 }
102
103 @Override
104 public boolean isMustBePaintedReversed(MCard card) {
105 return false;
106 }
107
108 /***
109 * is this zone is controlled by you.
110 */
111 private boolean you;
112 }