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


Java GC.fillRoundRectangle方法代码示例

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


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

示例1: paint

import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
/**
 * Paints the Node
 */
public void paint(GC gc) {
	gc.setBackground(getBackgroundColor());
	gc.setForeground(gc.getDevice().getSystemColor(SWT.COLOR_BLACK));

	gc.fillRoundRectangle(Math.round(x), Math.round(y), Math.round(width), Math.round(height), 5, 5);
	GraphUtils.drawString(gc, title, x, y, width, height, 0);

	if (hasOutgoingCrossLinksInternal || hasOutgoingCrossLinksExternal) {
		Color colorRed = gc.getDevice().getSystemColor(SWT.COLOR_RED);
		gc.setBackground(colorRed);
		gc.setForeground(colorRed);

		int ovalX = Math.round(x + width - SIZE_CROSS_LINKS_MARKER - 2);
		int ovalY = Math.round(y + 2);
		int ovalSize = Math.round(SIZE_CROSS_LINKS_MARKER);
		if (hasOutgoingCrossLinksInternal) {
			gc.fillOval(ovalX, ovalY, ovalSize, ovalSize);
		} else {
			gc.drawOval(ovalX, ovalY, ovalSize, ovalSize);
		}
	}

	gc.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:28,代码来源:Node.java

示例2: render

import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
/**
 * 
 */
@Override
public void render(XCalendarFrame frame) {
	// Background
	final GC gc = frame.getGc();
	final XCalendarModel model = popup.getModel();
	final XCalendarTheme theme = model.getTheme();
	final boolean hovered = this.mouse.isEntered();
	int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
	gc.setBackground(theme.getBackground(true, false, false, hovered));
	gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());

	// Foreground
	String text = chevron_down;
	gc.setForeground(theme.getToolBarBackground(hovered));
	gc.setFont(Fonts.getAwesomeFont()); final Point size = extent(gc, text);
	gc.drawText(text, x + 1 + ((w - size.x) >> 1), y + 1 + ((h - size.y) >> 1));
}
 
开发者ID:nextopcn,项目名称:xcalendar,代码行数:21,代码来源:XCalendarDecrWidget.java

示例3: render

import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
/**
 * 
 */
@Override
public void render(XCalendarFrame frame) {
	// Background
	final GC gc = frame.getGc();
	final boolean hovered = mouse.isEntered();
	final XCalendarModel model = popup.getModel();
	final XCalendarTheme theme = model.getTheme();
	final XVirtualCalendar calendar = model.getCalendar();
	final int year = query(calendar, model.getZoneId(), col, row);
	this.enabled = isValidYear(year, model.getZoneId(), calendar::isValid);
	boolean same = isSameYear(year, calendar.getCalendarDateTime().getYear());
	final int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
	gc.setBackground(theme.getBackground(enabled, same, false, hovered));
	gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());
	
	// Foreground
	String text = Strings.toString(year);
	gc.setForeground(theme.getForeground(enabled, same, true));
	gc.setFont(theme.getFont()); final Point size = extent(gc, text);
	gc.drawText(text, x + 1 + ((w - size.x) >> 1), y + 1 + ((h - size.y) >> 1));
}
 
开发者ID:nextopcn,项目名称:xcalendar,代码行数:25,代码来源:XCalendarYearWidget.java

示例4: render

import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
/**
 * 
 */
@Override
public void render(XCalendarFrame frame) {
	// Background
	final GC gc = frame.getGc();
	final XCalendarModel model = popup.getModel();
	final XCalendarTheme theme = model.getTheme();
	final boolean hovered = this.mouse.isEntered();
	int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
	gc.setBackground(theme.getBackground(true, false, false, hovered));
	gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());

	// Foreground
	String text = theme.getSecondTheme()[row][col];
	gc.setForeground(theme.getForeground(true, false, true));
	gc.setFont(theme.getFont()); final Point size = extent(gc, text);
	gc.drawText(text, x + 1 + ((w - size.x) >> 1), y + 1 + ((h - size.y) >> 1));
}
 
开发者ID:nextopcn,项目名称:xcalendar,代码行数:21,代码来源:XCalendarSecondWidget.java

示例5: render

import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
/**
 * 
 */
@Override
public void render(XCalendarFrame frame) {
	// Background
	final GC gc = frame.getGc();
	final XCalendarModel model = popup.getModel();
	final XCalendarTheme theme = model.getTheme();
	final boolean hovered = this.mouse.isEntered();
	int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
	gc.setBackground(theme.getBackground(true, false, false, hovered));
	gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());

	// Foreground
	String text = theme.getMinuteTheme()[row][col];
	gc.setForeground(theme.getForeground(true, false, true));
	gc.setFont(theme.getFont()); final Point size = extent(gc, text);
	gc.drawText(text, x + 1 + ((w - size.x) >> 1), y + 1 + ((h - size.y) >> 1));
}
 
