Skip to content

ScreenSelector enhancements#75

Open
wcmatthysen wants to merge 3 commits intoNASAWorldWind:masterfrom
wcmatthysen:screen-selector-enhanced
Open

ScreenSelector enhancements#75
wcmatthysen wants to merge 3 commits intoNASAWorldWind:masterfrom
wcmatthysen:screen-selector-enhanced

Conversation

@wcmatthysen
Copy link
Copy Markdown

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
Copy Markdown
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