本文整理汇总了Java中org.eclipse.draw2d.Polyline类的典型用法代码示例。如果您正苦于以下问题:Java Polyline类的具体用法?Java Polyline怎么用?Java Polyline使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Polyline类属于org.eclipse.draw2d包,在下文中一共展示了Polyline类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: refreshVisuals
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
/**
* @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
*/
@Override
protected void refreshVisuals() {
try {
super.refreshVisuals();
NotationNode notationNode = (NotationNode) getModel();
Polyline line = (Polyline) this.getFigure();
line.removeAllPoints();
line.addPoint(new Point(notationNode.getX(), notationNode.getY()));
line.addPoint(new Point(notationNode.getX(), notationNode.getY() + notationNode.getHeight()));
Rectangle bounds = new Rectangle(notationNode.getX(),
notationNode.getY(),
notationNode.getWidth(),
notationNode.getHeight());
((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), bounds);
} catch (Exception e) {
Log.error(UMLMessage.MESSAGE_INTERACTION_USE_EDIT_PART_REFRESH_VISUALS_ERROR + e);
}
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:24,代码来源:InteractionUseEditPart.java
示例2: createFigure
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
/**
* Creates a filled circle containing an L like segment to simulate a clock.
*
* @see seg.jUCMNav.figures.PathNodeFigure#createFigure()
*/
protected void createFigure() {
ellipse = new Ellipse();
// we're making it larger than the empty point.
ellipse.setBounds(new Rectangle(preferredSize.width / 8, preferredSize.height / 8, DEFAULT_WIDTH * 3 / 4, DEFAULT_HEIGHT * 3 / 4));
ellipse.setAntialias(GeneralPreferencePage.getAntialiasingPref());
poly = new Polyline();
poly.addPoint(new Point(DEFAULT_WIDTH / 2, preferredSize.height / 8));
poly.addPoint(new Point(DEFAULT_WIDTH / 2, DEFAULT_HEIGHT / 2));
poly.addPoint(new Point(preferredSize.width * 7 / 8, DEFAULT_HEIGHT / 2));
poly.setAntialias(GeneralPreferencePage.getAntialiasingPref());
ellipse.add(poly);
ellipse.setLineWidth(2);
ellipse.setAntialias(GeneralPreferencePage.getAntialiasingPref());
poly.setLineWidth(2);
add(ellipse);
}
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:24,代码来源:TimerFigure.java
示例3: addVerticalSeparator
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void addVerticalSeparator(final IFigure figure, final Rectangle rect) {
final Polyline separator = new Polyline();
separator.setLineWidth(separatorWidth);
separator.addPoint(new Point(rect.x, rect.y));
separator.addPoint(new Point(rect.x, rect.y + rect.height));
figure.getChildren().add(separator);
separator.setParent(figure);
separators.add(separator);
}
开发者ID:roundrop,项目名称:ermasterr,代码行数:13,代码来源:TableLayout.java
示例4: addHorizontalSeparator
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void addHorizontalSeparator(final IFigure figure, final Rectangle rect) {
final Polyline separator = new Polyline();
separator.setLineWidth(separatorWidth);
separator.addPoint(new Point(rect.x, rect.y));
separator.addPoint(new Point(rect.x + rect.width, rect.y));
figure.getChildren().add(separator);
separator.setParent(figure);
separators.add(separator);
}
开发者ID:roundrop,项目名称:ermasterr,代码行数:12,代码来源:TableLayout.java
示例5: addVerticalSeparator
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void addVerticalSeparator(IFigure figure, Rectangle rect) {
Polyline separator = new Polyline();
separator.setLineWidth(separatorWidth);
separator.addPoint(new Point(rect.x, rect.y));
separator.addPoint(new Point(rect.x, rect.y + rect.height));
figure.getChildren().add(separator);
separator.setParent(figure);
this.separators.add(separator);
}
开发者ID:kozake,项目名称:ermaster-k,代码行数:13,代码来源:TableLayout.java
示例6: addHorizontalSeparator
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void addHorizontalSeparator(IFigure figure, Rectangle rect) {
Polyline separator = new Polyline();
separator.setLineWidth(separatorWidth);
separator.addPoint(new Point(rect.x, rect.y));
separator.addPoint(new Point(rect.x + rect.width, rect.y));
figure.getChildren().add(separator);
separator.setParent(figure);
this.separators.add(separator);
}
开发者ID:kozake,项目名称:ermaster-k,代码行数:12,代码来源:TableLayout.java
示例7: createFigure
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
/**
* @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
*/
@Override
protected IFigure createFigure() {
NotationNode notationNode = (NotationNode) getModel();
Polyline line = new Polyline();
line.setOpaque(false);
line.addPoint(new Point(notationNode.getX(), notationNode.getY()));
line.addPoint(new Point(notationNode.getX(), notationNode.getY() + 100));
line.setLineWidth(2);
line.setForegroundColor(UiCorePlugin.getDefault().getColor(IConstantColorRegistry.DimGray));
line.setLineStyle(Graphics.LINE_DASH);
return line;
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:16,代码来源:InteractionUseEditPart.java
示例8: createContents
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
/**
* createContents
* void
*/
private void createContents() {
setLayoutManager(new InteractionOperandLayout());
operandUnderBoundary = new Polyline();
operandUnderBoundary.setFill(true);
operandUnderBoundary.setOpaque(true);
operandUnderBoundary.setLineWidth(1);
operandUnderBoundary.setLineStyle(Graphics.LINE_DASH);
operandUnderBoundary.setForegroundColor(UiCorePlugin.getDefault().getColor(IConstantColorRegistry.DimGray));
this.add(operandUnderBoundary);
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:17,代码来源:InteractionOperandFigure.java
示例9: getChildren
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
private List<IFigure> getChildren(IFigure parent) {
final List<IFigure> children = new ArrayList<>();
for (@SuppressWarnings("unchecked")
final Iterator<Polyline> iter = parent.getChildren().iterator(); iter.hasNext();) {
final IFigure child = iter.next();
if (!separators.contains(child)) {
children.add(child);
}
}
return children;
}
开发者ID:dbflute-session,项目名称:erflute,代码行数:15,代码来源:TableLayout.java
示例10: clearSeparator
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private List<IFigure> clearSeparator(IFigure parent) {
for (final Iterator<Polyline> iter = parent.getChildren().iterator(); iter.hasNext();) {
final IFigure child = iter.next();
if (separators.contains(child)) {
iter.remove();
}
}
separators.clear();
return parent.getChildren();
}
开发者ID:dbflute-session,项目名称:erflute,代码行数:15,代码来源:TableLayout.java
示例11: addVerticalSeparator
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void addVerticalSeparator(IFigure figure, Rectangle rect) {
final Polyline separator = new Polyline();
separator.setLineWidth(separatorWidth);
separator.addPoint(new Point(rect.x, rect.y));
separator.addPoint(new Point(rect.x, rect.y + rect.height));
figure.getChildren().add(separator);
separator.setParent(figure);
separators.add(separator);
}
开发者ID:dbflute-session,项目名称:erflute,代码行数:13,代码来源:TableLayout.java
示例12: addHorizontalSeparator
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void addHorizontalSeparator(IFigure figure, Rectangle rect) {
final Polyline separator = new Polyline();
separator.setLineWidth(separatorWidth);
separator.addPoint(new Point(rect.x, rect.y));
separator.addPoint(new Point(rect.x + rect.width, rect.y));
figure.getChildren().add(separator);
separator.setParent(figure);
separators.add(separator);
}
开发者ID:dbflute-session,项目名称:erflute,代码行数:12,代码来源:TableLayout.java
示例13: getStartFigure
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
private Polyline getStartFigure(Rectangle bounds) {
IPlanModifier modifier = PlanModifierMember.get(getViewer().getPlan()).getModifier();
if (startFigure != null || !(modifier instanceof ConstrainedPlanModifier)) {
return null;
}
startFigure = getTemporalBoundFigure(Timepoint.START, bounds);
return startFigure;
}
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:9,代码来源:TemporalNodeMoveEditPolicy.java
示例14: getEndFigure
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
private Polyline getEndFigure(Rectangle bounds) {
IPlanModifier modifier = PlanModifierMember.get(getViewer().getPlan()).getModifier();
if (endFigure != null || !(modifier instanceof ConstrainedPlanModifier)) {
return null;
}
endFigure = getTemporalBoundFigure(Timepoint.END, bounds);
return endFigure;
}
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:9,代码来源:TemporalNodeMoveEditPolicy.java
示例15: showSelection
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
@Override
protected void showSelection() {
Polyline line = (Polyline)getHostFigure();
IFigure p = line.getParent();
p.remove(line);
p.add(line);
line.setLineWidth(3);
}
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:9,代码来源:LinePlotDataSelectionEditPolicy.java
示例16: setTargetFeedbackPoints
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
protected void setTargetFeedbackPoints( Point p1, Point p2 )
{
Transposer transposer = new Transposer( );
transposer.setEnabled( !isHorizontal( ) );
Rectangle parentBox = transposer.t( getAbsoluteClientBounds( (GraphicalEditPart) getHost( ) ) );
Polyline fb = getLineFeedback( );
if ( p2.y >= parentBox.bottom( ) && parentBox.bottom( ) - p1.y < 10 )
{
p2.y = p1.y;
List list = ( (GraphicalEditPart) getHost( ) ).getChildren( );
int size = list.size( );
if ( size == 0 )
{
p2.x = p1.x + Math.min( 30, parentBox.width );
}
else
{
GraphicalEditPart last = (GraphicalEditPart) list.get( size - 1 );
Rectangle rect = getAbsoluteBounds( last );
p2.x = p1.x + Math.min( rect.width - 8, parentBox.width );
}
}
else if ( p2.y >= parentBox.bottom( ) )
{
p2.y = parentBox.bottom( );
}
fb.translateToRelative( p1 );
fb.translateToRelative( p2 );
fb.setPoint( p1, 0 );
fb.setPoint( p2, 1 );
}
开发者ID:eclipse,项目名称:birt,代码行数:36,代码来源:ReportFlowLayoutEditPolicy.java
示例17: createFigure
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
/**
* A simple line, as wide as the bounds.
*
* @see seg.jUCMNav.figures.PathNodeFigure#createFigure()
*/
protected void createFigure() {
mainFigure = new Polygon();
edges = new PointList();
int barWidth = 6 / 2;
edges.addPoint(DEFAULT_WIDTH / 2 - barWidth, 1);
edges.addPoint(DEFAULT_WIDTH / 2 - barWidth, DEFAULT_HEIGHT-1);
edges.addPoint(DEFAULT_WIDTH / 2 + barWidth, DEFAULT_HEIGHT-1);
edges.addPoint(DEFAULT_WIDTH / 2 + barWidth, 1);
edges.addPoint(DEFAULT_WIDTH / 2 - barWidth, 1);
mainFigure.setLineWidth(2);
mainFigure.setPoints(edges);
mainFigure.setAntialias(GeneralPreferencePage.getAntialiasingPref());
mainFigure.setForegroundColor(ColorManager.GRAY);
mainFigure.setBackgroundColor(ColorManager.LINE);
mainFigure.setFill(true);
add(mainFigure);
line = new Polyline();
linePts = new PointList();
linePts.addPoint(new Point(DEFAULT_WIDTH / 2 - barWidth+1, 0));
linePts.addPoint(new Point(DEFAULT_WIDTH / 2 + barWidth-1, DEFAULT_HEIGHT - 1));
line.setPoints(linePts);
line.setLineWidth(2);
line.setAntialias(GeneralPreferencePage.getAntialiasingPref());
line.setForegroundColor(ColorManager.WHITE);
add(line);
}
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:39,代码来源:EndPointFigure.java
示例18: createFigure
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
/**
* Is a Z like figure determined by the three static constants, WIDTH, HEIGHT and DELTA
*
*/
protected void createFigure() {
poly = new Polyline();
poly.setLineWidth(3);
poly.addPoint(getInitial());
poly.addPoint(new Point(-WIDTH / 2, HEIGHT / 2));
poly.addPoint(new Point(WIDTH / 2, -HEIGHT / 2));
poly.addPoint(new Point(WIDTH / 2, -DELTA));
poly.setAntialias(GeneralPreferencePage.getAntialiasingPref());
add(poly);
}
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:16,代码来源:TimeoutPathFigure.java
示例19: setColor
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
public void setColor(Color bg) {
super.setColor(bg);
for (Iterator i = rects.iterator(); i.hasNext();) {
Polyline l = (Polyline) i.next();
l.setBackgroundColor(bg);
}
}
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:9,代码来源:FailurePointFigure.java
示例20: rotate
import org.eclipse.draw2d.Polyline; //导入依赖的package包/类
public void rotate(double angle) {
// make it always point towards bottom
if (Math.cos(angle)>0)
angle -= Math.PI;
Transform t = new Transform();
t.setRotation(angle);
Point center = new Point(getPreferredSize().width / 2, getPreferredSize().height / 2);
for (int j = 0; j < lines.size(); j++) {
PointList points = (PointList) lines.get(j);
Polyline line = (Polyline) rects.get(j);
PointList newPoints = new PointList();
for (int i = 0; i < points.size(); i++) {
Point newPoint = t.getTransformed(new Point(points.getPoint(i).x - center.x, points.getPoint(i).y - center.y));
//Point pt = new Point(newPoint.x - center.x, newPoint.y - center.y);
newPoints.addPoint(newPoint);
}
newPoints.translate(center.x, center.y);
line.setPoints(newPoints);
}
((EllipseAnchor)outgoingAnchor).ancestorMoved(this);
}
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:30,代码来源:FailurePointFigure.java
注:本文中的org.eclipse.draw2d.Polyline类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论