r2824 - trunk/src/main/java/org/chorem/jtimer/ui/widget
Author: echatellier Date: 2012-03-15 10:56:38 +0100 (Thu, 15 Mar 2012) New Revision: 2824 Url: http://chorem.org/repositories/revision/jtimer/2824 Log: #487 : Force jtimer to start in non iconified frame mode Added: trunk/src/main/java/org/chorem/jtimer/ui/widget/WindowProperty2.java Added: trunk/src/main/java/org/chorem/jtimer/ui/widget/WindowProperty2.java =================================================================== --- trunk/src/main/java/org/chorem/jtimer/ui/widget/WindowProperty2.java (rev 0) +++ trunk/src/main/java/org/chorem/jtimer/ui/widget/WindowProperty2.java 2012-03-15 09:56:38 UTC (rev 2824) @@ -0,0 +1,53 @@ +/* + * #%L + * + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2012 Codelutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + +package org.chorem.jtimer.ui.widget; + +import java.awt.Component; +import java.awt.Frame; + +import org.jdesktop.application.session.WindowProperty; + +/** + * Code from http://kenai.com/jira/browse/BSAF-74. + * + * Force jtimer to always start in not iconified mode. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public class WindowProperty2 extends WindowProperty { + + @Override + public void setSessionState(final Component comp, final Object state) { + super.setSessionState(comp, state); + if (comp instanceof Frame && !((Frame) comp).isLocationByPlatform()) { + ((Frame) comp).setExtendedState(((Frame) comp).getExtendedState() & ~Frame.ICONIFIED); + } + } +} Property changes on: trunk/src/main/java/org/chorem/jtimer/ui/widget/WindowProperty2.java ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision HeadURL
participants (1)
-
echatellier@users.chorem.org