Revision 1082 trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/LayerCollectionEvent.java

View differences:

LayerCollectionEvent.java
9 9
 * @author Vicente Caballero Navarro
10 10
 */
11 11
public class LayerCollectionEvent extends FMapEvent {
12
	private final static int LAYER_ADDED = 0;
13
	private final static int LAYER_REMOVED = 2;
14
	private final static int LAYER_ADDING = 3;
15
	private final static int LAYER_REMOVING = 5;
16
	private final static int LAYER_ACTIVATION_CHANGED = 6;
17
	private final static int LAYER_VISIBILITY_CHANGED = 7;
18
	
12 19
	private FLayers layers;
13 20
	private FLayer affected;
21
	public static LayerCollectionEvent createLayerAddedEvent(FLayer lyr){
22
		return new LayerCollectionEvent(lyr, LAYER_ADDED);
23
	}
14 24

  
25
	public static LayerCollectionEvent createLayerRemovedEvent(FLayer lyr){
26
		return new LayerCollectionEvent(lyr, LAYER_REMOVED);
27
	}
28

  
29
	public static LayerCollectionEvent createLayerAddingEvent(FLayer lyr){
30
		return new LayerCollectionEvent(lyr, LAYER_ADDING);
31
	}
32

  
33
	public static LayerCollectionEvent createLayerRemovingEvent(FLayer lyr){
34
		return new LayerCollectionEvent(lyr, LAYER_REMOVING);
35
	}
36

  
37
	public static LayerCollectionEvent createLayerActivationEvent(FLayer lyr){
38
		return new LayerCollectionEvent(lyr, LAYER_ACTIVATION_CHANGED);
39
	}
40

  
41
	public static LayerCollectionEvent createLayerVisibilityEvent(FLayer lyr){
42
		return new LayerCollectionEvent(lyr, LAYER_VISIBILITY_CHANGED);
43
	}
44
	
15 45
	/**
16 46
	 * Crea un nuevo LayerCollectionEvent.
17 47
	 *
18 48
	 * @param lyr FLayers.
19 49
	 */
20
	public LayerCollectionEvent(FLayer lyr) {
50
	protected LayerCollectionEvent(FLayer lyr, int eventType) {
21 51
		layers = lyr.getParentLayer();
22 52
		affected = lyr;
53
		setEventType(eventType);
23 54
	}
24 55

  
25 56
	/**

Also available in: Unified diff