Source code: com/voytechs/jnetanalyzer/message/swing/JMessageSegment.java
1 /*
2 * File: JMessageSegment.java
3 * Auth: Mark Bednarczyk
4 * Date: DATE
5 * Id: $Id: JMessageSegment.java,v 1.1.1.1 2003/09/22 16:32:06 voytechs Exp $
6 ********************************************
7 Copyright (C) 2003 Mark Bednarczyk
8
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 ********************************************
23 * $Log: JMessageSegment.java,v $
24 * Revision 1.1.1.1 2003/09/22 16:32:06 voytechs
25 * Initial import.
26 *
27 */
28 package com.voytechs.jnetanalyzer.message.swing;
29
30 import java.lang.*;
31 import java.util.*;
32
33 import java.awt.*;
34 import java.awt.event.*;
35 import javax.swing.*;
36 import javax.swing.border.*;
37
38 /**
39 *
40 */
41 public class JMessageSegment
42 extends JMessageComponent {
43
44 /* Internal attributes */
45 private static final boolean debug = false;
46
47 private JTimedProgressBar progressBar;
48
49 private JLabel label1 = new JLabel();
50 private JLabel label2 = new JLabel();
51 private JLabel label3 = new JLabel("", JLabel.CENTER);
52 private JLabel label4 = new JLabel("", JLabel.CENTER);
53
54
55 /**
56 *
57 * @param
58 * @exception
59 */
60 public JMessageSegment() {
61
62 setLayout(new BorderLayout());
63
64 add(label1, BorderLayout.WEST);
65 add(label2, BorderLayout.EAST);
66 add(label3, BorderLayout.CENTER);
67 add(label4, BorderLayout.NORTH);
68
69
70 }
71
72 /**
73 * Set timeout value and timer.
74 */
75 public void setTimeout(int timeout) {
76 add(progressBar = new JTimedProgressBar(timeout), BorderLayout.SOUTH);
77 }
78
79 /**
80 *
81 */
82 public void setLabel1Text(String msg) {
83 label1.setText(msg);
84 }
85 public void setLabel2Text(String msg) {
86 label2.setText(msg);
87 }
88 public void setLabel3Text(String msg) {
89 label3.setText(msg);
90 }
91
92 public void setLabel4Text(String msg) {
93 label4.setText(msg);
94 }
95
96 /**
97 * Cancels the timeout progress bar for the segment.
98 * Also hides the progress bar.
99 */
100 public void cancelTimeoutTimer(){
101 progressBar.cancelTimeoutTimer();
102 progressBar.setVisible(false);
103 }
104
105 /**
106 * Test function for JMessageSegment
107 * @param args command line arguments
108 */
109 public static void main(String [] args) {
110 }
111
112 } /* END OF: JMessageSegment */