-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/#51 make geometryitems clickable #95
Conversation
@DorianRec wenn noch einmal jemand System.out.println benutzt, **** ich jemanden XD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good first state, some changes for selection need. Have you implemented a neighborhood distance in which to search for clicked elements? For example, if just one element is present, clicking everywhere selects this item.
src/main/java/com/treasure/hunt/strategy/hider/impl/RandomAngleHintHider.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the end highlighting the stuff with additional object seems a bad idea to be especially because be need to create specially designed Geometries for this.
Maybe we can look into it and see if we come up with a simpilier solution 🤔
Updated javadoc (1. Part of PR #95)
src/main/java/com/treasure/hunt/strategy/geom/GeometryItem.java
Outdated
Show resolved
Hide resolved
Also this has conflicts |
Also what about the maybe we remove the highlight things ountil we have some Ui and stuff to it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well what I said above
# Conflicts: # src/main/java/com/treasure/hunt/strategy/geom/GeometryItem.java # src/main/java/com/treasure/hunt/strategy/geom/GeometryStyle.java # src/main/java/com/treasure/hunt/strategy/geom/GeometryType.java # src/main/java/com/treasure/hunt/view/CanvasController.java
has conflicts |
# Conflicts: # src/main/java/com/treasure/hunt/game/GameEngine.java # src/main/java/com/treasure/hunt/game/GameManager.java # src/main/java/com/treasure/hunt/strategy/geom/GeometryType.java # src/main/java/com/treasure/hunt/strategy/hider/impl/MaxAreaAngularHintStrategy.java # src/main/java/com/treasure/hunt/strategy/searcher/impl/NaiveAngleSearcher.java # src/main/java/com/treasure/hunt/utils/JTSUtils.java # src/main/java/com/treasure/hunt/utils/Renderer.java
…-geometryitems-clickable
This recognizes the GeometryItem nearest to the mouse-clicked position.
GeometryItem will be printed out via log.info() and "highlighted".
Changes:
Treasure
.Selectable
, which SearchPath, Hint and Treasure extend.SearchPath
-Objects containing all LineSegments, of the searchers searchPath, instead of lacking the first LineSegment. This makes the SearchPath Class much easier to use, since we do not need to give it the first point of the searchpath in order to get the search path.List<Selectable> pickGeometry(Coordinate mouse, double distance)
, which returns a list of Selectables, the user may have selected.void refreshHighlighter(Coordinate coordinate, double scale)
, which selects a new Selecable. Thus, the method is called, when the user clicks the coordinate-system.void unselect()
, which unselects the SearchPath, Hint and Treasure, the Turn contains.List<GeometryItem<?>> getSelectedGeometryItems(Point movementStart)
.visible
from the classGeometryStyle
, since it was never used and is useless.static Polygon toPolygon(Envelope envelope)
.static Stream<GeometryItem<?>> getHighlighter(List<Turn> turns, int viewIndex)
.void onCanvasClicked(MouseEvent mouseEvent)
inCanvasController
, such that selecting of an Selectable.Issues:
but this is out of the scope of this issue!
Bugs:
Fixes #51
Fixes #181