01: package com.nexes.test;
02:
03: import com.nexes.wizard.*;
04:
05: import java.awt.*;
06: import java.awt.event.*;
07: import javax.swing.*;
08:
09: public class TestPanel3Descriptor extends WizardPanelDescriptor {
10:
11: public static final String IDENTIFIER = "SERVER_CONNECT_PANEL";
12:
13: TestPanel3 panel3;
14:
15: public TestPanel3Descriptor() {
16:
17: panel3 = new TestPanel3();
18: setPanelDescriptorIdentifier(IDENTIFIER);
19: setPanelComponent(panel3);
20:
21: }
22:
23: public Object getNextPanelDescriptor() {
24: return FINISH;
25: }
26:
27: public Object getBackPanelDescriptor() {
28: return TestPanel2Descriptor.IDENTIFIER;
29: }
30:
31: public void aboutToDisplayPanel() {
32:
33: panel3.setProgressValue(0);
34: panel3.setProgressText("Connecting to Server...");
35:
36: getWizard().setNextFinishButtonEnabled(false);
37: getWizard().setBackButtonEnabled(false);
38:
39: }
40:
41: public void displayingPanel() {
42:
43: Thread t = new Thread() {
44:
45: public void run() {
46:
47: try {
48: Thread.sleep(2000);
49: panel3.setProgressValue(25);
50: panel3
51: .setProgressText("Server Connection Established");
52: Thread.sleep(500);
53: panel3.setProgressValue(50);
54: panel3.setProgressText("Transmitting Data...");
55: Thread.sleep(3000);
56: panel3.setProgressValue(75);
57: panel3
58: .setProgressText("Receiving Acknowledgement...");
59: Thread.sleep(1000);
60: panel3.setProgressValue(100);
61: panel3
62: .setProgressText("Data Successfully Transmitted");
63:
64: getWizard().setNextFinishButtonEnabled(true);
65: getWizard().setBackButtonEnabled(true);
66:
67: } catch (InterruptedException e) {
68:
69: panel3.setProgressValue(0);
70: panel3.setProgressText("An Error Has Occurred");
71:
72: getWizard().setBackButtonEnabled(true);
73: }
74:
75: }
76: };
77:
78: t.start();
79: }
80:
81: public void aboutToHidePanel() {
82: // Can do something here, but we've chosen not not.
83: }
84:
85: }
|