public class ContextButtonPad
extends org.eclipse.draw2d.Shape
ContextButton
as children. The visual definition of the
context button pad is provided mostly by the
IContextButtonPadDeclaration
, which is set in the constructor, and
not calculated in this class.Constructor and Description |
---|
ContextButtonPad(ContextButtonManagerForPad contextButtonManagerForPad,
IContextButtonPadDeclaration declaration,
double zoomLevel,
DiagramBehavior diagramBehavior,
org.eclipse.gef.EditPart editPart,
IResourceRegistry resourceRegistry)
Creates a new ContextButtonPad and calls
initialize() . |
Modifier and Type | Method and Description |
---|---|
void |
addNotify()
Registers the listeners, when the context button pad is shown (when it is
added to its parent).
|
boolean |
containsPoint(int x,
int y)
Returns true, if the given point is contained inside one of the visible
parts of the context button pad.
|
boolean |
containsPointOverlapping(int x,
int y)
Returns true, if the given point is contained inside the overlapping area
of all visible parts of the context button pad.
|
ContextButtonManagerForPad |
getContextButtonManagerForPad() |
double |
getCurrentTransparency()
Returns the current transparency as described in
ITransparencyProvider . |
IContextButtonPadDeclaration |
getDeclaration()
Returns the declaration, which provides the visual definition and the
context buttons for this context button pad.
|
DiagramBehavior |
getDiagramBehavior()
Returns the container for which the context button pad belongs.
|
org.eclipse.gef.EditPart |
getEditPart()
Returns the edit-part for which the context button pad is showing.
|
double |
getZoomLevel()
Returns the zoom-level, which shall be used when rendering the context
button pad.
|
boolean |
isMouseInOverlappingArea()
Returns true, if the mouse is in the overlapping area of the context
button pad.
|
void |
paintFigure(org.eclipse.draw2d.Graphics graphics)
First initializes the given Graphics with settings like alpha-value,
antialias-value, ...
|
void |
removeNotify()
Deregisters the listeners, when the context button pad is hidden (when it
is removed from its parent).
|
getAlpha, getAntialias, getLineAttributes, getLineCap, getLineDash, getLineDashOffset, getLineJoin, getLineMiterLimit, getLineStyle, getLineWidth, getLineWidthFloat, setAlpha, setAlpha, setAntialias, setAntialias, setFill, setFillXOR, setLineAttributes, setLineCap, setLineDash, setLineDashOffset, setLineJoin, setLineMiterLimit, setLineStyle, setLineWidth, setLineWidthFloat, setOutline, setOutlineXOR, setXOR
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, containsPoint, erase, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getClippingStrategy, getCursor, getFont, getForegroundColor, getInsets, getLayoutManager, getLocalBackgroundColor, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isOpaque, isRequestFocusEnabled, isShowing, isVisible, paint, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setClippingStrategy, setConstraint, setCursor, setEnabled, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, validate
public ContextButtonPad(ContextButtonManagerForPad contextButtonManagerForPad, IContextButtonPadDeclaration declaration, double zoomLevel, DiagramBehavior diagramBehavior, org.eclipse.gef.EditPart editPart, IResourceRegistry resourceRegistry)
initialize()
.contextButtonManagerForPad
- declaration
- The context button pad declaration as described in
getDeclaration()
.zoomLevel
- The zoom-level as described in getZoomLevel()
.container
- The container as described in #getContainer()
.editPart
- The edit-part as described in getEditPart()
.resourceRegistry
- public final IContextButtonPadDeclaration getDeclaration()
public final double getZoomLevel()
getDeclaration()
) are
always using a zoom-level 1.0, so they have to be adjusted by the
zoom-level.public final DiagramBehavior getDiagramBehavior()
public final org.eclipse.gef.EditPart getEditPart()
public void addNotify()
addNotify
in interface org.eclipse.draw2d.IFigure
addNotify
in class org.eclipse.draw2d.Figure
public void removeNotify()
removeNotify
in interface org.eclipse.draw2d.IFigure
removeNotify
in class org.eclipse.draw2d.Figure
public void paintFigure(org.eclipse.draw2d.Graphics graphics)
super.paintFigure(graphics)
to continue with the default
painting mechanisms.paintFigure
in class org.eclipse.draw2d.Shape
graphics
- The Graphics on which to paint.public boolean isMouseInOverlappingArea()
IContextButtonPadDeclaration.getOverlappingContainmentRectangles()
).public ContextButtonManagerForPad getContextButtonManagerForPad()
public boolean containsPoint(int x, int y)
Technically this is the union of all containment rectangles (see
IContextButtonPadDeclaration.getContainmentRectangles()
).
containsPoint
in interface org.eclipse.draw2d.IFigure
containsPoint
in class org.eclipse.draw2d.Figure
x
- The x-coordinate of the point to check.y
- The y-coordinate of the point to check.public boolean containsPointOverlapping(int x, int y)
x
- The x-coordinate of the point to check.y
- The y-coordinate of the point to check.public double getCurrentTransparency()
ITransparencyProvider
.ITransparencyProvider
.