开发者ID:nextopcn,项目名称:xcalendar,代码行数:21,代码来源:XCalendarMinuteWidget.java

示例6: render

import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
/**
 * 
 */
@Override
public void render(XCalendarFrame frame) {
	// Background
	final GC gc = frame.getGc();
	final boolean hovered = mouse.isEntered();
	final XCalendarModel model = popup.getModel();
	final XCalendarTheme theme = model.getTheme();
	final XVirtualCalendar calendar = model.getCalendar();
	int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
	gc.setBackground(theme.getBackground(true, false, false, hovered));
	gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());
	
	// Foreground
	String text = model.getState().text(theme, calendar);
	gc.setForeground(theme.getForeground(true, false, true));
	gc.setFont(theme.getBold()); final Point size = extent(gc, text);
	gc.drawText(text, x + 1 + ((w - size.x) >> 1), y + 1 + ((h - size.y) >> 1));
}
 
开发者ID:nextopcn,项目名称:xcalendar,代码行数:22,代码来源:XCalendarSelectWidget.java

示例7: render

import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
/**
 * 
 */
@Override
public void render(XCalendarFrame frame) {
	// Background
	final GC gc = frame.getGc();
	final XCalendarModel model = popup.getModel();
	final XCalendarTheme theme = model.getTheme();
	final boolean hovered = this.mouse.isEntered();
	int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
	gc.setBackground(theme.getBackground(true, false, false, hovered));
	gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());

	// Foreground
	String text = chevron_up;
	gc.setForeground(theme.getToolBarBackground(hovered));
	gc.setFont(Fonts.getAwesomeFont()); final Point size = extent(gc, text);
	gc.drawText(text, x + 1 + ((w - size.x) >> 1), y + 1 + ((h - size.y) >> 1));
}
 
开发者ID:nextopcn,项目名称:xcalendar,代码行数:21,代码来源:XCalendarIncrWidget.java

示例8: render

import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
/**
 * 
 */
@Override
public void render(XCalendarFrame frame) {
	// Background
	final GC gc = frame.getGc();
	final boolean hovered = mouse.isEntered();
	final XCalendarModel model = popup.getModel();
	final XCalendarTheme theme = model.getTheme();
	final XVirtualCalendar calendar = model.getCalendar();
	int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
	gc.setBackground(theme.getBackground(true, false, false, hovered));
	gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());

	// Foreground
	String t1 = this.type.text(theme, calendar);
	gc.setForeground(theme.getForeground(true, false, true));
	gc.setFont(theme.getBold()); final Point s1 = extent(gc, t1);
	gc.drawText(t1, x + 1 + ((w - s1.x) >> 1), y + 1 + ((h - s1.y) >> 1));
	
	if(this.type == XCalendarTime.HOUR || this.type == XCalendarTime.MINUTE) {
		String t2 = ":"; Point s2 = extent(gc, t2);
		gc.setBackground(theme.getBackground(true, false, false, false));
		gc.drawText(t2, x + 1 + w + (getMargin().x >> 2), y + 1 + ((h - s2.y) >> 1));
	}
}
 
开发者ID:nextopcn,项目名称:xcalendar,代码行数:28,代码来源:XCalendarTimeWidget.java

示例9: render

import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
/**
 * 
 */
@Override
public void render(XCalendarFrame frame) {
	// Background
	final GC gc = frame.getGc();
	final XCalendarModel model = popup.getModel();
	final XCalendarTheme theme = model.getTheme();
	final boolean hovered = this.mouse.isEntered();
	int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
	gc.setBackground(theme.getBackground(true, false, false, hovered));
	gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());

	// Foreground
	String text = crosshairs;
	gc.setForeground(theme.getToolBarBackground(false));
	gc.setFont(Fonts.getAwesomeFont()); final Point size = extent(gc, text);
	gc.drawText(text, x + 1 + ((w - size.x) >> 1), y + 1 + ((h - size.y) >> 1));
}
 
开发者ID:nextopcn,项目名称:xcalendar,代码行数:21,代码来源:XCalendarSelectTodayWidget.java

示例10: render

import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
/**
 * 
 */
@Override
public void render(XCalendarFrame frame) {
	// Background
	final GC gc = frame.getGc();
	final XCalendarModel model = popup.getModel();
	final XCalendarTheme theme = model.getTheme();
	final boolean hovered = this.mouse.isEntered();
	int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
	gc.setBackground(theme.getBackground(true, false, false, hovered));
	gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());

	// Foreground
	String text = chevron_left;
	gc.setForeground(theme.getForeground(true, false, true));
	gc.setFont(Fonts.getAwesomeFont()); final Point size = extent(gc, text);
	gc.drawText(text, x + 1 + ((w - size.x) >> 1), y + 1 + ((h - size.y) >> 1));
}
 
