Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
1ace848c
Commit
1ace848c
authored
Oct 22, 2024
by
Riegel
Browse files
Add disabling of empty FeatureTabs to GUI
parent
c0b61e70
Pipeline
#10273
passed with stage
in 1 minute and 13 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/CityDoctorController.java
View file @
1ace848c
...
...
@@ -137,6 +137,7 @@ public class CityDoctorController {
mainWindow
.
getLod4Btn
().
setDisable
(
false
);
mainWindow
.
getWorldBtn
().
setDisable
(
false
);
mainWindow
.
getSaveBtn
().
setDisable
(
false
);
setupFeatureTabs
();
buildTrees
();
});
}
finally
{
...
...
@@ -144,6 +145,18 @@ public class CityDoctorController {
}
}
private
void
setupFeatureTabs
(){
mainWindow
.
setDisableOfFeatureTab
(
FeatureType
.
BUILDING
,
model
.
getBuildings
().
isEmpty
());
mainWindow
.
setDisableOfFeatureTab
(
FeatureType
.
VEGETATION
,
model
.
getVegetation
().
isEmpty
());
mainWindow
.
setDisableOfFeatureTab
(
FeatureType
.
TRANSPORTATION
,
model
.
getTransportation
().
isEmpty
());
mainWindow
.
setDisableOfFeatureTab
(
FeatureType
.
TUNNEL
,
model
.
getTunnels
().
isEmpty
());
mainWindow
.
setDisableOfFeatureTab
(
FeatureType
.
BRIDGE
,
model
.
getBridges
().
isEmpty
());
mainWindow
.
setDisableOfFeatureTab
(
FeatureType
.
WATER
,
model
.
getWater
().
isEmpty
());
mainWindow
.
setDisableOfFeatureTab
(
FeatureType
.
LAND
,
model
.
getLand
().
isEmpty
());
mainWindow
.
setDisableOfFeatureTab
(
FeatureType
.
CITY_FURNITURE
,
model
.
getCityFurniture
().
isEmpty
());
mainWindow
.
setDisableOfFeatureTab
(
FeatureType
.
GENERIC_CITY_OBJECT
,
model
.
getGenericCityObjects
().
isEmpty
());
}
public
void
buildTrees
()
{
resetFeatureChunks
();
buildBuildings
(
model
);
...
...
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/MainWindow.java
View file @
1ace848c
...
...
@@ -645,7 +645,7 @@ public class MainWindow extends Application {
selectedTab
=
FeatureType
.
TRANSPORTATION
;
break
;
case
3
:
selectedTab
=
FeatureType
.
T
RANSPORTATION
;
selectedTab
=
FeatureType
.
T
UNNEL
;
break
;
case
4
:
selectedTab
=
FeatureType
.
BRIDGE
;
...
...
@@ -668,6 +668,54 @@ public class MainWindow extends Application {
});
}
public
void
setDisableOfFeatureTab
(
FeatureType
featureType
,
boolean
value
){
switch
(
featureType
)
{
case
BUILDING:
buildingsTab
.
setDisable
(
value
);
break
;
case
VEGETATION:
vegetationTab
.
setDisable
(
value
);
break
;
case
TRANSPORTATION:
transportationTab
.
setDisable
(
value
);
break
;
case
TUNNEL:
tunnelTab
.
setDisable
(
value
);
break
;
case
BRIDGE:
bridgeTab
.
setDisable
(
value
);
break
;
case
WATER:
waterTab
.
setDisable
(
value
);
break
;
case
LAND:
terrainTab
.
setDisable
(
value
);
break
;
case
CITY_FURNITURE:
cityFurnitureTab
.
setDisable
(
value
);
break
;
case
GENERIC_CITY_OBJECT:
otherObjectsTab
.
setDisable
(
value
);
break
;
default
:
throw
new
IllegalArgumentException
(
"Unknown feature type: "
+
featureType
);
}
}
public
void
activateAllTabs
(){
buildingsTab
.
setDisable
(
false
);
vegetationTab
.
setDisable
(
false
);
transportationTab
.
setDisable
(
false
);
tunnelTab
.
setDisable
(
false
);
bridgeTab
.
setDisable
(
false
);
waterTab
.
setDisable
(
false
);
terrainTab
.
setDisable
(
false
);
cityFurnitureTab
.
setDisable
(
false
);
otherObjectsTab
.
setDisable
(
false
);
}
public
void
resetSearchBar
()
{
searchField
.
setText
(
""
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment