Class PictogramElementDelegate
- java.lang.Object
-
- org.eclipse.graphiti.ui.internal.parts.PictogramElementDelegate
-
- All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable,IFeatureProviderHolder,IVisualStateHolder,IPictogramElementDelegate
- Direct Known Subclasses:
AnchorContainerDelegate
public class PictogramElementDelegate extends java.lang.Object implements IPictogramElementDelegate
A class, which contains helper-methods, which are necessary to implement the interface IAnchorContainerEditPart. It is not possible to make this an EditPart itself, because of different inheritance-hierarchies used in the sub-classes.
-
-
Constructor Summary
Constructors Constructor Description PictogramElementDelegate(IConfigurationProviderInternal configurationProvider, PictogramElement pictogramElement, org.eclipse.gef.EditPart containerEditPart)Creates a new PictogramElementDelegate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivate()Activate.protected voidaddDecorators(GraphicsAlgorithm graphicsAlgorithm, PictogramElement pe, org.eclipse.draw2d.IFigure figure, IToolBehaviorProvider toolBehaviorProvider)org.eclipse.draw2d.IFigurecreateFigure()Creates the figure.voiddeactivate()Deactivate.java.lang.ObjectgetAdapter(java.lang.Class key)IConfigurationProviderInternalgetConfigurationProvider()Gets the configuration provider.protected org.eclipse.gef.EditPartgetContainerEditPart()Gets the edit part which holds the instance of this delegate.IFeatureProvidergetFeatureProvider()Gets the feature provider.org.eclipse.draw2d.IFiguregetFigureForGraphicsAlgorithm(GraphicsAlgorithm graphicsAlgorithm)Gets the figure for graphics algorithm.java.util.List<org.eclipse.draw2d.IFigure>getMainFiguresFromChildEditparts()PictogramElementgetPictogramElement()Gets the pictogram element.protected GFPreferencesgetPreferences()IVisualStategetVisualState()Returns the visual state of this shape.protected booleanisForceRefresh()booleanisValid()voidrefreshDecorators()voidrefreshEditPartsForModelChildrenAndSourceConnections(org.eclipse.gef.EditPart ep)refresh edit parts for child pictogram elements.voidrefreshFigureForEditPart()Refresh figure for edit part.protected voidsetContainerEditPart(org.eclipse.gef.EditPart containerEditPart)Sets the edit part which holds the instance of this delegate.voidsetForceRefresh(boolean forceRefresh)If set to true, the visual refresh (synchronization of figures and graphics algorithm) will be done even it is not necessary.protected voidsetValid(boolean valid)
-
-
-
Constructor Detail
-
PictogramElementDelegate
public PictogramElementDelegate(IConfigurationProviderInternal configurationProvider, PictogramElement pictogramElement, org.eclipse.gef.EditPart containerEditPart)
Creates a new PictogramElementDelegate.- Parameters:
configurationProvider- the configuration providerpictogramElement- the pictogram elementcontainerEditPart- the container edit part
-
-
Method Detail
-
activate
public void activate()
Description copied from interface:IPictogramElementDelegateActivate.- Specified by:
activatein interfaceIPictogramElementDelegate
-
createFigure
public org.eclipse.draw2d.IFigure createFigure()
Description copied from interface:IPictogramElementDelegateCreates the figure.- Specified by:
createFigurein interfaceIPictogramElementDelegate- Returns:
- the i figure
-
deactivate
public void deactivate()
Description copied from interface:IPictogramElementDelegateDeactivate.- Specified by:
deactivatein interfaceIPictogramElementDelegate
-
getAdapter
public java.lang.Object getAdapter(java.lang.Class key)
- Specified by:
getAdapterin interfaceorg.eclipse.core.runtime.IAdaptable
-
getConfigurationProvider
public IConfigurationProviderInternal getConfigurationProvider()
Gets the configuration provider.- Specified by:
getConfigurationProviderin interfaceIPictogramElementDelegate- Returns:
- Returns the configurationProvider.
-
getFigureForGraphicsAlgorithm
public org.eclipse.draw2d.IFigure getFigureForGraphicsAlgorithm(GraphicsAlgorithm graphicsAlgorithm)
Description copied from interface:IPictogramElementDelegateGets the figure for graphics algorithm.- Specified by:
getFigureForGraphicsAlgorithmin interfaceIPictogramElementDelegate- Parameters:
graphicsAlgorithm- the graphics algorithm- Returns:
- the figure for graphics algorithm
-
getPictogramElement
public PictogramElement getPictogramElement()
Description copied from interface:IPictogramElementDelegateGets the pictogram element.- Specified by:
getPictogramElementin interfaceIPictogramElementDelegate- Returns:
- the pictogram element
-
refreshEditPartsForModelChildrenAndSourceConnections
public void refreshEditPartsForModelChildrenAndSourceConnections(org.eclipse.gef.EditPart ep)
refresh edit parts for child pictogram elements.- Specified by:
refreshEditPartsForModelChildrenAndSourceConnectionsin interfaceIPictogramElementDelegate- Parameters:
ep- the ep
-
refreshFigureForEditPart
public void refreshFigureForEditPart()
Description copied from interface:IPictogramElementDelegateRefresh figure for edit part.- Specified by:
refreshFigureForEditPartin interfaceIPictogramElementDelegate
-
getContainerEditPart
protected org.eclipse.gef.EditPart getContainerEditPart()
Gets the edit part which holds the instance of this delegate.- Returns:
- the container edit part
-
setContainerEditPart
protected void setContainerEditPart(org.eclipse.gef.EditPart containerEditPart)
Sets the edit part which holds the instance of this delegate.- Parameters:
containerEditPart- the new container edit part
-
getFeatureProvider
public IFeatureProvider getFeatureProvider()
Description copied from interface:IFeatureProviderHolderGets the feature provider.- Specified by:
getFeatureProviderin interfaceIFeatureProviderHolder- Returns:
- the feature provider
-
setForceRefresh
public void setForceRefresh(boolean forceRefresh)
Description copied from interface:IPictogramElementDelegateIf set to true, the visual refresh (synchronization of figures and graphics algorithm) will be done even it is not necessary.- Specified by:
setForceRefreshin interfaceIPictogramElementDelegate
-
isForceRefresh
protected boolean isForceRefresh()
-
addDecorators
protected void addDecorators(GraphicsAlgorithm graphicsAlgorithm, PictogramElement pe, org.eclipse.draw2d.IFigure figure, IToolBehaviorProvider toolBehaviorProvider)
-
isValid
public boolean isValid()
- Specified by:
isValidin interfaceIPictogramElementDelegate- Returns:
- true, if edit part (and it's delegate) are still valid (alive)
-
setValid
protected void setValid(boolean valid)
-
getVisualState
public IVisualState getVisualState()
Returns the visual state of this shape.- Specified by:
getVisualStatein interfaceIVisualStateHolder- Returns:
- The visual state of this shape.
-
getMainFiguresFromChildEditparts
public java.util.List<org.eclipse.draw2d.IFigure> getMainFiguresFromChildEditparts()
- Specified by:
getMainFiguresFromChildEditpartsin interfaceIPictogramElementDelegate
-
getPreferences
protected GFPreferences getPreferences()
-
refreshDecorators
public void refreshDecorators()
- Specified by:
refreshDecoratorsin interfaceIPictogramElementDelegate
-
-