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 XVirtualCalendar calendar = model.getCalendar();
final ZonedDateTime d1 = calendar.getCalendarDateTime();
final ZonedDateTime d2 = query(calendar, model.getZoneId(), col, row);
boolean hovered = this.mouse.isEntered();
boolean same1 = isSameDate(d2, now(model.getZoneId()));
this.enabled = isValidDate(toDate(d2), calendar::isValid);
boolean selected = model.getDate() != null && isSameDate(d1, d2);
int x = bounds.x, y = bounds.y, w = bounds.width, h = bounds.height;
gc.setBackground(theme.getBackground(enabled, selected, same1, hovered));
gc.fillRoundRectangle(x, y, w, h, theme.getArc(), theme.getArc());
// Foreground
String text = Strings.toString(d2.getDayOfMonth());
boolean same2 = isSameYearMonth(d2, calendar.getTravelDateTime());
gc.setForeground(theme.getForeground(this.enabled, selected, same2));
gc.setFont(model.getTheme().getFont()); final Point size = extent(gc, text);
gc.drawText(text, x + 1 + ((w - size.x) >> 1), y + 1 + ((h - size.y) >> 1));
if(!same1) return; int c = w / 7;
gc.setClipping(x + c, y + c, w - 2 * c, h - 2 * c);
gc.setBackground(theme.getForeground(true, selected, false));
gc.fillPolygon(new int[] { x + w * 3 / 5, y + h, x + w, y + h, x + w, y + h * 3 / 5 });
gc.setClipping((Rectangle) null);
}