01: /* uDig - User Friendly Desktop Internet GIS client
02: * http://udig.refractions.net
03: * (C) 2004, Refractions Research Inc.
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation;
08: * version 2.1 of the License.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: */
15: package net.refractions.udig.project.ui.internal.property.pages;
16:
17: import net.refractions.udig.project.internal.Layer;
18: import net.refractions.udig.project.ui.internal.CRSPropertyPage;
19:
20: import org.eclipse.core.runtime.IAdaptable;
21: import org.eclipse.ui.IWorkbenchPropertyPage;
22:
23: /**
24: * Property page for setting the crs of a {@link Layer}
25: * @author Jesse
26: * @since 1.1.0
27: */
28: public class LayerCRSPropertyPage extends CRSPropertyPage implements
29: IWorkbenchPropertyPage {
30:
31: public LayerCRSPropertyPage() {
32: setMessage(
33: "Only change if the current projection is wrong. Changes only affect how the data is interpretted, it is not modified,",
34: WARNING);
35: }
36:
37: @Override
38: public void setElement(IAdaptable element) {
39: Layer layer;
40: if (element instanceof Layer) {
41: layer = (Layer) element;
42: } else {
43: layer = (Layer) element.getAdapter(Layer.class);
44: }
45: super .setStrategy(new LayerStrategy(layer));
46: }
47:
48: }
|