/* Ċ The ĠMIT ĠLicense Ġ( MIT ) Ċ Ċ Copyright Ġ( c ) Ġ 2 0 1 6 ĠTom ĠNeed ham Ċ Ċ Permission Ġis Ġhereby Ġgranted , Ġfree Ġof Ġcharge , Ġto Ġany Ġperson Ġobtaining Ġa Ġcopy Ċ of Ġthis Ġsoftware Ġand Ġassociated Ġdocumentation Ġfiles Ġ( the Ġ" Software "), Ġto Ġdeal Ċ in Ġthe ĠSoftware Ġwithout Ġrestriction , Ġincluding Ġwithout Ġlimitation Ġthe Ġrights Ċ to Ġuse , Ġcopy , Ġmodify , Ġmerge , Ġpublish , Ġdistribute , Ġsublicense , Ġand / or Ġsell Ċ copies Ġof Ġthe ĠSoftware , Ġand Ġto Ġpermit Ġpersons Ġto Ġwhom Ġthe ĠSoftware Ġis Ċ furnished Ġto Ġdo Ġso , Ġsubject Ġto Ġthe Ġfollowing Ġconditions : Ċ Ċ The Ġabove Ġcopyright Ġnotice Ġand Ġthis Ġpermission Ġnotice Ġshall Ġbe Ġincluded Ġin Ġall Ċ copies Ġor Ġsubstantial Ġportions Ġof Ġthe ĠSoftware . Ċ Ċ THE ĠSOFTWARE ĠIS ĠPROVIDED Ġ" AS ĠIS ", ĠWITHOUT ĠWARRANTY ĠOF ĠANY ĠKIND , ĠEXPRESS ĠOR Ċ IMPLIED , ĠINCLUDING ĠBUT ĠNOT ĠLIMITED ĠTO ĠTHE ĠWARRANTIES ĠOF ĠMERCHANTABILITY , Ċ FITNESS ĠFOR ĠA ĠPARTICULAR ĠPURPOSE ĠAND ĠNONINFRINGEMENT . ĠIN ĠNO ĠEVENT ĠSHALL ĠTHE Ċ AUTHORS ĠOR ĠCOPYRIGHT ĠHOLDERS ĠBE ĠLIABLE ĠFOR ĠANY ĠCLAIM , ĠDAMAGES ĠOR ĠOTHER Ċ LIABILITY , ĠWHETHER ĠIN ĠAN ĠACTION ĠOF ĠCONTRACT , ĠTORT ĠOR ĠOTHERWISE , ĠARISING ĠFROM , Ċ OUT ĠOF ĠOR ĠIN ĠCONNECTION ĠWITH ĠTHE ĠSOFTWARE ĠOR ĠTHE ĠUSE ĠOR ĠOTHER ĠDEALINGS ĠIN ĠTHE Ċ SOFTWARE . Ċ Ġ*/ Ċ package Ġcom . th omas . need ham . ne uro ph idea . forms . test Ċ Ċ import Ġcom . intellij . ide . util . Properties Component Ċ import Ġcom . intellij . openapi . ui . Messages Ċ import Ġcom . intellij . util . Platform Icons Ċ import Ġcom . th omas . need ham . ne uro ph idea . Constants . NETWORK _ TO _ TEST _ LOCATION _ KEY Ċ import Ġcom . th omas . need ham . ne uro ph idea . Constants . TEST _ FORM _ TEST ING _ SET _ LOCATION _ KEY Ċ import Ġcom . th omas . need ham . ne uro ph idea . core . Network Tester Ċ import Ġjava . awt . event . ActionEvent Ċ import Ġjava . awt . event . ActionListener Ċ import Ġjava . awt . event . Window Event Ċ Ċ /** Ċ Ġ* ĠCreated Ġby ĠThomas ĠNeed ham Ġon Ġ 0 5 / 0 6 / 2 0 1 6 . Ċ Ġ*/ Ċ class ĠTest Network Button ActionListener Ġ: ĠActionListener Ġ{ ĊĉĊ ĉ var Ġform Instance : ĠTest Network Form ? Ġ= Ġnull Ċ ĉ var Ġnetwork Tester : ĠNetwork Tester ? Ġ= Ġnull ĊĉĊ ĉ comp anion Ġobject ĠData Ġ{ Ċĉ ĉ val Ġproperties Ġ= ĠProperties Component . getInstance () Ċ ĉ } ĊĉĊ ĉ override Ġfun ĠactionPerformed ( e : ĠAction Event ?) Ġ{ Ċĉ ĉ if Ġ(! form Instance ?. txt Testing Data ?. text . equals ("")) Ġ{ Ċĉĉ ĉ val Ġinput Ġ= Ġform Instance ?. txt Testing Data ?. text Ċĉĉ ĉ val Ġsplit Ġ= Ġinput ?. split (",") Ċĉĉ ĉ val Ġparsed Output Ġ= ĠDouble Array ( split ?. size !! ) Ċĉĉ ĉ for Ġ( i Ġin Ġ 0 .. split ?. size !! ) Ġ{ Ċĉĉĉ ĉ parsed Output [ i ] Ġ= Ġsplit ! ![ i ]. toDouble () Ċĉĉ ĉ } Ċĉĉ ĉ network Tester Ġ= ĠNetwork Tester ( properties . getValue ( NETWORK _ TO _ TEST _ LOCATION _ KEY , Ġ""), Ġparsed Output , Ġform Instance ?. txt Output Path ?. text !! ) Ċĉ ĉ } Ġelse Ġ{ Ċĉĉ ĉ network Tester Ġ= ĠNetwork Tester ( properties . getValue ( NETWORK _ TO _ TEST _ LOCATION _ KEY , Ġ""), Ġproperties . getValue ( TEST _ FORM _ TEST ING _ SET _ LOCATION _ KEY , Ġ""), Ġform Instance ?. txt Output Path ?. text !! ) Ċĉ ĉ } Ċĉ ĉ network Tester ?. Test Network () Ċĉ ĉ Messages . show Ok Cancel Dialog (" Network ĠSuccessfully ĠTested !", Ġ" Success ", ĠPlatform Icons . CHECK _ ICON ) Ċĉ ĉ if Ġ( form Instance ?. should Close !! ) Ġ{ Ċĉĉ ĉ form Instance ?. dispatchEvent ( Window Event ( form Instance , ĠWindow Event . WINDOW _ CLO SING )) Ċĉĉ ĉ form Instance ?. dispose () Ċĉ ĉ } Ċ ĉ } Ċ }