Package com.biglybt.ui.swt.speedtest
Class SpeedTestPanel
java.lang.Object
com.biglybt.ui.swt.wizard.AbstractWizardPanel
com.biglybt.ui.swt.speedtest.SpeedTestPanel
- All Implemented Interfaces:
NetworkAdminSpeedTesterListener
,NetworkAdminSpeedTestScheduledTestListener
,IWizardPanel
public class SpeedTestPanel
extends AbstractWizardPanel
implements NetworkAdminSpeedTestScheduledTestListener, NetworkAdminSpeedTesterListener
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
An abort button listener(package private) class
Run test with encryption toggle button listener.(package private) class
A run button listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.eclipse.swt.widgets.Button
(package private) WizardListener
private org.eclipse.swt.widgets.Display
(package private) int
private org.eclipse.swt.widgets.Button
(package private) long
(package private) long
private NetworkAdminSpeedTestScheduler
private org.eclipse.swt.graphics.Color
private org.eclipse.swt.widgets.ProgressBar
private static final String
private boolean
private org.eclipse.swt.widgets.Button
private boolean
private org.eclipse.swt.widgets.Combo
private org.eclipse.swt.widgets.Label
private org.eclipse.swt.widgets.Label
private org.eclipse.swt.widgets.Text
(package private) int
Fields inherited from class com.biglybt.ui.swt.wizard.AbstractWizardPanel
previousPanel, wizard
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
void
complete
(NetworkAdminSpeedTester tester, NetworkAdminSpeedTesterResult result) When a test completes.void
void
finish()
private static int
private static int[]
getTimeLeftFromString
(String step) If you find the time left values then use them.private static int
getValueFromAveString
(String aveStr) Get the number after the last " " space in the String.boolean
boolean
This method is called when the "finish" button is pressed.boolean
private static String
Change the "progress status" string into something that can be displayed.protected void
protected void
reportStage
(String step) protected void
runTest
(int test_mode, boolean encrypt_mode) void
show()
void
stage
(NetworkAdminSpeedTester tester, String step) Informs listener when the test is at a new stage.void
stage
(NetworkAdminSpeedTestScheduledTest test, String step) protected void
Methods inherited from class com.biglybt.ui.swt.wizard.AbstractWizardPanel
cancelled, getPreviousPanel, isPreviousEnabled
-
Field Details
-
nasts
-
scheduled_test
-
testCombo
private org.eclipse.swt.widgets.Combo testCombo -
encryptToggle
private org.eclipse.swt.widgets.Button encryptToggle -
originalColor
private org.eclipse.swt.graphics.Color originalColor -
test
private org.eclipse.swt.widgets.Button test -
abort
private org.eclipse.swt.widgets.Button abort -
testCountDown1
private org.eclipse.swt.widgets.Label testCountDown1 -
testCountDown2
private org.eclipse.swt.widgets.Label testCountDown2 -
textMessages
private org.eclipse.swt.widgets.Text textMessages -
progress
private org.eclipse.swt.widgets.ProgressBar progress -
display
private org.eclipse.swt.widgets.Display display -
test_running
private boolean test_running -
switched_to_close
private boolean switched_to_close -
uploadTest
int uploadTest -
downloadTest
int downloadTest -
maxUploadTest
long maxUploadTest -
maxDownloadTest
long maxDownloadTest -
clListener
WizardListener clListener -
START_VALUES
- See Also:
-
-
Constructor Details
-
SpeedTestPanel
-
-
Method Details
-
show
public void show()- Specified by:
show
in interfaceIWizardPanel
-
finish
public void finish()- Specified by:
finish
in interfaceIWizardPanel
- Overrides:
finish
in classAbstractWizardPanel
-
cancel
public void cancel() -
runTest
protected void runTest(int test_mode, boolean encrypt_mode) -
stage
- Specified by:
stage
in interfaceNetworkAdminSpeedTestScheduledTestListener
-
complete
- Specified by:
complete
in interfaceNetworkAdminSpeedTestScheduledTestListener
-
stage
Description copied from interface:NetworkAdminSpeedTesterListener
Informs listener when the test is at a new stage.- Specified by:
stage
in interfaceNetworkAdminSpeedTesterListener
- Parameters:
tester
- - test running.step
- - String with stage.
-
complete
Description copied from interface:NetworkAdminSpeedTesterListener
When a test completes.- Specified by:
complete
in interfaceNetworkAdminSpeedTesterListener
- Parameters:
tester
- - test ranresult
- - String with the result
-
reportComplete
-
reportStage
-
modifyProgressStatusString
Change the "progress status" string into something that can be displayed.- Parameters:
step
- - String must start with "progress:"- Returns:
- - a String that can be displayed in the Text Messages window.
-
getValueFromAveString
Get the number after the last " " space in the String.- Parameters:
aveStr
- - String in format "download ave 32000"- Returns:
- int 32000, or -1 if an error.
-
getTimeLeftFromString
If you find the time left values then use them. On any error return null and the calling function should handle that condition.- Parameters:
step
- - String in format "progress: #: text: text: #: #" The last two items are the seconds till abort and seconds till complete respectively.- Returns:
- - int array of size 2 with time left in test, or null on any error.
-
getProgressBarValueFromString
- Parameters:
step
- - String with the expected format. "progress: #" where # is 0 - 100.- Returns:
- The number as an integer, if the result is not known return 0.
-
switchToClose
protected void switchToClose() -
isFinishEnabled
public boolean isFinishEnabled()- Specified by:
isFinishEnabled
in interfaceIWizardPanel
- Overrides:
isFinishEnabled
in classAbstractWizardPanel
-
isFinishSelectionOK
public boolean isFinishSelectionOK()Description copied from interface:IWizardPanel
This method is called when the "finish" button is pressed. It allows operations to be carried out before the "finish" panel is shown.- Specified by:
isFinishSelectionOK
in interfaceIWizardPanel
- Overrides:
isFinishSelectionOK
in classAbstractWizardPanel
- Returns:
- true - carry on and show the finish panel; false - operation failed, leave on current panel
-
getFinishPanel
- Specified by:
getFinishPanel
in interfaceIWizardPanel
- Overrides:
getFinishPanel
in classAbstractWizardPanel
-
isNextEnabled
public boolean isNextEnabled()- Specified by:
isNextEnabled
in interfaceIWizardPanel
- Overrides:
isNextEnabled
in classAbstractWizardPanel
-
getNextPanel
- Specified by:
getNextPanel
in interfaceIWizardPanel
- Overrides:
getNextPanel
in classAbstractWizardPanel
-