svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.mapcontext / org.gvsig.fmap.mapcontext.api / src / main / java / org / gvsig / fmap / mapcontext / rendering / legend / events / LegendChangedEvent.java @ 40559
History | View | Annotate | Download (2.99 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.fmap.mapcontext.rendering.legend.events; |
25 |
|
26 |
import org.gvsig.fmap.mapcontext.events.FMapEvent; |
27 |
import org.gvsig.fmap.mapcontext.rendering.legend.ILegend; |
28 |
|
29 |
|
30 |
|
31 |
/**
|
32 |
* <p>Event or set of events produced when changes a legend.</p>
|
33 |
*
|
34 |
* @see FMapEvent
|
35 |
* @author Vicente Caballero Navarro
|
36 |
*/
|
37 |
public class LegendChangedEvent extends LegendEvent { |
38 |
/**
|
39 |
* <p>Identifies this event as a changed of a legend.</p>
|
40 |
*/
|
41 |
private static final int LEGEND_CHANGED = 0; |
42 |
|
43 |
/**
|
44 |
* <p>Previous vector legend.</p>
|
45 |
*/
|
46 |
private ILegend oldLegend;
|
47 |
|
48 |
/**
|
49 |
* <p>New vector legend.</p>
|
50 |
*/
|
51 |
private ILegend newLegend;
|
52 |
|
53 |
/**
|
54 |
* <p>Events that constitute this one.</p>
|
55 |
*/
|
56 |
private LegendChangedEvent[] events; |
57 |
|
58 |
/**
|
59 |
* <p>Creates a new legend change event.</p>
|
60 |
*
|
61 |
* @param oldLegend previous vector legend
|
62 |
* @param newLegend new vector legend
|
63 |
*
|
64 |
* @return a new legend change event
|
65 |
*/
|
66 |
public static LegendChangedEvent createLegendChangedEvent(ILegend oldLegend, |
67 |
ILegend newLegend){ |
68 |
return new LegendChangedEvent(oldLegend, newLegend, LEGEND_CHANGED); |
69 |
} |
70 |
|
71 |
/**
|
72 |
* <p>Creates a new legend change event.</p>
|
73 |
*
|
74 |
* @param oldLegend previous vector legend
|
75 |
* @param newLegend new vector legend
|
76 |
*/
|
77 |
private LegendChangedEvent(ILegend oldLegend,
|
78 |
ILegend newLegend, int eventType) {
|
79 |
this.oldLegend = oldLegend;
|
80 |
this.newLegend = newLegend;
|
81 |
setEventType(eventType); |
82 |
} |
83 |
|
84 |
/**
|
85 |
* <p>Gets the previous vector legend.</p>
|
86 |
*
|
87 |
* @return the previous vector legend
|
88 |
*/
|
89 |
public ILegend getOldLegend() {
|
90 |
return oldLegend;
|
91 |
} |
92 |
|
93 |
/**
|
94 |
* <p>Gets the new vector legend.</p>
|
95 |
*
|
96 |
* @return the new vector legend
|
97 |
*/
|
98 |
public ILegend getNewLegend() {
|
99 |
return newLegend;
|
100 |
} |
101 |
|
102 |
/**
|
103 |
* <p>Gets the events that constitute this one.</p>
|
104 |
*
|
105 |
* @return an array with the events that constitute this one
|
106 |
*/
|
107 |
public LegendChangedEvent[] getEvents() { |
108 |
return events;
|
109 |
} |
110 |
|
111 |
/**
|
112 |
* <p>Sets the events that constitute this one.</p>
|
113 |
*
|
114 |
* @param events an array with the events that constitute this one
|
115 |
*/
|
116 |
public void setEvents(LegendChangedEvent[] events) { |
117 |
this.events = events;
|
118 |
} |
119 |
} |