Revision: 30
http://swingme.svn.sourceforge.net/swingme/?rev=30&view=rev
Author: yuranet
Date: 2008-07-11 10:40:00 -0700 (Fri, 11 Jul 2008)
Log Message:
-----------
still some off repaints
Modified Paths:
--------------
SwingME/src/net/yura/mobile/gui/DesktopPane.java
SwingME/src/net/yura/mobile/gui/components/Component.java
SwingME/src/net/yura/mobile/gui/components/Window.java
Modified: SwingME/src/net/yura/mobile/gui/DesktopPane.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/DesktopPane.java 2008-07-11 17:07:01 UTC (rev 29)
+++ SwingME/src/net/yura/mobile/gui/DesktopPane.java 2008-07-11 17:40:00 UTC (rev 30)
@@ -379,6 +379,7 @@
serviceRepaints();
}
repaint();
+
}
/**
@@ -404,6 +405,7 @@
* Repaint the softkeybar
*/
public void softkeyRepaint(boolean all) {
+
// TODO: is this correct, will ANY repaint do?
// by default calling repaint() like this will do a window repaint
if (all) {
@@ -450,9 +452,9 @@
public void setComponentCommand(int i, CommandButton softkey) {
if (componentCommands[i]!=softkey) {
- CommandButton old = componentCommands[i];
+ CommandButton old = getCurrentCommands()[i]; // get old 1
componentCommands[i] = softkey;
- if (getCurrentCommands()[i]==softkey) {
+ if (getCurrentCommands()[i]==softkey) { // check if we are the new 1
softkeyRepaint(old==null || softkey ==null);
}
}
Modified: SwingME/src/net/yura/mobile/gui/components/Component.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/Component.java 2008-07-11 17:07:01 UTC (rev 29)
+++ SwingME/src/net/yura/mobile/gui/components/Component.java 2008-07-11 17:40:00 UTC (rev 30)
@@ -107,7 +107,7 @@
// override and call super when things HAVE to be painted
public void paint(Graphics g) {
- System.out.println("paint "+this);
+ //System.out.println("paint "+this);
if (border != null) {
border.paintBorder(this, g,width,height);
@@ -188,7 +188,7 @@
}
public void repaint() {
-
+
// if we are not in a window, do nothing
if (owner==null) return;
Modified: SwingME/src/net/yura/mobile/gui/components/Window.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/Window.java 2008-07-11 17:07:01 UTC (rev 29)
+++ SwingME/src/net/yura/mobile/gui/components/Window.java 2008-07-11 17:40:00 UTC (rev 30)
@@ -274,9 +274,9 @@
public void setWindowCommand(int i, CommandButton softkey) {
if (panelCmds[i]!=softkey) {
- CommandButton oldc = panelCmds[i];
+ CommandButton oldc = DesktopPane.getDesktopPane().getCurrentCommands()[i]; // get old 1
panelCmds[i] = softkey;
- if (DesktopPane.getDesktopPane().getSelectedFrame()==this && DesktopPane.getDesktopPane().getCurrentCommands()[i]==softkey) {
+ if (DesktopPane.getDesktopPane().getCurrentCommands()[i]==softkey) { // check if we are the new 1
DesktopPane.getDesktopPane().softkeyRepaint(oldc==null || softkey == null);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|