// ĠCopyright Ġ 2 0 0 0 - 2 0 1 9 ĠJetBrains Ġs . r . o . ĠUse Ġof Ġthis Ġsource Ġcode Ġis Ġgoverned Ġby Ġthe ĠApache Ġ 2 . 0 Ġlicense Ġthat Ġcan Ġbe Ġfound Ġin Ġthe ĠLICENSE Ġfile . Ċ package Ġcom . intellij . openapi . vcs . changes Ċ Ċ import Ġcom . intellij . ide . util . Properties Component Ċ import Ġcom . intellij . ui . One Pixel Splitter Ċ Ċ private Ġconst Ġval ĠV ERT ICAL _ PRO PORT ION _ KEY Ġ= Ġ" Changes View Manager . COMMIT _ SPLIT TER _ PRO PORT ION " Ċ private Ġconst Ġval ĠH ORIZONTAL _ PRO PORT ION _ KEY Ġ= Ġ" Changes View Manager . COMMIT _ SPLIT TER _ PRO PORT ION . HORIZONTAL " Ċ private Ġconst Ġval ĠDEFAULT _ VERTICAL _ PRO PORT ION Ġ= Ġ 1 . 0 f Ċ private Ġconst Ġval ĠDEFAULT _ HORIZONTAL _ PRO PORT ION Ġ= Ġ 0 . 4 f Ċ Ċ private Ġval Ġproperties Component Ġget () Ġ= ĠProperties Component . getInstance () Ċ Ċ private Ġclass ĠChanges View Commit Panel Splitter Ġ: ĠOne Pixel Splitter ( true , Ġ"", ĠDEFAULT _ VERTICAL _ PRO PORT ION ) Ġ{ ĊĠ Ġprivate Ġvar Ġis Vertical Pro portion Set Ġ= Ġproperties Component . is Value Set ( VERTICAL _ PRO PORT ION _ KEY ) ĊĠ Ġprivate Ġvar Ġprevious Height Ġ= Ġ 0 ĊĠ Ġprivate Ġvar Ġvertical Second Height Ġ= Ġ 0 ĊĊĠ Ġinit Ġ{ ĊĠĠĠ Ġadd Property ChangeListener ( PROP _ OR IENTATION ) Ġ{ Ġload Pro portion () Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġdo Layout () Ġ{ ĊĠĠĠ Ġcalculate Initial Vertical Pro portion () ĊĠĠĠ Ġdo Layout Ret aining Second Height () ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġdo Layout Ret aining Second Height () Ġ{ ĊĠĠĠ Ġif Ġ( is Vertical Pro portion Set Ġ&& Ġcan Calculate Vertical Pro portion () Ġ&& Ġis Splitter Height Changed ()) Ġ{ ĊĠĠĠĠĠ Ġif Ġ( is Vertical Ġ&& Ġsecond Component . height Ġ> Ġ 0 ) Ġproportion Ġ= Ġget Pro portion For Second Height ( second Component . height ) ĊĠĠĠĠĠ Ġelse Ġif Ġ(! is Vertical Ġ&& Ġvertical Second Height Ġ> Ġ 0 ) Ġsave Vertical Pro portion ( get Pro portion For Second Height ( vertical Second Height )) ĊĠĠĠ Ġ} ĊĠĠĠ Ġsuper . do Layout () ĊĠĠĠ Ġprevious Height Ġ= Ġheight ĊĠĠĠ Ġif Ġ( is Vertical Pro portion Set Ġ&& Ġis Vertical Ġ&& Ġcan Calculate Vertical Pro portion ()) Ġvertical Second Height Ġ= Ġsecond Component . height ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġcalculate Initial Vertical Pro portion () Ġ{ ĊĠĠĠ Ġif Ġ( is Vertical Pro portion Set Ġ|| Ġ! is Vertical Ġ|| Ġ! can Calculate Vertical Pro portion ()) Ġreturn ĊĊĠĠĠ Ġis Vertical Pro portion Set Ġ= Ġtrue ĊĠĠĠ Ġproportion Ġ= Ġget Pro portion For Second Height ( second Component . preferred Size . height ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġget Pro portion For Second Height ( second Height : ĠInt ): ĠFloat Ġ= ĊĠĠĠ Ġget Pro portion For Second Size ( second Height , Ġheight ). coerce In ( 0 . 0 5 f , Ġ 0 . 9 5 f ) ĊĊĠ Ġprivate Ġfun Ġcan Calculate Vertical Pro portion (): ĠBoolean Ġ= Ġsecond Component Ġ!= Ġnull Ġ&& Ġheight Ġ> Ġdivider Width ĊĠ Ġprivate Ġfun Ġis Splitter Height Changed (): ĠBoolean Ġ= Ġprevious Height Ġ!= Ġheight ĊĊĠ Ġoverride Ġfun Ġload Pro portion () Ġ{ ĊĠĠĠ Ġif Ġ(! is Vertical ) Ġ{ ĊĠĠĠĠĠ Ġproportion Ġ= Ġproperties Component . get Float ( HORIZONTAL _ PRO PORT ION _ KEY , ĠDEFAULT _ HORIZONTAL _ PRO PORT ION ) ĊĠĠĠ Ġ} ĊĠĠĠ Ġelse Ġif Ġ( is Vertical Pro portion Set ) Ġ{ ĊĠĠĠĠĠ Ġproportion Ġ= Ġproperties Component . get Float ( VERTICAL _ PRO PORT ION _ KEY , ĠDEFAULT _ VERTICAL _ PRO PORT ION ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġsave Pro portion () Ġ{ ĊĠĠĠ Ġif Ġ(! is Vertical ) Ġ{ ĊĠĠĠĠĠ Ġproperties Component . setValue ( HORIZONTAL _ PRO PORT ION _ KEY , Ġproportion , ĠDEFAULT _ HORIZONTAL _ PRO PORT ION ) ĊĠĠĠ Ġ} ĊĠĠĠ Ġelse Ġif Ġ( is Vertical Pro portion Set ) Ġ{ ĊĠĠĠĠĠ Ġsave Vertical Pro portion ( pro portion ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġsave Vertical Pro portion ( value : ĠFloat ) Ġ= ĊĠĠĠ Ġproperties Component . setValue ( VERTICAL _ PRO PORT ION _ KEY , Ġvalue , ĠDEFAULT _ VERTICAL _ PRO PORT ION ) Ċ }