2 |
|
|
3 |
import javax.swing.JLabel; |
import javax.swing.JLabel; |
4 |
|
|
5 |
|
import schmitzm.geotools.gui.GeotoolsGUIUtil; |
6 |
import schmitzm.geotools.gui.SelectableXMapPane; |
import schmitzm.geotools.gui.SelectableXMapPane; |
7 |
import schmitzm.geotools.gui.XMapPaneEvent; |
import schmitzm.geotools.gui.XMapPaneEvent; |
8 |
import schmitzm.geotools.map.event.JMapPaneListener; |
import schmitzm.geotools.map.event.JMapPaneListener; |
16 |
updateCrs(); |
updateCrs(); |
17 |
} |
} |
18 |
}; |
}; |
19 |
|
|
20 |
private final SelectableXMapPane mapPane; |
private final SelectableXMapPane mapPane; |
21 |
|
|
22 |
CrsLabel(SelectableXMapPane mapPane) { |
public CrsLabel(SelectableXMapPane mapPane) { |
23 |
super(); |
super(); |
24 |
this.mapPane = mapPane; |
this.mapPane = mapPane; |
25 |
|
|
26 |
mapPane.addMapPaneListener(listenForCrsChange); |
mapPane.addMapPaneListener(listenForCrsChange); |
27 |
|
|
28 |
updateCrs(); |
updateCrs(); |
29 |
|
|
30 |
|
setToolTipText(GeotoolsGUIUtil.R("CRSLabel.TT")); |
31 |
} |
} |
32 |
|
|
33 |
public void updateCrs() { |
public void updateCrs() { |
34 |
|
String crsName = ""; |
35 |
try { |
try { |
36 |
setText(mapPane.getMapContext().getCoordinateReferenceSystem() |
crsName = mapPane.getMapContext().getCoordinateReferenceSystem() |
37 |
.getName().toString()); |
.getName().toString(); |
38 |
|
setText(GeotoolsGUIUtil.R("CRSLabel", crsName)); |
39 |
} catch (Exception e) { |
} catch (Exception e) { |
40 |
setText(""); |
setText(""); |
41 |
} |
} |