Class CmsAreaSelectPanel

java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
org.opencms.gwt.client.ui.CmsAreaSelectPanel
All Implemented Interfaces:
com.google.gwt.event.dom.client.HasClickHandlers, com.google.gwt.event.dom.client.HasMouseDownHandlers, com.google.gwt.event.dom.client.HasMouseMoveHandlers, com.google.gwt.event.dom.client.HasMouseUpHandlers, com.google.gwt.event.dom.client.MouseDownHandler, com.google.gwt.event.dom.client.MouseMoveHandler, com.google.gwt.event.dom.client.MouseUpHandler, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.logical.shared.HasValueChangeHandlers<CmsPositionBean>, com.google.gwt.event.shared.EventHandler, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.IndexedPanel, com.google.gwt.user.client.ui.IsRenderable, com.google.gwt.user.client.ui.IsWidget, Iterable<com.google.gwt.user.client.ui.Widget>

public class CmsAreaSelectPanel extends com.google.gwt.user.client.ui.Composite implements com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.IndexedPanel, com.google.gwt.event.logical.shared.HasValueChangeHandlers<CmsPositionBean>, com.google.gwt.event.dom.client.HasMouseDownHandlers, com.google.gwt.event.dom.client.HasMouseUpHandlers, com.google.gwt.event.dom.client.HasClickHandlers, com.google.gwt.event.dom.client.HasMouseMoveHandlers, com.google.gwt.event.dom.client.MouseDownHandler, com.google.gwt.event.dom.client.MouseUpHandler, com.google.gwt.event.dom.client.MouseMoveHandler
Select area widget. Allows the user to select an area inside the widget.

