本文整理汇总了Java中org.eclipse.draw2d.PolygonDecoration.setTemplate方法的典型用法代码示例。如果您正苦于以下问题:Java PolygonDecoration.setTemplate方法的具体用法?Java PolygonDecoration.setTemplate怎么用?Java PolygonDecoration.setTemplate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.draw2d.PolygonDecoration
的用法示例。
在下文中一共展示了PolygonDecoration.setTemplate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRoundArrow
import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的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;
}
示例2: createFigure
import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
@Override
protected IFigure createFigure() {
Link lnk = (Link) getModel();
String dis = "";
if (lnk.getSource() instanceof TriggerInstanceTerminalNode || lnk.getTarget() instanceof TriggerInstanceTerminalNode)
dis = "Period : " + lnk.getPeriod();
LabeledConnection conn = new LabeledConnection(dis);
PolygonDecoration decoration = new PolygonDecoration();
PointList decorationPointList = new PointList();
decorationPointList.addPoint(0, 0);
decorationPointList.addPoint(-2, 2);
decorationPointList.addPoint(-2, -2);
decoration.setTemplate(decorationPointList);
conn.setTargetDecoration(decoration);
conn.setConnectionRouter(new BendpointConnectionRouter());
return conn;
}
示例3: makeConnection
import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的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;
}
示例4: createDecoration
import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
/**
* @generated NOT
*/
private RotatableDecoration createDecoration() {
PolygonDecoration df = new PolygonDecoration();
df.setLineWidth(1);
PointList list = new PointList();
list.addPoint(0, 0);
list.addPoint(-1, 1);
list.addPoint(0, 0);
list.addPoint(-1, -1);
list.addPoint(0, 0);
list.addPoint(-1, 0);
list.addPoint(-2, 1);
list.addPoint(-1, 0);
list.addPoint(-2, -1);
list.addPoint(-1, 0);
df.setTemplate(list);
return df;
}
示例5: setConnectionState
import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的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 );
}
示例6: connect
import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的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 );
}
示例7: createFigure
import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
@Override
protected IFigure createFigure() {
LabeledConnection conn = new LabeledConnection("rank : " + ((Link) getModel()).getRank());
conn.setConnectionRouter(new BendpointConnectionRouter());
PolygonDecoration decoration = new PolygonDecoration();
PointList decorationPointList = new PointList();
decorationPointList.addPoint(0, 0);
decorationPointList.addPoint(-2, 2);
decorationPointList.addPoint(-2, -2);
decoration.setTemplate(decorationPointList);
conn.setTargetDecoration(decoration);
return conn;
}
示例8: createFigure
import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的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;
}
示例9: 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);
}
示例10: createTargetDecoration
import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
private RotatableDecoration createTargetDecoration() {
PolygonDecoration df = new PolygonDecoration();
df.setFill(true);
df.setLineWidth(getMapMode().DPtoLP(1));
df.setTemplate(PolygonDecoration.TRIANGLE_TIP);
return df;
}
示例11: 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;
}
示例12: 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;
}
示例13: 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();
}
示例14: 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;
}
示例15: 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;
}