Revision: 32
http://swingme.svn.sourceforge.net/swingme/?rev=32&view=rev
Author: yuranet
Date: 2008-07-14 07:06:29 -0700 (Mon, 14 Jul 2008)
Log Message:
-----------
got rid of old method
Modified Paths:
--------------
SwingME/src/net/yura/mobile/gui/Theme.java
SwingME/src/net/yura/mobile/gui/components/Button.java
SwingME/src/net/yura/mobile/gui/components/Label.java
Modified: SwingME/src/net/yura/mobile/gui/Theme.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/Theme.java 2008-07-14 13:23:14 UTC (rev 31)
+++ SwingME/src/net/yura/mobile/gui/Theme.java 2008-07-14 14:06:29 UTC (rev 32)
@@ -32,6 +32,8 @@
// Items info
public int background;
public int foreground;
+ public int activeForeground;
+ public int disabledForeground;
public Border normalBorder;
public Border activeBorder;
@@ -54,10 +56,12 @@
defaultWidth = a;
background = 0x00FFFFFF;
- foreground = 0;
+ foreground = 0x00000000;
+ activeForeground = 0x000000FF;
+ disabledForeground = 0x00808080;
normalBorder = new LineBorder(0x00808080);
- activeBorder = new LineBorder(0);
+ activeBorder = new LineBorder(0x00000000);
}
}
Modified: SwingME/src/net/yura/mobile/gui/components/Button.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/Button.java 2008-07-14 13:23:14 UTC (rev 31)
+++ SwingME/src/net/yura/mobile/gui/components/Button.java 2008-07-14 14:06:29 UTC (rev 32)
@@ -44,6 +44,10 @@
protected Border normalBorder;
protected Border activeBorder;
+ private int normalForeground;
+ private int activeForeground;
+ private int disabledForeground;
+
private ActionListener al;
private String actionCommand;
@@ -94,10 +98,22 @@
setActiveBorder(c);
selectable = true;
- setForegroundByFontColorIndex(0);
+ activeForeground = DesktopPane.getDefaultTheme().activeForeground;
+ disabledForeground = DesktopPane.getDefaultTheme().disabledForeground;
+ normalForeground = DesktopPane.getDefaultTheme().foreground;
}
+ public void setSelectable(boolean s) {
+ if (s) {
+ foreground = normalForeground;
+ }
+ else {
+ foreground = disabledForeground;
+ }
+ super.setSelectable(s);
+ }
+
public boolean isSelected() {
return selected;
}
@@ -178,7 +194,7 @@
public void focusLost() {
super.focusLost();
super.setBorder(normalBorder);
- setForegroundByFontColorIndex(0);
+ foreground = normalForeground;
if (useSelectButton) {
DesktopPane.getDesktopPane().setComponentCommand(0, null);
@@ -190,7 +206,7 @@
public void focusGained() {
super.focusGained();
super.setBorder(activeBorder);
- setForegroundByFontColorIndex(1);
+ foreground = activeForeground;
if (useSelectButton) {
DesktopPane.getDesktopPane().setComponentCommand(0, selectButton);
Modified: SwingME/src/net/yura/mobile/gui/components/Label.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/Label.java 2008-07-14 13:23:14 UTC (rev 31)
+++ SwingME/src/net/yura/mobile/gui/components/Label.java 2008-07-14 14:06:29 UTC (rev 32)
@@ -288,9 +288,7 @@
*/
public void setFont(Font font) {
this.font = font;
- if (font!=null) {
- setForegroundByFontColorIndex(0);
- }
+
}
/**
@@ -376,16 +374,5 @@
return DesktopPane.getDefaultTheme().defaultWidth;
}
- /**
- * @deprecated
- */
- public void setForegroundByFontColorIndex(int a) {
-
- if (a < font.getColors().length ) {
-
- foreground = font.getColors()[a];
- }
-
- }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|