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
3dba0e5e
Commit
3dba0e5e
authored
Nov 14, 2024
by
Riegel
Browse files
Add focusing function to polygon context menu
parent
b17c191c
Changes
4
Hide whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/resources/CityDoctorLocalization.properties
View file @
3dba0e5e
...
...
@@ -73,6 +73,7 @@ MainWindow.verticesTab=Vertices
MainWindow.attributeTab
=
Attributes
MainWindow.logTab
=
Log
MainWindow.globalErrorsTab
=
Global Errors
MainWindow.focusCityObject
=
Focus object
OpenFileDialog.fileLabel
=
File:
OpenFileDialog.selectBtn
=
Select
OpenFileDialog.loadBtn
=
Load
...
...
CityDoctorParent/CityDoctorModel/src/main/resources/CityDoctorLocalization_de.properties
View file @
3dba0e5e
...
...
@@ -71,6 +71,7 @@ MainWindow.verticesTab=Punkte
MainWindow.attributeTab
=
Attribute
MainWindow.logTab
=
Log
MainWindow.globalErrorsTab
=
Globale Fehler
MainWindow.focusCityObject
=
Objekt fokussieren
OpenFileDialog.fileLabel
=
Datei:
OpenFileDialog.selectBtn
=
Ausw
\u
00e4hlen
OpenFileDialog.loadBtn
=
Laden
...
...
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/MainWindow.java
View file @
3dba0e5e
...
...
@@ -3,6 +3,7 @@ package de.hft.stuttgart.citydoctor2.gui;
import
de.hft.stuttgart.citydoctor2.CityDoctorValidation
;
import
de.hft.stuttgart.citydoctor2.check.ValidationConfiguration
;
import
de.hft.stuttgart.citydoctor2.datastructure.BoundingBox
;
import
de.hft.stuttgart.citydoctor2.datastructure.CityObject
;
import
de.hft.stuttgart.citydoctor2.datastructure.FeatureType
;
import
de.hft.stuttgart.citydoctor2.gui.logger.GuiLogger
;
import
de.hft.stuttgart.citydoctor2.gui.tree.FeatureNode
;
...
...
@@ -300,7 +301,7 @@ public class MainWindow extends Application {
BorderPane
bp
=
loader
.
load
();
highlightController
=
new
HighlightController
(
world
);
renderer
=
new
Renderer
(
this
,
highlightController
);
clickHandler
=
new
VertexClickHandler
(
errorView
,
renderer
,
stage
);
clickHandler
=
new
VertexClickHandler
(
errorView
,
renderer
,
stage
,
this
);
controller
=
new
CityDoctorController
(
this
,
highlightController
,
renderer
);
mainToolBar
=
new
MainToolBar
(
stage
,
controller
,
featurePane
,
renderer
,
this
);
viewPane
.
getChildren
().
add
(
mainToolBar
.
getToolBar
());
...
...
@@ -1145,6 +1146,46 @@ public class MainWindow extends Application {
controller
.
setOriginBB
(
b
);
}
public
void
showCityObjectDetail
(
CityObject
co
)
{
FeatureType
coType
=
co
.
getFeatureType
();
TreeView
<
Renderable
>
featureView
;
Tab
featureTab
;
if
(
coType
==
FeatureType
.
BUILDING
){
featureView
=
buildingsView
;
featureTab
=
buildingsTab
;
}
else
if
(
coType
==
FeatureType
.
VEGETATION
){
featureView
=
vegetationView
;
featureTab
=
vegetationTab
;
}
else
if
(
coType
==
FeatureType
.
TRANSPORTATION
){
featureView
=
transView
;
featureTab
=
transportationTab
;
}
else
if
(
coType
==
FeatureType
.
TUNNEL
){
featureView
=
tunnelView
;
featureTab
=
tunnelTab
;
}
else
if
(
coType
==
FeatureType
.
BRIDGE
){
featureView
=
bridgeView
;
featureTab
=
bridgeTab
;
}
else
if
(
coType
==
FeatureType
.
WATER
){
featureView
=
waterView
;
featureTab
=
waterTab
;
}
else
if
(
coType
==
FeatureType
.
LAND
){
featureView
=
terrainView
;
featureTab
=
terrainTab
;
}
else
if
(
coType
==
FeatureType
.
CITY_FURNITURE
){
featureView
=
cityFurnitureView
;
featureTab
=
cityFurnitureTab
;
}
else
if
(
coType
==
FeatureType
.
GENERIC_CITY_OBJECT
){
featureView
=
otherObjectsView
;
featureTab
=
otherObjectsTab
;
}
else
{
throw
new
IllegalArgumentException
(
"unknown feature type: "
+
coType
);
}
featurePane
.
getSelectionModel
().
select
(
featureTab
);
searchField
.
setText
(
co
.
getGmlId
().
getGmlString
());
searchBtn
.
fire
();
renderer
.
render
(
co
);
}
public
MainToolBar
getMainToolbar
()
{
return
mainToolBar
;
}
...
...
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/VertexClickHandler.java
View file @
3dba0e5e
...
...
@@ -25,12 +25,14 @@ public class VertexClickHandler implements ClickHandler {
private
TreeView
<
Renderable
>
errorView
;
private
Renderer
renderer
;
private
Stage
stage
;
private
MainWindow
mainWindow
;
private
ParserConfiguration
config
;
public
VertexClickHandler
(
TreeView
<
Renderable
>
errorView
,
Renderer
renderer
,
Stage
stage
)
{
public
VertexClickHandler
(
TreeView
<
Renderable
>
errorView
,
Renderer
renderer
,
Stage
stage
,
MainWindow
mainWindow
)
{
this
.
errorView
=
errorView
;
this
.
renderer
=
renderer
;
this
.
stage
=
stage
;
this
.
mainWindow
=
mainWindow
;
}
public
void
setConfig
(
ParserConfiguration
config
)
{
...
...
@@ -58,6 +60,17 @@ public class VertexClickHandler implements ClickHandler {
clipboard
.
setContent
(
content
);
});
cMenu
.
getItems
().
add
(
clipMi
);
MenuItem
detailMi
=
new
MenuItem
(
Localization
.
getText
(
"MainWindow.focusCityObject"
));
detailMi
.
setOnAction
(
ea
->
{
CityObject
parent
=
p
.
getParent
().
getParent
();
if
(
parent
instanceof
BoundarySurface
bs
)
{
parent
=
bs
.
getParent
();
}
mainWindow
.
showCityObjectDetail
(
parent
);
});
cMenu
.
getItems
().
add
(
detailMi
);
cMenu
.
show
(
stage
,
me
.
getScreenX
(),
me
.
getScreenY
());
}
}
...
...
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