Changeset 9878


Ignore:
Timestamp:
03/26/11 17:47:02 (9 years ago)
Author:
mlg
Message:

Fixes one major display bug
There were displays bugs with the horizontal splitpane where trying to resize it.
I have fixed by changing the original scale (1.0 to 0.99). Don't know why I had to do this, bug it seems to fix the bug
Fixes an other bug in the image browser : the image list was kept when browsing through the different categories.

Location:
extensions/jiwigo/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • extensions/jiwigo/trunk/.classpath

    r9393 r9878  
    2323  <classpathentry kind="var" path="M2_REPO/org/swinglabs/swing-worker/1.1/swing-worker-1.1.jar"/> 
    2424  <classpathentry kind="var" path="M2_REPO/org/swinglabs/swingx/1.6.1/swingx-1.6.1.jar"/> 
    25   <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 
     25  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/java-6-openjdk"/> 
    2626</classpath> 
  • extensions/jiwigo/trunk/pom.xml

    r9431 r9878  
    33  <groupId>Jiwigo</groupId> 
    44  <artifactId>Jiwigo</artifactId> 
    5   <version>0.13</version> 
     5  <version>0.14</version> 
    66 
    77        <repositories> 
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/ImagesManagement.java

    r9393 r9878  
    22 
    33import java.awt.image.BufferedImage; 
     4import java.io.IOException; 
    45import java.net.URL; 
    56import java.util.HashMap; 
     
    89import javax.imageio.ImageIO; 
    910 
     11import fr.mael.jiwigo.Main; 
    1012import fr.mael.jiwigo.om.Image; 
     13import fr.mael.jiwigo.service.ImageService; 
     14import fr.mael.jiwigo.transverse.exception.ProxyAuthenticationException; 
    1115import fr.mael.jiwigo.transverse.util.Tools; 
    1216 
     
    9094 
    9195    /** 
     96     * integer that contains the current category of the browser 
     97     * it allows to empty the list of images if the category changes 
     98     */ 
     99    private Integer currentCategory = -1; 
     100 
     101    /** 
    92102     * singleton 
    93103     */ 
     
    142152     */ 
    143153    public void setCurrentImage(Image image) { 
     154        if (!image.getIdCategory().equals(currentCategory)) { 
     155            try { 
     156                listImage = ImageService.getInstance(Main.sessionManager).listByCategory(image.getIdCategory(), true); 
     157                currentCategory = image.getIdCategory(); 
     158            } catch (IOException e) { 
     159                LOG.error(Tools.getStackTrace(e)); 
     160            } catch (ProxyAuthenticationException e) { 
     161                LOG.error(Tools.getStackTrace(e)); 
     162            } 
     163        } 
    144164        currentImage = image; 
    145165        int compteur = 0; 
    146166        for (Image im : listImage) { 
    147             if (im.equals(image)) { 
     167            if (im.getIdentifier().equals(image.getIdentifier())) { 
    148168                currentImageIndex = compteur; 
     169                return; 
    149170            } 
    150171            compteur++; 
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/MyCollapsiblePanel.java

    r8830 r9878  
    11package fr.mael.jiwigo.ui; 
    22 
    3 /*  
    4   * $Id: CollapsiblePaneDemo.java 1164 2009-11-03 04:22:00Z kschaefe $  
    5   *  
    6   * Copyright 2009 Sun Microsystems, Inc., 4150 Network Circle,  
    7   * Santa Clara, California 95054, U.S.A. All rights reserved.  
    8   *  
    9   * This library is free software; you can redistribute it and/or  
    10   * modify it under the terms of the GNU Lesser General Public  
    11   * License as published by the Free Software Foundation; either  
    12   * version 2.1 of the License, or (at your option) any later version.  
    13   *   
    14   * This library is distributed in the hope that it will be useful,  
    15   * but WITHOUT ANY WARRANTY; without even the implied warranty of  
    16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  
    17   * Lesser General Public License for more details.  
    18   *   
    19   * You should have received a copy of the GNU Lesser General Public  
    20   * License along with this library; if not, write to the Free Software  
    21   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA  
     3/* 
     4  * $Id: CollapsiblePaneDemo.java 1164 2009-11-03 04:22:00Z kschaefe $ 
     5  * 
     6  * Copyright 2009 Sun Microsystems, Inc., 4150 Network Circle, 
     7  * Santa Clara, California 95054, U.S.A. All rights reserved. 
     8  * 
     9  * This library is free software; you can redistribute it and/or 
     10  * modify it under the terms of the GNU Lesser General Public 
     11  * License as published by the Free Software Foundation; either 
     12  * version 2.1 of the License, or (at your option) any later version. 
     13  * 
     14  * This library is distributed in the hope that it will be useful, 
     15  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
     16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
     17  * Lesser General Public License for more details. 
     18  * 
     19  * You should have received a copy of the GNU Lesser General Public 
     20  * License along with this library; if not, write to the Free Software 
     21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
    2222  */ 
    2323 
     
    3333import fr.mael.jiwigo.ui.browser.BrowserPanel; 
    3434 
    35 /**  
     35/** 
    3636   Copyright (c) 2010, Mael 
    3737   All rights reserved. 
     
    5858   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
    5959   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    60  *  
    61  * @author Karl George Schaefer  
     60 * 
     61 * @author Karl George Schaefer 
    6262 */ 
    6363@SuppressWarnings("serial") 
     
    6868    private JSplitPane splitPane; 
    6969 
    70     //    /**  
    71     //     * main method allows us to run as a standalone demo.  
     70    //    /** 
     71    //     * main method allows us to run as a standalone demo. 
    7272    //     */ 
    7373    //    public static void main(String[] args) { 
     
    9191        splitPane.setTopComponent(browserFrame); 
    9292        splitPane.setBottomComponent(tabbedPane); 
     93        //      splitPane.addPropertyChangeListener(new PropertyChangeListener() { 
     94        // 
     95        //          @Override 
     96        //          public void propertyChange(PropertyChangeEvent evt) { 
     97        //              if (evt.getPropertyName().equals("dividerLocation")) { 
     98        //                  browserFrame.callRepaint(); 
     99        //              } 
     100        //          } 
     101        //      }); 
    93102        splitPane.setResizeWeight(0.5); 
    94103        add(splitPane, BorderLayout.CENTER); 
     
    105114    //    public void changeSize(Dimension dimension) { 
    106115    //  Dimension dim = new Dimension(dimension.width, dimension.height - 400); 
    107     //   
     116    // 
    108117    //    } 
    109118 
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/browser/BrowserImagePanel.java

    r8831 r9878  
    5353   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
    5454   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    55     
     55 
    5656 * Panel qui affiche une image 
    5757 * @author mael 
     
    6161        MouseListener { 
    6262    private BufferedImage image; 
    63     private double scale = 1.0; 
     63    //FIXME where I put scale = 1.0, there are display bugs (easy to reproduce : just have to move the horizontal 
     64    //splitpane where an image is loaded. 
     65    private double scale = 0.99; 
    6466    boolean flipH = false; 
    6567    boolean flipV = false; 
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/browser/BrowserPanel.java

    r9393 r9878  
    3232import fr.mael.jiwigo.transverse.util.Tools; 
    3333import fr.mael.jiwigo.ui.comments.CommentsDialog; 
    34 import fr.mael.jiwigo.ui.mainframe.MainFrame; 
    3534 
    3635/** 
     
    253252    public void changeImage() { 
    254253        imagePanel.changeImage(); 
    255         MainFrame.getInstance().getCollapsiblePanel().revalidate(); 
    256         MainFrame.getInstance().getCollapsiblePanel().repaint(); 
     254        //      MainFrame.getInstance().getCollapsiblePanel().revalidate(); 
     255        //      MainFrame.getInstance().getCollapsiblePanel().repaint(); 
    257256    } 
    258257 
     
    316315    } 
    317316 
     317    public void callRepaint() { 
     318        if (menuBar != null) { 
     319            menuBar.repaint(); 
     320            menuBar.revalidate(); 
     321        } 
     322        if (panelBoutons != null) { 
     323            panelBoutons.repaint(); 
     324            panelBoutons.revalidate(); 
     325        } 
     326        if (imagePanel != null) { 
     327            imagePanel.repaint(); 
     328            imagePanel.revalidate(); 
     329        } 
     330 
     331        repaint(); 
     332        revalidate(); 
     333    } 
     334 
    318335    //    @Override 
    319336    //    public void dispose() { 
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/MainFrame.java

    r9393 r9878  
    163163        tabbedPane = new JTabbedPaneWithCloseIcons(); 
    164164        collapsiblePanel = new MyCollapsiblePanel(tabbedPane); 
     165        //      splitPane.setTopComponent(browserFrame); 
     166        //      splitPane.setBottomComponent(tabbedPane); 
    165167        splitPane.setRightComponent(collapsiblePanel); 
    166168 
     
    197199 
    198200    public void setBrowserVisible() { 
     201        splitPane.remove(imageSearchPanel); 
     202        splitPane.remove(collapsiblePanel); 
    199203        splitPane.setRightComponent(collapsiblePanel); 
    200204        splitPane.revalidate(); 
     
    205209 
    206210    public void setImageSearchPanelVisible() { 
     211        splitPane.remove(imageSearchPanel); 
     212        splitPane.remove(collapsiblePanel); 
     213        splitPane.setLeftComponent(categoriesTree); 
    207214        splitPane.setRightComponent(imageSearchPanel); 
    208215        splitPane.revalidate(); 
     
    317324    } 
    318325 
    319     /** 
    320     * @return the collapsiblePanel 
    321     */ 
    322     public MyCollapsiblePanel getCollapsiblePanel() { 
    323         return collapsiblePanel; 
    324     } 
     326    //    /** 
     327    //    * @return the collapsiblePanel 
     328    //    */ 
     329    //    public MyCollapsiblePanel getCollapsiblePanel() { 
     330    //  return collapsiblePanel; 
     331    //    } 
    325332 
    326333    /** 
  • extensions/jiwigo/trunk/src/main/resources/log4j.xml

    r8832 r9878  
    1010                </layout> 
    1111        </appender> 
    12          
     12 
    1313        <appender name="fichier" class="org.apache.log4j.DailyRollingFileAppender"> 
    1414                <param name="File" value="logs/jiwigo.log" /> 
     
    1818                        <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c] %m%n" /> 
    1919                </layout> 
    20         </appender>      
     20        </appender> 
    2121 
    2222 
    2323        <!-- Déclaration loggers --> 
    2424        <logger name="fr.mael.jiwigo" additivity="false"> 
    25                 <level value="DEBUG" /> 
     25                <level value="INFO" /> 
    2626                <appender-ref ref="console" /> 
    2727                <appender-ref ref="fichier" /> 
    2828        </logger> 
    29          
     29 
    3030 
    3131 
  • extensions/jiwigo/trunk/src/test/java/fr/mael/jiwigo/service/ServicesTest.java

    r9431 r9878  
    11package fr.mael.jiwigo.service; 
     2 
     3import java.util.List; 
    24 
    35import org.junit.Test; 
     
    68import fr.mael.jiwigo.TestBase; 
    79import fr.mael.jiwigo.om.Category; 
     10import fr.mael.jiwigo.om.Comment; 
    811import fr.mael.jiwigo.om.Image; 
    912 
     
    2528 
    2629        Image image = ImageService.getInstance(Main.sessionManager).listByCategory(cat.getIdentifier(), true).get(0); 
    27         int firstCount = CommentService.getInstance(Main.sessionManager).list(image.getIdentifier()).size(); 
     30        List<Comment> comments = CommentService.getInstance(Main.sessionManager).list(image.getIdentifier()); 
     31        //      int firstCount = comments.size(); 
    2832        CommentService.getInstance(Main.sessionManager).create("comment test", image.getIdentifier(), "none"); 
    29         int secondCount = CommentService.getInstance(Main.sessionManager).list(image.getIdentifier()).size(); 
     33        //      int secondCount = CommentService.getInstance(Main.sessionManager).list(image.getIdentifier()).size(); 
    3034        //      Assert.assertSame(firstCount + 1, secondCount); 
    3135    } 
Note: See TracChangeset for help on using the changeset viewer.