本文整理汇总了Java中org.eclipse.draw2d.PolylineConnection.setForegroundColor方法的典型用法代码示例。如果您正苦于以下问题:Java PolylineConnection.setForegroundColor方法的具体用法?Java PolylineConnection.setForegroundColor怎么用?Java PolylineConnection.setForegroundColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.draw2d.PolylineConnection
的用法示例。
在下文中一共展示了PolylineConnection.setForegroundColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: createFigure
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
@Override
protected IFigure createFigure() {
Link link = (Link) getModel();
link.editPart = this;
SankeyDiagram editor = ((ProductSystemNode) link.sourceNode.parent).editor;
PolylineConnection conn = new LinkFigure(link.getWidth(), editor);
if (editor.isRouted()) {
conn.setConnectionRouter(ROUTER);
} else {
conn.setConnectionRouter(ConnectionRouter.NULL);
}
link.figure = conn;
conn.setTolerance(0);
conn.setForegroundColor(link.getColor());
return conn;
}
示例4: 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;
}
示例5: createFigure
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的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;
}
示例6: 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.setLineStyle(SWTGraphics.LINE_DASH);
connection.setForegroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
return connection;
}
示例7: createFigure
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
/**
* @see nexcore.tool.uml.ui.core.diagram.edit.part.AbstractDiagramConnectionEditPart#createFigure()
*/
@Override
protected IFigure createFigure() {
Relation relation = (Relation) getModel();
PolylineConnection connection = (PolylineConnection) super.createFigure();
connection.setForegroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
connection.addRoutingListener(RoutingAnimator.getDefault());
connection.setConnectionRouter(new BendpointConnectionRouter());
if (RelationType.SYNCHRONOUS_MESSAGE.equals(relation.getRelationType())) {
return connection;
} else if (RelationType.ASYNCHRONOUS_MESSAGE.equals(relation.getRelationType())) {
PolylineDecoration poly = new PolylineDecoration();
PointList p = new PointList();
p.addPoint(0, 0);
p.addPoint(-1, -1);
p.addPoint(-1, 1);
poly.setPoints(p);
poly.setScale(10, 5);
connection.setTargetDecoration(poly);
connection.setLineStyle(Graphics.LINE_SOLID);
return connection;
} else if (RelationType.REPLY_MESSAGE.equals(relation.getRelationType())) {
connection.setLineStyle(Graphics.LINE_DOT);
return connection;
} else if (RelationType.CREATE_MESSAGE.equals(relation.getRelationType())) {
return connection;
} else if (RelationType.DESTROY_MESSAGE.equals(relation.getRelationType())) {
return connection;
} else {
return connection;
}
}
示例8: createFigure
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
protected IFigure createFigure() {
nodeConn = (MessageRoute)getModel();
PolylineConnection conn = new PolylineConnection();
conn.setTargetDecoration(new PolygonDecoration());
router = new CommonStyleRouter(nodeConn.getStyle());
conn.setConnectionRouter(router);
conn.setForegroundColor(ColorConstants.black);
label = new Label();
label.setText(nodeConn.getRouteId());
label.setOpaque(true);
conn.add(label, new MidpointLocator(conn, 0));
return conn;
}
示例9: createFigure
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
@Override
protected IFigure createFigure() {
PolylineConnection figure = new PolylineConnection();
figure.setForegroundColor(Link.COLOR);
figure.setConnectionRouter(getConnectionRouter());
figure.setTargetDecoration(new PolygonDecoration());
figure.setVisible(isVisible());
getModel().figure = figure;
return figure;
}
示例10: setSelected
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
@Override
public void setSelected(int value) {
if (!getFigure().isVisible())
return;
PolylineConnection figure = (PolylineConnection) getFigure();
if (value != EditPart.SELECTED_NONE) {
figure.setLineWidth(2);
figure.setForegroundColor(Link.HIGHLIGHT_COLOR);
} else {
figure.setLineWidth(1);
figure.setForegroundColor(Link.COLOR);
}
super.setSelected(value);
}
示例11: createDummyConnection
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
@Override
protected Connection createDummyConnection(Request req) {
PolylineConnection con = (PolylineConnection) super.createDummyConnection(req);
con.setForegroundColor(Link.COLOR);
if (!(req instanceof CreateConnectionRequest)) {
con.setTargetDecoration(new PolygonDecoration());
return con;
}
CreateLinkCommand cmd = (CreateLinkCommand) ((CreateConnectionRequest) req).getStartCommand();
if (cmd.output != null)
con.setTargetDecoration(new PolygonDecoration());
else if (cmd.input != null)
con.setSourceDecoration(new PolygonDecoration());
return con;
}
示例12: setSelected
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
@Override
public void setSelected(int value) {
PolylineConnection figure = (PolylineConnection) getFigure();
Link link = ((Link) getModel());
if (value != EditPart.SELECTED_NONE) {
figure.setForegroundColor(Link.HIGHLIGHT_COLOR);
} else {
figure.setForegroundColor(link.getColor());
}
super.setSelected(value);
}
示例13: 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.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;
}
示例14: 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();
connection.setTargetDecoration(polygonDecoreation);
connection.addRoutingListener(RoutingAnimator.getDefault());
connection.setConnectionRouter(new BendpointConnectionRouter());
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())
((LabelNodeEditPart) editpart).setConnectionAnchorPoints(sourcePoint, targetPoint);
}
}
}
}
});
return connection;
}
示例15: createFigure
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
@Override
protected IFigure createFigure()
{
final PolylineConnection connection = new PolylineConnection();
// connection.setAntialias(SWT.ON);
connection.setLineStyle(SWT.LINE_SOLID);
// connection.setLineWidthFloat(2.5f);
connection.setLineWidth(2);
connection.setTargetDecoration(new PolygonDecoration());
final IContourMember instance = (IContourMember) getModel();
// return point reference
if (instance.schema().modifiers().contains(NodeModifier.NM_RPDL))
{
final ContourDiagramEditPart contents = (ContourDiagramEditPart) getRoot().getContents();
final IJiveDebugTarget target = contents.getModel();
IMethodContour contour = null;
final IValue value = instance.value();
if (value.isMethodContourReference())
{
contour = (IMethodContour) ((IContourReference) value).contour();
}
else if (value.isOutOfModelMethodReference())
{
final IOutOfModelMethodReference targetValue = (IOutOfModelMethodReference) value;
contour = targetValue.method();
connection.setLineStyle(SWT.LINE_CUSTOM); // LINE_DOT
connection.setLineDash(new float[]
{ 5.0f, 2.0f });
// connection.setLineWidthFloat(2.25f);
connection.setLineWidth(2);
}
final IThreadColorManager manager = JiveUIPlugin.getDefault().getThreadColorManager();
final Color c = manager.threadColor(target, contour.thread());
connection.setForegroundColor(c);
}
// local variable reference
else if (instance.schema().kind() != NodeKind.NK_FIELD)
{
connection.setLineStyle(SWT.LINE_CUSTOM); // LINE_DOT
connection.setLineDash(new float[]
{ 5.0f, 2.0f });
connection.setLineWidth(2);
// connection.setLineWidthFloat(2.25f);
connection.setLineStyle(SWT.LINE_DASH);
connection.setForegroundColor(ColorConstants.gray);
}
// field reference
else
{
connection.setLineWidth(1);
// connection.setLineWidthFloat(1.25f);
connection.setForegroundColor(ColorConstants.darkGray);
}
return connection;
}