Commit 97a65114 authored by Riegel's avatar Riegel
Browse files

Merge branch 'dev' into 'master'

Version 3.15.0

See merge request !8
parents 99c8f6a8 5950ea5f
Pipeline #10106 passed with stage
in 3 minutes and 15 seconds
package de.hft.stuttgart.citydoctor2.gui.table;
import de.hft.stuttgart.citydoctor2.check.ErrorId;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleObjectProperty;
public class ErrorStat {
private final SimpleObjectProperty<ErrorId> errorId = new SimpleObjectProperty<>();
private final SimpleIntegerProperty count = new SimpleIntegerProperty();
public ErrorStat(ErrorId errorId) {
this(errorId, 0);
}
public ErrorStat(ErrorId errorId, int count) {
this.errorId.set(errorId);
this.count.set(count);
}
public int getCount() {
return count.get();
}
public IntegerProperty getCountProperty() {
return count;
}
public ObjectProperty<ErrorId> getErrorIdProperty() {
return errorId;
}
public void setCount(int count) {
this.count.set(count);
}
public void incrementCount() {
count.set(count.get() + 1);
}
public ErrorId getErrorId() {
return errorId.get();
}
public void setErrorId(ErrorId errorId) {
this.errorId.set(errorId);
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "ErrorStat [errorId=" + errorId + ", count=" + count + "]";
}
}
package de.hft.stuttgart.citydoctor2.gui.tree;
import java.util.List;
import de.hft.stuttgart.citydoctor2.datastructure.BoundarySurface;
import de.hft.stuttgart.citydoctor2.gui.CheckStatus;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class AllBoundarySurfacesNode extends Renderable {
private final List<BoundarySurface> boundarySurfaces;
public AllBoundarySurfacesNode(List<BoundarySurface> boundarySurfaces) {
this.boundarySurfaces = boundarySurfaces;
}
@Override
public String getText() {
return "Boundary Surfaces";
}
@Override
public void visit(Renderer renderer) {
renderer.clearCurrentRender();
}
@Override
public void refreshTextColor() {
boolean isValidated = false;
for (BoundarySurface bs : boundarySurfaces) {
if (bs.isValidated()) {
isValidated = true;
}
if (bs.containsAnyError()) {
setStatus(CheckStatus.ERROR);
return;
}
}
if (isValidated) {
setStatus(CheckStatus.OK);
} else {
setStatus(CheckStatus.NOT_CHECKED);
}
}
}
/*-
* Copyright 2022 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package de.hft.stuttgart.citydoctor2.gui.tree;
import java.util.List;
import de.hft.stuttgart.citydoctor2.datastructure.BridgeConstructiveElement;
import de.hft.stuttgart.citydoctor2.gui.CheckStatus;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class AllBridgeConstructiveElementsNode extends Renderable {
private final List<BridgeConstructiveElement> constructiveElements;
public AllBridgeConstructiveElementsNode(List<BridgeConstructiveElement> constructiveElements) {
this.constructiveElements = constructiveElements;
}
@Override
public String getText() {
return "Constructive Elements";
}
@Override
public void visit(Renderer renderer) {
renderer.clearCurrentRender();
}
@Override
public void refreshTextColor() {
boolean isValidated = false;
for (BridgeConstructiveElement bce : constructiveElements) {
if (bce.isValidated()) {
isValidated = true;
}
if (bce.containsAnyError()) {
setStatus(CheckStatus.ERROR);
return;
}
}
if (isValidated) {
setStatus(CheckStatus.OK);
} else {
setStatus(CheckStatus.NOT_CHECKED);
}
}
}
/*-
* Copyright 2022 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package de.hft.stuttgart.citydoctor2.gui.tree;
import java.util.List;
import de.hft.stuttgart.citydoctor2.datastructure.BridgeObject;
import de.hft.stuttgart.citydoctor2.gui.CheckStatus;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class AllBridgePartsNode extends Renderable {
private final List<BridgeObject> bridgeParts;
public AllBridgePartsNode(List<BridgeObject> bridgeParts) {
this.bridgeParts = bridgeParts;
}
@Override
public String getText() {
return "Bridge Parts";
}
@Override
public void visit(Renderer renderer) {
renderer.clearCurrentRender();
}
@Override
public void refreshTextColor() {
boolean wasChecked = false;
for (BridgeObject bp : bridgeParts) {
if (bp.isValidated()) {
wasChecked = true;
if (bp.containsAnyError()) {
setStatus(CheckStatus.ERROR);
return;
}
}
}
if (wasChecked) {
setStatus(CheckStatus.OK);
} else {
setStatus(CheckStatus.NOT_CHECKED);
}
}
}
package de.hft.stuttgart.citydoctor2.gui.tree;
import java.util.List;
import de.hft.stuttgart.citydoctor2.datastructure.BridgeObject;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class AllBridgesNode extends Renderable {
private final List<BridgeObject> bridges;
public AllBridgesNode(List<BridgeObject> bridges) {
this.bridges = bridges;
}
@Override
public void refreshTextColor() {
// no color changes
}
@Override
public String getText() {
return "Bridges";
}
@Override
public void visit(Renderer renderer) {
renderer.renderBridges(bridges);
}
}
package de.hft.stuttgart.citydoctor2.gui.tree;
import java.util.List;
import de.hft.stuttgart.citydoctor2.datastructure.BuildingPart;
import de.hft.stuttgart.citydoctor2.gui.CheckStatus;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class AllBuildingPartsNode extends Renderable {
private final List<BuildingPart> buildingParts;
public AllBuildingPartsNode(List<BuildingPart> buildingParts) {
this.buildingParts = buildingParts;
}
@Override
public String getText() {
return "Building Parts";
}
@Override
public void visit(Renderer renderer) {
renderer.clearCurrentRender();
}
@Override
public void refreshTextColor() {
boolean wasChecked = false;
for (BuildingPart bp : buildingParts) {
if (bp.isValidated()) {
wasChecked = true;
if (bp.containsAnyError()) {
setStatus(CheckStatus.ERROR);
return;
}
}
}
if (wasChecked) {
setStatus(CheckStatus.OK);
} else {
setStatus(CheckStatus.NOT_CHECKED);
}
}
}
package de.hft.stuttgart.citydoctor2.gui.tree;
import java.util.List;
import de.hft.stuttgart.citydoctor2.datastructure.Building;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class AllBuildingsNode extends Renderable {
private final List<Building> buildings;
public AllBuildingsNode(List<Building> buildings) {
this.buildings = buildings;
}
@Override
public void refreshTextColor() {
// no color changes
}
@Override
public String getText() {
return "Buildings";
}
@Override
public void visit(Renderer renderer) {
renderer.renderBuildings(buildings);
}
}
package de.hft.stuttgart.citydoctor2.gui.tree;
import java.util.List;
import de.hft.stuttgart.citydoctor2.datastructure.Installation;
import de.hft.stuttgart.citydoctor2.gui.CheckStatus;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class AllInstallationsNode extends Renderable {
private final List<Installation> buildingInstallations;
public AllInstallationsNode(List<Installation> bis) {
this.buildingInstallations = bis;
}
@Override
public String getText() {
return "Building Installations";
}
@Override
public void visit(Renderer renderer) {
renderer.clearCurrentRender();
}
@Override
public void refreshTextColor() {
boolean wasChecked = false;
for (Installation bp : buildingInstallations) {
if (bp.isValidated()) {
wasChecked = true;
if (bp.containsAnyError()) {
setStatus(CheckStatus.ERROR);
return;
}
}
}
if (wasChecked) {
setStatus(CheckStatus.OK);
} else {
setStatus(CheckStatus.NOT_CHECKED);
}
}
}
\ No newline at end of file
package de.hft.stuttgart.citydoctor2.gui.tree;
import java.util.List;
import de.hft.stuttgart.citydoctor2.datastructure.Opening;
import de.hft.stuttgart.citydoctor2.gui.CheckStatus;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class AllOpeningsNode extends Renderable {
private final List<Opening> openings;
public AllOpeningsNode(List<Opening> openings) {
this.openings = openings;
}
@Override
public void refreshTextColor() {
for (Opening bp : openings) {
if (bp.containsAnyError()) {
setStatus(CheckStatus.ERROR);
return;
}
}
setStatus(CheckStatus.OK);
}
@Override
public String getText() {
return "Openings";
}
@Override
public void visit(Renderer renderer) {
renderer.clearCurrentRender();
}
}
package de.hft.stuttgart.citydoctor2.gui.tree;
import java.util.List;
import de.hft.stuttgart.citydoctor2.datastructure.CityObject;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class AllTerrainNode extends Renderable {
private final List<CityObject> land;
public AllTerrainNode(List<CityObject> land) {
this.land = land;
}
@Override
public void refreshTextColor() {
// no use
}
@Override
public String getText() {
return "Terrain";
}
@Override
public void visit(Renderer renderer) {
renderer.renderTerrain(land);
}
}
/*-
* Copyright 2022 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package de.hft.stuttgart.citydoctor2.gui.tree;
import java.util.List;
import de.hft.stuttgart.citydoctor2.datastructure.TinObject;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class AllTinNode extends Renderable {
public AllTinNode(List<TinObject> components) {
// TODO Auto-generated constructor stub
}
@Override
public void refreshTextColor() {
// TODO Auto-generated method stub
}
@Override
public String getText() {
return "Components";
}
@Override
public void visit(Renderer renderer) {
// TODO Auto-generated method stub
}
}
package de.hft.stuttgart.citydoctor2.gui.tree;
import java.util.List;
import de.hft.stuttgart.citydoctor2.datastructure.TransportationObject;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class AllTransportationNode extends Renderable {
private final List<TransportationObject> transportation;
public AllTransportationNode(List<TransportationObject> transportation) {
this.transportation = transportation;
}
@Override
public void refreshTextColor() {
// no use
}
@Override
public String getText() {
return "Transportation";
}
@Override
public void visit(Renderer renderer) {
renderer.renderTransportation(transportation);
}
}
package de.hft.stuttgart.citydoctor2.gui.tree;
import java.util.List;
import de.hft.stuttgart.citydoctor2.datastructure.Vegetation;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class AllVegetationNode extends Renderable {
private final List<Vegetation> vegetation;
public AllVegetationNode(List<Vegetation> vegetation) {
this.vegetation = vegetation;
}
@Override
public void refreshTextColor() {
// no use
}
@Override
public String getText() {
return "Vegetation";
}
@Override
public void visit(Renderer renderer) {
renderer.renderVegetation(vegetation);
}
}
package de.hft.stuttgart.citydoctor2.gui.tree;
import java.util.List;
import de.hft.stuttgart.citydoctor2.datastructure.WaterObject;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class AllWaterNode extends Renderable {
private final List<WaterObject> water;
public AllWaterNode(List<WaterObject> water) {
this.water = water;
}
@Override
public void refreshTextColor() {
// no use
}
@Override
public String getText() {
return "Water";
}
@Override
public void visit(Renderer renderer) {
renderer.renderWater(water);
}
}
package de.hft.stuttgart.citydoctor2.gui.tree;
import de.hft.stuttgart.citydoctor2.datastructure.BoundarySurface;
import de.hft.stuttgart.citydoctor2.gui.CheckStatus;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class BoundarySurfaceNode extends Renderable {
private final BoundarySurface bs;
public BoundarySurfaceNode(BoundarySurface bs) {
this.bs = bs;
}
@Override
public String getText() {
return bs.getGmlId().getGmlString() + " [" + bs.getType() + "]";
}
@Override
public void visit(Renderer renderer) {
renderer.render(bs);
}
@Override
public void refreshTextColor() {
if (!bs.isValidated()) {
setStatus(CheckStatus.NOT_CHECKED);
} else if (bs.containsAnyError()) {
setStatus(CheckStatus.ERROR);
} else {
setStatus(CheckStatus.OK);
}
}
}
/*-
* Copyright 2023 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package de.hft.stuttgart.citydoctor2.gui.tree;
import de.hft.stuttgart.citydoctor2.datastructure.BridgeConstructiveElement;
import de.hft.stuttgart.citydoctor2.gui.CheckStatus;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class BridgeConstructiveElementNode extends Renderable {
private final BridgeConstructiveElement bce;
public BridgeConstructiveElementNode(BridgeConstructiveElement bce) {
this.bce = bce;
}
@Override
public String getText() {
return bce.getGmlId().getGmlString();
}
@Override
public void visit(Renderer renderer) {
renderer.render(bce);
}
@Override
public void refreshTextColor() {
if (!bce.isValidated()) {
setStatus(CheckStatus.NOT_CHECKED);
} else if (bce.containsAnyError()) {
setStatus(CheckStatus.ERROR);
} else {
setStatus(CheckStatus.OK);
}
}
}
/*-
* Copyright 2022 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package de.hft.stuttgart.citydoctor2.gui.tree;
import de.hft.stuttgart.citydoctor2.datastructure.BridgeObject;
import de.hft.stuttgart.citydoctor2.gui.CheckStatus;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class BridgeNode extends Renderable {
private final BridgeObject bridge;
public BridgeNode(BridgeObject bridge) {
this.bridge = bridge;
}
@Override
public String getText() {
return bridge.getGmlId().getGmlString();
}
@Override
public void visit(Renderer renderer) {
renderer.render(bridge);
}
@Override
public void refreshTextColor() {
if (!bridge.isValidated()) {
setStatus(CheckStatus.NOT_CHECKED);
} else if (bridge.containsAnyError()) {
setStatus(CheckStatus.ERROR);
} else {
setStatus(CheckStatus.OK);
}
}
}
package de.hft.stuttgart.citydoctor2.gui.tree;
import de.hft.stuttgart.citydoctor2.datastructure.Building;
import de.hft.stuttgart.citydoctor2.gui.CheckStatus;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class BuildingNode extends Renderable {
private final Building building;
public BuildingNode(Building building) {
this.building = building;
}
@Override
public String getText() {
return building.getGmlId().getGmlString();
}
public Building getBuilding() {
return building;
}
@Override
public void visit(Renderer renderer) {
renderer.render(building);
}
@Override
public void refreshTextColor() {
if (!building.isValidated()) {
setStatus(CheckStatus.NOT_CHECKED);
} else if (building.containsAnyError()) {
setStatus(CheckStatus.ERROR);
} else {
setStatus(CheckStatus.OK);
}
}
}
package de.hft.stuttgart.citydoctor2.gui.tree;
import de.hft.stuttgart.citydoctor2.datastructure.BuildingPart;
import de.hft.stuttgart.citydoctor2.gui.CheckStatus;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class BuildingPartNode extends Renderable {
private final BuildingPart bp;
public BuildingPartNode(BuildingPart bp) {
this.bp = bp;
}
@Override
public String getText() {
return bp.getGmlId().getGmlString();
}
@Override
public void visit(Renderer renderer) {
renderer.render(bp);
}
@Override
public void refreshTextColor() {
if (!bp.isValidated()) {
setStatus(CheckStatus.NOT_CHECKED);
} else if (bp.containsAnyError()) {
setStatus(CheckStatus.ERROR);
} else {
setStatus(CheckStatus.OK);
}
}
}
/*-
* Copyright 2020 Beuth Hochschule für Technik Berlin, Hochschule für Technik Stuttgart
*
* This file is part of CityDoctor2.
*
* CityDoctor2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* CityDoctor2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with CityDoctor2. If not, see <https://www.gnu.org/licenses/>.
*/
package de.hft.stuttgart.citydoctor2.gui.tree;
import de.hft.stuttgart.citydoctor2.gui.Renderer;
public class ButtonRenderable extends Renderable {
private final Runnable run;
public ButtonRenderable(Runnable run) {
this.run = run;
}
public void run() {
run.run();
}
@Override
public void refreshTextColor() {
// nothing to do
}
@Override
public String getText() {
return null;
}
@Override
public void visit(Renderer renderer) {
// nothing to render
}
}
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