开发者ID:nextopcn,项目名称:xcalendar,代码行数:21,代码来源:XCalendarPrevWidget.java

示例11: render

import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
/**
 * 
 */
@Override
public void render(XCalendarFrame frame) {
	// Background
	final GC gc = frame.getGc();
	final XCalendarModel model = popup.getModel();
	final XCalendarTheme theme = model.getTheme();
	final boolean hovered = this.mouse.isEntered();
	int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
	gc.setBackground(theme.getBackground(true, false, false, hovered));
	gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());

	// Foreground
	String text = chevron_right;
	gc.setForeground(theme.getForeground(true, false, true));
	gc.setFont(Fonts.getAwesomeFont()); final Point size = extent(gc, text);
	gc.drawText(text, x + 1 + ((w - size.x) >> 1), y + 1 + ((h - size.y) >> 1));
}
 
开发者ID:nextopcn,项目名称:xcalendar,代码行数:21,代码来源:XCalendarNextWidget.java

示例12: render

import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
/**
 * 
 */
@Override
public void render(XCalendarFrame frame) {
	// Background
	final GC gc = frame.getGc();
	final XCalendarModel model = popup.getModel();
	final XCalendarTheme theme = model.getTheme();
	int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
	gc.setBackground(theme.getBackground(true, false, false, false));
	gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());

	// Foreground
	String text = theme.getDayOfWeekTheme()[col];
	gc.setForeground(theme.getForeground(true, false, true));
	gc.setFont(theme.getBold()); final Point size = extent(gc, text);
	gc.drawText(text, x + 1 + ((w - size.x) >> 1), y + 1 + ((h - size.y) >> 1));
}
 
开发者ID:nextopcn,项目名称:xcalendar,代码行数:20,代码来源:XCalendarTextWidget.java

示例13: render

import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
/**
 * 
 */
@Override
public void render(XCalendarFrame frame) {
	// Background
	final GC gc = frame.getGc();
	final XCalendarModel model = popup.getModel();
	final XCalendarTheme theme = model.getTheme();
	final boolean hovered = this.mouse.isEntered();
	int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
	gc.setBackground(theme.getBackground(true, false, false, hovered));
	gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());

	// Foreground
	String text = theme.getHourTheme()[row][col];
	gc.setForeground(theme.getForeground(true, false, true));
	gc.setFont(theme.getFont()); final Point size = extent(gc, text);
	gc.drawText(text, x + 1 + ((w - size.x) >> 1), y + 1 + ((h - size.y) >> 1));
}
 
开发者ID:nextopcn,项目名称:xcalendar,代码行数:21,代码来源:XCalendarHourWidget.java

示例14: render

import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
/**
 * 
 */
@Override
public void render(XCalendarFrame frame) {
	// Background
	final GC gc = frame.getGc();
	final XCalendarModel model = popup.getModel();
	final XCalendarTheme theme = model.getTheme();
	final boolean hovered = this.mouse.isEntered();
	final boolean time = model.getStateMachine().isTime();
	int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
	gc.setBackground(theme.getBackground(true, false, false, hovered));
	gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());

	// Foreground
	String text = time ? calendar : clock_o;
	gc.setForeground(theme.getToolBarBackground(false));
	gc.setFont(Fonts.getAwesomeFont()); final Point size = extent(gc, text);
	gc.drawText(text, x + 1 + ((w - size.x) >> 1), y + 1 + ((h - size.y) >> 1));
}
 
开发者ID:nextopcn,项目名称:xcalendar,代码行数:22,代码来源:XCalendarSelectTimeWidget.java

示例15: render

import org.eclipse.swt.graphics.GC; //导入方法依赖的package包/类
/**
 * Render
 */
@Override
public void render(XCalendarFrame frame) {
	// Background
	final GC gc = frame.getGc();
	final XCalendarModel model = popup.getModel();
	final XCalendarTheme theme = model.getTheme();
	final boolean hovered = this.mouse.isEntered();
	int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
	gc.setBackground(theme.getBackground(true, false, false, hovered));
	gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());

	// Foreground
	String text = trash_o;
	gc.setForeground(theme.getToolBarBackground(false));
	gc.setFont(Fonts.getAwesomeFont()); final Point size = extent(gc, text);
	gc.drawText(text, x + 1 + ((w - size.x) >> 1), y + 1 + ((h - size.y) >> 1));
}
 
开发者ID:nextopcn,项目名称:xcalendar,代码行数:21,代码来源:XCalendarClearWidget.java


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