本文整理汇总了Java中org.eclipse.draw2d.Polyline类的典型用法代码示例。如果您正苦于以下问题:Java Polyline类的具体用法?Java Polyline怎么用?Java Polyline使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Polyline类属于org.eclipse.draw2d包,在下文中一共展示了Polyline类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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();
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}