本文整理汇总了Java中org.eclipse.draw2d.Graphics.fillPath方法的典型用法代码示例。如果您正苦于以下问题:Java Graphics.fillPath方法的具体用法?Java Graphics.fillPath怎么用?Java Graphics.fillPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.draw2d.Graphics
的用法示例。
在下文中一共展示了Graphics.fillPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: paintLeftArrow
import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
protected void paintLeftArrow(Graphics graphics){
int width = pagingControlHeight / 4;
Rectangle r = getBounds().getCopy();
Point start = new Point(r.getRight().x - 10, r.getCenter().y);
Path triangle = new Path(null);
triangle.moveTo(start.x, start.y);
triangle.lineTo(start.x - width, start.y - pagingControlHeight/2);
triangle.lineTo(start.x - width, start.y + pagingControlHeight/2);
graphics.fillPath(triangle);
}
示例2: paintRightArrow
import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
protected void paintRightArrow(Graphics graphics){
int width = pagingControlHeight / 4;
Rectangle r = getBounds().getCopy();
Point start = new Point(r.x + 10, r.getCenter().y);
Path triangle = new Path(null);
triangle.moveTo(start.x, start.y);
triangle.lineTo(start.x + width, start.y - pagingControlHeight/2);
triangle.lineTo(start.x + width, start.y + pagingControlHeight/2);
graphics.fillPath(triangle);
}
示例3: paintButton
import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
protected void paintButton(Graphics graphics) {
graphics.setBackgroundColor(ColorConstants.black);
Rectangle bounds = getBounds().getCopy();
Path path = new Path(null);
path.moveTo(bounds.right() - BUTTON_SIZE.width / 2,
bounds.getCenter().y - BUTTON_SIZE.height / 2);
path.lineTo(bounds.right()- 3*BUTTON_SIZE.width / 2,
bounds.getCenter().y - BUTTON_SIZE.height / 2);
path.lineTo(bounds.right() - BUTTON_SIZE.width,
bounds.getCenter().y + BUTTON_SIZE.height / 2);
graphics.fillPath(path);
}
示例4: paintFigure
import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
protected void paintFigure(Graphics graphics) {
super.paintFigure(graphics);
Rectangle bounds = getBounds();
graphics.setBackgroundColor(headerColor);
float bw = getBorder().getBorderWidth();
if (hasHeader()){
PrecisionRectangle top = new PrecisionRectangle();
top.setX(bounds.x + bw);
top.setY(bounds.y + bw);
top.setWidth(bounds.width - 2*bw);
top.setHeight(getTitleHeight());
//Path topPath = Drawer.getPartlyRoundedRectangle(top, getBorder().getBorderRadius() - bw, true, true, false, false);
Path topPath = Drawer.getTopRoundedRectangle(top, getBorder().getActualBorderRadius(getBounds()) - bw);
graphics.fillPath(topPath);
}
if (footerTitle != null || hasFooterView){
PrecisionRectangle bottom = new PrecisionRectangle();
bottom.setX(bounds.x + bw);
bottom.setY(bounds.bottom() - bw - getTitleHeight());
bottom.setWidth(bounds.width - 2*bw);
bottom.setHeight(getTitleHeight());
//Path bottomPath = Drawer.getPartlyRoundedRectangle(bottom, getBorder().getBorderRadius() - bw, false, false, true, true);
Path bottomPath = Drawer.getBottomRoundedRectangle(bottom, getBorder().getActualBorderRadius(getBounds()) - bw);
graphics.fillPath(bottomPath);
}
graphics.restoreState();
this.paintString(graphics, headerTitle, true);
this.paintString(graphics, footerTitle, false);
}