当前位置: 首页>>代码示例>>Java>>正文


Java PolylineConnection.setTargetDecoration方法代码示例

本文整理汇总了Java中org.eclipse.draw2d.PolylineConnection.setTargetDecoration方法的典型用法代码示例。如果您正苦于以下问题:Java PolylineConnection.setTargetDecoration方法的具体用法?Java PolylineConnection.setTargetDecoration怎么用?Java PolylineConnection.setTargetDecoration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.draw2d.PolylineConnection的用法示例。


在下文中一共展示了PolylineConnection.setTargetDecoration方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createRoundArrow

import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
private void createRoundArrow ( final Figure figure )
{
    final PolylineConnection c = new PolylineConnection ();
    c.setSourceAnchor ( new ChopboxAnchor ( this.sourceRect ) );
    c.setTargetAnchor ( new ChopboxAnchor ( this.targetRect ) );

    final PolygonDecoration dec = new PolygonDecoration ();
    dec.setTemplate ( PolygonDecoration.TRIANGLE_TIP );
    c.setTargetDecoration ( dec );

    final MidpointLocator typeLocator = new MidpointLocator ( c, 0 );
    typeLocator.setRelativePosition ( PositionConstants.NORTH );
    this.typeLabel = new Label ( "" ); //$NON-NLS-1$
    c.add ( this.typeLabel, typeLocator );

    figure.add ( c );
    this.roundConnection = c;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:19,代码来源:RoundDetailsPart.java

示例2: makeConnection

import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
private PolylineConnection makeConnection(IFigure contents, IFigure source, NodeFigure target, Color color) {
	PolylineConnection c = new PolylineConnection();
	ConnectionAnchor targetAnchor = new ChopboxAnchor(target);
	c.setTargetAnchor(targetAnchor);
	c.setSourceAnchor(new ChopboxAnchor(source));
	PolygonDecoration decoration = new PolygonDecoration();
	decoration.setTemplate(PolygonDecoration.TRIANGLE_TIP);
	c.setTargetDecoration(decoration);
	c.setForegroundColor(color);
	ConnectionMouseListener listener = new ConnectionMouseListener(c);
	c.addMouseMotionListener(listener);
	c.addMouseListener(listener);
	c.setCursor(Cursors.HAND);
	contents.add(c);
	connections.add(c);
	return c;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:18,代码来源:GraphEditPart.java

示例3: decorateRelation

import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
// @Override
// public void refreshVisuals() {
// super.refreshVisuals();
//
// }

@Override
protected void decorateRelation() {
    final ERDiagram diagram = getDiagram();

    if (diagram != null) {
        final Relation relation = (Relation) getModel();

        final PolylineConnection connection = (PolylineConnection) getConnectionFigure();

        final String notation = diagram.getDiagramContents().getSettings().getNotation();

        final Decoration decoration = DecorationFactory.getDecoration(notation, relation.getParentCardinality(), relation.getChildCardinality());

        connection.setSourceDecoration(decoration.getSourceDecoration());
        connection.setTargetDecoration(decoration.getTargetDecoration());

        targetLabel.setText(Format.null2blank(decoration.getTargetLabel()));
    }
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:29,代码来源:RelationEditPart.java

示例4: createFigure

import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
/**
 * @see nexcore.tool.uml.ui.core.diagram.edit.part.AbstractDiagramConnectionEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {
    PolylineConnection connection = new PolylineConnection() {
        @Override
        public void paintFigure(Graphics graphics) {
            graphics.setAntialias(SWT.ON);
            super.paintFigure(graphics);
        }
    };
    connection.setForegroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
    PolygonDecoration polygonDecoreation = new PolygonDecoration();
    polygonDecoreation.setBackgroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    polygonDecoreation.setScale(10, 5);
    connection.setTargetDecoration(polygonDecoreation);
    connection.addRoutingListener(RoutingAnimator.getDefault());
    connection.setConnectionRouter(new BendpointConnectionRouter());

    return connection;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:23,代码来源:GeneralizationEditPart.java

示例5: refreshVisuals

import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
@Override
protected void refreshVisuals() {
    super.refreshVisuals();
    final ERDiagram diagram = getDiagram();
    if (diagram != null) {
        final Relationship relation = (Relationship) getModel();
        final PolylineConnection connection = (PolylineConnection) getConnectionFigure();
        final String notation = diagram.getDiagramContents().getSettings().getNotation();
        final Decoration decoration =
                DecorationFactory.getDecoration(notation, relation.getParentCardinality(), relation.getChildCardinality());
        connection.setSourceDecoration(decoration.getSourceDecoration());
        connection.setTargetDecoration(decoration.getTargetDecoration());
        targetLabel.setText(Format.null2blank(decoration.getTargetLabel()));
    }
    calculateAnchorLocation();
    refreshBendpoints();
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:18,代码来源:RelationEditPart.java

示例6: createRoleEquivalenceFigure

import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
/**
 * {@link Relation}s from type roleequivalence have as figure a dashed line with a white arrow
 * tips at both connection ends.
 * 
 * @return conn org.eclipse.draw2d.PolylineConnection
 */
private static Figure createRoleEquivalenceFigure() {
  // create white arrow tip 1
  PolygonDecoration poly1 = new PolygonDecoration();
  poly1.setAntialias(SWT.ON);
  poly1.setBackgroundColor(ColorConstants.white);
  poly1.setScale(5, 5);

  // create white arrow tip 2
  PolygonDecoration poly2 = new PolygonDecoration();
  poly2.setAntialias(SWT.ON);
  poly2.setBackgroundColor(ColorConstants.white);
  poly2.setScale(5, 5);

  PolylineConnection conn = new PolylineConnection();
  conn.setAntialias(SWT.ON);
  conn.setLineDash(new float[] {5.0f, 5.0f});
  conn.setLineStyle(SWT.LINE_CUSTOM);
  // add white arrow tip 1
  conn.setTargetDecoration(poly1);
  // add white arrow tip 2
  conn.setSourceDecoration(poly2);
  conn.setConnectionRouter(new BendpointConnectionRouter());
  return conn;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:31,代码来源:ORMConnectionFigureFactory.java

示例7: createRoleRelationshipImplicationFigure

import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
/**
 * {@link Relations}s from type roleimplication and relationshipimplication have as figure a
 * dashed line with a white arrow tip at target end of this connection.
 * 
 * @return conn org.eclipse.draw2d.PolylineConnection
 */
private static Figure createRoleRelationshipImplicationFigure() {
  // create white arrow tip
  PolygonDecoration poly = new PolygonDecoration();
  poly.setAntialias(SWT.ON);
  poly.setBackgroundColor(ColorConstants.white);
  poly.setScale(5, 5);

  PolylineConnection conn = new PolylineConnection();
  conn.setAntialias(SWT.ON);
  conn.setLineDash(new float[] {5.0f, 5.0f});
  conn.setLineStyle(SWT.LINE_CUSTOM);
  conn.setTargetDecoration(poly);
  conn.setConnectionRouter(new BendpointConnectionRouter());
  return conn;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:22,代码来源:ORMConnectionFigureFactory.java

示例8: createRoleRelationshipExclusionFigure

import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
/**
 * 
 * {@link Relations}s from type roleprohibition and relationshipexclusion have as figure a
 * dashed line with a white arrow tip at target end of this connection.
 * 
 * @return conn org.eclipse.draw2d.PolylineConnection
 * */
private static Figure createRoleRelationshipExclusionFigure() {
  // create white arrow tip
  PolylineDecoration poly1 = new PolylineDecoration();
  poly1.setTemplate(INVERTED_TRIANGLE_TIP);
  poly1.setAntialias(SWT.ON);
  poly1.setBackgroundColor(ColorConstants.black);
  poly1.setScale(5, 5);
  
  PolylineDecoration poly2 = new PolylineDecoration();
  poly2.setTemplate(INVERTED_TRIANGLE_TIP);
  poly2.setAntialias(SWT.ON);
  poly2.setBackgroundColor(ColorConstants.black);
  poly2.setScale(5, 5);

  PolylineConnection conn = new PolylineConnection();
  conn.setAntialias(SWT.ON);
  conn.setLineDash(new float[] {5.0f, 5.0f});
  conn.setLineStyle(SWT.LINE_CUSTOM);
  conn.setTargetDecoration(poly1);
  conn.setSourceDecoration(poly2);
  conn.setConnectionRouter(new BendpointConnectionRouter());
  return conn;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:31,代码来源:ORMConnectionFigureFactory.java

示例9: createRoleProhibitonFigure

import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
/**
 * {@link Relation}s from type roleprohibition have as figure a dased line with two inverted and
 * open arrow tips at both ends of this connection.
 * 
 * @return conn org.eclipse.draw2d.PolylineConnection
 */
private static Figure createRoleProhibitonFigure() {
  PolylineDecoration poly1 = new PolylineDecoration();
  poly1.setTemplate(INVERTED_TRIANGLE_TIP);
  poly1.setAntialias(SWT.ON);
  poly1.setBackgroundColor(ColorConstants.black);
  poly1.setScale(5, 5);


  PolylineDecoration poly2 = new PolylineDecoration();
  poly2.setTemplate(INVERTED_TRIANGLE_TIP);
  poly2.setAntialias(SWT.ON);
  poly2.setBackgroundColor(ColorConstants.black);
  poly2.setScale(5, 5);


  PolylineConnection conn = new PolylineConnection();
  conn.setAntialias(SWT.ON);
  conn.setLineDash(new float[] {5.0f, 5.0f});
  conn.setLineStyle(SWT.LINE_CUSTOM);
  conn.setTargetDecoration(poly1);
  conn.setSourceDecoration(poly2);
  conn.setConnectionRouter(new BendpointConnectionRouter());

  return conn;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:32,代码来源:ORMConnectionFigureFactory.java

示例10: setConnectionState

import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
/**
 * Set graphics attribute according to the connection state
 * 
 * @param connection
 *            the connection to change
 * @param state
 *            the state
 */
protected void setConnectionState ( final PolylineConnection connection, final boolean state )
{
    final PolygonDecoration dec = new PolygonDecoration ();
    dec.setTemplate ( PolygonDecoration.TRIANGLE_TIP );

    connection.setLineStyle ( state ? Graphics.LINE_SOLID : Graphics.LINE_DOT );
    connection.setLineWidth ( state ? 2 : 1 );
    connection.setTargetDecoration ( state ? dec : null );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:18,代码来源:ManualOverride.java

示例11: connect

import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
private void connect ( final IFigure figure, final IFigure source, final IFigure target )
{
    final PolylineConnection c = new PolylineConnection ();
    c.setSourceAnchor ( new ChopboxAnchor ( source ) );
    c.setTargetAnchor ( new ChopboxAnchor ( target ) );

    final PolygonDecoration dec = new PolygonDecoration ();
    dec.setTemplate ( PolygonDecoration.TRIANGLE_TIP );
    dec.setBackgroundColor ( ColorConstants.black );
    c.setTargetDecoration ( dec );

    figure.add ( c );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:14,代码来源:InputScaleDetails.java

示例12: createFigure

import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
@Override
protected IFigure createFigure() {

	PolylineConnection connection = (PolylineConnection) super
			.createFigure();
	connection.addRoutingListener(RoutingAnimator.getDefault());
	connection.setTargetDecoration(new PolygonDecoration());
	connection.setLineStyle(getCastedModel().getLineStyle());
	return connection;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:11,代码来源:LinkEditPart.java

示例13: createFigure

import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
@Override
protected IFigure createFigure() {
	final PolylineConnection connection = new PolylineConnection();
	connection.setConnectionRouter(new BendpointConnectionRouter());
	PolygonDecoration decoration = new PolygonDecoration();
	decoration.setTemplate(new PointList(new int[]{0, 0, -2, 2, -2, 0, -2, -2, 0, 0}));
	RGB rgb=Activator.getPreference().getTransitionColor();
	decoration.setBackgroundColor(new Color(null,rgb));
	connection.setTargetDecoration(decoration);
	connection.setAntialias(SWT.ON);
	connection.setForegroundColor(new Color(null,rgb));
	return connection;
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:14,代码来源:TransitionEditPart.java

示例14: addArrowDecoration

import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
static void addArrowDecoration(PolylineConnection pointer) {
	PolylineDecoration decoration = new PolylineDecoration();
	PointList points = new PointList();
	points.addPoint(-1, -1);
	points.addPoint(0, 0);
	points.addPoint(-1, 1);
	decoration.setTemplate(points);
	decoration.setScale(PandionJConstants.ARROW_EDGE, PandionJConstants.ARROW_EDGE);
	decoration.setLineWidth(PandionJConstants.ARROW_LINE_WIDTH);
	decoration.setOpaque(true);
	pointer.setTargetDecoration(decoration);
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:13,代码来源:Utils.java

示例15: addArrowDecoration

import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
private void addArrowDecoration(PolylineConnection pointer) {
	PolylineDecoration decoration = new PolylineDecoration();
	PointList points = new PointList();
	points.addPoint(-1, -1);
	points.addPoint(0, 0);
	points.addPoint(-1, 1);
	decoration.setTemplate(points);
	decoration.setScale(Constants.ARROW_EDGE, Constants.ARROW_EDGE);
	decoration.setLineWidth(Constants.ARROW_LINE_WIDTH);
	decoration.setOpaque(true);
	pointer.setTargetDecoration(decoration);
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:13,代码来源:FrameViewer.java


注:本文中的org.eclipse.draw2d.PolylineConnection.setTargetDecoration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。