org.eclipse.draw2d.ConnectionLocator Java Examples

The following examples show how to use org.eclipse.draw2d.ConnectionLocator. 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: EdgeLabelQuery.java    From statecharts with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Get the location among {@link LabelViewConstants} constants where to relocate
 * the label figure.
 *
 * @return the location among {@link LabelViewConstants} constants
 */
private static int getLocation(Integer keyPoint) {
	int location = LabelViewConstants.MIDDLE_LOCATION;
	switch (keyPoint) {
	case ConnectionLocator.SOURCE:
		location = LabelViewConstants.TARGET_LOCATION;
		break;
	case ConnectionLocator.TARGET:
		location = LabelViewConstants.SOURCE_LOCATION;
		break;
	case ConnectionLocator.MIDDLE:
		location = LabelViewConstants.MIDDLE_LOCATION;
		break;
	default:
		location = LabelViewConstants.MIDDLE_LOCATION;
		break;
	}
	return location;
}
 
Example #2
Source File: EntityFigureListener.java    From JDeodorant with MIT License 6 votes vote down vote up
public void mouseExited(MouseEvent me) {

		List<JConnection> connections = figure.getOutgoingConnections();
		for(JConnection connection: connections){
			connection.setAlpha(null);
			connection.setLineWidth(1);
			Label l = connection.getLabel();


			if(l != null){
				//l.setFont(new Font(null, "Arial", 10, SWT.BOLD));
				l.setFont(DecorationConstants.normalFont);
				ConnectionLocator locator = connection.getLocator();
				locator.setRelativePosition(PositionConstants.CENTER);
				connection.add(l, locator);
			}

		}
	}
 
Example #3
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 #4
Source File: CursorTimingsLayer.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
public CursorConnectionLocator(PolylineConnection connection, int distance) {
	super(connection, ConnectionLocator.SOURCE);
	fDistance = distance;
}
 
Example #5
Source File: WrappingLabel4EditPart.java    From scava with Eclipse Public License 2.0 4 votes vote down vote up
/**
* @generated
*/
public int getKeyPoint() {
	return ConnectionLocator.MIDDLE;
}
 
Example #6
Source File: WrappingLabelEditPart.java    From scava with Eclipse Public License 2.0 4 votes vote down vote up
/**
* @generated
*/
public int getKeyPoint() {
	return ConnectionLocator.MIDDLE;
}
 
Example #7
Source File: WrappingLabel3EditPart.java    From scava with Eclipse Public License 2.0 4 votes vote down vote up
/**
* @generated
*/
public int getKeyPoint() {
	return ConnectionLocator.MIDDLE;
}
 
Example #8
Source File: WrappingLabel2EditPart.java    From scava with Eclipse Public License 2.0 4 votes vote down vote up
/**
* @generated
*/
public int getKeyPoint() {
	return ConnectionLocator.MIDDLE;
}
 
Example #9
Source File: JConnection.java    From JDeodorant with MIT License 4 votes vote down vote up
public ConnectionLocator getLocator() {
	return locator;
}
 
Example #10
Source File: SequenceFlowNameEditPart.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
/**
* @generated
*/
public int getKeyPoint() {
	return ConnectionLocator.MIDDLE;
}
 
Example #11
Source File: MessageFlowLabelEditPart.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
/**
* @generated
*/
public int getKeyPoint() {
	return ConnectionLocator.MIDDLE;
}