package Ġhap . rule engine . editor . view . parts čĊč Ċ import Ġhap . rule engine . editor . view model . event . Begin Connect Wire č Ċ import Ġhap . rule engine . editor . view model . event . Mouse Entered Connection Point č Ċ import Ġhap . rule engine . parts . I Connection Point č Ċ import Ġjavafx . geometry . Point 2 D č Ċ import Ġjavafx . scene . shape . Rectangle č Ċ import Ġt orn ad of x . Fragment č Ċ import Ġt orn ad of x . single Assign č Ċ import Ġjava . util .* čĊč Ċ abstract Ġclass ĠConnection Point View Ġ: ĠFragment () Ġ{ čĊĠĠĠ Ġprotected Ġval Ġmy Wire : ĠArrayList < Wire View > Ġ= ĠArrayList () čĊĠĠĠ Ġprotected Ġvar Ġmy Connection Point : ĠRectangle Ġby Ġsingle Assign () čĊčĊĠĠĠ Ġfun Ġadd Wire ( wire : ĠWire View ) Ġ{ čĊĠĠĠĠĠĠĠ Ġmy Wire . add ( wire ) čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġfun Ġhas W ires () Ġ= Ġmy Wire . count () Ġ> Ġ 0 čĊčĊĠĠĠ Ġfun Ġget Scene Relative Center (): ĠPoint 2 D Ġ{ čĊĠĠĠĠĠĠĠ Ġval Ġbounds Ġ= Ġmy Connection Point . layout Bounds čĊĠĠĠĠĠĠĠ Ġval Ġoffset Ġ= Ġconnection Point Size Ġ/ Ġ 2 čĊĠĠĠĠĠĠĠ Ġreturn Ġmy Connection Point . local To Scene ( bounds . min X Ġ+ Ġoffset , Ġbounds . min Y Ġ+ Ġoffset ) čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġfun Ġupdate W ires () Ġ{ čĊĠĠĠĠĠĠĠ Ġmy Wire . forEach Ġ{ Ġit . update End Points () Ġ} čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġprotected Ġfun Ġstart Connect Wire ( connection Point : ĠI Connection Point , Ġscene Relative Center : ĠPoint 2 D ) Ġ{ čĊĠĠĠĠĠĠĠ Ġfire ( Begin Connect Wire ( connection Point , Ġscene Relative Center )) čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġprotected Ġfun Ġentered Connection Point ( connection Point : ĠI Connection Point ?) Ġ{ čĊĠĠĠĠĠĠĠ Ġfire ( Mouse Entered Connection Point ( connection Point )) čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġfun Ġdisconnect All W ires () čĊĠĠĠ Ġ{ čĊĠĠĠĠĠĠĠ Ġmy Wire . toList (). map Ġ{ Ġit . delete () Ġ} čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġabstract Ġfun Ġdisconnect ( wire : ĠWire View ) č Ċ } čĊč Ċ const Ġval Ġconnection Point Size : ĠDouble Ġ= Ġ 1 2 . 0 čĊ