Class EventSelectionHandler


  • public class EventSelectionHandler
    extends Object
    Helper class which manages keeping track of selected Events for EventPlotInfo.
    Author:
    ulman
    • Constructor Detail

      • EventSelectionHandler

        public EventSelectionHandler()
    • Method Detail

      • removeEventSelectionListener

        public void removeEventSelectionListener​(EventSelectionListener listener)
      • setAllowMultipleEventSelection

        public void setAllowMultipleEventSelection​(boolean allowMultiple)
        If true, multiple events may be selected by holding down the ctrl key while clicking them. Does not restrict programmatic selection in any way.
      • isAllowMultipleEventSelection

        public boolean isAllowMultipleEventSelection()
      • setClearSelectionOnClick

        public void setClearSelectionOnClick​(boolean clear)
        If true, the set of selected events is cleared when the user clicks on an area of the timeline which contains no events. Otherwise, such a click has no effect on the selected events. In this case, the only way to deselect all events is to ctrl-click on all the selected events.
        Parameters:
        clear -
      • isClearSelectionOnClick

        public boolean isClearSelectionOnClick()
        See Also:
        EventPlotInfo#setClearSelectionOnClick(boolean)
      • setAllowMouseEventSelection

        public void setAllowMouseEventSelection​(boolean allowSelection)

        If true, Events are automatically selected when users click inside or near them with the mouse (unless they are set as unselectable via Event.setSelectable(boolean). Clicking one event removes all other selected events unless the ctrl key is held down, in which case the clicked event is added or removed from the set of selected Events.

        If custom selection semmantics are required (only selecting events when their icon is clicked, for example), then setAllowMouseEventSelection(boolean) can be set to false and client code can attach a custom EventPlotListener or GlimpseMouseListener which calls setSelectedEvents(Set) as desired based on user clicks.

        Parameters:
        allowSelection -
      • isAllowMouseEventSelection

        public boolean isAllowMouseEventSelection()
      • getSelectedEvents

        public Set<Event> getSelectedEvents()
      • setSelectedEvents

        public void setSelectedEvents​(Set<Event> newEvents)
      • clearSelectedEvents

        public void clearSelectedEvents()
      • addSelectedEvent

        public void addSelectedEvent​(Event event)
      • removeSelectedEvent

        public void removeSelectedEvent​(Event event)
      • isEventSelected

        public boolean isEventSelected​(Event event)
      • getSelectedEventBorderColor

        public float[] getSelectedEventBorderColor()
      • getSelectedEventBackgroundColor

        public float[] getSelectedEventBackgroundColor()
      • getSelectedEventBorderThickness

        public float getSelectedEventBorderThickness()
      • isHighlightSelectedEvents

        public boolean isHighlightSelectedEvents()
      • setSelectedEventBorderColor

        public void setSelectedEventBorderColor​(float[] color)
      • setSelectedEventBackgroundColor

        public void setSelectedEventBackgroundColor​(float[] color)
      • setSelectedEventBorderThickness

        public void setSelectedEventBorderThickness​(float thickness)
      • setHighlightSelectedEvents

        public void setHighlightSelectedEvents​(boolean highlight)