Revision 20098 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/LegendChangedEvent.java
LegendChangedEvent.java | ||
---|---|---|
45 | 45 |
|
46 | 46 |
|
47 | 47 |
/** |
48 |
* <p>Event or set of events produced when changes a legend.</p> |
|
48 | 49 |
* |
49 |
* <p>The class <code>LegendChangedEvent</code> stores all necessary information of an event |
|
50 |
* produced when a modification in a legend is done.</p> |
|
51 |
* |
|
52 | 50 |
* @see FMapEvent |
53 | 51 |
* @author Vicente Caballero Navarro |
54 | 52 |
*/ |
55 | 53 |
public class LegendChangedEvent extends LegendEvent { |
54 |
/** |
|
55 |
* <p>Identifies this event as a changed of a legend.</p> |
|
56 |
*/ |
|
56 | 57 |
private static final int LEGEND_CHANGED = 0; |
57 | 58 |
|
59 |
/** |
|
60 |
* <p>Previous vector legend.</p> |
|
61 |
*/ |
|
58 | 62 |
private ILegend oldLegend; |
63 |
|
|
64 |
/** |
|
65 |
* <p>New vector legend.</p> |
|
66 |
*/ |
|
59 | 67 |
private ILegend newLegend; |
68 |
|
|
69 |
/** |
|
70 |
* <p>Events that constitute this one.</p> |
|
71 |
*/ |
|
60 | 72 |
private LegendChangedEvent[] events; |
61 | 73 |
|
74 |
/** |
|
75 |
* <p>Creates a new legend change event.</p> |
|
76 |
* |
|
77 |
* @param oldLegend previous vector legend |
|
78 |
* @param newLegend new vector legend |
|
79 |
* |
|
80 |
* @return a new legend change event |
|
81 |
*/ |
|
62 | 82 |
public static LegendChangedEvent createLegendChangedEvent(ILegend oldLegend, |
63 | 83 |
ILegend newLegend){ |
64 | 84 |
return new LegendChangedEvent(oldLegend, newLegend, LEGEND_CHANGED); |
65 | 85 |
} |
66 |
|
|
86 |
|
|
67 | 87 |
/** |
68 |
* Constructor method.Creates a new LegendChangedEvent.
|
|
88 |
* <p>Creates a new legend change event.</p>
|
|
69 | 89 |
* |
70 |
* @param oldLegend old legend.
|
|
71 |
* @param newLegend New legend.
|
|
90 |
* @param oldLegend previous vector legend
|
|
91 |
* @param newLegend new vector legend
|
|
72 | 92 |
*/ |
73 | 93 |
private LegendChangedEvent(ILegend oldLegend, |
74 | 94 |
ILegend newLegend, int eventType) { |
... | ... | |
78 | 98 |
} |
79 | 99 |
|
80 | 100 |
/** |
81 |
* Returns the old legend.
|
|
101 |
* <p>Gets the previous vector legend.</p>
|
|
82 | 102 |
* |
83 |
* @return Old legend.
|
|
103 |
* @return the previous vector legend
|
|
84 | 104 |
*/ |
85 | 105 |
public ILegend getOldLegend() { |
86 | 106 |
return oldLegend; |
87 | 107 |
} |
88 | 108 |
|
89 | 109 |
/** |
90 |
* Returns the new legend.
|
|
110 |
* <p>Gets the new vector legend.</p>
|
|
91 | 111 |
* |
92 |
* @return New legend.
|
|
112 |
* @return the new vector legend
|
|
93 | 113 |
*/ |
94 | 114 |
public ILegend getNewLegend() { |
95 | 115 |
return newLegend; |
96 | 116 |
} |
97 | 117 |
|
98 | 118 |
/** |
99 |
* Vector of LegendChangedEvent with the events.
|
|
119 |
* <p>Gets the events that constitute this one.</p>
|
|
100 | 120 |
* |
101 |
* @return Vector of LegendChangedEvent.
|
|
121 |
* @return an array with the events that constitute this one
|
|
102 | 122 |
*/ |
103 | 123 |
public LegendChangedEvent[] getEvents() { |
104 | 124 |
return events; |
105 | 125 |
} |
106 | 126 |
|
107 | 127 |
/** |
108 |
* Inserts a vector with LegendChangedEvent.
|
|
128 |
* <p>Sets the events that constitute this one.</p>
|
|
109 | 129 |
* |
110 |
* @param events Vector of LegendChangedEvent.
|
|
130 |
* @param events an array with the events that constitute this one
|
|
111 | 131 |
*/ |
112 | 132 |
public void setEvents(LegendChangedEvent[] events) { |
113 | 133 |
this.events = events; |
Also available in: Unified diff