001: /*
002: * Copyright (C) 2004 TiongHiang Lee
003: *
004: * This library is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License as published by the Free Software Foundation; either
007: * version 2.1 of the License, or (at your option) any later version.
008: *
009: * This library is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012: * Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public
015: * License along with this library; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: *
018: * Email: thlee@onemindsoft.org
019: */
020:
021: package org.onemind.swingweb.component.shareapp;
022:
023: import javax.swing.Icon;
024: import javax.swing.JLabel;
025: import org.onemind.swingweb.session.SessionLocal;
026:
027: public class SharedJLabel extends JLabel {
028:
029: private SessionLocal _text;
030:
031: /**
032: * Constructor
033: */
034: public SharedJLabel() {
035: super ();
036: // TODO Auto-generated constructor stub
037: }
038:
039: /**
040: * Constructor
041: * @param image
042: * @param horizontalAlignment
043: */
044: public SharedJLabel(Icon image, int horizontalAlignment) {
045: super (image, horizontalAlignment);
046: // TODO Auto-generated constructor stub
047: }
048:
049: /**
050: * Constructor
051: * @param image
052: */
053: public SharedJLabel(Icon image) {
054: super (image);
055: // TODO Auto-generated constructor stub
056: }
057:
058: /**
059: * Constructor
060: * @param text
061: * @param icon
062: * @param horizontalAlignment
063: */
064: public SharedJLabel(String text, Icon icon, int horizontalAlignment) {
065: super (text, icon, horizontalAlignment);
066: // TODO Auto-generated constructor stub
067: }
068:
069: /**
070: * Constructor
071: * @param text
072: * @param horizontalAlignment
073: */
074: public SharedJLabel(String text, int horizontalAlignment) {
075: super (text, horizontalAlignment);
076: // TODO Auto-generated constructor stub
077: }
078:
079: /**
080: * Constructor
081: * @param text
082: */
083: public SharedJLabel(String text) {
084: super (text);
085: // TODO Auto-generated constructor stub
086: }
087:
088: private synchronized SessionLocal _getTextLocal() {
089: if (_text == null) {
090: _text = new SessionLocal();
091: }
092: return _text;
093: }
094:
095: public void setText(String text) {
096: _getTextLocal().setValue(text);
097: super .setText(text);
098: }
099:
100: public String getText() {
101: return (String) _getTextLocal().getValue();
102: }
103: }
|