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


Java Graphics.drawRoundRectangle方法代码示例

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


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

示例3: 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

示例4: outlineShape

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

示例5: outlineShape

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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: outlineShape

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
/**
 * @see org.eclipse.draw2d.Shape#outlineShape(org.eclipse.draw2d.Graphics)
 */
protected void outlineShape(Graphics graphics) {
    Rectangle r = getBounds().getCopy();
    r.x = r.x + lineWidth / 2;
    r.y = r.y + lineWidth / 2;
    r.width = r.width - Math.max(1, lineWidth);
    r.height = r.height - Math.max(1, lineWidth);
    graphics.drawRoundRectangle(r, 30, 30);
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:12,代码来源:OpaqueActionFigure.java

示例11: doDrawBorder

import org.eclipse.draw2d.Graphics; //导入方法依赖的package包/类
@Override
public void doDrawBorder(RectangleAttribute rectangleAttr, Graphics graphics, Rectangle bounds) throws IllegalActionException {
  int rounding = (int) ((DoubleToken) rectangleAttr.rounding.getToken()).doubleValue();
  if (rounding > 0) {
    graphics.drawRoundRectangle(bounds, rounding, rounding);
  } else {
    graphics.drawRectangle(bounds);
  }
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:10,代码来源:RectangleDrawingStrategy.java

示例12: outlineShape

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


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