Class AbstractContextButtonPadDeclaration

    • Constructor Detail

      • AbstractContextButtonPadDeclaration

        public AbstractContextButtonPadDeclaration​(IContextButtonPadData contextButtonPadData)
        Creates a new AbstractContextButtonPadDeclaration.
        Parameters:
        referenceRectangle - The original reference rectangle as described in getOriginalReferenceRectangle()
        contextButtonPadData - The context button data containing the IContextButtonEntry
    • Method Detail

      • getButtonSize

        protected abstract int getButtonSize()
        Returns the size of the generic and domain-specific context buttons.
        Returns:
        The size of the generic and domain-specific context buttons.
      • getButtonPadding

        protected abstract int getButtonPadding()
        Returns the padding between the generic and domain-specific context buttons.
        Returns:
        The padding between the generic and domain-specific context buttons.
      • getCollapseButtonPadding

        protected abstract int getCollapseButtonPadding()
        Returns the padding between the collapse context button and the other generic context buttons.
        Returns:
        The padding between the collapse context button and the other generic context buttons.
      • getPadPaddingOutside

        protected abstract int getPadPaddingOutside()
        Returns the padding of the generic and domain-specific context buttons at the outside of the context button pad.
        Returns:
        The padding of the generic and domain-specific context buttons at the outside of the context button pad.
      • getPadPaddingInside

        protected abstract int getPadPaddingInside()
        Returns the padding of the generic and domain-specific context buttons at the inside of the context button pad.
        Returns:
        The padding of the generic and domain-specific context buttons at the inside of the context button pad.
      • getPadHorizontalOverlap

        protected abstract int getPadHorizontalOverlap()
        Returns the horizontal overlap of the pads (top with right, right with bottom).
        Returns:
        The horizontal overlap of the pads (top with right, right with bottom).
      • getPadVerticalOverlap

        protected abstract int getPadVerticalOverlap()
        Returns the vertical overlap of the pads (top with right, right with bottom).
        Returns:
        The vertical overlap of the pads (top with right, right with bottom).
      • getPadAppendageLength

        protected abstract int getPadAppendageLength()
        Returns the length of the pad appendage, which is shown if the neighboring pad does not exist.
        Returns:
        The length of the pad appendage, which is shown if the neighboring pad does not exist.
      • createButton

        public abstract PositionedContextButton createButton​(IContextButtonEntry entry,
                                                             java.awt.Rectangle position)
        Creates a PositionedContextButton for a given context button entry and position. This method can be implemented to set all the visual attributes of the context buttons (line-width, color, opacity, ...).
      • getTopPad

        public java.awt.Rectangle getTopPad()
        Returns the rectangular bounds of the top pad. The rectangular bounds were calculated by the constructor in initializeRectangles(). It can be null.
        Specified by:
        getTopPad in interface IContextButtonPadDeclaration
        Returns:
        The rectangular bounds of the top pad.
      • getRightPad

        public java.awt.Rectangle getRightPad()
        Returns the rectangular bounds of the right pad. The rectangular bounds were calculated by the constructor in initializeRectangles(). It can be null.
        Specified by:
        getRightPad in interface IContextButtonPadDeclaration
        Returns:
        The rectangular bounds of the right pad.
      • getBottomPad

        public java.awt.Rectangle getBottomPad()
        Returns the rectangular bounds of the bottom pad. The rectangular bounds were calculated by the constructor in initializeRectangles(). It can be null.
        Specified by:
        getBottomPad in interface IContextButtonPadDeclaration
        Returns:
        The rectangular bounds of the bottom pad.
      • getOriginalReferenceRectangle

        protected final java.awt.Rectangle getOriginalReferenceRectangle()
        Returns the original reference rectangle around which the context button pad is aligned. It was given in the constructor. Typically these are the bounds of the shape around which the context button pad shall appear. It must not be null.
        Returns:
        The original reference rectangle around which the context button pad is aligned.
      • getPadReferenceRectangle

        protected final java.awt.Rectangle getPadReferenceRectangle()
        Returns the adjusted reference rectangle around which the context button pad is aligned. It was calculated in the constructor from the original reference rectangle. For example the original rectangle could be expanded to achieve a distance between the context button pad and the original reference rectangle. It must not be null.
        Returns:
        The adjusted reference rectangle around which the context button pad is aligned.
      • getGenericButtons

        protected final java.util.List<IContextButtonEntry> getGenericButtons()
        Returns the list of generic, domain-independent context button entries. It was given in the constructor. The generic buttons will be located in the top pad. It must not be null but it can be empty.
        Returns:
        The list of generic, domain-independent context button entries.
      • getCollapseButton

        protected final IContextButtonEntry getCollapseButton()
        Returns the context button entry for the collapse/expand functionality. It was given in the constructor. It can be null.
        Returns:
        The context button entry for the collapse/expand functionality. It was given in the constructor. It can be null.
      • getCollapseAndGenericButtons

        protected final java.util.List<IContextButtonEntry> getCollapseAndGenericButtons()
        Returns the combined list of the collapse button and the generic context button entries. Those will be located in the top pad. It must not be null but it can be empty. See getCollapseButton() and getGenericButtons().
        Returns:
        The combined list of the collapse button and the generic context button entries.
      • getDomainButtons

        protected final java.util.List<IContextButtonEntry> getDomainButtons()
        Returns the list of domain-specific context button entries. It was given in the constructor. The domain-specific buttons will be located in the right pad and bottom pad. It must not be null but it can be empty.
        Returns:
        The list of domain-specific context button entries.
      • getDomainButtonsRight

        protected final java.util.List<IContextButtonEntry> getDomainButtonsRight()
        Returns the list of domain-specific context button entries, which are located in the right pad. It is calculated in initializeDomainButtonLists(). It must not be null but it can be empty.
        Returns:
        The list of domain-specific context button entries, which are located in the right pad.
        See Also:
        getDomainButtons()
      • getDomainButtonsBottom

        protected final java.util.List<IContextButtonEntry> getDomainButtonsBottom()
        Returns the list of domain-specific context button entries, which are located in the bottom pad. It is calculated in initializeDomainButtonLists(). It must not be null but it can be empty.
        Returns:
        The list of domain-specific context button entries, which are located in the bottom pad.
        See Also:
        getDomainButtons()
      • getContainmentRectangles

        public final java.util.List<java.awt.Rectangle> getContainmentRectangles()
        Returns the rectangular bounds around all visible areas of the context button pad.
        Specified by:
        getContainmentRectangles in interface IContextButtonPadDeclaration
        Returns:
        The rectangular bounds around all visible areas of the context button pad.
      • getOverlappingContainmentRectangles

        public final java.util.List<java.awt.Rectangle> getOverlappingContainmentRectangles()
        Returns the overlapping rectangular bounds around all visible areas of the context button pad.
        Specified by:
        getOverlappingContainmentRectangles in interface IContextButtonPadDeclaration
        Returns:
        The overlapping rectangular bounds around all visible areas of the context button pad.
      • initializeDomainButtonLists

        protected void initializeDomainButtonLists()
        Determines which domain buttons shall be located in the right pad and which in the bottom pad. The algorithm first calculates how many buttons fit into the height of the adjusted reference rectangle and locates those in the right pad. Any further buttons are located in the bottom pad.
        See Also:
        getDomainButtonsRight(), getDomainButtonsBottom()
      • initializeRectangles

        protected void initializeRectangles()
        Calculates the rectangular bounds for the top pad, right pad and bottom pad.
      • initializeButtonPositions

        protected void initializeButtonPositions()
        Determines the positions and sizes of all context buttons.