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

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

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

revision 864 by alfonx, Mon May 24 23:28:45 2010 UTC revision 894 by alfonx, Fri Jun 4 09:19:07 2010 UTC
# Line 60  import com.vividsolutions.jts.geom.Envel Line 60  import com.vividsolutions.jts.geom.Envel
60   * This class enables a non Atlas context to use the Atlas LayerPanel   * This class enables a non Atlas context to use the Atlas LayerPanel
61   * {@link JPanel} as a {@link MapContextManagerInterface}   * {@link JPanel} as a {@link MapContextManagerInterface}
62   *   *
63   * @author <a href="mailto:[email protected]">Stefan Alfons Kr&uuml;ger</a>   * @author <a href="mailto:[email protected]">Stefan Alfons Tzeggai</a>
64   *   *
65   *         TODO Rename to StyledShapefile   *         TODO Rename to StyledShapefile
66   */   */
# Line 156  public class StyledFS implements StyledF Line 156  public class StyledFS implements StyledF
156          public CoordinateReferenceSystem getCrs() {          public CoordinateReferenceSystem getCrs() {
157                  if (crs == null) {                  if (crs == null) {
158                          crs = fs.getSchema().getCoordinateReferenceSystem();                          crs = fs.getSchema().getCoordinateReferenceSystem();
159                          if (fs.getSchema().getCoordinateReferenceSystem() == null) {                          if (crs == null) {
160                                  LOGGER.warn("Could not determine the CRS of " + getTitle()  
161                                                  + ". Using default " + GeoImportUtil.getDefaultCRS());                                  crs = fs.getSchema().getGeometryDescriptor()
162                                  crs = GeoImportUtil.getDefaultCRS();                                                  .getCoordinateReferenceSystem();
163                                    
164                                    if (crs == null) {
165                                            LOGGER.warn("Could not determine the CRS of " + getTitle()
166                                                            + ". Using default "
167                                                            + GeoImportUtil.getDefaultCRS());
168                                            crs = GeoImportUtil.getDefaultCRS();
169                                    }
170                          }                          }
171                  }                  }
172                  return crs;                  return crs;
# Line 292  public class StyledFS implements StyledF Line 299  public class StyledFS implements StyledF
299           * @return The {@link File} where the SLD was loaded from or           * @return The {@link File} where the SLD was loaded from or
300           *         <code>null</code> if there didn't exist a {@link File}.           *         <code>null</code> if there didn't exist a {@link File}.
301           *           *
302           * @author <a href="mailto:[email protected]">Stefan Alfons           * @author <a href="mailto:[email protected]">Stefan Alfons Tzeggai</a>
          *         Kr&uuml;ger</a>  
303           */           */
304          public File getSldFile() {          public File getSldFile() {
305                  return sldFile;                  return sldFile;
# Line 366  public class StyledFS implements StyledF Line 372  public class StyledFS implements StyledF
372          /**          /**
373           * Tries to load a style from the file denoted in {@link #getSldFile()}. If           * Tries to load a style from the file denoted in {@link #getSldFile()}. If
374           * the file doesn't exits, return <code>null</code>;           * the file doesn't exits, return <code>null</code>;
375             *
376           * @return <code>true</code> is style was loaded           * @return <code>true</code> is style was loaded
377           */           */
378          public boolean loadStyle() {          public boolean loadStyle() {
379                  if (getSldFile() == null)                  if (getSldFile() == null)
380                          return false;                          return false;
381                    
382                  try {                  try {
383                          Style[] loadSLD = StylingUtil.loadSLD(getSldFile());                          Style[] loadSLD = StylingUtil.loadSLD(getSldFile());
384                          setStyle(loadSLD[0]);                          setStyle(loadSLD[0]);

Legend:
Removed from v.864  
changed lines
  Added in v.894

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26