Commit 70201856 authored by Riegel's avatar Riegel
Browse files

Feat: Add JavaFX ListCell & Node for CityGmlZipEntry

2 merge requests!28Version 3.17.0 Release,!26Add ZIP-archive support
Showing with 52 additions and 0 deletions
+52 -0
package de.hft.stuttgart.citydoctor2.gui.tree;
import javafx.scene.control.ListCell;
public class ZipEntryListCell extends ListCell<ZipEntryNode> {
@Override
protected void updateItem(ZipEntryNode item, boolean empty) {
super.updateItem(item, empty);
if (!empty || item != null) {
setText(item.getText());
} else {
setText(null);
}
}
public void updateColor() {
setTextFill(getItem().getTextColor());
}
}
package de.hft.stuttgart.citydoctor2.gui.tree;
import de.hft.stuttgart.citydoctor2.zip.CityGmlZipEntry;
import javafx.scene.paint.Color;
public class ZipEntryNode {
private final CityGmlZipEntry entry;
public ZipEntryNode(CityGmlZipEntry entry) {
this.entry = entry;
}
public Color getTextColor() {
if (entry.getErrorType() != null) {
return Color.RED;
} else if (entry.isDecompressed()) {
return Color.GREEN;
} else {
return Color.BLACK;
}
}
public String getText() {
return entry.getDisplayName();
}
public CityGmlZipEntry getEntry() {
return entry;
}
}
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