org.eclipse.graphiti.internal.contextbuttons

## Class AbstractContextButtonPadDeclaration

- java.lang.Object
- - org.eclipse.graphiti.internal.contextbuttons.AbstractContextButtonPadDeclaration

All Implemented Interfaces:
  IContextButtonPadDeclaration

Direct Known Subclasses:
  SpecialContextButtonPadDeclaration, StandardContextButtonPadDeclaration

    public abstract class AbstractContextButtonPadDeclaration
    extends Object
    implements IContextButtonPadDeclaration

An implementation of `IContextButtonPadDeclaration`. The calculation of the visual definition of the context button pad is based on a reference rectangle (around which the context pad is aligned) and on the context button entries (which provided the functionality of the context buttons).

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.eclipse.graphiti.internal.contextbuttons.IContextButtonPadDeclaration

`IContextButtonPadDeclaration.PadStyle`

### Constructor Summary

Constructors
Constructor and Description
`AbstractContextButtonPadDeclaration(IContextButtonPadData contextButtonPadData)` Creates a new AbstractContextButtonPadDeclaration.

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`abstract PositionedContextButton` `createButton(IContextButtonEntry entry, Rectangle position)` Creates a `PositionedContextButton` for a given context button entry and position.
`Rectangle` `getBottomPad()` Returns the rectangular bounds of the bottom pad.
`List<Rectangle>` `getContainmentRectangles()` Returns the rectangular bounds around all visible areas of the context button pad.
`List<Rectangle>` `getOverlappingContainmentRectangles()` Returns the overlapping rectangular bounds around all visible areas of the context button pad.
`List<PositionedContextButton>` `getPositionedContextButtons()` Returns the list of all positioned context buttons.
`Rectangle` `getRightPad()` Returns the rectangular bounds of the right pad.
`IContextButtonPadDeclaration.PadStyle` `getRightPadStyle()` Returns the right pad style.
`Rectangle` `getTopPad()` Returns the rectangular bounds of the top pad.
`IContextButtonPadDeclaration.PadStyle` `getTopPadStyle()` Returns the top pad style.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.eclipse.graphiti.internal.contextbuttons.IContextButtonPadDeclaration

`getPadCornerRadius, getPadDefaultOpacity, getPadFillColor, getPadInnerLineColor, getPadLineWidth, getPadMiddleLineColor, getPadOuterLineColor`

### 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

#### createButton

    public abstract PositionedContextButton createButton(IContextButtonEntry entry,
                                                         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 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 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 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.

#### getTopPadStyle

    public IContextButtonPadDeclaration.PadStyle getTopPadStyle()

Returns the top pad style. It is calculated by the constructor in `initializeRectangles()`.

Specified by:
  `getTopPadStyle` in interface `IContextButtonPadDeclaration`
Returns:
  The top pad style.

#### getRightPadStyle

    public IContextButtonPadDeclaration.PadStyle getRightPadStyle()

Returns the right pad style. It is calculated by the constructor in `initializeRectangles()`.

Specified by:
  `getRightPadStyle` in interface `IContextButtonPadDeclaration`
Returns:
  The right pad style.

#### getPositionedContextButtons

    public final List<PositionedContextButton> getPositionedContextButtons()

Returns the list of all positioned context buttons. It must not be null but it can be empty. It is calculated in `initializeButtonPositions()`.

Specified by:
  `getPositionedContextButtons` in interface `IContextButtonPadDeclaration`
Returns:
  The list of all positioned context buttons.

#### getContainmentRectangles

    public final List<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 List<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.