001: /*
002: * Created on 16/01/2007
003: *
004: * Swing Components - visit http://sf.net/projects/gfd
005: *
006: * Copyright (C) 2007 Igor Regis da Silva Simões
007: *
008: * This program is free software; you can redistribute it and/or
009: * modify it under the terms of the GNU General Public License
010: * as published by the Free Software Foundation; either version 2
011: * of the License, or (at your option) any later version.
012: *
013: * This program is distributed in the hope that it will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
016: * GNU General Public License for more details.
017: *
018: * You should have received a copy of the GNU General Public License
019: * along with this program; if not, write to the Free Software
020: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
021: *
022: */
023: package br.com.gfpshare.beans;
024:
025: import javax.swing.JComponent;
026: import javax.swing.JProgressBar;
027:
028: public class PopupMessageView extends JComponent implements MessageView {
029:
030: private MessagePanel popMessagePanel = new PopupMessagePanel();
031:
032: public void finishUse() {
033: //------------------------------------------------
034: // TODO Auto-generated method stub
035:
036: }
037:
038: public void finishUse(long segundos) {
039: //------------------------------------------------
040: // TODO Auto-generated method stub
041:
042: }
043:
044: public MessagePanel getMessagePanel() {
045: return popMessagePanel;
046: }
047:
048: public MessageView showMessage(String title, String message,
049: boolean showProgress) {
050: getMessagePanel().setMessage(message, showProgress);
051: return this ;
052: }
053:
054: private class PopupMessagePanel extends MultiLineToolTip implements
055: MessagePanel {
056: public PopupMessagePanel() {
057: setOpaque(false);
058: }
059:
060: /**
061: * A message can be appended to the view
062: */
063: public void addMessage(String message) {
064: setTipText(getTipText() + "\n" + message);
065: }
066:
067: /**
068: * Set a message clearing the current one
069: * @param boolean popup has no effect here
070: */
071: public void setMessage(String message, boolean popup) {
072: setTipText(message);
073: }
074:
075: /**
076: * We do not provide progress bar
077: * @deprecated
078: */
079: @Deprecated
080: public JProgressBar getProgressBar() {
081: return null;
082: }
083:
084: /**
085: * We don't blink
086: * @deprecated
087: */
088: @Deprecated
089: public void piscar(boolean popup) {
090: }
091:
092: /**
093: * We don't provide progress bar
094: * @deprecated
095: */
096: @Deprecated
097: public void showProgress(boolean show) {
098: }
099:
100: }
101: }
|