    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     *
    022     * @author Tobias Kuhn
    023     */
    024    public class SolidLabel extends Label {
    025
    026            private static final long serialVersionUID = -1721467828910909396L;
    027
    028            /**
    029             * Creates a new empty label.
    030             */
    031            public SolidLabel() {
    032                    super();
    033            }
    034
    035            /**
    036             * Creates a new label containing only an image.
    037             *
    038             * @param image The image.
    039             */
    040            public SolidLabel(ImageReference image) {
    041                    super(image);
    042            }
    043
    044            /**
    045             * Creates a new label.
    046             *
    047             * @param text The text of the label.
    048             */
    049            public SolidLabel(String text) {
    050                    super(text);
    051            }
    052
    053            /**
    054             * Creates a new label of the given style.
    055             *
    056             * @param text The text of the label.
    057             * @param style The style of the label.
    058             */
    059            public SolidLabel(String text, int style) {
    060                    super(text, style);
    061            }
    062
    063            /**
    064             * Creates a new label of the given style with the given text size.
    065             *
    066             * @param text The text of the label.
    067             * @param style The style of the label.
    068             * @param size The size of the text.
    069             */
    070            public SolidLabel(String text, int style, int size) {
    071                    super(text, style, size);
    072            }
    073
    074            void initLabel(int style, int size) {
    075                    super.initLabel(style, size);
    076                    setLineWrap(false);
    077            }
    078
    079    }