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


Java PolygonDecoration.setScale方法代码示例

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


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

示例1: createFigure

import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的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

示例2: createRoleEquivalenceFigure

import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的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

示例3: createRoleRelationshipImplicationFigure

import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的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

示例4: addNullDecoration

import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
private void addNullDecoration(PolylineConnection pointer) {
	PolygonDecoration decoration = new PolygonDecoration();
	PointList points = new PointList();
	points.addPoint(0,-1); // 1
	points.addPoint(0, 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,代码行数:12,代码来源:FrameViewer.java

示例5: createFigure

import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
/**
 * 
 * @see org.eclipse.gef.editparts.AbstractConnectionEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {
    PolylineConnection connection = new PolylineConnection();
    connection.setForegroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
    PolygonDecoration polygonDecoreation = new PolygonDecoration();
    polygonDecoreation.setScale(10, 5);
    connection.setTargetDecoration(polygonDecoreation);
    return connection;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:14,代码来源:AbstractDiagramConnectionEditPart.java

示例6: createInheritanceFigure

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

  // add white arrow tip
  conn.setTargetDecoration(poly);
  conn.setConnectionRouter(new BendpointConnectionRouter());
  return conn;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:21,代码来源:ORMConnectionFigureFactory.java

示例7: InitiatorMessageFigure

import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
InitiatorMessageFigure(final boolean isTransparent)
{
  super();
  setOpaque(!isTransparent);
  setLineStyle(SWT.LINE_SOLID);
  setForegroundColor(isTransparent ? ColorConstants.white : ColorConstants.gray);
  setLineWidthFloat(1.15f);
  // omit decoration for transparent figures
  if (!isTransparent)
  {
    final PolygonDecoration decoration = new PolygonDecoration();
    decoration.setScale(8, 3);
    setTargetDecoration(decoration);
  }
}
 
开发者ID:UBPL,项目名称:jive,代码行数:16,代码来源:MessageFigure.java

示例8: createTargetDecoration

import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
/**
 * @generated
 */
private RotatableDecoration createTargetDecoration() {
	PolygonDecoration df = new PolygonDecoration();
	df.setFill(true);
	PointList pl = new PointList();
	pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0));
	pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2));
	pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2));
	pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0));
	df.setTemplate(pl);
	df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));
	return df;
}
 
开发者ID:bluezio,项目名称:simplified-bpmn-example,代码行数:16,代码来源:SequenceFlow2EditPart.java

示例9: createTargetDecoration

import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
/**
 * @generated
 */
private RotatableDecoration createTargetDecoration() {
	PolygonDecoration df = new PolygonDecoration();
	df.setFill(true);
	df.setBackgroundColor(ColorConstants.white);
	PointList pl = new PointList();
	pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0));
	pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2));
	pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2));
	pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0));
	df.setTemplate(pl);
	df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));
	return df;
}
 
开发者ID:bluezio,项目名称:simplified-bpmn-example,代码行数:17,代码来源:MessageFlow2EditPart.java

示例10: LinkRefConnection

import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
/**
 * Constructor. Set the default type to Contribution
 */
public LinkRefConnection() {
    super();
    setLineWidth(3);
    setAntialias(GeneralPreferencePage.getAntialiasingPref());

    contribution = new PolylineDecoration();
    contribution.setTemplate(PolylineDecoration.TRIANGLE_TIP);
    contribution.setLineWidth(3);
    contribution.setScale(17, 7);
    contribution.setAntialias(GeneralPreferencePage.getAntialiasingPref());

    line = new PolylineDecoration();
    line.setTemplate(LINE);
    line.setLineWidth(3);
    line.setScale(10, 10);
    line.setAntialias(GeneralPreferencePage.getAntialiasingPref());

    depend = new PolygonDecoration();
    depend.setTemplate(DEPENDENCY_FIG);
    depend.setLineWidth(3);
    depend.setFill(true);
    depend.setForegroundColor(ColorManager.LINE);
    depend.setScale(2, 2);
    depend.setAntialias(GeneralPreferencePage.getAntialiasingPref());

    this.type = TYPE_CONTRIBUTION;
    setConnectionVisual();
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:32,代码来源:LinkRefConnection.java

示例11: createTargetDecoration

import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
/**
 * @generated
 */
private RotatableDecoration createTargetDecoration() {
	PolygonDecoration df = new PolygonDecoration();
	df.setFill(true);
	df.setLineWidth(2);
	df.setBackgroundColor(ColorConstants.white);
	PointList pl = new PointList();
	pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0));
	pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(2));
	pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(-2));
	df.setTemplate(pl);
	df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));
	return df;
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:17,代码来源:ExtendibleElementSupertypeEditPart.java

示例12: createTargetDecoration

import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
/**
 * @generated
 */
