Class AbstractBpFigure
- java.lang.Object
-
- org.eclipse.draw2d.Figure
-
- org.eclipse.draw2d.Shape
-
- com._1c.g5.v8.dt.diagram.framework.ui.model.AbstractDiagramFigure
-
- com._1c.g5.v8.dt.bp.scheme.ui.model.draw2d.AbstractBpFigure
-
- All Implemented Interfaces:
IAnchorable
,IDisposable
,IRefreshable
,com._1c.g5.v8.dt.diagram.framework.ui.model.ISelectable
,org.eclipse.draw2d.IFigure
- Direct Known Subclasses:
AbstractBpRouteFigure
,DecorationFigure
public abstract class AbstractBpFigure extends com._1c.g5.v8.dt.diagram.framework.ui.model.AbstractDiagramFigure implements com._1c.g5.v8.dt.diagram.framework.ui.model.ISelectable, IDisposable, IAnchorable, IRefreshable
Base class for BP scheme figures.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractBpFigure.BpFigureMouseListener
Bp figures mouse listener.
-
Field Summary
Fields Modifier and Type Field Description static int
MIN_HEIGHT
Minimum figure height.static int
MIN_WIDTH
Minimum figure width.
-
Constructor Summary
Constructors Constructor Description AbstractBpFigure(com._1c.g5.v8.dt.diagram.framework.IEntity associatedEntity)
Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Collection<AnchorFigure>
createAnchorFigures()
Initializes anchor figures.void
dispose()
Removes unneed figures associated with this from figure canvas.protected Collection<AnchorFigure>
getAnchorFigures()
Returns anchor figures.BpEntity
getAssociatedEntity()
protected org.eclipse.swt.graphics.Color
getColor(org.eclipse.swt.graphics.RGB rgb)
Returns color from given rgb.protected abstract org.eclipse.swt.graphics.Color
getDefaultBackgroundColor()
Returns default background color.AnchorFigure
getHighlitedAnchor()
Returns highlited anchor.org.eclipse.draw2d.Label
getLabel()
Returns label.protected ScalableImageFigure
getPicture()
Returns picture.protected org.eclipse.swt.graphics.Color
getTextColor()
Returns text color.void
highlightClosestAnchor(org.eclipse.draw2d.geometry.Point location, int anchorType)
Highlites the closest anchor to givenlocation
.protected void
initializeMouseListeners()
Initializes mouse listeners.protected void
outlineShape(org.eclipse.draw2d.Graphics graphics)
void
refresh()
Refreshes ui style.protected void
refreshColors(GraphicalSchemeFigure modelObject)
Refreshes colors.protected void
refreshImage(GraphicalSchemeFigure modelObject)
Refreshes image.protected void
refreshLayout(GraphicalSchemeFigure modelObject)
Refreshes figure layoutvoid
setAnchorsVisible(boolean isVisible, int anchorType)
Sets anchors visibility.void
setBounds(org.eclipse.draw2d.geometry.Rectangle rect)
void
setParent(org.eclipse.draw2d.IFigure parent)
void
setSelected(boolean isSelected)
protected void
setTextColor(org.eclipse.swt.graphics.Color textColor)
Sets text color-
Methods inherited from class org.eclipse.draw2d.Shape
fillShape, getAlpha, getAntialias, getLineAttributes, getLineCap, getLineDash, getLineDashOffset, getLineJoin, getLineMiterLimit, getLineStyle, getLineWidth, getLineWidthFloat, paintFigure, setAlpha, setAlpha, setAntialias, setAntialias, setFill, setFillXOR, setLineAttributes, setLineCap, setLineDash, setLineDashOffset, setLineJoin, setLineMiterLimit, setLineStyle, setLineWidth, setLineWidthFloat, setOutline, setOutlineXOR, setXOR
-
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalFont, 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, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
-
-
-
-
Field Detail
-
MIN_WIDTH
public static final int MIN_WIDTH
Minimum figure width.- See Also:
- Constant Field Values
-
MIN_HEIGHT
public static final int MIN_HEIGHT
Minimum figure height.- See Also:
- Constant Field Values
-
-
Method Detail
-
setParent
public void setParent(org.eclipse.draw2d.IFigure parent)
- Specified by:
setParent
in interfaceorg.eclipse.draw2d.IFigure
- Overrides:
setParent
in classorg.eclipse.draw2d.Figure
-
setBounds
public void setBounds(org.eclipse.draw2d.geometry.Rectangle rect)
- Specified by:
setBounds
in interfaceorg.eclipse.draw2d.IFigure
- Overrides:
setBounds
in classorg.eclipse.draw2d.Figure
-
setSelected
public void setSelected(boolean isSelected)
- Specified by:
setSelected
in interfacecom._1c.g5.v8.dt.diagram.framework.ui.model.ISelectable
-
setAnchorsVisible
public void setAnchorsVisible(boolean isVisible, int anchorType)
Description copied from interface:IAnchorable
Sets anchors visibility.- Specified by:
setAnchorsVisible
in interfaceIAnchorable
- Parameters:
isVisible
- -true
if anchors should be visible.anchorType
- - anchor type.- See Also:
AnchorFigure.TARGET
,AnchorFigure.SOURCE
-
highlightClosestAnchor
public void highlightClosestAnchor(org.eclipse.draw2d.geometry.Point location, int anchorType)
Description copied from interface:IAnchorable
Highlites the closest anchor to givenlocation
.- Specified by:
highlightClosestAnchor
in interfaceIAnchorable
- Parameters:
location
- - location. Can't benull
.anchorType
- - anchor type.- See Also:
AnchorFigure.TARGET
,AnchorFigure.SOURCE
-
getHighlitedAnchor
public AnchorFigure getHighlitedAnchor()
Description copied from interface:IAnchorable
Returns highlited anchor. If there is no highlited anchor, returnsnull
.- Specified by:
getHighlitedAnchor
in interfaceIAnchorable
- Returns:
- highlited anchor. If there is no highlited anchor, returns
null
. Can returnnull
.
-
dispose
public void dispose()
Description copied from interface:IDisposable
Removes unneed figures associated with this from figure canvas.- Specified by:
dispose
in interfaceIDisposable
-
getAssociatedEntity
public BpEntity getAssociatedEntity()
- Overrides:
getAssociatedEntity
in classcom._1c.g5.v8.dt.diagram.framework.ui.model.AbstractDiagramFigure
-
getLabel
public org.eclipse.draw2d.Label getLabel()
Returns label.- Returns:
- label. Can return
null
.
-
refresh
public void refresh()
Description copied from interface:IRefreshable
Refreshes ui style.- Specified by:
refresh
in interfaceIRefreshable
-
createAnchorFigures
protected abstract Collection<AnchorFigure> createAnchorFigures()
Initializes anchor figures.- Returns:
- anchor figures. Can't return
null
.
-
outlineShape
protected void outlineShape(org.eclipse.draw2d.Graphics graphics)
- Specified by:
outlineShape
in classorg.eclipse.draw2d.Shape
-
getAnchorFigures
protected Collection<AnchorFigure> getAnchorFigures()
Returns anchor figures.- Returns:
- anchor figures. Can't return
null
.
-
getColor
protected org.eclipse.swt.graphics.Color getColor(org.eclipse.swt.graphics.RGB rgb)
Returns color from given rgb. If graphical scheme editor can't be found, returns black color.- Parameters:
rgb
- - rgb. Can't benull
.- Returns:
- color from given rgb. Can't return
null
.
-
initializeMouseListeners
protected void initializeMouseListeners()
Initializes mouse listeners.
-
getPicture
protected ScalableImageFigure getPicture()
Returns picture.- Returns:
- picture. Can return
null
.
-
refreshColors
protected void refreshColors(GraphicalSchemeFigure modelObject)
Refreshes colors.- Parameters:
modelObject
- - associated with this figure model object. Can't benull
-
setTextColor
protected void setTextColor(org.eclipse.swt.graphics.Color textColor)
Sets text color- Parameters:
textColor
- - color to set. Can't benull
.
-
getTextColor
protected org.eclipse.swt.graphics.Color getTextColor()
Returns text color.- Returns:
- text color. Can't return
null
.
-
refreshLayout
protected void refreshLayout(GraphicalSchemeFigure modelObject)
Refreshes figure layout- Parameters:
modelObject
- - model object. Can't benull
.
-
refreshImage
protected void refreshImage(GraphicalSchemeFigure modelObject)
Refreshes image.- Parameters:
modelObject
- - model object. Can't benull
.
-
getDefaultBackgroundColor
protected abstract org.eclipse.swt.graphics.Color getDefaultBackgroundColor()
Returns default background color.- Returns:
- default background color. Can't return
null
.;
-
-