Author: chatellier Date: 2010-12-02 13:08:24 +0000 (Thu, 02 Dec 2010) New Revision: 332 Log: Retypage en JFrame pour qu'elle soit visible dans la barre des t?\195?\162ches windows Added: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphFrame.jaxx Removed: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphDialog.jaxx Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlHandler.java Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java =================================================================== --- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java 2010-12-02 10:52:31 UTC (rev 331) +++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/CoserFrameHandler.java 2010-12-02 13:08:24 UTC (rev 332) @@ -92,14 +92,14 @@ /** * Install le curseur sablier. */ - protected void setWaitCursor() { + public void setWaitCursor() { view.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); } /** * Repositionne le curseur a sa valeur par defaut. */ - protected void setDefaultCursor() { + public void setDefaultCursor() { view.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } @@ -191,7 +191,7 @@ modelBuilder.addOption(CoserBusinessConfig.CoserBusinessOption.CONTROL_TYPE_FISH); modelBuilder.addOption(CoserBusinessConfig.CoserBusinessOption.SELECTION_FILTER_OCCURRENCE); modelBuilder.addOption(CoserBusinessConfig.CoserBusinessOption.SELECTION_FILTER_DENSITY); - + // category misc modelBuilder.addCategory(_("coser.config.category.misc"), _("coser.config.category.misc.description")); modelBuilder.addOption(CoserConfig.CoserOption.SMTP_HOST); Deleted: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphDialog.jaxx =================================================================== --- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphDialog.jaxx 2010-12-02 10:52:31 UTC (rev 331) +++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphDialog.jaxx 2010-12-02 13:08:24 UTC (rev 332) @@ -1,45 +0,0 @@ -<!-- - #%L - Coser :: UI - - $Id$ - $HeadURL$ - %% - Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric - %% - 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 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 Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program. If not, see - <http://www.gnu.org/licenses/gpl-3.0.html>. - #L% - --> -<JDialog title="coser.ui.control.graphtitle"> - - <ControlHandler id="handler" javaBean="null" /> - - <Table> - <row> - <cell> - <JLabel text="coser.ui.control.graph.species"/> - </cell> - <cell fill="horizontal"> - <SpecyComboModel id="specyComboModel" /> - <JComboBox model="{specyComboModel}" onActionPerformed="getHandler().updateCompareNumberCatchGraph(this)" /> - </cell> - </row> - <row fill="both" weightx="1" weighty="1" columns="2"> - <cell> - <JPanel id="controlGraphPanel" layout="{new BorderLayout()}"/> - </cell> - </row> - </Table> -</JDialog> Copied: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphFrame.jaxx (from rev 291, trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphDialog.jaxx) =================================================================== --- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphFrame.jaxx (rev 0) +++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlGraphFrame.jaxx 2010-12-02 13:08:24 UTC (rev 332) @@ -0,0 +1,45 @@ +<!-- + #%L + Coser :: UI + + $Id$ + $HeadURL$ + %% + Copyright (C) 2010 Ifremer, Codelutin, Chatellier Eric + %% + 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 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 Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> +<JFrame title="coser.ui.control.graphtitle"> + + <ControlHandler id="handler" javaBean="null" /> + + <Table> + <row> + <cell> + <JLabel text="coser.ui.control.graph.species"/> + </cell> + <cell fill="horizontal"> + <SpecyComboModel id="specyComboModel" /> + <JComboBox model="{specyComboModel}" onActionPerformed="getHandler().updateCompareNumberCatchGraph(this)" /> + </cell> + </row> + <row fill="both" weightx="1" weighty="1" columns="2"> + <cell> + <JPanel id="controlGraphPanel" layout="{new BorderLayout()}"/> + </cell> + </row> + </Table> +</JFrame> Modified: trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlHandler.java =================================================================== --- trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlHandler.java 2010-12-02 10:52:31 UTC (rev 331) +++ trunk/coser-ui/src/main/java/fr/ifremer/coser/ui/control/ControlHandler.java 2010-12-02 13:08:24 UTC (rev 332) @@ -26,6 +26,8 @@ import static org.nuiton.i18n.I18n._; import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Cursor; import java.awt.Desktop; import java.awt.GridBagConstraints; import java.awt.Insets; @@ -54,11 +56,11 @@ import javax.swing.JTextField; import javax.swing.JViewport; import javax.swing.ListSelectionModel; +import javax.swing.SwingUtilities; import javax.swing.SwingWorker; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.event.TreeSelectionEvent; -import javax.swing.table.TableColumn; import javax.swing.tree.TreePath; import jaxx.runtime.JAXXUtil; @@ -103,6 +105,24 @@ private static final Log log = LogFactory.getLog(ControlHandler.class); /** + * Install le curseur sablier. + * + * @param comp component to set cursor + */ + public void setWaitCursor(Component comp) { + comp.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); + } + + /** + * Repositionne le curseur a sa valeur par defaut. + * + * @param comp component to set cursor + */ + public void setDefaultCursor(Component comp) { + comp.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + } + + /** * Return l'intance de la table qui est selectionnée. * * Les 4 table sont dupliquées juste pour concerver l'etat des colonnes. @@ -819,20 +839,31 @@ * * @param view view */ - public void displayCompareNumberCatchGraph(ControlView view) { - Project project = view.getContextValue(Project.class); - PublicationService publicationService = view.getContextValue(PublicationService.class); + public void displayCompareNumberCatchGraph(final ControlView view) { - Map<String, JFreeChart> charts = publicationService.getCompareCatchLengthGraph(project, project.getControl(), null); - List<String> species = new ArrayList<String>(charts.keySet()); + final Project project = view.getContextValue(Project.class); + final PublicationService publicationService = view.getContextValue(PublicationService.class); - ControlGraphDialog dialog = new ControlGraphDialog(view); - dialog.setHandler(this); - dialog.setContextValue(charts); - dialog.getSpecyComboModel().setSpecy(species); - dialog.pack(); - dialog.setLocationRelativeTo(view); - dialog.setVisible(true); + SwingUtilities.invokeLater(new Runnable() { + public void run() { + try { + setWaitCursor(view); + Map<String, JFreeChart> charts = publicationService.getCompareCatchLengthGraph(project, project.getControl(), null); + List<String> species = new ArrayList<String>(charts.keySet()); + + ControlGraphFrame frame = new ControlGraphFrame(view); + frame.setHandler(ControlHandler.this); + frame.setContextValue(charts); + frame.getSpecyComboModel().setSpecy(species); + frame.pack(); + frame.setLocationRelativeTo(view); + frame.setVisible(true); + } + finally { + setDefaultCursor(view); + } + } + }); } /** @@ -850,7 +881,7 @@ * * @param view view */ - public void updateCompareNumberCatchGraph(ControlGraphDialog view) { + public void updateCompareNumberCatchGraph(ControlGraphFrame view) { String specyName = (String)view.getSpecyComboModel().getSelectedItem(); Map<String, JFreeChart> charts = view.getContextValue(Map.class); JFreeChart chart = charts.get(specyName);