本文整理汇总了Java中org.eclipse.draw2d.PolylineConnection.setLineWidth方法的典型用法代码示例。如果您正苦于以下问题:Java PolylineConnection.setLineWidth方法的具体用法?Java PolylineConnection.setLineWidth怎么用?Java PolylineConnection.setLineWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.draw2d.PolylineConnection
的用法示例。
在下文中一共展示了PolylineConnection.setLineWidth方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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 );
}
示例2: createFigure
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
@Override
protected IFigure createFigure() {
final PolylineConnection res = (PolylineConnection)super.createFigure();
res.setLineWidth(1);
// PolygonDecoration decoration = new PolygonDecoration();
// decoration.setTemplate(PolygonDecoration.TRIANGLE_TIP);
// res.setTargetDecoration(decoration);
res.setLineStyle(SWT.LINE_SOLID);
res.setBackgroundColor(ColorConstants.listForeground);
return res;
}
示例3: createFigure
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
/**
* Creates a Connection and adds appropriate decorations.
*
* @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
*/
protected IFigure createFigure() {
PolylineConnection connection = new PolylineConnection();
connection.setLineWidth(2);
connection.setLineStyle(SWT.LINE_DASH);
connection.setAntialias(GeneralPreferencePage.getAntialiasingPref());
return connection;
}
示例4: 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);
}
示例5: addSelectionHandles
import org.eclipse.draw2d.PolylineConnection; //导入方法依赖的package包/类
protected void addSelectionHandles() {
super.addSelectionHandles();
PolylineConnection figure = getConnectionFigure();
figure.setLineWidth(3);
}
示例6: 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;
}