minor fix: save iconified plugins

This commit is contained in:
fros4943 2010-04-26 08:19:32 +00:00
parent a430573688
commit c2876b2d25

View file

@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* $Id: GUI.java,v 1.167 2010/03/19 15:04:51 fros4943 Exp $ * $Id: GUI.java,v 1.168 2010/04/26 08:19:32 fros4943 Exp $
*/ */
package se.sics.cooja; package se.sics.cooja;
@ -3481,10 +3481,12 @@ public class GUI extends Observable {
pluginSubElement.setText("" + pluginFrame.getLocation().y); pluginSubElement.setText("" + pluginFrame.getLocation().y);
pluginElement.addContent(pluginSubElement); pluginElement.addContent(pluginSubElement);
if (pluginFrame.isIcon()) {
pluginSubElement = new Element("minimized"); pluginSubElement = new Element("minimized");
pluginSubElement.setText(new Boolean(pluginFrame.isIcon()).toString()); pluginSubElement.setText("" + true);
pluginElement.addContent(pluginSubElement); pluginElement.addContent(pluginSubElement);
} }
}
config.add(pluginElement); config.add(pluginElement);
} }
@ -3615,9 +3617,18 @@ public class GUI extends Observable {
location.y = Integer.parseInt(pluginSubElement.getText()); location.y = Integer.parseInt(pluginSubElement.getText());
startedPlugin.getGUI().setLocation(location); startedPlugin.getGUI().setLocation(location);
} else if (pluginSubElement.getName().equals("minimized")) { } else if (pluginSubElement.getName().equals("minimized")) {
boolean minimized = Boolean.parseBoolean(pluginSubElement.getText());
final JInternalFrame pluginGUI = startedPlugin.getGUI();
if (minimized && pluginGUI != null) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
try { try {
startedPlugin.getGUI().setIcon(Boolean.parseBoolean(pluginSubElement.getText())); pluginGUI.setIcon(true);
} catch (PropertyVetoException e) { } } catch (PropertyVetoException e) {
}
};
});
}
} }
} }