当前位置: 首页>>代码示例>>Java>>正文


Java Graphics.fillRoundRectangle方法代码示例

本文整理汇总了Java中org.eclipse.draw2d.Graphics.fillRoundRectangle方法的典型用法代码示例。如果您正苦于以下问题:Java Graphics.fillRoundRectangle方法的具体用法?Java Graphics.fillRoundRectangle怎么用?Java Graphics.fillRoundRectangle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.draw2d.Graphics的用法示例。


在下文中一共展示了Graphics.fillRoundRectangle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: paintCancel

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
protected void paintCancel(Graphics graphics){
	Rectangle barBounds = getBounds().getCopy();
	barBounds.crop(new Insets(getMargin()));
	if (barBounds.height > getMaxHeight()){
		int dy = (barBounds.height - getMaxHeight())/2;
		barBounds.crop(new Insets(dy,0,dy,0));
	}
	
	Rectangle cancelBounds = barBounds.getCopy();
	cancelBounds.x = cancelBounds.right() - getCancelButtonWidth();
	cancelBounds.width = getCancelButtonWidth();
	
	Color cancelColor = new Color(null,
			ColorUtils.darker(
					ColorUtils.darker(
							graphics.getBackgroundColor().getRGB())));
	graphics.setBackgroundColor(cancelColor);
	int radius = Math.min(15, cancelBounds.height);
	graphics.fillRoundRectangle(cancelBounds, radius, radius);
	graphics.drawRoundRectangle(cancelBounds, radius, radius);
	graphics.setForegroundColor(ColorConstants.white);
	paintString(graphics, "Cancel", cancelBounds);
	cancelColor.dispose();
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:25,代码来源:SearchBarFigure.java

示例2: drawShadowLayer

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
private void drawShadowLayer(Rectangle rectangle, Graphics graphics,
		int offset, Color color) {

	// Save the state of the graphics object
	graphics.pushState();
	graphics.setLineWidth(0);
	graphics.setBackgroundColor(color);
	Rectangle shadowLayer = new Rectangle(rectangle);
	shadowLayer.x += offset;
	shadowLayer.y += offset;

	Dimension cornerDimensions = getCornerDimensions();
	graphics.fillRoundRectangle(shadowLayer, cornerDimensions.width,
			cornerDimensions.height);
	// Restore the start of the graphics object
	graphics.popState();
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:18,代码来源:DropShadowRectangle.java

示例3: paintFigure

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
protected void paintFigure(Graphics graphics) {
	//this will draw main border
	getBorder().paintBackground(this, graphics,	borderInsets);

	//now we need to draw border with another color
	//to imitate value
	Rectangle bounds = getBounds().getCopy().crop(borderInsets);
	bounds.width *= this.value;
	//bounds.shrink(0, borderInsets.top);
	
	int radius = Math.min(Math.min(bounds.height, bounds.width), (int)getBorder().getBorderRadius()*2);
	graphics.setBackgroundColor(valueColor);
	graphics.fillRoundRectangle(bounds, radius, radius);
	graphics.drawRoundRectangle(bounds, radius, radius);
	
	graphics.setBackgroundColor(getBorder().getBackgroundColor());
	
	drawCircle(graphics, bounds);
	
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:22,代码来源:SliderFigure.java

示例4: paintFigure

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
protected void paintFigure(Graphics graphics) {
	
	//this will draw main border
	super.paintFigure(graphics);
	//now we need to draw border with another color
	//to imitate value
	Rectangle bounds = getBounds().getCopy();
	bounds.width *= this.value;
	
	
	if (bounds.width > 0){
		int radius = Math.min(Math.min(bounds.height, bounds.width), (int)getBorder().getBorderRadius()*2);
		graphics.setBackgroundColor(valueColor);
		graphics.setForegroundColor(valueColor);
		graphics.fillRoundRectangle(bounds, radius, radius);
		graphics.drawRoundRectangle(bounds, radius, radius);
	}
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:20,代码来源:ProgressBarFigure.java

示例5: fillShape

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void fillShape(final Graphics graphics) {
    Rectangle f = Rectangle.SINGLETON.setBounds(getBounds());
    final Insets shadowInset = new Insets(0, 0, SHADOW_INSET, SHADOW_INSET);
    f = shrink(f, shadowInset);
    drawShadow(f, graphics);
    final Dimension cornerDimensions = getCornerDimensions();
    graphics.fillRoundRectangle(f, cornerDimensions.width, cornerDimensions.height);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:13,代码来源:DropShadowRectangle.java

示例6: drawShadowLayer

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
private void drawShadowLayer(final Rectangle rectangle, final Graphics graphics, final int offset, final Color color) {

        // Save the state of the graphics object
        graphics.pushState();
        graphics.setLineWidth(0);
        graphics.setBackgroundColor(color);
        final Rectangle shadowLayer = new Rectangle(rectangle);
        shadowLayer.x += offset;
        shadowLayer.y += offset;

        final Dimension cornerDimensions = getCornerDimensions();
        graphics.fillRoundRectangle(shadowLayer, cornerDimensions.width, cornerDimensions.height);
        // Restore the start of the graphics object
        graphics.popState();
    }
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:16,代码来源:DropShadowRectangle.java

示例7: fillShape

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void fillShape(Graphics graphics) {
	Rectangle f = Rectangle.SINGLETON.setBounds(getBounds());
	Insets shadowInset = new Insets(0, 0, SHADOW_INSET, SHADOW_INSET);
	f = shrink(f, shadowInset);
	this.drawShadow(f, graphics);
	Dimension cornerDimensions = getCornerDimensions();
	graphics.fillRoundRectangle(f, cornerDimensions.width, cornerDimensions.height);
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:13,代码来源:DropShadowRectangle.java

示例8: drawBadge

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
public static void drawBadge(Graphics graphics, Rectangle r, String text){
	if (Utils.isNotEmpty(text)){
		graphics.setBackgroundColor(ColorConstants.white);
		Dimension textSize = FigureUtilities.getStringExtents(text, graphics.getFont());
		int h = textSize.height;
		int w = Math.max(h, textSize.width + 8);
		int radius = Math.min(w, h);
		graphics.fillRoundRectangle(new Rectangle(r.right()-w-2, r.y+2, w, h), radius, radius);
		graphics.setBackgroundColor(ColorConstants.red);
		Rectangle textRect = new Rectangle(r.right()-w-1, r.y + 3,w-2, h-2);
		radius = Math.min(textRect.width, textRect.height);
		graphics.fillRoundRectangle(textRect, radius, radius);
		drawString(graphics, text, textRect);
	}
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:16,代码来源:Drawer.java

示例9: paintBody

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
protected void paintBody(Graphics graphics) {
	graphics.setBackgroundColor(background);
	boolean drawCC = true;//(cc != null || bcc != null);
	int fieldsCount = drawCC ? 4 : 2;
	int compositeHeight = 1 + (fieldsCount * 35);
	Rectangle rect = new Rectangle(2, 34, resolution.width - 4, compositeHeight);
	graphics.fillRectangle(rect);
	
	Dimension fieldSize = new Dimension(resolution.width - 16, 30);
	graphics.setBackgroundColor(background2);
	graphics.setForegroundColor(border);
	rect = new Rectangle(new Point(8, 36), fieldSize);

	//to, cc, bcc, subject
	for (int i = 0; i < fieldsCount; i++) {
		graphics.fillRoundRectangle(rect, radius, radius);
		graphics.drawRoundRectangle(rect, radius, radius);
		rect.performTranslate(0, 35);
	}
	
	//message
	rect = new Rectangle(2, rect.y  , resolution.width - 4, resolution.height - 160);
	graphics.fillRoundRectangle(rect, radius, radius);
	graphics.drawRoundRectangle(rect, radius, radius);
	
	graphics.setForegroundColor(text);
	
	String[] titles = getTitles(drawCC);
	fieldSize.width -= 8;
	for (int i = 0; i < fieldsCount; i++) {
		Rectangle textRect = new Rectangle(new Point(12, 5 + (i + 1)*35), fieldSize);
		Drawer.drawString(graphics, titles[i], textRect, Alignments.left, Alignments.center);
	}
	
	paintMessage(graphics, rect);
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:37,代码来源:EmailDialogFigure.java

示例10: paindButtonsBar

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * @param graphics
 */
private void paindButtonsBar(Graphics graphics) {
	int panelHeight = 42;
	graphics.setBackgroundColor(defaultBarColor);
	Rectangle rect = new Rectangle(2, resolution.height - 2 - panelHeight,
			resolution.width - 4, panelHeight);
	graphics.fillRectangle(rect);
			
	int buttonWidth = (resolution.width - 20) / 7 ;
	int space = (resolution.width - buttonWidth * 7) / 7;
		
	graphics.setBackgroundColor(background2);
	graphics.setForegroundColor(border);
	rect = new Rectangle(5 + space, resolution.height - panelHeight + 2, buttonWidth*2, panelHeight - 10);
	graphics.fillRoundRectangle(rect, radius, radius);
	graphics.drawRoundRectangle(rect, radius, radius);
	
	rect.translate(buttonWidth*5 + space*2, 0);
	graphics.fillRoundRectangle(rect, radius, radius);
	graphics.drawRoundRectangle(rect, radius, radius);
	
	rect.translate(-buttonWidth*3 - space, 0);
	rect.width = buttonWidth*3;
	graphics.fillRoundRectangle(rect, radius, radius);
	graphics.drawRoundRectangle(rect, radius, radius);
	
	graphics.setForegroundColor(ColorConstants.black);
	graphics.drawText("Send", new Point(22 + space, resolution.height - panelHeight + 7));
	graphics.drawText("Save as Draft", new Point(12 + space*2 + buttonWidth*2, resolution.height - panelHeight + 7));
	graphics.drawText("Discard", new Point(14 + space*3 + buttonWidth*5, resolution.height - panelHeight + 7));
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:34,代码来源:EmailDialogFigure.java

示例11: drawDeviceSpeaker

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
protected void drawDeviceSpeaker(Graphics graphics, int deviceWidth) {
	int widthSpeacker = Math.min(180, deviceWidth / 2);
	int xSpeaker = (deviceWidth - widthSpeacker) / 2;
	int ySpeaker = 15;

	graphics.setForegroundColor(black);
	graphics.setLineWidth(2);
	graphics.drawRoundRectangle(new Rectangle(xSpeaker, ySpeaker, widthSpeacker, 10),
			10, 10);
	graphics.setBackgroundColor(speakerGray);
	graphics.fillRoundRectangle(new Rectangle(xSpeaker, ySpeaker, widthSpeacker, 10),
			10, 10);
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:14,代码来源:AndroidMobileScreenFigure.java

示例12: drawCircle

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
protected void drawCircle(Graphics graphics, Rectangle bounds) {
	//draw circle
	int x = Math.min(Math.max(bounds.right() - sliderWidth / 4, 0), getBounds().right() - sliderWidth/2);
	graphics.fillRoundRectangle(new Rectangle(x, getBounds().y, sliderWidth / 2 + 1,
			getBounds().height), 5, 5);
	graphics.drawRoundRectangle(new Rectangle(x, getBounds().y, sliderWidth / 2,
			getBounds().height - 1), 5, 5);
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:10,代码来源:SliderFigureAndroid.java

示例13: fillShape

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * @see Shape#fillShape(Graphics)
 */
protected void fillShape(Graphics graphics) {
    graphics.pushState();
    Rectangle bound = this.getBounds().getCopy();

    graphics.fillRoundRectangle(bound, 30, 30);
    graphics.popState();
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:11,代码来源:OpaqueActionFigure.java

示例14: fillShape

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
protected void fillShape(Graphics graphics) {
    Rectangle f = Rectangle.SINGLETON.setBounds(getBounds());
    final Insets shadowInset = new Insets(0, 0, SHADOW_INSET, SHADOW_INSET);
    f = shrink(f, shadowInset);
    drawShadow(f, graphics);
    graphics.fillRoundRectangle(f, corner.width, corner.height);
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:9,代码来源:DropShadowRectangle.java

示例15: drawShadowLayer

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
private void drawShadowLayer(Rectangle rectangle, Graphics graphics, int offset, Color color) {
    // Save the state of the graphics object
    graphics.pushState();
    graphics.setLineWidth(0);
    graphics.setBackgroundColor(color);
    final Rectangle shadowLayer = new Rectangle(rectangle);
    shadowLayer.x += offset;
    shadowLayer.y += offset;
    graphics.fillRoundRectangle(shadowLayer, corner.width, corner.height);
    // Restore the start of the graphics object
    graphics.popState();
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:13,代码来源:DropShadowRectangle.java


注:本文中的org.eclipse.draw2d.Graphics.fillRoundRectangle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。