本文整理汇总了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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}