Class PositionedContextButton
- java.lang.Object
-
- org.eclipse.graphiti.internal.contextbuttons.PositionedContextButton
-
public class PositionedContextButton extends java.lang.Object
A positioned context button is a container for anIContextButtonEntry
and several graphical attributes used to paint a context button.
-
-
Constructor Summary
Constructors Constructor Description PositionedContextButton(IContextButtonEntry contextButtonEntry, java.awt.Rectangle position)
Creates a new PositionedContextbutton.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IContextButtonEntry
getContextButtonEntry()
Returns the context button entry, which contains the logical definition of the context button.int
getCornerRadius()
Returns the corner radius of the context button outline(s).double
getDefaultOpacity()
Returns the default opacity of the context button.IColorConstant
getFillColor()
Returns the fill color of the context button.int
getLineWidth()
Returns the line-width of the context button outline(s).IColorConstant
getMiddleLineColor()
Returns the color of the middle line of the context button.double
getMouseDownOpacity()
Returns the mouse-down opacity of the context button.double
getMouseOverOpacity()
Returns the mouse-over opacity of the context button.IColorConstant
getOuterLineColor()
Returns the color of the outer line of the context button.java.awt.Rectangle
getPosition()
Returns the position (location and size) of the context button.void
setColors(IColorConstant outerLineColor, IColorConstant middleLineColor, IColorConstant fillColor)
Sets the graphical color attributes.void
setLine(int lineWidth, int cornerRadius)
Sets the graphical attributes for the line(s).void
setOpacity(double defaultOpacity, double mouseOverOpacity, double mouseDownOpacity)
Sets the graphical opacity attributes.
-
-
-
Constructor Detail
-
PositionedContextButton
public PositionedContextButton(IContextButtonEntry contextButtonEntry, java.awt.Rectangle position)
Creates a new PositionedContextbutton.- Parameters:
contextButtonEntry
- The context button entry as defined ingetContextButtonEntry()
.position
- The position as described ingetPosition()
.
-
-
Method Detail
-
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
public final IContextButtonEntry 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
public final java.awt.Rectangle 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
public final IColorConstant 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
public final IColorConstant 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
public final IColorConstant 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.
-
-