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) classAn abort button listener(package private) classRun test with encryption toggle button listener.(package private) classA run button listener -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.eclipse.swt.widgets.Button(package private) WizardListenerprivate org.eclipse.swt.widgets.Display(package private) intprivate org.eclipse.swt.widgets.Button(package private) long(package private) longprivate NetworkAdminSpeedTestSchedulerprivate org.eclipse.swt.graphics.Colorprivate org.eclipse.swt.widgets.ProgressBarprivate static final Stringprivate booleanprivate org.eclipse.swt.widgets.Buttonprivate booleanprivate org.eclipse.swt.widgets.Comboprivate org.eclipse.swt.widgets.Labelprivate org.eclipse.swt.widgets.Labelprivate org.eclipse.swt.widgets.Text(package private) intFields inherited from class AbstractWizardPanel
previousPanel, wizard -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()voidcomplete(NetworkAdminSpeedTester tester, NetworkAdminSpeedTesterResult result) When a test completes.voidvoidfinish()private static intprivate static int[]getTimeLeftFromString(String step) If you find the time left values then use them.private static intgetValueFromAveString(String aveStr) Get the number after the last " " space in the String.booleanbooleanThis method is called when the "finish" button is pressed.booleanprivate static StringChange the "progress status" string into something that can be displayed.protected voidprotected voidreportStage(String step) protected voidrunTest(int test_mode, boolean encrypt_mode) voidshow()voidstage(NetworkAdminSpeedTester tester, String step) Informs listener when the test is at a new stage.voidstage(NetworkAdminSpeedTestScheduledTest test, String step) protected voidMethods inherited from class 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:
showin interfaceIWizardPanel
-
finish
public void finish()- Specified by:
finishin interfaceIWizardPanel- Overrides:
finishin classAbstractWizardPanel
-
cancel
public void cancel() -
runTest
protected void runTest(int test_mode, boolean encrypt_mode) -
stage
- Specified by:
stagein interfaceNetworkAdminSpeedTestScheduledTestListener
-
complete
- Specified by:
completein interfaceNetworkAdminSpeedTestScheduledTestListener
-
stage
Description copied from interface:NetworkAdminSpeedTesterListenerInforms listener when the test is at a new stage.- Specified by:
stagein interfaceNetworkAdminSpeedTesterListener- Parameters:
tester- - test running.step- - String with stage.
-
complete
Description copied from interface:NetworkAdminSpeedTesterListenerWhen a test completes.- Specified by:
completein interfaceNetworkAdminSpeedTesterListener- Parameters:
tester- - test ranresult- - String with the result
-
reportComplete
-
reportStage
-
modifyProgressStatusString
-
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:
isFinishEnabledin interfaceIWizardPanel- Overrides:
isFinishEnabledin classAbstractWizardPanel
-
isFinishSelectionOK
public boolean isFinishSelectionOK()Description copied from interface:IWizardPanelThis method is called when the "finish" button is pressed. It allows operations to be carried out before the "finish" panel is shown.- Specified by:
isFinishSelectionOKin interfaceIWizardPanel- Overrides:
isFinishSelectionOKin classAbstractWizardPanel- Returns:
- true - carry on and show the finish panel; false - operation failed, leave on current panel
-
getFinishPanel
- Specified by:
getFinishPanelin interfaceIWizardPanel- Overrides:
getFinishPanelin classAbstractWizardPanel
-
isNextEnabled
public boolean isNextEnabled()- Specified by:
isNextEnabledin interfaceIWizardPanel- Overrides:
isNextEnabledin classAbstractWizardPanel
-
getNextPanel
- Specified by:
getNextPanelin interfaceIWizardPanel- Overrides:
getNextPanelin classAbstractWizardPanel
-