43 |
import javax.swing.JComponent; |
import javax.swing.JComponent; |
44 |
|
|
45 |
/** |
/** |
|
* Ancestor Event |
|
46 |
* @author Andrew Selkirk |
* @author Andrew Selkirk |
47 |
* @author Ronald Veldema |
* @author Ronald Veldema |
48 |
*/ |
*/ |
49 |
public class AncestorEvent extends AWTEvent { |
public class AncestorEvent extends AWTEvent |
50 |
|
{ |
51 |
//------------------------------------------------------------- |
private static final serialVersionUID = 4799843792513591457L; |
52 |
// Constants -------------------------------------------------- |
|
53 |
//------------------------------------------------------------- |
public static int ANCESTOR_ADDED = 0; |
54 |
|
public static int ANCESTOR_MOVED = 1; |
55 |
/** |
public static int ANCESTOR_REMOVED = 2; |
56 |
* ANCESTOR_ADDED constant |
|
57 |
*/ |
private JComponent sourceComponent; |
58 |
public static int ANCESTOR_ADDED = 0; |
private Container ancestor; |
59 |
|
private Container ancestorParent; |
60 |
/** |
|
61 |
* ANCESTOR_MOVED constant |
/** |
62 |
*/ |
* @param source Source component |
63 |
public static int ANCESTOR_MOVED = 1; |
* @param id ID |
64 |
|
* @param ancestor ancestor |
65 |
/** |
* @param ancestorParent parent ancestor |
66 |
* ANCESTOR_REMOVED constant |
*/ |
67 |
*/ |
public AncestorEvent(JComponent source, int id, Container ancestor, |
68 |
public static int ANCESTOR_REMOVED = 2; |
Container ancestorParent) |
69 |
|
{ |
70 |
|
super(source, id); |
71 |
//------------------------------------------------------------- |
this.sourceComponent = source; |
72 |
// Variables -------------------------------------------------- |
this.ancestor = ancestor; |
73 |
//------------------------------------------------------------- |
this.ancestorParent = ancestorParent; |
74 |
|
} |
75 |
/** |
|
76 |
* Source component |
/** |
77 |
*/ |
* Returns the ancestor of this event. |
78 |
private JComponent sourceComponent = null; |
*/ |
79 |
|
public Container getAncestor() |
80 |
/** |
{ |
81 |
* Ancestor |
return ancestor; |
82 |
*/ |
} |
83 |
private Container ancestor = null; |
|
84 |
|
/** |
85 |
/** |
* Returns the ancester parent of this event. |
86 |
* Ancestor Parent |
*/ |
87 |
*/ |
public Container getAncestorParent() |
88 |
private Container ancestorParent = null; |
{ |
89 |
|
return ancestorParent; |
90 |
|
} |
91 |
//------------------------------------------------------------- |
|
92 |
// Initialization --------------------------------------------- |
/** |
93 |
//------------------------------------------------------------- |
* Returns the source of this event. |
94 |
|
*/ |
95 |
/** |
public JComponent getComponent() |
96 |
* Constructor AncestorEvent |
{ |
97 |
* @param source Source component |
return sourceComponent; |
98 |
* @param id ID |
} |
99 |
* @param ancestor ancestor |
} |
|
* @param ancestorParent parent ancestor |
|
|
*/ |
|
|
public AncestorEvent(JComponent source, int id, Container ancestor, |
|
|
Container ancestorParent) { |
|
|
super(source, id); |
|
|
this.sourceComponent = source; |
|
|
this.ancestor = ancestor; |
|
|
this.ancestorParent = ancestorParent; |
|
|
} // AncestorEvent() |
|
|
|
|
|
|
|
|
//------------------------------------------------------------- |
|
|
// Methods ---------------------------------------------------- |
|
|
//------------------------------------------------------------- |
|
|
|
|
|
/** |
|
|
* Get ancestor |
|
|
* @return ancestor |
|
|
*/ |
|
|
public Container getAncestor() { |
|
|
return ancestor; |
|
|
} // getAncestor() |
|
|
|
|
|
/** |
|
|
* Get ancestor parent |
|
|
* @return ancestor parent |
|
|
*/ |
|
|
public Container getAncestorParent() { |
|
|
return ancestorParent; |
|
|
} // getAncestorParent() |
|
|
|
|
|
/** |
|
|
* Get component |
|
|
* @return component |
|
|
*/ |
|
|
public JComponent getComponent() { |
|
|
return sourceComponent; |
|
|
} // getComponent() |
|
|
|
|
|
|
|
|
} // AncestorEvent |
|