SharedJLabel.java :  » Web-Framework » swingweb » org » onemind » swingweb » component » shareapp » Java Open Source

Java Open Source » Web Framework » swingweb 
swingweb » org » onemind » swingweb » component » shareapp » SharedJLabel.java
/*
 * Copyright (C) 2004 TiongHiang Lee
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not,  write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Email: thlee@onemindsoft.org
 */

package org.onemind.swingweb.component.shareapp;

import javax.swing.Icon;
import javax.swing.JLabel;
import org.onemind.swingweb.session.SessionLocal;
public class SharedJLabel extends JLabel
{

    private SessionLocal _text;

    /**
     * Constructor
     */
    public SharedJLabel()
    {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * Constructor
     * @param image
     * @param horizontalAlignment
     */
    public SharedJLabel(Icon image, int horizontalAlignment)
    {
        super(image, horizontalAlignment);
        // TODO Auto-generated constructor stub
    }

    /**
     * Constructor
     * @param image
     */
    public SharedJLabel(Icon image)
    {
        super(image);
        // TODO Auto-generated constructor stub
    }

    /**
     * Constructor
     * @param text
     * @param icon
     * @param horizontalAlignment
     */
    public SharedJLabel(String text, Icon icon, int horizontalAlignment)
    {
        super(text, icon, horizontalAlignment);
        // TODO Auto-generated constructor stub
    }

    /**
     * Constructor
     * @param text
     * @param horizontalAlignment
     */
    public SharedJLabel(String text, int horizontalAlignment)
    {
        super(text, horizontalAlignment);
        // TODO Auto-generated constructor stub
    }

    /**
     * Constructor
     * @param text
     */
    public SharedJLabel(String text)
    {
        super(text);
        // TODO Auto-generated constructor stub
    }

    private synchronized SessionLocal _getTextLocal()
    {
        if (_text == null)
        {
            _text = new SessionLocal();
        }
        return _text;
    }

    public void setText(String text)
    {
        _getTextLocal().setValue(text);
        super.setText(text);
    }

    public String getText()
    {
        return (String) _getTextLocal().getValue();
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.