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
b17c191c
Commit
b17c191c
authored
Nov 13, 2024
by
Riegel
Browse files
Rework MeshView ContextMenu to allow copying of GML-ID
parent
bcf28ac0
Pipeline
#10336
passed with stage
in 1 minute and 43 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
CityDoctorParent/Extensions/CityDoctorGUI/src/main/java/de/hft/stuttgart/citydoctor2/gui/VertexClickHandler.java
View file @
b17c191c
package
de.hft.stuttgart.citydoctor2.gui
;
package
de.hft.stuttgart.citydoctor2.gui
;
import
de.hft.stuttgart.citydoctor2.datastructure.*
;
import
de.hft.stuttgart.citydoctor2.gui.tree.FeatureNode
;
import
de.hft.stuttgart.citydoctor2.utils.Localization
;
import
javafx.scene.input.Clipboard
;
import
javafx.scene.input.ClipboardContent
;
import
org.locationtech.proj4j.ProjCoordinate
;
import
org.locationtech.proj4j.ProjCoordinate
;
import
de.hft.stuttgart.citydoctor2.datastructure.Polygon
;
import
de.hft.stuttgart.citydoctor2.datastructure.Vertex
;
import
de.hft.stuttgart.citydoctor2.gui.tree.Renderable
;
import
de.hft.stuttgart.citydoctor2.gui.tree.Renderable
;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
import
de.hft.stuttgart.citydoctor2.parser.ParserConfiguration
;
import
javafx.scene.control.ContextMenu
;
import
javafx.scene.control.ContextMenu
;
...
@@ -15,6 +18,8 @@ import javafx.scene.input.MouseButton;
...
@@ -15,6 +18,8 @@ import javafx.scene.input.MouseButton;
import
javafx.scene.input.MouseEvent
;
import
javafx.scene.input.MouseEvent
;
import
javafx.stage.Stage
;
import
javafx.stage.Stage
;
import
static
javafx
.
scene
.
input
.
Clipboard
.
getSystemClipboard
;
public
class
VertexClickHandler
implements
ClickHandler
{
public
class
VertexClickHandler
implements
ClickHandler
{
private
TreeView
<
Renderable
>
errorView
;
private
TreeView
<
Renderable
>
errorView
;
...
@@ -38,8 +43,21 @@ public class VertexClickHandler implements ClickHandler {
...
@@ -38,8 +43,21 @@ public class VertexClickHandler implements ClickHandler {
errorView
.
getSelectionModel
().
clearSelection
();
errorView
.
getSelectionModel
().
clearSelection
();
renderer
.
highlight
(
p
);
renderer
.
highlight
(
p
);
}
else
if
(
me
.
getButton
()
==
MouseButton
.
SECONDARY
)
{
}
else
if
(
me
.
getButton
()
==
MouseButton
.
SECONDARY
)
{
MenuItem
mi
=
new
MenuItem
(
p
.
getGmlId
().
getGmlString
());
ContextMenu
cMenu
=
new
ContextMenu
();
ContextMenu
cMenu
=
new
ContextMenu
(
mi
);
MenuItem
clipMi
=
new
MenuItem
(
Localization
.
getText
(
"MainWindow.copyId"
));
clipMi
.
setOnAction
(
ea
->
{
CityObject
parent
=
p
.
getParent
().
getParent
();
if
(
parent
instanceof
BoundarySurface
bs
)
{
parent
=
bs
.
getParent
();
}
Clipboard
clipboard
=
getSystemClipboard
();
ClipboardContent
content
=
new
ClipboardContent
();
content
.
putString
(
parent
.
getGmlId
().
toString
());
clipboard
.
setContent
(
content
);
});
cMenu
.
getItems
().
add
(
clipMi
);
cMenu
.
show
(
stage
,
me
.
getScreenX
(),
me
.
getScreenY
());
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