/[schmitzm]/trunk/src/skrueger/geotools/CrsLabel.java
ViewVC logotype

Diff of /trunk/src/skrueger/geotools/CrsLabel.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1220 by alfonx, Wed Nov 3 13:09:32 2010 UTC revision 1222 by alfonx, Wed Nov 3 14:07:08 2010 UTC
# Line 2  package skrueger.geotools; Line 2  package skrueger.geotools;
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;
# Line 15  public class CrsLabel extends JLabel { Line 16  public class CrsLabel extends JLabel {
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                  }                  }

Legend:
Removed from v.1220  
changed lines
  Added in v.1222

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26