private RotatableDecoration createTargetDecoration() {
	PolygonDecoration df = new PolygonDecoration();
	df.setFill(true);
	PointList pl = new PointList();
	pl.addPoint(getMapMode().DPtoLP(-1), getMapMode().DPtoLP(1));
	pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0));
	pl.addPoint(getMapMode().DPtoLP(-1), getMapMode().DPtoLP(-1));
	pl.addPoint(getMapMode().DPtoLP(-2), getMapMode().DPtoLP(0));
	pl.addPoint(getMapMode().DPtoLP(-1), getMapMode().DPtoLP(1));
	df.setTemplate(pl);
	df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));
	return df;
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:17,代码来源:DecompositionEditPart.java

示例13: createTargetDecoration

import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
/**
 * @generated
 */
private RotatableDecoration createTargetDecoration() {
	PolygonDecoration df = new PolygonDecoration();
	df.setFill(true);
	df.setBackgroundColor(ColorConstants.white);
	PointList pl = new PointList();
	pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(1));
	pl.addPoint(getMapMode().DPtoLP(-1), getMapMode().DPtoLP(1));
	pl.addPoint(getMapMode().DPtoLP(-1), getMapMode().DPtoLP(-1));
	pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(-1));
	pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(1));
	df.setTemplate(pl);
	df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));
	return df;
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:18,代码来源:ClassNestedInEditPart.java

示例14: createFigure

import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的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.addFigureListener(new FigureListener() {

        /**
         * @see org.eclipse.draw2d.FigureListener#figureMoved(org.eclipse.draw2d.IFigure)
         */
        @SuppressWarnings("unchecked")
        public void figureMoved(IFigure source) {
            Point sourcePoint = ((PolylineConnection) source).getStart();
            Point targetPoint = ((PolylineConnection) source).getEnd();

            RootEditPart rootEditPart = (RootEditPart) getParent();
            List<EditPart> diagramEditparts = new ArrayList<EditPart>();
            diagramEditparts = rootEditPart.getChildren();
            List<EditPart> editParts = new ArrayList<EditPart>();

            for (EditPart diagramEditPart : diagramEditparts) {
                editParts = diagramEditPart.getChildren();
                for (EditPart editpart : editParts) {
                    if (editpart.getModel() instanceof LabelNode) {
                        if (((LabelNode) editpart.getModel()).getOwner() == getModel())
                            if (editpart instanceof LabelNodeEditPart) {
                                ((LabelNodeEditPart) editpart).setConnectionAnchorPoints(sourcePoint, targetPoint);
                            }
                    }
                }
            }
        }
    });
    // PolygonDecoration polygonDecoreation = new PolygonDecoration();
    // polygonDecoreation.setScale(10,5);
    // connection.setTargetDecoration(polygonDecoreation);
    // connection.setLineStyle(SWT.LINE_DOT);
    // connection.addRoutingListener(RoutingAnimator.getDefault());
    // connection.setConnectionRouter(new BendpointConnectionRouter());

    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.setLineStyle(SWT.LINE_DOT);
    connection.setTargetDecoration(polygonDecoreation);
    connection.addRoutingListener(RoutingAnimator.getDefault());
    connection.setConnectionRouter(new BendpointConnectionRouter());
    return connection;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:58,代码来源:RealizationEditPart.java

示例15: createFulfillmentFigure

import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
/**
 * {@link Relation}s from type fulfillment have as figure a drawn through line with a
 * {@link Label} at the connection end that contains the names of the {@link Shape}s from type
 * roletype and rolegroup that are fulfilled from the source of this fulfillment and a black arrow
 * tip at the target end of the connection.
 * 
 * @return conn org.eclipse.draw2d.PolylineConnection
 */
private static Figure createFulfillmentFigure(Relation relation, EditPart editPart) {
  PartFigure tooltipTarget = new PartFigure();

  PolylineConnection conn = new PolylineConnection();
  conn.setAntialias(SWT.ON);

  // create the black arrow tip
  PolygonDecoration poly = new PolygonDecoration();
  poly.setAntialias(SWT.ON);
  poly.setBackgroundColor(ColorConstants.black);
  poly.setScale(5, 5);

  // add the the black arrow tip
  conn.setTargetDecoration(poly);
  conn.setConnectionRouter(new BendpointConnectionRouter());

  // add target Label
  ConnectionEndpointLocator targetEndL = new ConnectionEndpointLocator(conn, true);
  targetEndL.setVDistance(-1);
  targetEndL.setUDistance(1);

  // add to the targetLabel the initial roletype and the rolegroup names in the fulfilledrole list
  Label label = new Label("<...>");
  int roleCount = 0;
  for (Shape role : relation.getReferencedRoles()) {
    if (label.getText().equals("<...>")) {
      label.setText(role.getName());
    } else {
      if (roleCount > 2) {
        tooltipTarget.add(new Label(role.getName()));
      } else {
        label.setText(label.getText() + ", " + role.getName());
      }
    }
    roleCount++;
  }

  label.setToolTip(tooltipTarget);
  conn.add(label, targetEndL);

  if (editPart instanceof ORMFulfillmentEditPart) {
    ((ORMFulfillmentEditPart) editPart).setTargetLabel(label);
    ((ORMFulfillmentEditPart) editPart).setTargetToolTip(tooltipTarget);
  }
  return conn;
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:55,代码来源:ORMConnectionFigureFactory.java


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