本文整理汇总了Java中org.eclipse.draw2d.PolygonDecoration.setBackgroundColor方法的典型用法代码示例。如果您正苦于以下问题:Java PolygonDecoration.setBackgroundColor方法的具体用法?Java PolygonDecoration.setBackgroundColor怎么用?Java PolygonDecoration.setBackgroundColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.draw2d.PolygonDecoration
的用法示例。
在下文中一共展示了PolygonDecoration.setBackgroundColor方法的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;
}
示例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;
}
示例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;
}
示例4: 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 );
}
示例5: 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;
}
示例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;
}
示例7: 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;
}
示例8: 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;
}
示例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(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;
}
示例10: createTargetDecoration
import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
/**
* @generated
*/
private RotatableDecoration createTargetDecoration() {
PolygonDecoration df = new PolygonDecoration();
df.setLineWidth(1);
// sets a triangular background color in white
df.setBackgroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
return df;
}
示例11: makeHeadDecoration
import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
private PolygonDecoration makeHeadDecoration(RelationshipType relType){
PolygonDecoration decoration = new PolygonDecoration();
PointList points = new PointList();
switch(relType){
case AGGREGATION:
decoration.setBackgroundColor(ColorConstants.white);
case COMPOSITION:
points.addPoint(0,0);
points.addPoint(-3,3);
points.addPoint(-6,0);
points.addPoint(-3,-3);
break;
case DIRECTEDASSOCIATION:
case DEPENDENCY:
points.addPoint(0,0);
points.addPoint(-2,4);
points.addPoint(0,0);
points.addPoint(-2,-4);
break;
case REALIZATION:
case GENERALIZATION:
decoration.setBackgroundColor(ColorConstants.white);
points.addPoint(0,0);
points.addPoint(-2,4);
points.addPoint(-2,-4);
break;
}
if(points.size() > 0){
decoration.setTemplate(points);
return decoration;
}
return null;
}
示例12: 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;
}
示例13: getInnerDecoration
import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
private RotatableDecoration getInnerDecoration() {
PolygonDecoration srcpd = new PolygonDecoration();
srcpd.setTemplate(JOINDECORATOR);
srcpd.setBackgroundColor(ColorConstants.black);
return srcpd;
}
示例14: getOuterDecoration
import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
private RotatableDecoration getOuterDecoration() {
PolygonDecoration srcpd = new PolygonDecoration();
srcpd.setTemplate(JOINDECORATOR);
srcpd.setBackgroundColor(ColorConstants.white);
return srcpd;
}
示例15: getCrossDecoration
import org.eclipse.draw2d.PolygonDecoration; //导入方法依赖的package包/类
private RotatableDecoration getCrossDecoration() {
PolygonDecoration srcpd = new PolygonDecoration();
srcpd.setTemplate(JOINDECORATOR);
srcpd.setBackgroundColor(ColorConstants.lightGray);
return srcpd;
}