Changeset 6980 for extensions/jiwigo


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

Translation of the comments
French -> English

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

Legend:

Unmodified
Added
Removed
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/Main.java

    r6821 r6980  
    5050    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory.getLog(Main.class);
    5151    /**
    52      * Le manager de login, qui permet de se connecter et
    53      * de lancer les requetes vers les méthodes du webservice
     52     * The login and session manager that allows to connect to
     53     * the webservice and to query it
    5454     */
    5555    public static SessionManager sessionManager;
    5656
    5757    /**
    58      *  La fenetre principale
     58     *  the main window
    5959     */
    6060    private static MainFrame mainFrame;
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/dao/CategoryDao.java

    r6962 r6980  
    1010import fr.mael.jiwigo.Main;
    1111import fr.mael.jiwigo.om.Category;
     12import fr.mael.jiwigo.transverse.enumeration.CategoryEnum;
    1213import fr.mael.jiwigo.transverse.enumeration.MethodsEnum;
    1314import fr.mael.jiwigo.transverse.util.Outil;
     
    4950    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory.getLog(Main.class);
    5051    /**
    51      * Instance, afin d'utiliser un singleton
     52     * Instance to use a singleton
    5253     */
    5354    private static CategoryDao instance;
    5455
    5556    /**
    56      * Constructeur privé, afin que seule l'instance soit accessible
     57     * Private constructor to use a singleton
    5758     */
    5859    private CategoryDao() {
     
    6162
    6263    /**
    63      * @return l'instance
     64     * @return the instance
    6465     */
    6566    public static CategoryDao getInstance() {
     
    7172
    7273    /**
    73      * Lister les catégorie
    74      * @param rafraichir permet de dire si on utilise les catégories présentes dans le cache ou pas
    75      * @param recursive listing récursif des catégories
    76      * @return la liste des catégories
     74     * Lists the categories
     75     * @param rafraichir true : uses the categories of the cache
     76     * @param recursive true : recursive listing of the categories
     77     * @return the list of categories
    7778     * @throws IOException
    7879     */
     
    8485        ArrayList<Category> categories = new ArrayList<Category>();
    8586        for (Element cat : listElement) {
    86             Category myCat = new Category(cat);
     87            Category myCat = new Category();
     88            myCat.setIdentifiant(Integer.valueOf(cat.getAttributeValue(CategoryEnum.ID.getLabel())));
     89            myCat.setUrlCategory(cat.getAttributeValue(CategoryEnum.URL.getLabel()));
     90            myCat.setNbImages(Integer.valueOf(cat.getAttributeValue(CategoryEnum.NB_IMAGES.getLabel())));
     91            myCat.setNbTotalImages(Integer.valueOf(cat.getAttributeValue(CategoryEnum.NB_TOTAL_IMAGES.getLabel())));
     92            myCat.setNom(cat.getChildText(CategoryEnum.NAME.getLabel()));
     93            String catMeres = cat.getChildText(CategoryEnum.CAT_MERES.getLabel());
     94            ArrayList<Integer> idCategoriesMeres = new ArrayList<Integer>();
     95            for (String catA : catMeres.split(",")) {
     96                if (!catA.equals("")) {
     97                    idCategoriesMeres.add(Integer.valueOf(catA));
     98                }
     99            }
     100            myCat.setIdCategoriesMeres(idCategoriesMeres);
    87101            categories.add(myCat);
    88102        }
     
    91105
    92106    /**
    93      * Création d'une catégorie
    94      * @param category la catégorie à créer
    95      * @return true si la catégorie a bien été créée
     107     * Creation of a category
     108     * @param category the category to create
     109     * @return true if the category is successfully created
    96110     */
    97111    public boolean creer(Category category) {
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/dao/CommentDao.java

    r6821 r6980  
    3939   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    4040   
    41  * Dao des commentaires
     41 * Dao for the comments
    4242 * @author mael
    4343 *
     
    5050            .getLog(CommentDao.class);
    5151    /**
    52      *  Instance qui permet d'utiliser un singleton
     52     *  Instance that allows to use a singleton
    5353     */
    5454    private static CommentDao instance;
    5555
    5656    /**
    57      * Constructeur privé, pour n'avoir accès qu'au singleton
     57     * private constructor, to use a singleton
    5858     */
    5959    private CommentDao() {
     
    6262
    6363    /**
    64      * @return le singleton
     64     * @return the singleton
    6565     */
    6666    public static CommentDao getInstance() {
     
    7272
    7373    /**
    74      * Listing des commentaires pour une image donnée
    75      * @param idImage identifiant de l'image
    76      * @return liste des commentaires
     74     * Listing of the comments for the given image
     75     * @param idImage id of the  image
     76     * @return list of comments
    7777     * @throws IOException
    7878     */
     
    9595
    9696    /**
    97      * Recupération de la clé pour l'ajout d'un com
    98      * @param idImage
    99      * @return
     97     * Gets the key essential to add a comment
     98     * @param idImage the id of the image
     99     * @return the key
    100100     * @throws IOException
    101101     */
     
    107107    }
    108108
     109    /**
     110     * Creates a comment
     111     * @param commentaire the comment to add
     112     * @return true if the comment is successfully added
     113     * @throws IOException
     114     */
    109115    public boolean creer(Comment commentaire) throws IOException {
    110116        String key = getKey(commentaire.getImageId());
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/dao/ImageDao.java

    r6972 r6980  
    6161
    6262    /**
    63      * cache
     63     * cache to avoid downloading image for each access
    6464     */
    6565    private HashMap<Integer, List<Image>> cache;
     
    7171
    7272    /**
    73      * Constructeur privé, pour n'avoir accès qu'au singleton
     73     * Private singleton, to use a singleton
    7474     */
    7575    private ImageDao() {
     
    8888
    8989    /**
    90      * Lister toutes les images
    91      * @return la liste des images
     90     * Lists all images
     91     * @return the list of images
    9292     * @throws IOException
    9393     */
     
    9797
    9898    /**
    99      * Listing des images d'une catégorie
    100      * @param categoryId l'id de la catégorie
    101      * @return la liste des images
     99     * Listing of the images for a category
     100     * @param categoryId the id of the category
     101     * @return the list of images
    102102     * @throws IOException
    103103     */
     
    125125
    126126    /**
    127      * Creation d'une image.<br/>
    128      * Dans l'ordre : <br/>
     127     * Creation of an image<br/>
     128     * Sequence : <br/>
    129129     * <li>
    130      * <ul>envoi de la miniature en base64, grace à la méthode addchunk.</ul>
    131      * <ul>envoi de l'image originale en base64, grace à la méthode addchunk</ul>
    132      * <ul>utilisation de la methode add pour ajouter l'image dans la base<ul>
     130     * <ul>sending of the thumbnail in base64, thanks to the method addchunk.</ul>
     131     * <ul>sending of the image in base64, thanks to the method addchunk</ul>
     132     * <ul>using of the add method to add the image to the database<ul>
    133133     * </li>
    134      * Pour finir, on vérifie les réponses du webservice.
     134     * Finally, the response of the webservice is checked
    135135     *
    136      * @param image l'image à créer
    137      * @return true si l'insertiopn de l'image s'est bien passée
     136     * @param the image to create
     137     * @return true if the creation of the image was the successful
    138138     * @throws Exception
    139139     */
    140140    //TODO ne pas continuer si une des réponses précédentes est négative
    141141    public boolean creer(Image image) throws Exception {
    142         //on convertit la miniature en string base64
     142        //thumbnail converted to base64
    143143        BASE64Encoder base64 = new BASE64Encoder();
    144144
    145145        String thumbnailBase64 = base64.encode(Outil.getBytesFromFile(image.getThumbnail()));
    146         //on envoie la miniature et on recupere la reponse
     146        //sends the thumbnail and gets the result
    147147        Document reponseThumb = (Main.sessionManager.executerReturnDocument("pwg.images.addChunk", "data",
    148148                thumbnailBase64, "type", "thumb", "position", "1", "original_sum", Outil.getMD5Checksum(image
     
    167167        //end
    168168
    169         //on ajoute l'image en base et on recupere la reponse
     169        //add the image in the database and get the result of the webservice
    170170        Document reponseAjout = (Main.sessionManager.executerReturnDocument("pwg.images.add", "file_sum", Outil
    171171                .getMD5Checksum(image.getOriginale().getAbsolutePath()), "thumbnail_sum", Outil.getMD5Checksum(image
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/dao/TagDao.java

    r6972 r6980  
    1212import fr.mael.jiwigo.om.Tag;
    1313import fr.mael.jiwigo.transverse.enumeration.MethodsEnum;
     14import fr.mael.jiwigo.transverse.enumeration.TagEnum;
    1415import fr.mael.jiwigo.transverse.util.Outil;
    1516
     
    5051    public static final org.apache.commons.logging.Log LOG = org.apache.commons.logging.LogFactory.getLog(Main.class);
    5152    /**
    52      * Instance, afin d'utiliser un singleton
     53     * Instance, to use a singleton
    5354     */
    5455    private static TagDao instance;
    5556
    5657    /**
    57      * Constructeur privé, afin que seule l'instance soit accessible
     58     * private constructor to use a singleton
    5859     */
    5960    private TagDao() {
     
    6263
    6364    /**
    64      * @return l'instance
     65     * @return the instance
    6566     */
    6667    public static TagDao getInstance() {
     
    7273
    7374    /**
    74      * Lister les tag
    75      * @return la liste des tags
     75     * lists the tags
     76     * @return the list of tags
    7677     * @throws IOException
    7778     */
     
    9293        List<Element> listElement = (List<Element>) element.getChildren("tag");
    9394        ArrayList<Tag> tags = new ArrayList<Tag>();
    94         for (Element t : listElement) {
    95             Tag tag = new Tag(t);
     95        for (Element tagElement : listElement) {
     96            Tag tag = new Tag();
     97            tag.setId(Integer.valueOf(tagElement.getAttributeValue(TagEnum.ID.getLabel())));
     98            tag.setNom(tagElement.getAttributeValue(TagEnum.NAME.getLabel()));
    9699            tags.add(tag);
    97100        }
     
    101104
    102105    /**
    103      * Création d'un tag
    104      * @param tag le tag à créer
    105      * @return true si le tag a bien été créé
     106     * Creation of a tag
     107     * @param tag the tag to create
     108     * @return true if the tag as been successfully created
    106109     */
    107110    public boolean creer(Tag tag) {
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/om/Category.java

    r6962 r6980  
    44
    55import org.jdom.Element;
    6 
    7 import fr.mael.jiwigo.transverse.enumeration.CategoryEnum;
    86
    97/**
     
    4947    private Integer parentDirect;
    5048
    51     /**
    52      * Constructeur. Une categorie est cree a partir de son element xml
    53      * @param element
    54      */
    55     public Category(Element element) {
    56         this.element = element;
    57         this.identifiant = Integer.valueOf(element.getAttributeValue(CategoryEnum.ID.getLabel()));
    58         this.urlCategory = element.getAttributeValue(CategoryEnum.URL.getLabel());
    59         this.nbImages = Integer.valueOf(element.getAttributeValue(CategoryEnum.NB_IMAGES.getLabel()));
    60         this.nbTotalImages = Integer.valueOf(element.getAttributeValue(CategoryEnum.NB_TOTAL_IMAGES.getLabel()));
    61         this.nom = element.getChildText(CategoryEnum.NAME.getLabel());
    62         String catMeres = element.getChildText(CategoryEnum.CAT_MERES.getLabel());
    63         idCategoriesMeres = new ArrayList<Integer>();
    64         for (String cat : catMeres.split(",")) {
    65             if (!cat.equals("")) {
    66                 idCategoriesMeres.add(Integer.valueOf(cat));
    67             }
    68         }
     49    public Category() {
    6950        categoriesFilles = new ArrayList<Category>();
    7051        categoriesMeres = new ArrayList<Category>();
    71     }
    72 
    73     public Category() {
    74         // TODO Auto-generated constructor stub
    7552    }
    7653
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/om/Comment.java

    r6821 r6980  
    11package fr.mael.jiwigo.om;
    2 
    3 import org.jdom.Element;
    42
    53/**
     
    4038    private Integer identifiant;
    4139    private String date;
    42 
    43     public Comment(Element element) {
    44         this.identifiant = Integer.valueOf(element.getAttributeValue("id"));
    45         this.date = element.getAttributeValue("date");
    46         this.author = element.getChildText("author");
    47         this.content = element.getChildText("content");
    48 
    49     }
    50 
    51     public Comment() {
    52 
    53     }
    5440
    5541    /**
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/om/Tag.java

    r6968 r6980  
    11package fr.mael.jiwigo.om;
    2 
    3 import org.jdom.Element;
    4 
    5 import fr.mael.jiwigo.transverse.enumeration.TagEnum;
    62
    73/**
     
    4642
    4743    /**
    48      * Empty constructor
    49      */
    50     public Tag() {
    51     }
    52 
    53     /**
    54      * @param element the element in the RPC response
    55      */
    56     public Tag(Element element) {
    57         this.identifiant = Integer.valueOf(element.getAttributeValue(TagEnum.ID.getLabel()));
    58         this.nom = element.getAttributeValue(TagEnum.NAME.getLabel());
    59     }
    60 
    61     /**
    62      * @param nom the name of the tag
    63      */
    64     public Tag(String nom) {
    65         this.nom = nom;
    66     }
    67 
    68     /**
    6944     * @return the nom
    7045     */
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/service/CategoryService.java

    r6962 r6980  
    5050
    5151    /**
    52      * @return le singleton
     52     * @return the singleton
    5353     */
    5454    public static CategoryService getInstance() {
     
    6060
    6161    /**
    62      * Constructeur privé, pour n'avoir accès qu'au singleton
     62     * private constructor to use a singleton
    6363     */
    6464    private CategoryService() {
     
    6767
    6868    /**
    69      * Listing des categories
    70      * @param rafraichir utilisation du cache ou non
    71      * @param recursive
    72      * @return la liste des catégories
     69     * Lists all categories
     70     * @param rafraichir true to refresh
     71     * @param recursive true : recursive listing
     72     * @return the list of categories
    7373     * @throws IOException
    7474     */
     
    7878
    7979    /**
    80      * Fonction qui permet de construire l'arbre des categorie
    81      * En association catégories mères/catégories filles
    82      * @return la liste des catégories
     80     * Allows to create the categories tree
     81     * @return list of categories
    8382     * @throws IOException
    8483     */
     
    102101
    103102    /**
    104      * Création d'une catégorie
    105      * @param nom nom de la catégorie
    106      * @param parent catégorie parent
    107      * @return true si la catégorie a bien été créée
     103     * creation of a category
     104     * @param nom name of the category
     105     * @param parent parent category
     106     * @return true if successful
    108107     */
    109108    public boolean creer(String nom, Integer parent) {
     
    115114
    116115    /**
    117      * Création d'une catégorie
    118      * @param nom nom de la catégorie
    119      * @param parent catégorie parent
    120      * @return true si la catégorie a bien été créée
     116     * creation of a category without parent
     117     * @param nom name of the category
     118     * @return true if successful
    121119     */
    122120    public boolean creer(String nom) {
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/service/CommentService.java

    r6821 r6980  
    5050
    5151    /**
    52      * @return le singleton
     52     * @return the singleton
    5353     */
    5454    public static CommentService getInstance() {
     
    6060
    6161    /**
    62      * Constructeur privé, pour n'avoir accès qu'au singleton
     62     * private constructor, to use a singleton
    6363     */
    6464    private CommentService() {
     
    6767
    6868    /**
    69      * Listing des commentaires pour une image
    70      * @param imageId id de l'image
    71      * @return la liste des commentaires
     69     * Lists all comments for an image
     70     * @param imageId the id of the image
     71     * @return the list of comments
    7272     * @throws IOException
    7373     */
     
    7676    }
    7777
     78    /**
     79     * Creates a comment for an image
     80     * @param content the comment
     81     * @param imageId the id of the image
     82     * @param auteur the author of the comment
     83     * @return true if successful
     84     * @throws IOException
     85     */
    7886    public boolean creer(String content, Integer imageId, String auteur) throws IOException {
    7987        Comment commentaire = new Comment();
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/service/ImageService.java

    r6972 r6980  
    5151            .getLog(ImageService.class);
    5252
     53    /**
     54     * Singleton
     55     */
    5356    private static ImageService instance;
    5457
     58    /**
     59     * @return the singleton
     60     */
    5561    public static ImageService getInstance() {
    5662        if (instance == null) {
     
    6066    }
    6167
     68    /**
     69     * private constructor to use a singleton
     70     */
    6271    private ImageService() {
    6372
    6473    }
    6574
     75    /**
     76     * Lists all images for a category
     77     * @param categoryId the id of the category
     78     * @param rafraichir true : refresh the list of images
     79     * @return the list of images
     80     * @throws IOException
     81     */
    6682    public List<Image> listerParCategory(Integer categoryId, boolean rafraichir) throws IOException {
    6783        return ImageDao.getInstance().listerParCategory(categoryId, rafraichir);
     
    7086    /**
    7187     * Method called to send an image to the server.
    72      
    7388     * @param filePath
    7489     * @param idCategory
     
    7792     */
    7893    public boolean creer(String filePath, Integer idCategory) throws Exception {
    79         MainFrame.getInstance().setReussiteMessage(Messages.getMessage("mainFrame_resizing") + " " + filePath);
     94        MainFrame.getInstance().setMessage(Messages.getMessage("mainFrame_resizing") + " " + filePath);
    8095        //get the byte array of the original file, to keep metadata
    8196        byte[] bytesFichierOriginal = Outil.getBytesFromFile(new File(filePath));
     
    98113            //I use here a try catch because if the original file isn't a jpeg
    99114            //the methode Outil.enrich will fail, but the procedure has to continue
    100             MainFrame.getInstance().setReussiteMessage(Messages.getMessage("mainFrame_addMetadata") + " " + filePath);
     115            MainFrame.getInstance().setMessage(Messages.getMessage("mainFrame_addMetadata") + " " + filePath);
    101116            try {
    102117                byte[] fichierEnrichi = Outil.enrich(bytesFichierOriginal, Outil.getBytesFromFile(new File(System
     
    115130        image.setOriginale(originale);
    116131        image.setIdCategory(idCategory);
    117         MainFrame.getInstance().setReussiteMessage(Messages.getMessage("mainFrame_sendingFiles") + " " + filePath);
     132        MainFrame.getInstance().setMessage(Messages.getMessage("mainFrame_sendingFiles") + " " + filePath);
    118133        //now we call the dao to send the image to the webservice
    119134        return ImageDao.getInstance().creer(image);
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/service/TagService.java

    r6968 r6980  
    4545            .getLog(TagService.class);
    4646
     47    /**
     48     * The instance, to use a singleton
     49     */
    4750    private static TagService instance;
    4851
     52    /**
     53     * @return the singleton
     54     */
    4955    public static TagService getInstance() {
    5056        if (instance == null) {
     
    7783     */
    7884    public boolean creer(String nom) throws IOException {
    79         Tag tag = new Tag(nom);
     85        Tag tag = new Tag();
     86        tag.setNom(nom);
    8087        return TagDao.getInstance().creer(tag);
    8188    }
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/enumeration/MethodsEnum.java

    r6972 r6980  
    3030   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    3131   
    32  * Listing des méthodes du webservice
     32 * Lists the methods of the webservice
    3333 * @author mael
    3434 *
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/session/SessionManager.java

    r6965 r6980  
    5252            .getLog(SessionManager.class);
    5353    /**
    54      * Le login entré
     54     * the entered login
    5555     */
    5656    private String login;
    5757    /**
    58      * Le mot de passe entré
     58     * the entered password
    5959     */
    6060    private String motDePasse;
    6161    /**
    62      * l'url du site
     62     * the url of the site
    6363     */
    6464    private String url;
    6565    /**
    66      * le client http
     66     * the http client
    6767     */
    6868    private HttpClient client;
    6969
    7070    /**
    71      * Constructeur
    72      * @param login le login
    73      * @param motDePasse le mot de passe
    74      * @param url l'url du site
     71     * Constructor
     72     * @param login the login
     73     * @param motDePasse the password
     74     * @param url the url of the site
    7575     */
    7676    public SessionManager(String login, String motDePasse, String url) {
     
    7979        this.url = url + "/ws.php";
    8080        client = new HttpClient();
    81         //utilisation d'un useragent linux, parce que c'est mieux 8)
     81        //Using of a Linux user agent. cause... it's better 8)
    8282        client.getParams().setParameter("http.useragent",
    8383                "Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1");
     
    8585
    8686    /**
    87      * Methode de connexion
    88      * @return true si la connexion s'est bien deroulee
     87     * Connection method
     88     * @return true if successful
    8989     */
    9090    public boolean processLogin() {
     
    101101
    102102    /**
    103      * Execute une methode sur le web service et retourne le resultat sous forme de string
    104      * @param methode la methode a executer
    105      * @param parametres les parametres a  ajouter a la methode. doit etre un nombre pair : la cle suivie de sa valeur
    106      * @return le resultat
     103     * Executes a method on the webservice and returns the result as a string
     104     * @param methode the method to execute
     105     * @param parametres the parameters of the method. Must be even : the name of the parameter followed by its value
     106     * @return the result
    107107     */
    108108    public String executerReturnString(String methode, String... parametres) {
     
    150150
    151151    /**
    152      * Execute une methode sur le webservice et renvoie le resultat sous form de document jdom
    153      * @param methode la methode a executer
    154      * @param parametres les parametres a  ajouter a la methode. doit etre un nombre pair : la cle suivie de sa valeur
    155      * @return le resultat
     152     * Executes a method on the webservice and returns the result as a Dom document
     153     * @param methode the method to execute
     154     * @param parametres the parameters of the method. Must be even : the name of the parameter followed by its value
     155     * @return the result
    156156     * @throws IOException
    157157     */
     
    168168
    169169    /**
    170      * Execute une methode sur le webservice et renvoie le resultat sous form de document jdom
    171      * @param methode la methode a executer
    172      * @return le resultat
     170     * Executes a method on the webservice and returns the result as a Dom document
     171     * @param methode the method to execute
     172     * @return the result
    173173     */
    174174    public Document executerReturnDocument(String methode) {
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/util/ImagesUtil.java

    r6958 r6980  
    6565
    6666    /**
    67      * Fonction de rotation d'une image
    68      * @param image l'image à tourner
    69      * @param angle l'angle de rotation
    70      * @return l'image pivotée
     67     * rotates an image
     68     * @param image the image to rotate
     69     * @param angle the angle of rotation
     70     * @return the rotated image
    7171     */
    7272    public static BufferedImage rotate(BufferedImage image, double angle) {
     
    9494
    9595    /**
    96      * Ecriture d'une image dans un fichier png
    97      * @param file le fichier
    98      * @param bufferedImage l'image
     96     * Writes an image in a file
     97     * @param file the file
     98     * @param bufferedImage the image
    9999     * @throws IOException
    100100     */
     
    104104
    105105    /**
    106      * Mise à l'échelle d'une image
    107      * @param filePath le chemin vers le fichier de l'image
    108      * @param tempName le nom du fichier résultat
    109      * @param width la largeur
    110      * @param height la hauteur
    111      * @return true si l'image a effectivement ete redimensionnee
     106     * scales an image
     107     * @param filePath the path to the file of the image
     108     * @param tempName the name of the resulting file
     109     * @param width the width
     110     * @param height the height
     111     * @return true if successful
    112112     * @throws Exception
    113113     */
     
    120120        int imageWidth = image.getWidth(null);
    121121        int imageHeight = image.getHeight(null);
    122         //on n'agrandit pas l'image
    123122        if (imageWidth < width || imageHeight < height) {
    124123            return false;
     
    141140    }
    142141
     142    /**
     143     * Save an image
     144     * @param fileName the name of the file
     145     * @param img the img
     146     * @throws FileNotFoundException
     147     * @throws IOException
     148     */
    143149    private static void saveImage(String fileName, BufferedImage img) throws FileNotFoundException, IOException {
    144150        Iterator iter = ImageIO.getImageWritersByFormatName("jpeg");
     
    205211    }
    206212
    207     // This method returns true if the specified image has transparent pixels
     213    /**
     214     *  This method returns true if the specified image has transparent pixels
     215     * @param image the image to check
     216     * @return true or false
     217     */
    208218    public static boolean hasAlpha(Image image) {
    209219        // If buffered image, the color model is readily available
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/util/Messages.java

    r6979 r6980  
    3737   
    3838 * @author mael
    39  * Gestion des messages pour les traductions
     39 * management of the messages for the translations
    4040 */
    4141public class Messages {
     
    4444
    4545    /**
    46      * Recuperation d'un message
    47      * @param key clé du message
    48      * @return le message
     46     * returns a message
     47     * @param key the key of the message
     48     * @return the message
    4949     */
    5050    public static String getMessage(String key) {
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/util/Outil.java

    r6965 r6980  
    6969
    7070    /**
    71      * Transformation d'un inputstream en string.<br/>
    72      * Util pour lire la réponse du webservice
    73      * @param input le stream
    74      * @return la string
     71     * Transformation of an inpustream into string.<br/>
     72     * useful to read the result of the webservice
     73     * @param input the stream
     74     * @return the string
    7575     * @throws IOException
    7676     */
    7777    public static String readInputStreamAsString(InputStream input) throws IOException {
    78         //      DataInputStream dis = new DataInputStream(new BufferedInputStream(input));
    79         //
    80         //      String temp;
    81         //      StringBuffer buffer = new StringBuffer();
    82         //      while ((temp = dis.readLine()) != null) {
    83         //          buffer.append(temp);
    84         //      }
    85         //      return buffer.toString();
    8678        StringWriter writer = new StringWriter();
    8779        InputStreamReader streamReader = new InputStreamReader(input);
    88         //le buffer permet le readline
    8980        BufferedReader buffer = new BufferedReader(streamReader);
    9081        String line = "";
     
    9283            writer.write(line);
    9384        }
    94         // Sortie finale dans le String
    9585        return writer.toString();
    9686    }
    9787
    9888    /**
    99      * Transformation d'une string en document
    100      * @param string la string
    101      * @return le document correspondant
     89     * String to document
     90     * @param string the string
     91     * @return the corresponding document
    10292     * @throws JDOMException
    10393     * @throws IOException
     
    10595    public static Document stringToDocument(String string) throws JDOMException, IOException {
    10696        SAXBuilder sb = new SAXBuilder();
    107         //      System.out.println(string);
    10897        Document doc = sb.build(new StringReader(string));
    10998        return doc;
     
    112101
    113102    /**
    114      * Transformation d'un inputstream en document
    115      * @param input l'inputstream
    116      * @return le document
     103     * Inputstream to document
     104     * @param input the inputStream
     105     * @return the document
    117106     * @throws JDOMException
    118107     * @throws IOException
     
    123112
    124113    /**
    125      * Transformation d'un document en string
    126      * @param doc le document à transformer
    127      * @return la string
     114     * Document to string
     115     * @param doc the document to transform
     116     * @return the string
    128117     */
    129118    public static String documentToString(Document doc) {
     
    133122
    134123    /**
    135      * Fonction qui retour l'url d'un fichier donné.
    136      * Utile pour récupérer le chemin des images à l'intérieur du jar
    137      * @param fileName le chemin du fichier
    138      * @return l'url
     124     * Function that gets the url of a file
     125     * Useful to get the images that are in the jar
     126     * @param fileName the path of the file
     127     * @return the url of the file
    139128     */
    140129    public static URL getURL(String fileName) {
     
    145134
    146135    /**
    147      * Fonction qui retourne la somme de controle MD5 d'un fichier donné
    148      * @param filename le chemin du fichier
    149      * @return la somme de controle
     136     * gets the md5 sum of a file
     137     * @param filename the path of the file
     138     * @return the checksum
    150139     * @throws Exception
    151140     */
     
    160149
    161150    /**
    162      * Creation de la somme de controle d'un fichier
    163      * @param filename le chemin du fichier
    164      * @return la somme de controle sous forme de byte[]
     151     * Creation of the checksum of a file
     152     * @param filename the path of the file
     153     * @return the checksum as array byte
    165154     * @throws Exception
    166155     */
     
    182171
    183172    /**
    184      * Fonction qui transforme un fichier en tableau de bytes
    185      * @param file le fichier
    186      * @return le tableau de bytes
     173     * File to array bytes
     174     * @param file the file
     175     * @return the array bytes
    187176     * @throws IOException
    188177     */
     
    206195
    207196    /**
    208      * Fonction qui vérifie que si la réponse du webservice est positive
    209      * @param doc le document que retourne le webservice
    210      * @return true si c'est ok
     197     * Function that checks if the webservice response is ok
     198     * @param doc the document from the webservice
     199     * @return true if ok
    211200     */
    212201    public static boolean checkOk(Document doc) {
     
    298287    }
    299288
     289    /**
     290     * Bytes to file
     291     * @param fichier the file path
     292     * @param bytes the array bytes
     293     * @throws IOException
     294     */
    300295    public static void byteToFile(String fichier, byte[] bytes) throws IOException {
    301296        FileOutputStream fos = new FileOutputStream(fichier);
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/transverse/util/preferences/PreferencesManagement.java

    r6959 r6980  
    4949
    5050    /**
    51      * fonction qui retourne le chemin du fichier de configuration
     51     * function that returns the path of the configuration file
    5252     * @return
    5353     */
     
    5757
    5858    /**
    59      * Creation du fichier de configuration par défaut
     59     * Creation of the default file configuration
    6060     * @throws IOException
    6161     */
     
    8282
    8383    /**
    84      * Fonction qui retourne la valeur d'une préférence
    85      * @param key la cle de la preference
    86      * @return la valeur
     84     * Function that returns the value of a preference
     85     * @param key the key of the preference
     86     * @return the value
    8787     */
    8888    public static String getValue(String key) {
     
    9898
    9999    /**
    100      * Fonction qui attribue une valeur à une préférence
    101      * @param key la cle
    102      * @param text la valeur
     100     * Function that gives a value to a preference key
     101     * @param key the key
     102     * @param text the value
    103103     */
    104104    public static void setValue(String key, String text) {
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/ConnexionDialog.java

    r6979 r6980  
    6969            .getLog(ConnexionDialog.class);
    7070    /**
    71      * field contenant l'url
     71     * field that contains the url
    7272     */
    7373    private JTextField fieldUrl;
    7474    /**
    75      * field contenant le login
     75     * field that contains the login
    7676     */
    7777    private JTextField loginField;
    7878    /**
    79      * field contenant le mot de passe
     79     * field that contains de password
    8080     */
    8181    private JPasswordField passwordField;
    8282    /**
    83      * label de l'url
     83     * label of the url field
    8484     */
    8585    private JLabel labelUrl;
    8686    /**
    87      * label du login
     87     * label of the login field
    8888     */
    8989    private JLabel labelLogin;
    9090    /**
    91      *  label du mot de passe
     91     *  label of the password field
    9292     */
    9393    private JLabel labelPass;
    9494    /**
    95      * bouton ok, pour la connexion
     95     * ok button for the connection
    9696     */
    9797    private JButton boutonOk;
    9898
    9999    /**
    100      * Box qui permet de retenir les informations
     100     * Box that allows to save informations
    101101     */
    102102    private JCheckBox checkBoxRetenir;
     
    108108
    109109    /**
    110      * Constructeur
     110     * Constructor
    111111     */
    112112    public ConnexionDialog() {
     
    181181    @Override
    182182    public void actionPerformed(ActionEvent paramActionEvent) {
    183         //si un des champs est vide, on affiche une erreur
     183        //if one field is empty, an error is displayed
    184184        if (fieldUrl.getText().equals("") || loginField.getText().equals("") || passwordField.getText().equals("")) {
    185185            JOptionPane.showMessageDialog(null, Messages.getMessage("connexionDialog_emptyField"), Messages
     
    189189                fieldUrl.setText("http://" + fieldUrl.getText());
    190190            }
    191             //sinon, on instancie le session manager de la classe principale
     191            //instanciation of the session manager
    192192            Main.sessionManager = new SessionManager(loginField.getText(), passwordField.getText(), fieldUrl.getText());
    193193            if (checkBoxRetenir.isSelected()) {
     
    201201            }
    202202            if (!Main.sessionManager.processLogin()) {
    203                 //si le login a échoué, on affiche une erreur
     203                //if the login fails, an error is displayed
    204204                JOptionPane.showMessageDialog(null, Messages.getMessage("connexionDialog_connexionError"), Messages
    205205                        .getMessage("error"), JOptionPane.ERROR_MESSAGE);
     
    207207                //              Locale.setDefault((Locale) comboLocales.getSelectedItem());
    208208                Main.showFrame();
    209                 //on cache le dialog de connexion
     209                //hides the dialog
    210210                this.dispose();
    211211            }
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/ImagesManagement.java

    r6958 r6980  
    3838   
    3939 * @author mael
    40  * Classe de gestion des images à taille relle.
    41  * mettre tout en static permet d'y accéder depuis les différentes classes qui en ont besoin
     40 * Management of the real sized pictures
    4241 */
    4342public class ImagesManagement {
     
    4847            .getLog(ImagesManagement.class);
    4948    /**
    50      * L'index de l'image courante dans la liste
     49     * the index of the current image
    5150     */
    5251    public static int CURRENT_IMAGE_INDEX;
    5352    /**
    54      * l'image courante
     53     * the current image
    5554     */
    5655    public static Image CURRENT_IMAGE;
    5756    /**
    58      * la liste des images
     57     * images list
    5958     */
    6059    public static List<Image> LIST_IMAGE;
    6160
    6261    /**
    63      * cache permettant de ne pas recharger les images à chaque fois
     62     * cache allows to keep the images in the ram
    6463     */
    6564    private static HashMap<Integer, BufferedImage> IMAGES_CACHE = new HashMap<Integer, BufferedImage>();
    6665
    6766    /**
    68      * cache permettant de ne pas recharger les images à chaque fois
     67     * cache allows to keep the thumbnails in the ram
    6968     */
    7069    private static HashMap<Integer, BufferedImage> MINIATURE_CACHE = new HashMap<Integer, BufferedImage>();
    7170
    7271    /**
    73      * Récupération de l'image courante
    74      * @return l'image
     72     * gets the current image
     73     * @return the image
    7574     */
    7675    public static Image getCurrentImage() {
     
    8079
    8180    /**
    82      * passage à l'image suivante
     81     * next image
    8382     */
    8483    public static void next() {
     
    9291
    9392    /**
    94      * passage à l'image précédente
     93     * previous image
    9594     */
    9695    public static void previous() {
     
    105104    /**
    106105     *
    107      * @param image l'image courante
     106     * @param image the current image
    108107     */
    109108    public static void setCurrentImage(Image image) {
     
    119118
    120119    /**
    121      * Fonction qui permet de ne charger les images qu'une seule fois
    122      * afin d'améliorer les temps de réponses en ne consommant pas de bande passante.
    123      * @return l'image
     120     * Function that allows to load images once
     121     * to decrease response delays
     122     * @return the image
    124123     */
    125124    public static BufferedImage getCurrentBufferedImage() {
     
    136135
    137136    /**
    138      * Fonction qui permet de ne charger les images qu'une seule fois
    139      * afin d'améliorer les temps de réponses en ne consommant pas de bande passante.
    140      * @return l'image
     137     * Function that allows to load thimbnails once
     138     * to decrease response delays
     139     * @return the image
    141140     */
    142141    public static BufferedImage getMiniatureBufferedImage(Image image) {
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/browser/BrowserFrame.java

    r6966 r6980  
    7575            .getLog(BrowserFrame.class);
    7676    /**
    77      * bouton pour passer à l'image suivante
     77     * bouton to go to the  next image
    7878     */
    7979    private JButton next = new JButton();
    8080    /**
    81      * bouton pour passer à l'image précédente
     81     * bouton to go to the previous image
    8282     */
    8383    private JButton previous = new JButton();
    8484    /**
    85      * rotation de l'image vers la gauche
     85     * rotation on the left
    8686     */
    8787    private JButton rotateLeft = new JButton();
    8888    /**
    89      * rotation de l'image vers la droite
     89     * rotation on the right
    9090     */
    9191    private JButton rotateRight = new JButton();
    9292    /**
    93      * sauvegarde de l'image
     93     * saves the image
    9494     */
    9595    private JButton save = new JButton();
    9696    /**
    97      * affichage des commentaire de l'image
     97     * displays the comments for the current image
    9898     */
    9999    private JButton comment = new JButton();
    100100    /**
    101      * panel contenant tous les boutons précédents
     101     * panel that contains the previous buttons
    102102     */
    103103    private JPanel panelBoutons;
    104104
    105105    /**
    106      * rogner l'image
     106     * clip the image
    107107     */
    108108    private JButton cut = new JButton();
     
    129129     * Il est instancié et ajouté à la création de la frame, et retiré lorsqu'on la quitte
    130130     */
     131    @Deprecated
    131132    private AWTEventListener generalListener;
    132133
     
    206207        this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    207208        setUpMenu();
    208         //instanciation du listener general
    209209        this.generalListener = new AWTEventListener() {
    210210
     
    222222        this.setVisible(true);
    223223
    224         //ajout du listener general
    225224        //Toolkit.getDefaultToolkit().addAWTEventListener(generalListener, AWTEvent.KEY_EVENT_MASK);
    226225
     
    290289    public void dispose() {
    291290        super.dispose();
    292         //on enleve le listener general
    293291        Toolkit.getDefaultToolkit().removeAWTEventListener(generalListener);
    294292    }
     
    299297            new CommentsDialog(this, ImagesManagement.getCurrentImage().getIdentifiant());
    300298        } else if (e.getSource().equals(save)) {
    301             //ouverture du dialog de sauvegarde d'une image
     299            //opens the dialog to save the file
    302300            JFileChooser chooser = new JFileChooser();
    303301            if (JFileChooser.APPROVE_OPTION == chooser.showSaveDialog(null)) {
     
    305303                if (chosenFile.getName().endsWith(".png")) {
    306304                    try {
    307                         //sauvegarde de l'image
     305                        //saves the image
    308306                        ImagesUtil.writeImageToPNG(chosenFile, imagePanel.getImage());
    309307                    } catch (IOException ex) {
     
    321319        } else if (e.getSource().equals(next)) {
    322320            imagePanel.setDrawSelection(false);
    323             //on appelle d'abord la fonction de l'images panel qui increment l'image courante
    324321            ImagesManagement.next();
    325             //on rafraichit le panel qui contient l'image
    326322            BufferedImage img;
    327323            try {
     
    334330        } else if (e.getSource().equals(previous)) {
    335331            imagePanel.setDrawSelection(false);
    336             //on appelle d'abord la fonction de l'images panel qui décrémente l'image courante
    337332            ImagesManagement.previous();
    338             //on rafraichit le panel qui contient l'image
    339333            BufferedImage img;
    340334            try {
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/browser/BrowserImagePanel.java

    r6966 r6980  
    7272
    7373    /**
    74      * Constructeur
    75      * @param image
     74     * Constructor
     75     * @param image the image
    7676     */
    7777    public BrowserImagePanel(BufferedImage image) {
     
    122122    public void rogner() {
    123123        if (scale == 1.0) {
    124             //récupération des dimensions de l'image
     124            //gets the dimensions of the image
    125125            Double width = getSize().getWidth();
    126126            Double height = getSize().getHeight();
    127             //recuperation du coin haut gauche de l'image
     127            //get the top left corner
    128128            Double xZeroImage = ((width - image.getWidth()) / 2);
    129129            Double yZeroImage = ((height - image.getHeight()) / 2);
    130             //les positions du premier clic
    131             //sur l'image. Les positions récupérées précédemment étaient
    132             //les positions sur le panel, il faut donc calculer les positions sur l'image
     130            //the position of the first click on the imagee
     131            //The previous positions where the ones on the panel
     132            //have to calculate the position on the image
    133133            int positionX, positionY;
    134             //largeur et longueur du rognage sur l'image
     134            //width and height of the clip
    135135            int largeur, longueur;
    136             //si jamais la sélection commence avant le début de l'image
    137             //en x, on prend comme position 0, sinon, on calcule la position
    138             //du clic selon le calcul position sur l'image = position sur le panel - position du x de l'image
     136            //if the selection begins before the beginning of the image in x
     137            //0 is taken. Otherwise the position of the click is calculated :
     138            //position on the image = position on the panel - position of the x of the image
    139139            if (xTopPosition - xZeroImage.intValue() < 0) {
    140140                positionX = 0;
     
    142142                positionX = xTopPosition - xZeroImage.intValue();
    143143            }
    144             //si jamais la sélection commence avant le début de l'image
    145             //en y, on prend comme position 0, sinon, on calcule la position
    146             //du clic selon le calcul position sur l'image = position sur le panel - position du y de l'image
     144            //if the selection begins before the beginning of the image in y
     145            //0 is taken. Otherwise the position of the click is calculated :
     146            //position on the image = position on the panel - position of the y of the image
    147147            if (yTopPosition - yZeroImage.intValue() < 0) {
    148148                positionY = 0;
     
    150150                positionY = yTopPosition - yZeroImage.intValue();
    151151            }
    152             //on calcule la largeur
     152            //calculates the width
    153153            largeur = xDragPosition - xTopPosition;
    154             //si ça dépasse de l'image
     154            //if it goes past the image
    155155            if ((positionX + largeur) > image.getWidth()) {
    156                 //on recalcule la largeur
     156                //the width is recalculated
    157157                largeur = image.getWidth() - positionX;
    158158            }
    159             //on calcule la longueur
     159            //calculate the height
    160160            longueur = yDragPosition - yTopPosition;
    161             //si ça dépasse en hauteur
     161            ////if it goes past the image
    162162            if ((positionY + longueur) > image.getHeight()) {
    163                 //on recalcule la hauteur
     163                //the height is recalculated
    164164                longueur = image.getHeight() - positionY;
    165165            }
    166             //recuperation de l'image coupée
     166            //gets the cutted imagee
    167167            image = image.getSubimage(positionX, positionY, largeur, longueur);
    168168            repaint();
     
    176176
    177177    /**
    178      * Récupération du slider
    179      * @return le slider
     178     * gets the slider
     179     * @return the slider
    180180     */
    181181    public JSlider getSlider() {
     
    223223
    224224    /**
    225      * Label du slider
     225     * Label of the slider
    226226     * @param min
    227227     * @param max
     
    239239
    240240    /**
    241      *  Rotation vers la droite
     241     *  right rotation
    242242     */
    243243    public void rotationDroite() {
     
    246246
    247247    /**
    248      * Rotation vers la gauche
     248     * left rotation
    249249     */
    250250    public void rotationGauche() {
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/comments/CommentPanel.java

    r6821 r6980  
    3838   
    3939 * @author mael
    40  * Un panel affichant un commentaire
     40 * a panel that displays a comment of an image
    4141 */
    4242public class CommentPanel extends JPanel {
     
    4848
    4949    /**
    50      * Constructeur
    51      * @param color la couleur de la zone de commentaire
    52      * @param text le commentaire
    53      * @param auteur l'auteur du commentaire
    54      * @param date la date du commentaire
     50     * Constructor
     51     * @param color The color of the panel
     52     * @param text the comment
     53     * @param auteur the author of the comment
     54     * @param date the date of the comment
    5555     */
    5656    public CommentPanel(Color color, String text, String auteur, String date) {
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/comments/CommentsDialog.java

    r6821 r6980  
    5454   
    5555 * @author mael
    56  * dialog affichant les commentaires d'une image et permettant d'en ajouter un
     56 * dialog that displays the comments of an image and allows to add one
    5757 */
    5858public class CommentsDialog extends JDialog implements ActionListener {
     
    6363            .getLog(CommentsDialog.class);
    6464    /**
    65      * booleen permettant d'alterner les couleurs des commentaires
     65     * booleen that allows to alernate the colors
    6666     */
    6767    private boolean alternate = true;
    6868    /**
    69      * area permettant d'écrire un nouveau commentaire
     69     * area to write a new comment
    7070     */
    7171    private JTextArea textArea = new JTextArea();
    7272    /**
    73      * bouton d'envoi d'un commentaire
     73     * sends the new comment
    7474     */
    7575    private JButton boutonEnvoyer = new JButton("Ok");
    7676
    7777    /**
    78      * id de l'image
     78     * id of the image
    7979     */
    8080    private Integer imageId;
    8181    /**
    82      * panel qui permet de scroller sur les commentaires
     82     * panel that allows to scroll
    8383     */
    8484    private JPanel panelScrollCommentaires = new JPanel(new GridBagLayout());
    8585    /**
    86      * panel qui permet d'ajouter un commentaire
     86     * panel that allows to add a comment
    8787     */
    8888    private JPanel panelAjouterCommentaire = new JPanel(new FlowLayout());
    8989
    9090    /**
    91      * Scrollpane qui permet de scroller sur l'area
     91     * Scrollpane
    9292     */
    9393    private JScrollPane scrollPaneArea;
    9494    /**
    95      * scrollpane qui permet de scroller sur les commentaires
     95     * scrollpane that allows to scroll
    9696     */
    9797    private JScrollPane scrollPaneCommentaires;
    9898
    9999    /**
    100      * Constructeur
    101      * @param imageId id de l'image
     100     * Constructor
     101     * @param imageId the id of the image
    102102     */
    103103    public CommentsDialog(JFrame parent, Integer imageId) {
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/CategoriesTree.java

    r6962 r6980  
    6464            .getLog(CategoriesTree.class);
    6565    /**
    66      *  L'arbre
     66     *  the tree
    6767     */
    6868    private JTree tree;
    6969    /**
    70      * le menu permettant d'ajouter une catégorie
     70     * the menu to add a category
    7171     */
    7272    private JMenuItem menuAjouter;
    7373    /**
    74      * Le menu permettant d'actualiser les catégories
     74     * the menu to refresh the categories
    7575     */
    7676    private JMenuItem menuActualiser;
    7777    /**
    78      * la racine du tree, qu'on n'affiche pas
     78     * the root of the tree which is not displayed
    7979     */
    8080    private DefaultMutableTreeNode root = new DefaultMutableTreeNode("");
    8181    /**
    82      * La catégorie selectionnée
     82     * the selected category
    8383     */
    8484    private Category selectedCategory;
    8585
    8686    /**
    87      * Constructeur
     87     * Constructor
    8888     */
    8989    public CategoriesTree() {
    9090        super(new BorderLayout());
    91         //creation de l'arbre
     91        //creation of the tree
    9292        createNodes(root);
    9393        tree = new JTree(root);
     
    103103
    104104    /**
    105      * Methode qui permet de mettre à jour l'arbre
     105     * Method that allows to update the tree
    106106     */
    107107    public void setUpUi() {
     
    129129
    130130    /**
    131      * Creation des noeuds
    132      * @param root noeud racine
     131     * creation of the nodes
     132     * @param root the root
    133133     */
    134134    private void createNodes(DefaultMutableTreeNode root) {
     
    153153
    154154    /**
    155      * Méthode récursive de creation des noeuds de l'arbre
     155     * recursive method for the creation of the nodes
    156156     * @param categoryNode
    157157     * @param category
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/MainFrame.java

    r6972 r6980  
    6363            .getLog(MainFrame.class);
    6464    /**
    65      * l'arbre des catégories
     65     * the categories tree
    6666     */
    6767    private CategoriesTree categoriesTree;
    6868    /**
    69      * Splitpane avec à gauche l'arbre et à droite les miniatures pour la catégorie
    70      * courante
     69     * Splitpane. On the left : the categories tree and on the right the thumbnails
     70     * for the current category
    7171     */
    7272    private JSplitPane splitPane;
    7373    /**
    74      * Panel contenant les miniatures de la catégorie courante
     74     * Panel that contains the thumbnail of the current category
    7575     */
    7676    public static ThumbnailCategoryPanel imagesPanel;
    7777    /**
    78      *  Scrollpane contenant le panel ci dessus
     78     *  Scrollpane that contains the panel above
    7979     */
    8080    private JScrollPane scrollPaneImagesPanel;
    8181    /**
    82      * label qui affiche des messages
     82     * label that displays messages
    8383     */
    8484    private JLabel labelMessage;
    8585
    8686    /**
    87      * Barre de menu
     87     * menu bar
    8888     */
    8989    private JMenuBar jMenuBar;
    9090
    9191    /**
    92      * Menu d'édition
     92     * edition menu
    9393     */
    9494    private JMenu jMenuEdition;
    9595
    9696    /**
    97      * menu des preferences
     97     * preferences menu
    9898     */
    9999    private JMenuItem jMenuItemPreferences;
     
    113113
    114114    /**
    115      * @return le singleton
     115     * @return the singleton
    116116     */
    117117    public static MainFrame getInstance() {
     
    123123
    124124    /**
    125      * COnstructeur privé, permettant de n'avoir accès qu'au singleton
     125     * private constructor to use a singleton
    126126     */
    127127    private MainFrame() {
     
    202202
    203203    /**
    204      * affichage de la frame
     204     * displays the frame
    205205     */
    206206    public void showUi() {
     
    209209
    210210    /**
    211      * Affichage d'un message d'erreur
    212      * @param message
    213      */
    214     public void setErrorMessage(String message) {
    215         this.labelMessage.setText(message);
    216     }
    217 
    218     /**
    219211     * Affichage d'un message de réussite
    220212     * @param message
    221213     */
    222     public void setReussiteMessage(String message) {
     214    public void setMessage(String message) {
    223215        this.labelMessage.setText(message);
    224216    }
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/PreferencesDialog.java

    r6831 r6980  
    6161
    6262    /**
    63      * Les onglets
     63     * the tabs
    6464     */
    6565    private JTabbedPane tabPane;
    6666
    6767    /**
    68      * l'onglet de gestion des preferences des images
     68     * preferences of the images tab
    6969     */
    7070    private JPanel panelImage;
    7171
    7272    /**
    73      * largeur des images
     73     * width of the images
    7474     */
    7575    private JTextField fieldWidth;
    7676
    7777    /**
    78      * hauteur des images
     78     * height of the images
    7979     */
    8080    private JTextField fieldHeight;
    8181
    8282    /**
    83      * taille des morceaux
     83     * size of the chunks
    8484     */
    8585    private JTextField fieldChunkSize;
     
    101101
    102102    /**
    103      * bouton d'enregistrement des preferences
     103     * save the preferences
    104104     */
    105105    private JButton boutonOk = new JButton("Ok");
    106106
    107107    /**
    108      * panel contenant les boutons
     108     * panel that contains the buttons
    109109     */
    110110    private JPanel panelBoutons;
    111111
    112112    /**
    113      * bouton pour annuler
     113     * bouton to cancel
    114114     */
    115115    private JButton boutonAnnuler;
    116116
    117117    /**
    118      * Constructeur
     118     * Constructor
    119119     * @param parent frame parent
    120120     */
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/ThumbnailCategoryPanel.java

    r6972 r6980  
    4343   
    4444 * @author mael
    45  * Classe qui affiche toutes les miniatures d'une catégorie
     45 * Class that display the thumbnails of a category
    4646 */
    4747public class ThumbnailCategoryPanel extends JPanel implements IThumbnailPanel {
     
    5252            .getLog(ThumbnailCategoryPanel.class);
    5353    /**
    54      * L'id de la catégorie pour laquelle les miniatures doivent être affichées
     54     * id of the category
    5555     */
    5656    private Integer categoryId;
     
    6464
    6565    /**
    66      * Constructeur
    67      * @param categoryId l'id de la catégorie
     66     * Constructor
     67     * @param categoryId id of the category
    6868     */
    6969    public ThumbnailCategoryPanel(Integer categoryId) {
     
    8484
    8585    /**
    86      * rafraichissement, afin d'afficher les nouvelles images
    87      * @param categoryId
     86     * refreshes the panel
     87     * @param categoryId the id of the category
    8888     */
    8989    public void rafraichir(Integer categoryId, boolean rafraichir) {
     
    139139
    140140                    ImageService.getInstance().creer(files[i].getCanonicalPath(), categoryId);
    141                     MainFrame.getInstance().setReussiteMessage(
    142                             files[i].getName() + " " + Messages.getMessage("sendingSuccess"));
     141                    MainFrame.getInstance()
     142                            .setMessage(files[i].getName() + " " + Messages.getMessage("sendingSuccess"));
    143143                } catch (Exception e) {
    144144                    LOG.error(Outil.getStackTrace(e));
    145                     //s'il y a une erreur lors de l'envoi
     145                    //displays a dialog if there is an error
    146146                    JOptionPane.showMessageDialog(null, Messages.getMessage("sendingError") + files[i].getName(),
    147147                            Messages.getMessage("error"), JOptionPane.ERROR_MESSAGE);
    148                     MainFrame.getInstance().setErrorMessage(
    149                             Messages.getMessage("sendingError") + " " + files[i].getName());
     148                    MainFrame.getInstance().setMessage(Messages.getMessage("sendingError") + " " + files[i].getName());
    150149                } finally {
    151150                    MainFrame.getInstance().getProgressBar().setValue(nbProgressBar);
    152151                }
    153152            }
    154             //on rafraichit
     153            //refresh
    155154            rafraichir(categoryId, true);
    156155            MainFrame.getInstance().getProgressBar().setValue(0);
     
    179178            JPanel panelh = new JPanel(new FlowLayout());
    180179            try {
    181                 MainFrame.getInstance().setReussiteMessage(Messages.getMessage("thumbviewer_loading"));
     180                MainFrame.getInstance().setMessage(Messages.getMessage("thumbviewer_loading"));
    182181                ImagesManagement.LIST_IMAGE = ImageService.getInstance().listerParCategory(categoryId, rafraichir);
    183182                for (Image image : ImagesManagement.LIST_IMAGE) {
     
    203202                panel.repaint();
    204203                panel.revalidate();
    205                 MainFrame.getInstance().setReussiteMessage(Messages.getMessage("loadingOk"));
     204                MainFrame.getInstance().setMessage(Messages.getMessage("loadingOk"));
    206205            } catch (Exception e) {
    207206                LOG.error(Outil.getStackTrace(e));
    208207                JOptionPane.showMessageDialog(null, Messages.getMessage("imagesListingError"), Messages
    209208                        .getMessage("error"), JOptionPane.ERROR_MESSAGE);
    210                 MainFrame.getInstance().setErrorMessage(Messages.getMessage("imagesListingError"));
     209                MainFrame.getInstance().setMessage(Messages.getMessage("imagesListingError"));
    211210            }
    212211
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/ThumbnailPanel.java

    r6968 r6980  
    6262   
    6363 * @author mael
    64  * Panel contenant la miniature d'une image.
    65  * C'est un panel "cliquable", qui permet d'afficher l'image à taille réelle
     64 * Panel that contains the thumbnail of an image
    6665 */
    6766public class ThumbnailPanel extends JLabel implements MouseListener, ActionListener {
     
    7271            .getLog(ThumbnailPanel.class);
    7372    /**
    74      * l'image
     73     * the image
    7574     */
    7675    private Image image;
     
    9897    /**
    9998     * Constructeur
    100      * @param image l'image
    101      * @param imagesPanel le panel
     99     * @param image the image
     100     * @param imagesPanel the panel
    102101     */
    103102    public ThumbnailPanel(Image image) {
     
    148147    @Override
    149148    public void mouseEntered(MouseEvent paramMouseEvent) {
    150         //changement du curseur, pour signifier à l'utilisateur que l'image est cliquable
    151149        this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    152150    }
  • extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/mainframe/ThumbnailSearchPanel.java

    r6972 r6980  
    8080
    8181    /**
    82      * rafraichissement, afin d'afficher les nouvelles images
    83      * @param categoryId
     82     *refreshes
     83     * @param categoryId the id of the category
    8484     */
    8585    public void rechercher() {
     
    8888        JPanel panelh = new JPanel(new FlowLayout());
    8989        try {
    90             MainFrame.getInstance().setReussiteMessage(Messages.getMessage("thumbviewer_loading"));
     90            MainFrame.getInstance().setMessage(Messages.getMessage("thumbviewer_loading"));
    9191            ImagesManagement.LIST_IMAGE = ImageService.getInstance().search(queryString);
    9292            for (Image image : ImagesManagement.LIST_IMAGE) {
     
    112112            this.repaint();
    113113            this.revalidate();
    114             MainFrame.getInstance().setReussiteMessage(Messages.getMessage("loadingOk"));
     114            MainFrame.getInstance().setMessage(Messages.getMessage("loadingOk"));
    115115        } catch (Exception e) {
    116116            LOG.error(Outil.getStackTrace(e));
    117117            JOptionPane.showMessageDialog(null, Messages.getMessage("imagesListingError"),
    118118                    Messages.getMessage("error"), JOptionPane.ERROR_MESSAGE);
    119             MainFrame.getInstance().setErrorMessage(Messages.getMessage("imagesListingError"));
     119            MainFrame.getInstance().setMessage(Messages.getMessage("imagesListingError"));
    120120        }
    121121    }
Note: See TracChangeset for help on using the changeset viewer.