001    // This file is part of the Attempto Java Packages.
002    // Copyright 2008, Attempto Group, University of Zurich (see http://attempto.ifi.uzh.ch).
003    //
004    // The Attempto Java Packages is free software: you can redistribute it and/or modify it under the
005    // terms of the GNU Lesser General Public License as published by the Free Software Foundation,
006    // either version 3 of the License, or (at your option) any later version.
007    //
008    // The Attempto Java Packages is distributed in the hope that it will be useful, but WITHOUT ANY
009    // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
010    // PURPOSE. See the GNU Lesser General Public License for more details.
011    //
012    // You should have received a copy of the GNU Lesser General Public License along with the Attempto
013    // Java Packages. If not, see http://www.gnu.org/licenses/.
014    
015    package ch.uzh.ifi.attempto.echocomp;
016    
017    import nextapp.echo2.app.ImageReference;
018    
019    /**
020     * This is a convenience class for easy creation of labels with no line wrap.
021     * @author Tobias Kuhn
022     *
023     */
024    public class SolidLabel extends Label {
025    
026            /**
027             * Creates a new empty label.
028             */
029            public SolidLabel() {
030                    super();
031            }
032    
033            /**
034             * Creates a new label containing only an image.
035             * 
036             * @param image The image.
037             */
038            public SolidLabel(ImageReference image) {
039                    super(image);
040            }
041    
042            /**
043             * Creates a new label.
044             * 
045             * @param text The text of the label.
046             */
047            public SolidLabel(String text) {
048                    super(text);
049            }
050    
051            /**
052             * Creates a new label of the given style.
053             * 
054             * @param text The text of the label.
055             * @param style The style of the label.
056             */
057            public SolidLabel(String text, int style) {
058                    super(text, style);
059            }
060    
061            /**
062             * Creates a new label of the given style with the given text size.
063             * 
064             * @param text The text of the label.
065             * @param style The style of the label.
066             * @param size The size of the text.
067             */
068            public SolidLabel(String text, int style, int size) {
069                    super(text, style, size);
070            }
071            
072            void initLabel(int style, int size) {
073                    super.initLabel(style, size);
074                    setLineWrap(false);
075            }
076    
077    }