import Ġandroidx . compose . desktop . ui . tool ing . preview . Preview Ċ import Ġandroidx . compose . foundation . Vertical Scrollbar Ċ import Ġandroidx . compose . foundation . layout . Box Ċ import Ġandroidx . compose . foundation . layout . Column Ċ import Ġandroidx . compose . foundation . layout . Row Ċ import Ġandroidx . compose . foundation . layout . fill Max Height Ċ import Ġandroidx . compose . foundation . layout . fill MaxSize Ċ import Ġandroidx . compose . foundation . layout . fill Max Width Ċ import Ġandroidx . compose . foundation . layout . padding Ċ import Ġandroidx . compose . foundation . remember Scroll State Ċ import Ġandroidx . compose . foundation . remember Scrollbar Adapter Ċ import Ġandroidx . compose . foundation . vertical Scroll Ċ import Ġandroidx . compose . runtime . Composable Ċ import Ġandroidx . compose . runtime . mutable State Of Ċ import Ġandroidx . compose . runtime . remember Ċ import Ġandroidx . compose . ui . Alignment Ċ import Ġandroidx . compose . ui . Modifier Ċ import Ġandroidx . compose . ui . draw . draw Be hind Ċ import Ġandroidx . compose . ui . geometry . Offset Ċ import Ġandroidx . compose . ui . graphics . Color Ċ import Ġandroidx . compose . ui . graphics . Solid Color Ċ import Ġandroidx . compose . ui . unit . Dp Size Ċ import Ġandroidx . compose . ui . unit . dp Ċ import Ġandroidx . compose . ui . window . Window Ċ import Ġandroidx . compose . ui . window . application Ċ import Ġandroidx . compose . ui . window . remember Window State Ċ import Ġcomp os ables . Button Create Ċ import Ġcomp os ables . DropDown Ċ import Ġcomp os ables . Filename Selector Ċ import Ġcomp os ables . Folder Selector Ċ import Ġkotlinx . serialization . Internal Serialization Api Ċ import Ġtemplates . Craft ing Sh aped Recipe Template Ċ import Ġtemplates . Recipe Type Ċ import Ġtemplates . Template Ċ import Ġtemplates . Template Type Ċ import Ġjava . nio . file . Paths Ċ import Ġjavax . swing . J Component Ċ Ċ late init Ġvar Ġframe : ĠJ Component Ċ Ċ const Ġval ĠCLASS _ TYPE _ TO _ REMOVE Ġ= Ġ" class _ type _ to _ remove " Ċ Ċ @ Opt In ( Internal Serialization Api :: class ) Ċ @ Composable Ċ @ Preview Ċ fun ĠApp () Ġ{ Ċ ĉ val ĠfileName Ġ= Ġremember Ġ{ Ġmutable State Of (" file ") Ġ} Ċ ĉ val Ġfolder Ġ= Ġremember Ġ{ Ġmutable State Of ( Paths . get (" "). to AbsolutePath (). normalize (). toString ()) Ġ} Ċ ĉ val Ġtemplate Value Ġ= Ġremember Ġ{ Ġmutable State Of < Template >( Craft ing Sh aped Recipe Template ()) Ġ} Ċ ĉ val Ġtemplate Name Ġ= Ġremember Ġ{ Ġmutable State Of < Any ? >( Recipe Type . values ()[ 0 ]) Ġ} Ċ ĉ val Ġtype Ġ= Ġremember Ġ{ Ġmutable State Of ( Template Type . RE CI PE ) Ġ} ĊĉĊ ĉ Row Ġ{ Ċĉ ĉ Column ( Ċĉĉ ĉ modifier Ġ= ĠModifier . draw Be hind Ġ{ Ċĉĉĉ ĉ draw Line ( Ċĉĉĉĉ ĉ start Ġ= ĠOffset ( size . width , Ġ 0 f ), Ċĉĉĉĉ ĉ end Ġ= ĠOffset ( size . width , Ġsize . height ), Ċĉĉĉĉ ĉ brush Ġ= ĠSolid Color ( Color . Light Gray ) Ċĉĉĉ ĉ ) Ċĉĉ ĉ }. weight ( 0 . 3 f ). padding ( end Ġ= Ġ 1 0 . dp ), Ċĉĉ ĉ horizontal Alignment Ġ= ĠAlignment . Center H orizontally Ċĉ ĉ ) Ġ{ Ċĉĉ ĉ DropDown ( type , Ġ" Type ") Ġ{ Ġit . name Ġ} ĊĉĉĉĊĉĉ ĉ if Ġ( type . value Ġ== ĠTemplate Type . RE CI PE ) Ġ{ Ċĉĉĉ ĉ Column ( Ċĉĉĉĉ ĉ modifier Ġ= ĠModifier . fill Max Width (). fill Max Height ( 0 . 8 f ). padding ( top Ġ= Ġ 1 0 0 . dp ), Ċĉĉĉĉ ĉ horizontal Alignment Ġ= ĠAlignment . Center H orizontally Ċĉĉĉ ĉ ) Ġ{ Ċĉĉĉĉ ĉ val Ġrecipe Type Ġ= Ġremember Ġ{ Ġmutable State Of ( Recipe Type . CR AFT ING _ SHA PED ) Ġ} ĊĉĉĉĉĉĊĉĉĉĉ ĉ Filename Selector ( fileName ) ĊĉĉĉĉĉĊĉĉĉĉ ĉ DropDown ( recipe Type , Ġ" Recipe ĠType ") Ġ{ Ċĉĉĉĉĉ ĉ template Name . value Ġ= Ġit Ċĉĉĉĉĉ ĉ template Value . value Ġ= Ġit . to Template () Ċĉĉĉĉ ĉ } Ċĉĉĉ ĉ } Ċĉĉ ĉ } ĊĉĉĉĊĉĉ ĉ Button Create ( folder , ĠfileName , Ġtemplate Value , Ġtype ) Ċĉ ĉ } ĊĉĉĊĉ ĉ Column ( Ċĉĉ ĉ modifier Ġ= ĠModifier . weight ( 0 . 7 f ) Ċĉ ĉ ) Ġ{ Ċĉĉ ĉ Folder Selector ( folder ) ĊĉĉĉĊĉĉ ĉ Box ( modifier Ġ= ĠModifier . fill MaxSize (). padding ( 1 5 . dp )) Ġ{ Ċĉĉĉ ĉ val Ġstate Vertical Ġ= Ġremember Scroll State ( 0 ) Ċĉĉĉ ĉ comp os ables . Template ( template Value . value , ĠModifier . vertical Scroll ( state Vertical )) Ċĉĉĉ ĉ Vertical Scrollbar ( modifier Ġ= ĠModifier . align ( Alignment . Center End ). fill Max Height (), Ġadapter Ġ= Ġremember Scrollbar Adapter ( state Vertical )) Ċĉĉ ĉ } Ċĉ ĉ } Ċ ĉ } Ċ } Ċ Ċ fun Ġmain () Ġ= Ġapplication Ġ{ Ċ ĉ val Ġstate Ġ= Ġremember Window State ( size Ġ= ĠD p Size ( 1 2 0 0 . dp , Ġ 7 0 0 . dp )) Ċ ĉ Window ( onClose Request Ġ= Ġ:: exit Application , Ġtitle Ġ= Ġ" Minecraft ĠJSON ĠGenerator ", Ġstate Ġ= Ġstate , Ġres izable Ġ= Ġfalse ) Ġ{ Ċĉ ĉ App () Ċĉ ĉ frame Ġ= Ġwindow . root Pane Ċ ĉ } Ċ } Ċ