Changeset 6832


Ignore:
Timestamp:
Sep 1, 2010, 8:49:20 PM (14 years ago)
Author:
mlg
Message:

Bug correction :
The scrollpane on the thumbnails viewer did not work. Now it works and each row of the viewer contains 6 thumbnails.
The scrollpane is displayed "as needed".

Location:
extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java

    r6831 r6832  
    125125        try {
    126126            client.executeMethod(method);
    127             return (method.getResponseBodyAsString());
     127            String toReturn = method.getResponseBodyAsString();
     128            LOG.debug(toReturn);
     129            return toReturn;
    128130        } catch (HttpException e) {
    129131            // TODO Auto-generated catch block
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/MainFrame.java

    r6831 r6832  
    22
    33import java.awt.BorderLayout;
     4import java.awt.Dimension;
    45import java.awt.FlowLayout;
    56import java.awt.event.ActionEvent;
    67import java.awt.event.ActionListener;
    78
     9import javax.swing.JComponent;
    810import javax.swing.JFrame;
    911import javax.swing.JLabel;
     
    118120        splitPane.setLeftComponent(categoriesTree);
    119121        imagesPanel = new ThumbnailCategoryPanel(null);
     122        reduceSizeOfComponent(imagesPanel);
    120123        scrollPaneImagesPanel = new JScrollPane(imagesPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
    121                 JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
     124                JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
     125        scrollPaneImagesPanel.setPreferredSize(new Dimension(900, 700));
    122126        splitPane.setRightComponent(scrollPaneImagesPanel);
    123127
     
    171175    }
    172176
     177    public static void reduceHeightOfComponent(JComponent comp) {
     178        comp.setMaximumSize(new Dimension(comp.getMaximumSize().width, comp.getPreferredSize().height));
     179    }
     180
     181    public static void reduceWidthOfComponent(JComponent comp) {
     182        comp.setMaximumSize(new Dimension(comp.getPreferredSize().width, comp.getMaximumSize().height));
     183    }
     184
     185    public static void reduceSizeOfComponent(JComponent comp) {
     186        comp.setMaximumSize(comp.getPreferredSize());
     187    }
     188
    173189}
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/ThumbnailCategoryPanel.java

    r6831 r6832  
    11package fr.mael.jiwigo.ui.mainframe;
    22
    3 import java.awt.Dimension;
    43import java.awt.FlowLayout;
    54
     5import javax.swing.BoxLayout;
    66import javax.swing.JOptionPane;
    77import javax.swing.JPanel;
     
    6060    public ThumbnailCategoryPanel(Integer categoryId) {
    6161        this.categoryId = categoryId;
    62         this.setLayout(new FlowLayout());
    63         this.setPreferredSize(new Dimension(1000, 750));
     62        //      this.setLayout(new FlowLayout());
     63        this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
     64        //      this.setPreferredSize(new Dimension(900, 800));
    6465        if (categoryId != null) {
    6566            rafraichir(categoryId, false);
     
    9394        this.categoryId = categoryId;
    9495        this.removeAll();
     96        int nb = 1;
     97        JPanel panelh = new JPanel(new FlowLayout());
    9598        try {
    9699            ImagesManagement.LIST_IMAGE = ImageService.getInstance().listerParCategory(categoryId, rafraichir);
    97100            for (Image image : ImagesManagement.LIST_IMAGE) {
    98101                try {
    99                     //              MiniatureLabel label = new MiniatureLabel(image, this);
    100                     ThumbnailPanel panel = new ThumbnailPanel(image);
    101                     this.add(panel);
     102
     103                    if (nb == 7) {
     104                        this.add(panelh);
     105                        panelh = new JPanel(new FlowLayout());
     106                        nb = 0;
     107                    } else {
     108                        ThumbnailPanel panel = new ThumbnailPanel(image);
     109                        panelh.add(panel);
     110                    }
     111                    nb++;
     112
    102113                } catch (Exception e) {
    103114
Note: See TracChangeset for help on using the changeset viewer.