Class PositionedContextButton
java.lang.Object
org.eclipse.graphiti.internal.contextbuttons.PositionedContextButton
A positioned context button is a container for an
IContextButtonEntry
and several graphical attributes used to paint a context button.-
Constructor Summary
ConstructorDescriptionPositionedContextButton
(IContextButtonEntry contextButtonEntry, Rectangle position) Creates a new PositionedContextbutton. -
Method Summary
Modifier and TypeMethodDescriptionfinal IContextButtonEntry
Returns the context button entry, which contains the logical definition of the context button.final int
Returns the corner radius of the context button outline(s).final double
Returns the default opacity of the context button.final IColorConstant
Returns the fill color of the context button.final int
Returns the line-width of the context button outline(s).final IColorConstant
Returns the color of the middle line of the context button.final double
Returns the mouse-down opacity of the context button.final double
Returns the mouse-over opacity of the context button.final IColorConstant
Returns the color of the outer line of the context button.final Rectangle
Returns the position (location and size) of the context button.final void
setColors
(IColorConstant outerLineColor, IColorConstant middleLineColor, IColorConstant fillColor) Sets the graphical color attributes.final void
setLine
(int lineWidth, int cornerRadius) Sets the graphical attributes for the line(s).final void
setOpacity
(double defaultOpacity, double mouseOverOpacity, double mouseDownOpacity) Sets the graphical opacity attributes.
-
Constructor Details
-
PositionedContextButton
Creates a new PositionedContextbutton.- Parameters:
contextButtonEntry
- The context button entry as defined ingetContextButtonEntry()
.position
- The position as described ingetPosition()
.
-
-
Method Details
-
setLine
public final void setLine(int lineWidth, int cornerRadius) Sets the graphical attributes for the line(s).- Parameters:
lineWidth
- The line-width as described ingetLineWidth()
.cornerRadius
- The corner radius as described ingetCornerRadius()
.
-
setColors
public final void setColors(IColorConstant outerLineColor, IColorConstant middleLineColor, IColorConstant fillColor) Sets the graphical color attributes.- Parameters:
outerLineColor
- The color of the outer line as described ingetOuterLineColor()
.middleLineColor
- The color of the middle line as described ingetMiddleLineColor()
.fillColor
- The fill color as described ingetFillColor()
.
-
setOpacity
public final void setOpacity(double defaultOpacity, double mouseOverOpacity, double mouseDownOpacity) Sets the graphical opacity attributes.- Parameters:
defaultOpacity
- The default opacity as described ingetDefaultOpacity()
.mouseOverOpacity
- The mouse-over opacity as described ingetMouseOverOpacity()
.mouseDownOpacity
- The mouse-down opacity as described ingetMouseDownOpacity()
.
-
getContextButtonEntry
Returns the context button entry, which contains the logical definition of the context button. The context button entry is set in the constructor and can not be changed afterwards.- Returns:
- The context button entry, which contains the logical definition of the context button.
-
getPosition
Returns the position (location and size) of the context button. The position is defined in absolute coordinates. It is not adjusted to the current zoom-level. The position is set in the constructor and can not be changed afterwards.- Returns:
- The position (location and size) of the context button.
-
getLineWidth
public final int getLineWidth()Returns the line-width of the context button outline(s). It is not adjusted to the current zoom-level.- Returns:
- The line-width of the context button outline(s).
-
getCornerRadius
public final int getCornerRadius()Returns the corner radius of the context button outline(s). It is not adjusted to the current zoom-level.- Returns:
- The corner radius of the context button outline(s).
-
getOuterLineColor
Returns the color of the outer line of the context button. Directly inside this outer line the middle line is painted (seegetMiddleLineColor()
).- Returns:
- The color of the outer line of the context button.
-
getMiddleLineColor
Returns the color of the middle line of the context button. It is painted directly inside the outer line (seegetOuterLineColor()
).- Returns:
- The color of the middle line of the context button.
-
getFillColor
Returns the fill color of the context button.- Returns:
- The fill color of the context button.
-
getDefaultOpacity
public final double getDefaultOpacity()Returns the default opacity of the context button. Values are between 0.0 (invisible) and 1.0 (opaque).- Returns:
- The default opacity of the context button.
-
getMouseOverOpacity
public final double getMouseOverOpacity()Returns the mouse-over opacity of the context button. Values are between 0.0 (invisible) and 1.0 (opaque).The mouse-over opacity is used when the mouse is over the context button, to give visual feedback to the user.
- Returns:
- The mouse-over opacity of the context button.
-
getMouseDownOpacity
public final double getMouseDownOpacity()Returns the mouse-down opacity of the context button. Values are between 0.0 (invisible) and 1.0 (opaque).The mouse-down opacity is used when the context button is pressed, to give visual feedback to the user.
- Returns:
- The mouse-down opacity of the context button.
-