Skip to content

ScreenSelector enhancements #75

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

ScreenSelector enhancements #75

wants to merge 3 commits into from

Conversation

wcmatthysen
Copy link

I made some modifications to the screen-selection classes:

  • The SelectionHighlightController is a very useful companion class for ScreenSelector and is currently hidden as a protected class inside the ScreenSelection example. I moved it out to a class of its own and made it a public class.
  • I then modified the ScreenSelector class by introducing two new toggles, called autoEnable and autoDisable. I also added an "enabled" flag to simplify the input-handler registration / deregistration that occurred in the enable and disable methods. With the autoEnable and autoDisable flags set to true you can Control / Shift click and drag the mouse to select objects on the globe using the ScreenSelector. This is a bit more convenient than manually arming the ScreenSelector.

You can test the ScreenSelection functionality by calling:

this.screenSelector.setAutoEnable(true);
this.screenSelector.setAutoDisable(true);

in the ScreenSelection example.

The SelectionHighlightController is a useful class that can be used in
combination with the ScreenSelector class. Thus, changed the
ScreenSelection example application by pulling out the
SelectionHighlightController and moving it to the
gov.nasa.worldwindx.examples.util package.
Modified the ScreenSelector class by introducing additional behaviour.
Added two flags, namely autoEnable and autoDisable (with getter and
setter methods) to allow for auto-arm and disarming of the selector
based on whether the user Control or Shift clicks before dragging the
mouse.
@wcmatthysen wcmatthysen changed the title Screen selector enhanced ScreenSelector enhancements Dec 12, 2016
The ScreenSelector class should not fire a selection event when a
single-click is done on the map. It should only fire events when
clicking and dragging a rectangle. The reason for this is that the
single-click events will not contain any objects if it originates from
the ScreenSelector. This can cause odd behaviour in terms of selecting
an object and then deselecting everything. Thus, single-click select
events should only be generated by the WorldWind canvas itself.
@wcmatthysen
Copy link
Author

Oh, another thing: the default behavior of ScreenSelector stays the same for clients that are used to the manual arming / disarming. You get the new auto arm / disarm behavior only if you set the two flags (autoEnable and autoDisable) to true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants