本文整理汇总了Java中org.eclipse.draw2d.Graphics.fillArc方法的典型用法代码示例。如果您正苦于以下问题:Java Graphics.fillArc方法的具体用法?Java Graphics.fillArc怎么用?Java Graphics.fillArc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.draw2d.Graphics
的用法示例。
在下文中一共展示了Graphics.fillArc方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawCircle
import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
protected void drawCircle(Graphics graphics, Rectangle bounds){
//draw circle
int x = Math.min(Math.max(bounds.right() - sliderWidth / 2, 0), getBounds().right() - sliderWidth);
graphics.fillArc(x, getBounds().y, sliderWidth,
getBounds().height, 0, 360);
graphics.drawArc(x, getBounds().y, sliderWidth,
getBounds().height, 0, 360);
}
示例2: paintPagingControl
import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
protected void paintPagingControl(Graphics graphics){
int diametr = ARCH_RADIUS * 2;
int width = diametr * 2 * pagesCount - diametr;
Point leftTop = new Point(getBounds().getCenter().x - width / 2,
getBounds().bottom() - ARCH_RADIUS * 3);
for (int i = 0; i < pagesCount; i++) {
graphics.setBackgroundColor(currentPage == i ?
ColorConstants.black : ColorConstants.lightGray);
graphics.fillArc(leftTop.x, leftTop.y, diametr,
diametr, 0, 360);
leftTop.translate(diametr*2, 0);
}
}
示例3: drawDeviceButton
import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
protected void drawDeviceButton(Graphics graphics, int deviceHeight,
int deviceWidth) {
int beginBlackButtonX = (deviceWidth / 2) - 25;
int beginBlackButtonY = deviceHeight - 35 - 25;
int beginCremeButtonX = (deviceWidth / 2) - 20;
int beginCremeButtonY = deviceHeight - 35 - 20;
int beginWhiteButtonX = (deviceWidth / 2) - 18;
int beginWhiteButtonY = deviceHeight - 35 - 18;
graphics.setForegroundColor(black);
graphics.setLineWidth(6);
graphics.drawArc(beginBlackButtonX, beginBlackButtonY, 50, 50, 0, 360);
graphics.setForegroundColor(creameColor);
graphics.setLineWidth(6);
graphics.drawArc(beginCremeButtonX, beginCremeButtonY, 40, 40, 0, 360);
graphics.setBackgroundColor(whiteColor);
graphics.fillArc(beginWhiteButtonX, beginWhiteButtonY, 36, 36, 0, 360);
}
示例4: paintTitle
import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
public void paintTitle(Graphics graphics) {
if (Utils.isNotEmpty(getText())){
graphics.pushState();
Color bgColor = graphics.getBackgroundColor();
graphics.setBackgroundColor(ColorConstants.white);
int titleHeight = FigureUtilities.getStringExtents(getText(), titleFont).height;
Rectangle titleRect = getTextHolderRectangle();
Rectangle imRect = new Rectangle(titleRect.x + getMargin(),
titleRect.y + getMargin(), titleHeight, titleHeight);
graphics.fillArc(imRect, 0, 360);
graphics.setBackgroundColor(bgColor);
imRect.shrink(4, 4);
graphics.fillArc(imRect, 0, 360);
graphics.setBackgroundColor(ColorConstants.white);
graphics.fillPolygon(new int[]{imRect.x + imRect.width / 6,
imRect.y + imRect.width / 3,
imRect.x + imRect.width - imRect.width/ 6,
imRect.y + imRect.width / 3,
imRect.x + imRect.width/ 2,
imRect.y + imRect.width});
graphics.setBackgroundColor(ColorConstants.gray);
graphics.drawLine(titleRect.x + 50, titleRect.y + titleHeight + getMargin() + 1,
titleRect.right() - 50, titleRect.y + titleHeight + getMargin() + 1);
graphics.popState();
titleRect.x += titleHeight + getMargin()*2;
titleRect.width -= titleHeight + getMargin()*3;
paintString(graphics, getText(), titleRect);
}
}
示例5: paintPagingControl
import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
protected void paintPagingControl(Graphics graphics) {
if (pagingControlHeight > 0){
graphics.setBackgroundColor(getPagingControlColor());
Rectangle r = getBounds().getCopy();
r.y = r.bottom() - pagingControlHeight;
r.height = pagingControlHeight;
graphics.fillRectangle(r);
graphics.setBackgroundColor(ColorConstants.white);
int diametr = Math.min(pagingControlHeight, 10);
int width = diametr*(pagesCount*2 - 1);
int x = r.getCenter().x - width / 2;
for (int i = 0; i < pagesCount; i++) {
//draw dot at the bottom
graphics.fillArc(x,
r.getCenter().y - diametr / 2, diametr, diametr,
0, 360);
x += diametr*2;
}
if (currentPage >= 0){
graphics.setBackgroundColor(ColorConstants.gray);
x = r.getCenter().x - width / 2;
x += diametr*2*currentPage;
graphics.fillArc(x,
r.getCenter().y - diametr / 2, diametr, diametr,
0, 360);
}
}
}
示例6: doFillShape
import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
public void doFillShape(ArcAttribute arcAttr, Graphics graphics, Rectangle bounds) throws IllegalActionException {
int offset = (int) ((DoubleToken) arcAttr.start.getToken()).doubleValue();
int length = (int) ((DoubleToken) arcAttr.extent.getToken()).doubleValue();
// Don't know how to have a "closed" arc (i.e. a chord) in draw2d Graphics,
// so we handle it as a simple "open" arc.
String arcType = arcAttr.type.stringValue();
switch (arcType) {
case "open":
case "chord":
break;
default:
graphics.fillArc(bounds, offset, length);
}
}