(class)
Standard SelectionContext for desktop-like discrete selection of Shapes and Graphics.
Description
This context allows users to select
GraphicSelectables or
ShapeSelectables that have been associated with objects that fall within it.
This class supports dragging out of rectangular selection rectangles as well as standard click selection. It also supports additive (i.e. CTRL key depressed) as well as standard selection modes.
To use, mix-in to a
Box.
Notes
| default: | Construct new DiscreteGraphicSelectionContext |
| constructor public | {DiscreteGraphicSelectionContext.default} |
accessor public DiscreteGraphicSelectionContext.container:
Graphic
| draw-style: | How should the selected Graphics or Shapes be drawn when they are selected? |
field public DiscreteGraphicSelectionContext.selection-rectangle-enabled?:
bool =true
| public | {DiscreteGraphicSelectionContext.create-command}:#Command |
| protected | {DiscreteGraphicSelectionContext.internal-fire-event-at-selectable}:void |
| public | {DiscreteGraphicSelectionContext.note-dragscroll-continued}:void |
| public | {DiscreteGraphicSelectionContext.note-dragscroll-ended}:void |
| public | {DiscreteGraphicSelectionContext.note-dragscroll-started}:void |
| public | {DiscreteGraphicSelectionContext.on-drag-started}:void |
| public | {DiscreteGraphicSelectionContext.on-pointer-press}:void |
| public | {DiscreteGraphicSelectionContext.on-pointer-release}:void |
| overdraw-selection: | Draw selection affordances on top of g which is in this selection context. |
| public | {DiscreteGraphicSelectionContext.overdraw-selection}:void |
| public | {DiscreteGraphicSelectionContext.overdraw-shape-selection}:bool |
| public | {DiscreteGraphicSelectionContext.select-all}:void |
Methods inherited from GuiEventTarget:
handle-delegate-event, handle-event, on-action, on-cancel-mode, on-command-changed, on-commit, on-composition-change-event, on-composition-result-event, on-context-menu-event, on-current-record-change-request, on-current-record-changed, on-destroy-notify, on-destroy-requested, on-drag-enter, on-drag-leave, on-drag-over, on-drag-pointer, on-drop, on-end-composition-event, on-focus-event, on-focus-in, on-focus-out, on-gesture, on-gesture-begin, on-gesture-end, on-gesture-magnify, on-gesture-pan, on-gesture-rotate, on-gesture-swipe, on-gesture-tap, on-gesture-touch, on-gui-event, on-input-method-event, on-inspection, on-key-event, on-key-press, on-pointer-button, on-pointer-crossing, on-pointer-enter, on-pointer-envelope-event, on-pointer-event, on-pointer-leave, on-pointer-scroll, on-raw-key-event, on-raw-key-press, on-raw-key-release, on-reset, on-selectable-added, on-selectable-removed, on-selection-context-activated, on-selection-context-deactivated, on-selection-event, on-start-composition-event, on-start-event, on-stop-event, on-view-activate, on-view-deactivate, on-window-close, remove-event-handlers-for-event-class
(constructor)
| public | {DiscreteGraphicSelectionContext.default} |
Construct new DiscreteGraphicSelectionContext
selection-rectangle-enabled?: Should this context support selection via dragging out a selection rectangle?
multiple-selection-enabled?: Should this context support selection of multiple items?
(accessor)
accessor public DiscreteGraphicSelectionContext.container:
Graphic The Graphic to which this SelectionContext applies.
Description
All contents of this
Graphic (including graphical children) which are not members of a nested
SelectionContext are candidates for selection by this object.
(field)
How should the selected Graphics or Shapes be drawn when they are selected?
Description
(field)
public DiscreteGraphicSelectionContext.selection-rectangle-enabled?:
bool =true
Should a drag gesture create a rectangle for multiple selection?
(method)
| public | {DiscreteGraphicSelectionContext.create-command}:#Command |
Create a command lazily
Description
Overriding
Override this method for any commands which should be instantiated dynamically for this
CommandContext when requested. Be sure to call the superclass implementation of this method if you wish to inherit dynamically created commands from the superclasses as well.
Note that commands may also be specified by calling the method
CommandContext.add-command in the class constructor. For performance reasons, and to allow subclasses to override commands, it is recommended to use this method instead.
(method)
| protected | {DiscreteGraphicSelectionContext.internal-fire-event-at-selectable}:void |
Fire a SelectionEvent at a Selectable
Overriding
Subclasses that wish to take additional steps before or after the firing of these events should override this method.
(method)
| public | {DiscreteGraphicSelectionContext.note-dragscroll-continued}:void |
Note that the dragscroll gesture is continuing.
x: Horizontal point where the gesture continues.
y: Vertical point where the gesture continues.
Description
This method will be called whenever the mouse moves or, if autoscrolling is occurring, at the regular intervals when the autoscrolling timer fires.
(method)
| public | {DiscreteGraphicSelectionContext.note-dragscroll-ended}:void |
Note that the dragscroll gesture has ended.
(method)
| public | {DiscreteGraphicSelectionContext.note-dragscroll-started}:void |
Note that the dragscroll gesture has begun.
x: Horizontal point where the gesture started.
y: Vertical point where the gesture started.
(method)
| public | {DiscreteGraphicSelectionContext.on-drag-started}:void |
The static event handler for DragStarted events.
Description
(method)
| public | {DiscreteGraphicSelectionContext.on-pointer-press}:void |
The static event handler for PointerPress events.
Description
(method)
| public | {DiscreteGraphicSelectionContext.on-pointer-release}:void |
(method)
| public | {DiscreteGraphicSelectionContext.overdraw-selection}:void |
Draw selection affordances on top of g which is in this selection context.
Description
This method is called by the curl drawing mechanism and should not typically be called directly.
Overriding
Implementations of this method should note that the clipping-rectangle set on gc is set to be the cell-bounds of g. This allows the SelectionContext to draw selection affordances on top of g's border and margins as well as g's bounds. Note that it may be appropriate for implementations of this method to perform further clipping, and in particular before calling associated draw methods on g.
(method)
| public | {DiscreteGraphicSelectionContext.overdraw-shape-selection}:bool |
Draw selection affordances on top of s which is in this selection context.
Returns
A bool indicating whether or not the Shape was selected. It is true if the Shape was selected, and therefore was overdrawn.
Description
This method is called by the curl drawing mechanism and should not typically be called directly.
Notes
(method)
| public | {DiscreteGraphicSelectionContext.select-all}:void |
Select all Selectables within this context.
Description