Since:
8.0.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static interface 
    The ui-binder interface.

    Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject

    com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled

    Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets

    com.google.gwt.user.client.ui.HasWidgets.ForIsWidget

    Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel

    com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.google.gwt.dom.client.Element
    The marker.
    protected com.google.gwt.dom.client.Element
    Select overlay.
    protected com.google.gwt.dom.client.Element
    Select overlay.
    protected com.google.gwt.dom.client.Element
    Select overlay.
    protected com.google.gwt.dom.client.Element
    Select overlay.
    protected com.google.gwt.user.client.ui.FlowPanel
    The panel holding added widgets.

    Fields inherited from class com.google.gwt.user.client.ui.UIObject

    DEBUG_ID_PREFIX
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(com.google.gwt.user.client.ui.Widget w)
     
    com.google.gwt.event.shared.HandlerRegistration
    addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
     
    com.google.gwt.event.shared.HandlerRegistration
    addMouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler handler)
     
    com.google.gwt.event.shared.HandlerRegistration
    addMouseMoveHandler(com.google.gwt.event.dom.client.MouseMoveHandler handler)
     
    com.google.gwt.event.shared.HandlerRegistration
    addMouseUpHandler(com.google.gwt.event.dom.client.MouseUpHandler handler)
     
    com.google.gwt.event.shared.HandlerRegistration
    addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<CmsPositionBean> handler)
     
    void
     
    void
    Removes the current selection.
    getAreaPosition(boolean relative)
    Returns the position of the selected area, or null if nothing is selected.
    com.google.gwt.user.client.ui.Widget
    getWidget(int index)
     
    int
     
    int
    getWidgetIndex(com.google.gwt.user.client.ui.Widget child)
     
    boolean
    Returns if the value change event will always be fired, or only when a select/resize/move operation is finished.
    Iterator<com.google.gwt.user.client.ui.Widget>
     
    void
    onMouseDown(com.google.gwt.event.dom.client.MouseDownEvent event)
     
    void
    onMouseMove(com.google.gwt.event.dom.client.MouseMoveEvent event)
     
    void
    onMouseUp(com.google.gwt.event.dom.client.MouseUpEvent event)
     
    boolean
    remove(int index)
     
    boolean
    remove(com.google.gwt.user.client.ui.Widget w)
     
    void
    Resets the select area ratio.
    void
    setAreaPosition(boolean relative, CmsPositionBean pos)
    Sets the selection area.
    void
    setFireAll(boolean isFireAll)
    Sets if the value change event will always be fired, or only when a select/resize/move operation is finished.
    void
    setRatio(double heightToWidth)
    Sets a fixed selection ratio.

    Methods inherited from class com.google.gwt.user.client.ui.Composite

    claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget

    Methods inherited from class com.google.gwt.user.client.ui.Widget

    addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents

    Methods inherited from class com.google.gwt.user.client.ui.UIObject

    addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.gwt.event.shared.HasHandlers

    fireEvent

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Field Details

    • m_marker

      @UiField protected com.google.gwt.dom.client.Element m_marker
      The marker.
    • m_overlayBottom

      @UiField protected com.google.gwt.dom.client.Element m_overlayBottom
      Select overlay.
    • m_overlayLeft

      @UiField protected com.google.gwt.dom.client.Element m_overlayLeft
      Select overlay.
    • m_overlayRight

      @UiField protected com.google.gwt.dom.client.Element m_overlayRight
      Select overlay.
    • m_overlayTop

      @UiField protected com.google.gwt.dom.client.Element m_overlayTop
      Select overlay.
    • m_panel

      @UiField protected com.google.gwt.user.client.ui.FlowPanel m_panel
      The panel holding added widgets.
  • Constructor Details

  • Method Details

    • add

      public void add(com.google.gwt.user.client.ui.Widget w)
      Specified by:
      add in interface com.google.gwt.user.client.ui.HasWidgets
      See Also:
      • HasWidgets.add(com.google.gwt.user.client.ui.Widget)
    • addClickHandler

      public com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
      Specified by:
      addClickHandler in interface com.google.gwt.event.dom.client.HasClickHandlers
      See Also:
      • HasClickHandlers.addClickHandler(com.google.gwt.event.dom.client.ClickHandler)
    • addMouseDownHandler

      public com.google.gwt.event.shared.HandlerRegistration addMouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler handler)
      Specified by:
      addMouseDownHandler in interface com.google.gwt.event.dom.client.HasMouseDownHandlers
      See Also:
      • HasMouseDownHandlers.addMouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler)
    • addMouseMoveHandler

      public com.google.gwt.event.shared.HandlerRegistration addMouseMoveHandler(com.google.gwt.event.dom.client.MouseMoveHandler handler)
      Specified by:
      addMouseMoveHandler in interface com.google.gwt.event.dom.client.HasMouseMoveHandlers
      See Also:
      • HasMouseMoveHandlers.addMouseMoveHandler(com.google.gwt.event.dom.client.MouseMoveHandler)
    • addMouseUpHandler

      public com.google.gwt.event.shared.HandlerRegistration addMouseUpHandler(com.google.gwt.event.dom.client.MouseUpHandler handler)
      Specified by:
      addMouseUpHandler in interface com.google.gwt.event.dom.client.HasMouseUpHandlers
      See Also:
      • HasMouseUpHandlers.addMouseUpHandler(com.google.gwt.event.dom.client.MouseUpHandler)
    • addValueChangeHandler

      public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<CmsPositionBean> handler)
      Specified by:
      addValueChangeHandler in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<CmsPositionBean>
      See Also:
      • HasValueChangeHandlers.addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler)
    • clear

      public void clear()
      Specified by:
      clear in interface com.google.gwt.user.client.ui.HasWidgets
      See Also:
      • HasWidgets.clear()
    • clearSelection

      public void clearSelection()
      Removes the current selection.

    • getAreaPosition

      public CmsPositionBean getAreaPosition(boolean relative)
      Returns the position of the selected area, or null if nothing is selected.

      Parameters:
      relative - if true the relative position is returned, otherwise the absolute position
      Returns:
      the position of the selected area
    • getWidget

      public com.google.gwt.user.client.ui.Widget getWidget(int index)
      Specified by:
      getWidget in interface com.google.gwt.user.client.ui.IndexedPanel
      See Also:
      • IndexedPanel.getWidget(int)
    • getWidgetCount

      public int getWidgetCount()
      Specified by:
      getWidgetCount in interface com.google.gwt.user.client.ui.IndexedPanel
      See Also:
      • IndexedPanel.getWidgetCount()
    • getWidgetIndex

      public int getWidgetIndex(com.google.gwt.user.client.ui.Widget child)
      Specified by:
      getWidgetIndex in interface com.google.gwt.user.client.ui.IndexedPanel
      See Also:
      • IndexedPanel.getWidgetIndex(com.google.gwt.user.client.ui.Widget)
    • isFireAll

      public boolean isFireAll()
      Returns if the value change event will always be fired, or only when a select/resize/move operation is finished.

      Returns:
      true if the value change event will always be fired
    • iterator

      public Iterator<com.google.gwt.user.client.ui.Widget> iterator()
      Specified by:
      iterator in interface com.google.gwt.user.client.ui.HasWidgets
      Specified by:
      iterator in interface Iterable<com.google.gwt.user.client.ui.Widget>
      See Also:
      • HasWidgets.iterator()
    • onMouseDown

      public void onMouseDown(com.google.gwt.event.dom.client.MouseDownEvent event)
      Specified by:
      onMouseDown in interface com.google.gwt.event.dom.client.MouseDownHandler
      See Also:
      • MouseDownHandler.onMouseDown(com.google.gwt.event.dom.client.MouseDownEvent)
    • onMouseMove

      public void onMouseMove(com.google.gwt.event.dom.client.MouseMoveEvent event)
      Specified by:
      onMouseMove in interface com.google.gwt.event.dom.client.MouseMoveHandler
      See Also:
      • MouseMoveHandler.onMouseMove(com.google.gwt.event.dom.client.MouseMoveEvent)
    • onMouseUp

      public void onMouseUp(com.google.gwt.event.dom.client.MouseUpEvent event)
      Specified by:
      onMouseUp in interface com.google.gwt.event.dom.client.MouseUpHandler
      See Also:
      • MouseUpHandler.onMouseUp(com.google.gwt.event.dom.client.MouseUpEvent)
    • remove

      public boolean remove(int index)
      Specified by:
      remove in interface com.google.gwt.user.client.ui.IndexedPanel
      See Also:
      • IndexedPanel.remove(int)
    • remove

      public boolean remove(com.google.gwt.user.client.ui.Widget w)
      Specified by:
      remove in interface com.google.gwt.user.client.ui.HasWidgets
      See Also:
      • HasWidgets.remove(com.google.gwt.user.client.ui.Widget)
    • resetRatio

      public void resetRatio()
      Resets the select area ratio.

    • setAreaPosition

      public void setAreaPosition(boolean relative, CmsPositionBean pos)
      Sets the selection area.

      Parameters:
      relative - true if provided position is relative to the select area, not absolute to the page
      pos - the area position to select
    • setFireAll

      public void setFireAll(boolean isFireAll)
      Sets if the value change event will always be fired, or only when a select/resize/move operation is finished.

      Parameters:
      isFireAll - true to always be fire the value change event
    • setRatio

      public void setRatio(double heightToWidth)
      Sets a fixed selection ratio. Set 0 to remove the fix.

      Parameters:
      heightToWidth - the height to width ratio