Commit 766e173e authored by Luna Riegel's avatar Luna Riegel
Browse files

Refactor: Simplify GeometryNode text creation

parent b9a9738f
...@@ -251,6 +251,21 @@ public class Geometry extends GmlElement { ...@@ -251,6 +251,21 @@ public class Geometry extends GmlElement {
return "Geometry [type=" + type + ", lod=" + lod + ", id=" + getGmlId() + "]"; return "Geometry [type=" + type + ", lod=" + lod + ", id=" + getGmlId() + "]";
} }
public String getDisplayText() {
StringBuilder sb = new StringBuilder();
sb.append("Geometry [");
sb.append(this.getType());
sb.append(", ");
sb.append(this.getLod());
if (this.getGmlId().isGenerated()) {
sb.append("]");
} else {
sb.append("] ");
sb.append(this.getGmlId());
}
return sb.toString();
}
public List<Vertex> getVertices() { public List<Vertex> getVertices() {
return vertices; return vertices;
} }
......
...@@ -119,6 +119,10 @@ public class ImplicitGeometryHolder extends Geometry { ...@@ -119,6 +119,10 @@ public class ImplicitGeometryHolder extends Geometry {
LibraryObject.resetObjectMap(); LibraryObject.resetObjectMap();
} }
@Override
public String getDisplayText() {
return "Implicit" + super.getDisplayText();
}
} }
...@@ -13,21 +13,7 @@ public class GeometryNode extends Renderable { ...@@ -13,21 +13,7 @@ public class GeometryNode extends Renderable {
public GeometryNode(Geometry geom) { public GeometryNode(Geometry geom) {
this.geom = geom; this.geom = geom;
StringBuilder sb = new StringBuilder(); text = geom.getDisplayText();
if (geom instanceof ImplicitGeometryHolder) {
sb.append("Implicit");
}
sb.append("Geometry [");
sb.append(geom.getType());
sb.append(", ");
sb.append(geom.getLod());
if (geom.getGmlId().isGenerated()) {
sb.append("]");
} else {
sb.append("] ");
sb.append(geom.getGmlId());
}
text = sb.toString();
} }
@Override @Override
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment