source:
fedd/abac-src/atnvis/src/ProgressPanel.java
@
2c9fff0
Last change on this file since 2c9fff0 was 8780cbec, checked in by , 15 years ago | |
---|---|
|
|
File size: 700 bytes |
Rev | Line | |
---|---|---|
[8780cbec] | 1 | package com.algomagic.atn; |
2 | ||
3 | import java.util.*; | |
4 | import java.awt.*; | |
5 | import javax.swing.*; | |
6 | ||
7 | ||
8 | public class ProgressPanel | |
9 | extends JPanel | |
10 | implements Observer | |
11 | { | |
12 | JProgressBar _progress; | |
13 | ||
14 | public ProgressPanel( ) { | |
15 | super( ); | |
16 | setLayout( new BorderLayout( ) ); | |
17 | ||
18 | _progress = new JProgressBar( 0, 1 ); | |
19 | _progress.setValue( 0 ); | |
20 | _progress.setStringPainted( true ); | |
21 | ||
22 | add( _progress, BorderLayout.CENTER ); | |
23 | ||
24 | PanelHelper.setBorder( this, "Negotiation Progress" ); | |
25 | } | |
26 | ||
27 | public void setMax( int n ) { | |
28 | _progress.setMaximum( n-1 ); | |
29 | } | |
30 | ||
31 | public void update( Observable o, Object arg ) { | |
32 | PlayBackController pbc = (PlayBackController)o; | |
33 | _progress.setValue( pbc.getIndex( ) ); | |
34 | } | |
35 | } |
Note: See TracBrowser
for help on using the repository browser.