Class PolygonFeedbackFactory
java.lang.Object
org.csstudio.opibuilder.widgets.feedback.PolygonFeedbackFactory
- All Implemented Interfaces:
IGraphicalFeedbackFactory
Graphical feedback factory for polygon widgets.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAn identifier which is used as key for extended data in request objects. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal org.eclipse.gef.commands.CommandcreateChangeBoundsCommand(AbstractWidgetModel model, org.eclipse.gef.requests.ChangeBoundsRequest request, org.eclipse.draw2d.geometry.Rectangle targetBounds) Returns a command, which handles the size and location changes, implied by the change bounds request and the target bounds.final List<org.eclipse.gef.Handle>createCustomHandles(org.eclipse.gef.GraphicalEditPart hostEP) Creates and returns custom handlesHandlefor the specified edit part.final org.eclipse.draw2d.IFigurecreateDragSourceFeedbackFigure(AbstractWidgetModel model, org.eclipse.draw2d.geometry.Rectangle initalBounds) The returned figure will be used to provide graphical feedback during drag or resize operations.protected org.eclipse.draw2d.PolylineSubclasses should return an appropriate feedback figure.final org.eclipse.gef.commands.CommandcreateInitialBoundsCommand(AbstractWidgetModel widgetModel, org.eclipse.gef.requests.CreateRequest request, org.eclipse.draw2d.geometry.Rectangle bounds) Returns a command, which handles the initial size and location during the creation of new widget models.final org.eclipse.draw2d.ShapecreateSizeOnDropFeedback(org.eclipse.gef.requests.CreateRequest createRequest) The returned figure will be used to provide graphical feedback during the creation of new widget models.final ClassGets the class type of a custom creation tool for the kind of objects, this factory is responsible for.voidshowChangeBoundsFeedback(AbstractWidgetModel model, org.eclipse.draw2d.geometry.PrecisionRectangle bounds, org.eclipse.draw2d.IFigure feedbackFigure, org.eclipse.gef.requests.ChangeBoundsRequest request) This method will be called, when the size or location of the feedback changes during drag or resize operations.voidshowSizeOnDropFeedback(org.eclipse.gef.requests.CreateRequest createRequest, org.eclipse.draw2d.IFigure feedbackFigure, org.eclipse.draw2d.geometry.Insets insets) This method will be called, when the size or location of the feedback changes during the creation process.The specified figure equals the figure, which is created byIGraphicalFeedbackFactory.createSizeOnDropFeedback(CreateRequest).
-
Field Details
-
PROP_POINTS
An identifier which is used as key for extended data in request objects.- See Also:
-
-
Constructor Details
-
PolygonFeedbackFactory
public PolygonFeedbackFactory()
-
-
Method Details
-
createFeedbackFigure
protected org.eclipse.draw2d.Polyline createFeedbackFigure()Subclasses should return an appropriate feedback figure. This basically supports code inheritance for the polyline and polygon implementations.- Returns:
- a polyline or polygon figure which is used for graphical feedback
-
createDragSourceFeedbackFigure
public final org.eclipse.draw2d.IFigure createDragSourceFeedbackFigure(AbstractWidgetModel model, org.eclipse.draw2d.geometry.Rectangle initalBounds) Description copied from interface:IGraphicalFeedbackFactoryThe returned figure will be used to provide graphical feedback during drag or resize operations.- Specified by:
createDragSourceFeedbackFigurein interfaceIGraphicalFeedbackFactory- Parameters:
model- the widget modelinitalBounds- the initial bounds- Returns:
- a customized feedback figure during draging, null if not necessary.
-
showChangeBoundsFeedback
public void showChangeBoundsFeedback(AbstractWidgetModel model, org.eclipse.draw2d.geometry.PrecisionRectangle bounds, org.eclipse.draw2d.IFigure feedbackFigure, org.eclipse.gef.requests.ChangeBoundsRequest request) Description copied from interface:IGraphicalFeedbackFactoryThis method will be called, when the size or location of the feedback changes during drag or resize operations. The specified figure equals the figure, which is created by theIGraphicalFeedbackFactory.createDragSourceFeedbackFigure(AbstractWidgetModel, Rectangle). Implementors should apply the changed bounds to their individual feedback figure.- Specified by:
showChangeBoundsFeedbackin interfaceIGraphicalFeedbackFactory- Parameters:
model- the corresponding widget modelbounds- the new boundsfeedbackFigure- the current feedback figurerequest- the change request
-
createSizeOnDropFeedback
public final org.eclipse.draw2d.Shape createSizeOnDropFeedback(org.eclipse.gef.requests.CreateRequest createRequest) Description copied from interface:IGraphicalFeedbackFactoryThe returned figure will be used to provide graphical feedback during the creation of new widget models.- Specified by:
createSizeOnDropFeedbackin interfaceIGraphicalFeedbackFactory- Parameters:
createRequest- the create request- Returns:
- a customized droop feedback figure, null if it is not necessary.
-
showSizeOnDropFeedback
public void showSizeOnDropFeedback(org.eclipse.gef.requests.CreateRequest createRequest, org.eclipse.draw2d.IFigure feedbackFigure, org.eclipse.draw2d.geometry.Insets insets) Description copied from interface:IGraphicalFeedbackFactoryThis method will be called, when the size or location of the feedback changes during the creation process.The specified figure equals the figure, which is created byIGraphicalFeedbackFactory.createSizeOnDropFeedback(CreateRequest).- Specified by:
showSizeOnDropFeedbackin interfaceIGraphicalFeedbackFactory- Parameters:
createRequest- the create requestfeedbackFigure- the current feedback figureinsets- any insets that need to be applied to the creation feedback's bounds
-
getCreationTool
Description copied from interface:IGraphicalFeedbackFactoryGets the class type of a custom creation tool for the kind of objects, this factory is responsible for.- Specified by:
getCreationToolin interfaceIGraphicalFeedbackFactory- Returns:
- the class type of a custom creation tool or null, if the default creation tool should be used
-
createInitialBoundsCommand
public final org.eclipse.gef.commands.Command createInitialBoundsCommand(AbstractWidgetModel widgetModel, org.eclipse.gef.requests.CreateRequest request, org.eclipse.draw2d.geometry.Rectangle bounds) Description copied from interface:IGraphicalFeedbackFactoryReturns a command, which handles the initial size and location during the creation of new widget models.- Specified by:
createInitialBoundsCommandin interfaceIGraphicalFeedbackFactory- Parameters:
widgetModel- the created widget modelrequest- the create request (may contain extended data, when a custom creation tool (seeIGraphicalFeedbackFactory.getCreationTool()) is usedbounds- the initial bounds- Returns:
- a undoable command, which sets up the initial size and location changes. null if it is not necessary to initialize size and location.
-
createChangeBoundsCommand
public final org.eclipse.gef.commands.Command createChangeBoundsCommand(AbstractWidgetModel model, org.eclipse.gef.requests.ChangeBoundsRequest request, org.eclipse.draw2d.geometry.Rectangle targetBounds) Description copied from interface:IGraphicalFeedbackFactoryReturns a command, which handles the size and location changes, implied by the change bounds request and the target bounds.- Specified by:
createChangeBoundsCommandin interfaceIGraphicalFeedbackFactory- Parameters:
model- the affected widget modelrequest- a change bounds request (may contain extended data, when a custom creation tool (seeIGraphicalFeedbackFactory.getCreationTool()) or custom handles (IGraphicalFeedbackFactory.createCustomHandles(GraphicalEditPart)) are used.targetBounds- the new bounds- Returns:
- a undoable command, which handles the size and location changes, null if default change bounds command should be used.
-
createCustomHandles
public final List<org.eclipse.gef.Handle> createCustomHandles(org.eclipse.gef.GraphicalEditPart hostEP) Description copied from interface:IGraphicalFeedbackFactoryCreates and returns custom handlesHandlefor the specified edit part.- Specified by:
createCustomHandlesin interfaceIGraphicalFeedbackFactory- Parameters:
hostEP- the edit part- Returns:
- a list, which contains all custom handles or null, if no custom handles should be created
-