package Ġdev . shot a . de compiler . window Ċ Ċ import Ġcom . sun . java fx . tk . Toolkit Ċ import Ġjavafx . application . Platform Ċ import Ġjavafx . embed . swing . J FX Panel Ċ import Ġjavafx . scene . Scene Ċ import Ġjavafx . scene . control . Split Pane Ċ import Ġjavafx . scene . input . Transfer Mode Ċ import Ġjavafx . scene . text . Font Ċ import Ġdev . shot a . de compiler . window . container . Container Ċ import Ġdev . shot a . de compiler . window . menu . MenuBar Ċ import Ġdev . shot a . de compiler . window . sidebar . Sidebar Ċ import Ġdev . shot a . de compiler . window . utils . styles Ċ import Ġjava . awt . Task bar Ċ import Ġjava . io . File Ċ import Ġjavax . swing .* Ċ import Ġkotlin . system . exit Process Ċ Ċ object ĠWindow Ġ: ĠJ Frame () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġfonts Ġ= ĠarrayOf ( ĊĠĠĠĠĠĠĠ Ġ" Jet Brains Mono - Bold ", Ġ" Jet Brains Mono - Bold Italic ", Ġ" Jet Brains Mono - Extra Bold ", Ġ" Jet Brains Mono - Extra Bold Italic ", ĊĠĠĠĠĠĠĠ Ġ" Jet Brains Mono - Extra Light ", Ġ" Jet Brains Mono - Extra Light Italic ", Ġ" Jet Brains Mono - Italic ", Ġ" Jet Brains Mono - Light ", ĊĠĠĠĠĠĠĠ Ġ" Jet Brains Mono - Light Italic ", Ġ" Jet Brains Mono - Medium ", Ġ" Jet Brains Mono - Medium Italic ", Ġ" Jet Brains Mono - Regular ", ĊĠĠĠĠĠĠĠ Ġ" Jet Brains Mono - Sem iB old ", Ġ" Jet Brains Mono - Sem iB old Italic ", Ġ" Jet Brains Mono - Th in ", Ġ" Jet Brains Mono - Th in Italic ", ĊĊĠĠĠĠĠĠĠ Ġ" Open Sans - Bold ", Ġ" Open Sans - Bold Italic ", Ġ" Open Sans - Con dense d Bold ", Ġ" Open Sans - Con dense d Bold Italic ", ĊĠĠĠĠĠĠĠ Ġ" Open Sans - Con dense d Extra Bold ", Ġ" Open Sans - Con dense d Extra Bold Italic ", Ġ" Open Sans - Con dense d Italic ", ĊĠĠĠĠĠĠĠ Ġ" Open Sans - Con dense d Light ", Ġ" Open Sans - Con dense d Light Italic ", Ġ" Open Sans - Con dense d Regular ", ĊĠĠĠĠĠĠĠ Ġ" Open Sans - Con dense d Sem iB old ", Ġ" Open Sans - Con dense d Sem iB old Italic ", Ġ" Open Sans - Extra Bold ", ĊĠĠĠĠĠĠĠ Ġ" Open Sans - Extra Bold Italic ", Ġ" Open Sans - Light ", Ġ" Open Sans - Light Italic ", Ġ" Open Sans - Regular ", ĊĠĠĠĠĠĠĠ Ġ" Open Sans - Sem iB old ", Ġ" Open Sans - Sem iB old Italic " ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġtitle Ġ= Ġ" De compiler " ĊĠĠĠĠĠĠĠ Ġdefault Close Operation Ġ= ĠDIS POSE _ ON _ CLOSE ĊĠĠĠĠĠĠĠ Ġval Ġicon Ġ= ĠImage Icon ( java Class . class Loader . getResource AsStream (" icons / logo . png ") ?. read All Bytes ()). image ĊĠĠĠĠĠĠĠ Ġif Ġ( Task bar . is Task bar Supported () Ġ&& ĠTask bar . get Task bar (). is Supported ( Task bar . Feature . ICON _ IMAGE )) ĠTask bar . get Task bar (). icon Image Ġ= Ġicon ĊĠĠĠĠĠĠĠ Ġicon Image Ġ= Ġicon ĊĠĠĠĠĠĠĠ Ġj MenuBar Ġ= ĠMenu Bar () ĊĊĠĠĠĠĠĠĠ Ġval Ġroot Ġ= ĠSplit Pane ( Sidebar , ĠContainer ) ĊĠĠĠĠĠĠĠ Ġroot . set Divider Positions ( Sidebar . min Width Ġ/ Ġ( Sidebar . min Width Ġ+ ĠContainer . min Width ), ĠContainer . min Width Ġ/ Ġ( Sidebar . min Width Ġ+ ĠContainer . min Width )) ĊĠĠĠĠĠĠĠ ĠSplit Pane . setResizable With Parent ( Sidebar , Ġfalse ) ĊĊĠĠĠĠĠĠĠ Ġfor Ġ( font Ġin Ġfonts ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠFont . load Font ( java Class . class Loader . getResource AsStream (" fonts /${ font . split ("- ")[ 0 ] }/ $ font . ttf "), ĠToolkit . get Toolkit (). font Loader . system FontSize . toDouble ()) ĊĠĠĠĠĠĠĠ Ġroot . stylesheets . add ( styles (" global . styl ")) ĊĠĠĠĠĠĠĠ Ġroot . stylesheets . add ( styles (" syntax . styl ")) ĊĊĠĠĠĠĠĠĠ Ġval Ġpanel Ġ= ĠJ FX Panel () ĊĠĠĠĠĠĠĠ Ġpanel . scene Ġ= ĠScene ( root , Ġ 8 9 4 . 0 , Ġ 5 2 8 . 0 ) ĊĠĠĠĠĠĠĠ Ġpanel . scene . setOn Drag Over Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . accept Transfer Modes (* Transfer Mode . COPY _ OR _ MOVE ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . consume () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġpanel . scene . setOn Drag Dropped Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( it . drag board . files . size Ġ> Ġ 0 Ġ&& Ġit . drag board . files [ 0 ]. extension . equals (" jar ", Ġtrue )) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠSidebar . open ( it . drag board . files [ 0 ]) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġit . is Drop Completed Ġ= Ġtrue ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . consume () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġadd ( panel ) ĊĠĠĠĠĠĠĠ Ġpack () ĊĠĠĠĠĠĠĠ Ġset Location Relative To ( null ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġdispose () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . dispose () ĊĠĠĠĠĠĠĠ Ġexit Process ( 0 ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġrun ( args : ĠArray < String >) Ġ{ ĊĠĠĠĠĠĠĠ Ġis Visible Ġ= Ġtrue ĊĠĠĠĠĠĠĠ ĠPlatform . run Later Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( args . isNotEmpty ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠSidebar . open ( File ( args [ 0 ])) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ Ċ }