Commit d1d9a549 authored by Luna Riegel's avatar Luna Riegel
Browse files

Feat: Add TopologyErrorNode class

Adds a general node class for TopologyErrors, which allows custom
rendering/highlighting implementations for each error with a strategy
pattern.
parent 8fc0bec0
package de.hft.stuttgart.citydoctor2.gui.tree.node;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
import de.hft.stuttgart.citydoctor2.gui.tree.Renderable;
public class TopologyErrorNode extends Renderable {
private final RenderStrategy strategy;
private final String text;
public TopologyErrorNode(String text, RenderStrategy strategy) {
this.strategy = strategy;
this.text = text;
}
@Override
public void refreshTextColor() {}
@Override
public String getText() {
return text;
}
@Override
public void visit(Renderer renderer) {
strategy.render(renderer);
}
/**
* Strategy-pattern Interface for rendering/highlighting of the geometries in a TopologyError
*/
public interface RenderStrategy {
void render(Renderer renderer);
}
}
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