Java Code Examples for org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil#getMapMode()

The following examples show how to use org.eclipse.gmf.runtime.draw2d.ui.mapmode.MapModeUtil#getMapMode() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SyntaxColoringLabel.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public FlowUtilitiesEx getFlowUtilities() {
	if (flowUtilities == null) {
		flowUtilities = new FlowUtilitiesEx(MapModeUtil.getMapMode(this)) {
			@Override
			protected TextUtilities getTextUtilities() {
				if (textUtilities == null) {
					textUtilities = new StyleTextUtilities(MapModeUtil.getMapMode(StyledTextFlow.this));
				}
				return textUtilities;
			}
		};
	}
	return flowUtilities;
}
 
Example 2
Source File: TransitionPriorityDecorationProvider.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
public void createDecorators(IGraphicalEditPart editPart) {
	PriorityFigure figure = new PriorityFigure(MapModeUtil.getMapMode(), getPriority(editPart));
	figure.setSize(12, 13);
	setDecoration(getDecoratorTarget().addDecoration(figure,
			new ConnectionLocator((Connection) editPart.getFigure(), ConnectionLocator.TARGET) {
				protected Point getLocation(PointList points) {
					Point p = PointListUtilities.pointOn(PointListUtilities.copyPoints(points),
							DISTANCE_TO_SOURCE, KeyPoint.ORIGIN, new Point());
					return p;
				}
			}, false));

	figure.setToolTip(new Label("Transition Priority " + getPriority(editPart)));
}
 
Example 3
Source File: FeedbackGraphicalNodeEditPolicy.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
protected IMapMode getMapMode() {
	RootEditPart root = getHost().getRoot();
	if (root instanceof DiagramRootEditPart) {
		DiagramRootEditPart dgrmRoot = (DiagramRootEditPart) root;
		return dgrmRoot.getMapMode();
	}
	return MapModeUtil.getMapMode();

}
 
Example 4
Source File: RegionPriorityDecorationProvider.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
public void createDecorators(IGraphicalEditPart editPart) {
	PriorityFigure figure = new PriorityFigure(MapModeUtil.getMapMode(), getPriority(editPart));
	figure.setSize(10, 10);
	setDecoration(
			getDecoratorTarget().addShapeDecoration(figure, IDecoratorTarget.Direction.NORTH_WEST, -1, false));
}