From: Jonathan A. <jon...@gm...> - 2005-10-28 17:20:13
|
Note also that there is sometimes a lag of several hours between Sourceforge's developer CVS and public CVS. On 10/28/05, Ugo Taddei <ta...@la...> wrote: > Hallo Uwe, > > I beg your pardon. I checked in a change regarding the resize problem > (w.pack()) but forgot the latest changes regarding this bug. > > The curent cvs version has the fix, which I'm posting here. > > Sorry, > > Ugo > > /* > * The Unified Mapping Platform (JUMP) is an extensible, interactive GUI > * for visualizing and manipulating spatial features with geometry and > attributes. > * > * Copyright (C) 2003 Vivid Solutions > * > * This program is free software; you can redistribute it and/or > * modify it under the terms of the GNU General Public License > * as published by the Free Software Foundation; either version 2 > * 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 Public License for more details. > * > * You should have received a copy of the GNU General Public License > * along with this program; if not, write to the Free Software > * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA > 02111-1307, USA. > * > * For more information, contact: > * > * Vivid Solutions > * Suite #1A > * 2328 Government Street > * Victoria BC V8T 5G5 > * Canada > * > * (250)385-6040 > * www.vividsolutions.com > */ > > package com.vividsolutions.jump.workbench.ui.plugin.skin; > > import java.awt.Frame; > import java.awt.GridBagConstraints; > import java.awt.GridBagLayout; > import java.awt.Insets; > import java.awt.Window; > import java.awt.event.ActionEvent; > import java.awt.event.ActionListener; > import java.util.Collection; > import java.util.Iterator; > > import javax.swing.DefaultComboBoxModel; > import javax.swing.JComboBox; > import javax.swing.JLabel; > import javax.swing.JPanel; > import javax.swing.JPopupMenu; > import javax.swing.SwingUtilities; > import javax.swing.UIManager; > import javax.swing.UnsupportedLookAndFeelException; > > import com.vividsolutions.jts.util.Assert; > import com.vividsolutions.jump.util.Blackboard; > import com.vividsolutions.jump.workbench.ui.OptionsPanel; > import com.vividsolutions.jump.workbench.ui.TrackedPopupMenu; > > /** > * > * Implements an {@link OptionsPanel} to allow skin selection. > * > */ > > public class SkinOptionsPanel extends JPanel implements OptionsPanel { > private static final String CURRENT_SKIN_KEY =3D SkinOptionsPanel.cla= ss + > " - CURRENT SKIN"; > public static final String SKINS_KEY =3D SkinOptionsPanel.class + " - > SKINS"; > private GridBagLayout gridBagLayout1 =3D new GridBagLayout(); > private JComboBox comboBox =3D new JComboBox(); > private JPanel fillerPanel =3D new JPanel(); > private JLabel label =3D new JLabel(); > private Blackboard blackboard; > //[UT] is not used, commented out > // private Window window; > private boolean modified; > > public SkinOptionsPanel(Blackboard blackboard, Window window) { > // this.window =3D window; > this.blackboard =3D blackboard; > try { > comboBox.addActionListener(new ActionListener() { > public void actionPerformed(ActionEvent e) { > modified =3D true; > } > }); > jbInit(); > > } catch (Exception ex) { > ex.printStackTrace(); > } > } > > void jbInit() throws Exception { > this.setLayout(gridBagLayout1); > label.setText("Skin:"); > this.add(comboBox, > new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, > GridBagConstraints.CENTER, GridBagConstraints.NONE, > new Insets(10, 0, 10, 10), 0, 0)); > this.add(fillerPanel, > new GridBagConstraints(2, 1, 1, 1, 1.0, 1.0, > GridBagConstraints.CENTER, GridBagConstraints.BOTH, > new Insets(0, 0, 0, 0), 0, 0)); > this.add(label, > new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, > GridBagConstraints.CENTER, GridBagConstraints.NONE, > new Insets(10, 10, 10, 4), 0, 0)); > > } > > public void init() { > DefaultComboBoxModel model =3D new DefaultComboBoxModel(); > > for (Iterator i =3D ((Collection) > blackboard.get(SKINS_KEY)).iterator(); > i.hasNext();) { > LookAndFeelProxy proxy =3D (LookAndFeelProxy) i.next(); > model.addElement(proxy); > } > > comboBox.setModel(model); > comboBox.setSelectedItem(blackboard.get(CURRENT_SKIN_KEY, > comboBox.getModel().getElementAt(0))); > modified =3D false; > } > > public void okPressed() { > if (!modified) { > return; > } > > blackboard.put(CURRENT_SKIN_KEY, comboBox.getSelectedItem()); > > try { > UIManager.setLookAndFeel(((LookAndFeelProxy) > comboBox.getSelectedItem()).getLookAndFeel()); > } catch (UnsupportedLookAndFeelException e) { > Assert.shouldNeverReachHere(e.toString()); > } > > updateFrames(); > updatePopupMenus(); > } > > private void updatePopupMenus() { > for (Iterator i =3D TrackedPopupMenu.trackedPopupMenus().iterator= (); > i.hasNext();) { > JPopupMenu menu =3D (JPopupMenu) i.next(); > SwingUtilities.updateComponentTreeUI(menu); > } > } > > private void updateFrames() { > Frame[] frames =3D Frame.getFrames(); > > for (int i =3D 0; i < frames.length; i++) { > SwingUtilities.updateComponentTreeUI(frames[i]); > > Window[] windows =3D frames[i].getOwnedWindows(); > > for (int j =3D 0; j < windows.length; j++) > updateWindow(windows[j]); > } > } > > private void updateWindow(Window w) { > SwingUtilities.updateComponentTreeUI(w); > > // [UT] 2005-10-26 bug fix for editing toolbox resize problem found > by uwe dalluege > w.pack ( ); > > Window[] children =3D w.getOwnedWindows(); > > for (int i =3D 0; i < children.length; i++) > updateWindow(children[i]); > } > > public String validateInput() { > return null; > } > } > > > Uwe Dalluege wrote: > > >Hi Ugo, > > > >I have downloaded the latest cvs-version ( at 1:15 pm in Germany) > >and the bug was not fixed in my eclipse-enviroment. > >I started eclipse with the > >-Dswing.defaultlaf=3Djavax.swing.plaf.metal.MetalLookAndFeel > > > >under VM arguments and I have the metal LookAndFeel. > >But the bug is still there :-( > >Is there a different between eclipse and "normal" > >startup from OpenJUMP? > > > >Uwe > > > >Ugo wrote: > > > > > >>Hi, > >> > >>Uwe Dalluege wrote: > >> > >> > >> > >>>Hi Ugo, > >>> > >>>I use your very good option > >>>-Dswing.defaultlaf=3Djavax.swing.plaf.metal.MetalLookAndFeel > >>> > >>>If you have time please have a look at bug# 1333804 > >>> > >>>Maybe you have an idea to fix it. > >>> > >>> > >>> > >>> > >>I have fixed it: > >> > >>Comment By: Ugo Taddei (taddei) > >> > >>Date: 2005-10-27 09:53 > >> > >>Message: > >>Logged In: YES > >>user_id=3D1034970 > >> > >>Fixed (hopefuly ;-) > >> > >>In init() modified =3D false; was the first statement. The > >>combo model was recreated, action performed was fired and > >>modified was set to true, though it really wasn't. Fix was > >>to make modified =3D false; the last statement in the function. > >> > >>Note that init is being called every time the user wants > >>this panel. I don't think the combo model need to be > >>recreated. (Unless, of course, someone changed the list in > >>blackboard.get(SKINS_KEY). Very unlikely to happen. > >> > >>Ugo > >> > >> > >> > >> > >>>Thank you for your help :-) > >>> > >>>Uwe > >>> > >>> > >>>Ugo Taddei wrote at 2005-08-15 > >>> > >>> > >>> > >>> > >>>>Hello everyone, > >>>> > >>>> > >>>> > >>>> > >>> > >>> > >>> > >>>>I"ve just commited two changes regarding L&F. > >>>> > >>>> > >>>> > >>>> > >>> > >>> > >>> > >>>>First: you can now start OpenJUMP with your favourite L&F. Please use > >>>>the -D parameter as follows > >>>>For the Java Swing native Metal L&F > >>>>-Dswing.defaultlaf=3Djavax.swing.plaf.metal.MetalLookAndFeel > >>>>or > >>>>-Dswing.defaultlaf=3Dcom.sun.java.swing.plaf.windows.WindowsLookAndFe= el > >>>>for the windows L&F > >>>> > >>>> > >>>> > >>>> > >>> > >>> > >>> > >>> > >>>>Second: private InstallSkinsPlugIn installSkinsPlugIn =3D new > >>>>InstallSkinsPlugIn(); has been added. You can know change the L&F > >>>>on-the-fly. For that use the Menu > >>>>Edit -> Options, "Skins" tab. > >>>> > >>>> > >>>> > >>>> > >>> > >>> > >>> > >>>>Chers, > >>>> > >>>> > >>>> > >>>> > >>> > >>> > >>> > >>>>Ugo > >>>>PS: The skins plug-in belongs to the standard JUMP, but was not > >>>> > >>>> > >installed. > > > > > > > > > > > >------------------------------------------------------- > >This SF.Net email is sponsored by the JBoss Inc. > >Get Certified Today * Register for a JBoss Training Course > >Free Certification Exam for All Training Attendees Through End of 2005 > >Visit http://www.jboss.com/services/certification for more information > >_______________________________________________ > >Jump-pilot-devel mailing list > >Jum...@li... > >https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > > > > > > > > > -- > l a t / l o n GmbH > Aennchenstrasse 19 53177 Bonn, Germany > phone ++49 +228 184960 fax ++49 +228 1849629 > http://www.lat-lon.de http://www.deegree.org > > > > ------------------------------------------------------- > This SF.Net email is sponsored by the JBoss Inc. > Get Certified Today * Register for a JBoss Training Course > Free Certification Exam for All Training Attendees Through End of 2005 > Visit http://www.jboss.com/services/certification for more information > _______________________________________________ > Jump-pilot-devel mailing list > Jum...@li... > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > -- Jon Aquino (Victoria BC Canada) http://jonathanaquino.com |