Mercurial > mxd2map
diff src/java/de/intevation/mxd/reader/LabelEngineReader.java @ 180:f4eb506499f5
Done some code styling and removed TODOs.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Mon, 11 Jul 2011 12:11:08 +0200 |
parents | f3a91cd7440b |
children | 0bde090506f9 |
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/reader/LabelEngineReader.java Fri Jul 08 16:32:05 2011 +0200 +++ b/src/java/de/intevation/mxd/reader/LabelEngineReader.java Mon Jul 11 12:11:08 2011 +0200 @@ -44,8 +44,9 @@ this.properties = (LabelEngineLayerProperties)prop; } else { - throw new Exception("Not an instance of LaberEngineLayerProperties: " + - prop.getClass().toString()); + throw new Exception("Not an instance of" + + " LaberEngineLayerProperties: " + + prop.getClass().toString()); } } @@ -59,7 +60,7 @@ } public void setParent(Element parent) { - this.parent = parent; + this.parent = parent; } @@ -72,7 +73,7 @@ public Element read() throws IOException{ logger.debug("read()"); - Element labelElement; + Element labelElement; try { labelElement = util.addLabel(parent); } @@ -81,58 +82,60 @@ return null; } - try { - labelElement.setAttribute("expression", properties.getExpression()); - } - catch(IOException ioe) { - logger.warn("Could not read label expression."); - return null; - } + try { + labelElement.setAttribute( + "expression", + properties.getExpression()); + } + catch(IOException ioe) { + logger.warn("Could not read label expression."); + return null; + } try { - labelElement.setAttribute( + labelElement.setAttribute( "offset", - String.valueOf(properties.getOffset())); - } - catch(IOException ioe) { - logger.warn("Could not read label offset."); - } - - try { - labelElement.setAttribute( - "definition_query", - properties.getWhereClause()); - } - catch(IOException ioe) { - logger.warn("Could not read label where clause."); - } + String.valueOf(properties.getOffset())); + } + catch(IOException ioe) { + logger.warn("Could not read label offset."); + } try { - labelElement.setAttribute( - "max_scale", - String.valueOf(properties.getAnnotationMaximumScale())); - labelElement.setAttribute( - "min_scale", - String.valueOf(properties.getAnnotationMinimumScale())); - } - catch(IOException ioe) { - logger.warn("Could not read label scale."); - } + labelElement.setAttribute( + "definition_query", + properties.getWhereClause()); + } + catch(IOException ioe) { + logger.warn("Could not read label where clause."); + } - try { + try { + labelElement.setAttribute( + "max_scale", + String.valueOf(properties.getAnnotationMaximumScale())); + labelElement.setAttribute( + "min_scale", + String.valueOf(properties.getAnnotationMinimumScale())); + } + catch(IOException ioe) { + logger.warn("Could not read label scale."); + } + + try { ITextSymbol sym = properties.getSymbol(); - if(sym instanceof TextSymbol) { - TextSymbolReader tsr = new TextSymbolReader(sym); - tsr.setParent(labelElement); - tsr.setUtil(util); - tsr.read(); - } - } + if(sym instanceof TextSymbol) { + TextSymbolReader tsr = new TextSymbolReader(sym); + tsr.setParent(labelElement); + tsr.setUtil(util); + tsr.read(); + } + } catch(Exception e) { - logger.warn("Could not read label text symbol."); - } - - return labelElement; + logger.warn("Could not read label text symbol."); + } + + return labelElement; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :