private String text;
+ private Color backgroundColor = null;
+ private Color foregroundColor = null;
+
private int align = SWT.CENTER;
private Image iconImage = null;
return this.outlineInColors.get(state);
}
+ public Color getBackground() {
+ return backgroundColor;
+ }
+
+ public void setBackground(Color color) {
+ backgroundColor = color;
+ }
+
+ public Color getForeground() {
+ return foregroundColor;
+ }
+
+ public void setForeground(Color color) {
+ foregroundColor = color;
+ }
+
}
@Override
protected void setBackground(Color color) {
- parent.getAttribute().setBackGroundColor(ENABLE, color);
+ parent.getAttribute().setBackground(color);
}
@Override
protected void setForeground(Color color) {
- parent.getAttribute().setForeGroundColor(ENABLE, color);
+ parent.getAttribute().setForeground(color);
}
private void drawMouseHover() {
@Override
protected boolean getSelection() {
- return((state & SELECT) == SELECT);
+ return ((state & SELECT) == SELECT);
}
@Override
}
}
+ private void drawBackground(Rectangle rect, GC gc) {
+ Color color = parent.getAttribute().getBackground();
+ if (null == color) {
+ return;
+ }
+ gc.setBackground(color);
+ gc.fillRectangle(rect);
+ }
+
+ private void drawForeground(GC gc) {
+ Color color = parent.getAttribute().getForeground();
+ if (null != color) {
+ gc.setForeground(color);
+ return;
+ }
+
+ if (isState(state, ENABLE)) {
+ gc.setForeground(TizenResourceManager.RADIO_BUTTON_NORMAL_FONT_COLOR);
+ } else {
+ gc.setForeground(TizenResourceManager.RADIO_BUTTON_DISABLE_FONT_COLOR);
+ }
+ }
+
@Override
protected void drawButton(final Event e) {
TizenButton me = (TizenButton) e.widget;
Rectangle rect = me.getClientArea();
+ drawBackground(rect, e.gc);
int x = 0;
int y = 0;
Image img = getImage();
y = (rect.height - fontHeight) / 2;
}
- if (null != parent.getAttribute().getForeGroundcolor(ENABLE)) {
- e.gc.setForeground(parent.getAttribute().getForeGroundcolor(ENABLE));
- } else if (null != parent.getForeground()) {
- e.gc.setForeground(parent.getForeground());
- } else {
- e.gc.setForeground(TizenResourceManager.BLACK_COLOR);
- }
+ drawForeground(e.gc);
if (null != parent.getAttribute().getFont()) {
e.gc.setFont(parent.getAttribute().getFont());