UIPainter.st
changeset 1316 d66f0b84aa6b
parent 1314 f22b28597a05
child 1317 49d6dac15a57
equal deleted inserted replaced
1315:8722cfe3cce1 1316:d66f0b84aa6b
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
    12 
    13 
    13 
    14 ToolApplicationModel subclass:#UIPainter
    14 ToolApplicationModel subclass:#UIPainter
    15 	instanceVariableNames:'specClass specSelector specSuperclass aspects treeView specCanvas
    15 	instanceVariableNames:'specClass specSelector specSuperclass aspects treeView
    16 		selectionPanel tabSelection layoutCanvas helpCanvas modified'
    16 		selectionPanel tabSelection modified specTool layoutTool helpTool'
    17 	classVariableNames:''
    17 	classVariableNames:''
    18 	poolDictionaries:''
    18 	poolDictionaries:''
    19 	category:'Interface-UIPainter'
    19 	category:'Interface-UIPainter'
    20 !
    20 !
    21 
    21 
  1869 !
  1869 !
  1870 
  1870 
  1871 noteBookView
  1871 noteBookView
  1872     "returns the notebook view; initialize the tools embedded in the notebook"
  1872     "returns the notebook view; initialize the tools embedded in the notebook"
  1873 
  1873 
  1874     |noteBook modifiedChannel helpTool layoutTool specTool|
  1874     |noteBook modifiedChannel applBuilder applWindow|
  1875 
  1875 
  1876     (noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[
  1876     (noteBook := builder bindingAt:#noteBookView) isNil ifTrue:[
  1877         noteBook   := View new.
  1877         modifiedChannel := self modifiedChannel.
       
  1878         noteBook := View new.
       
  1879         builder aspectAt:#noteBookView put:noteBook.
       
  1880 
  1878         layoutTool := UILayoutTool new.
  1881         layoutTool := UILayoutTool new.
  1879         helpTool   := UIHelpTool   new.
  1882         layoutTool createBuilder.
       
  1883         applBuilder := layoutTool builder.
       
  1884         applWindow  := SimpleView origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
       
  1885         applWindow level:0.
       
  1886         layoutTool masterApplication:self.
       
  1887         applBuilder window:applWindow.
       
  1888         applWindow client:layoutTool spec:#windowSpec builder:applBuilder.
       
  1889         applBuilder window:applWindow.
       
  1890         layoutTool modifiedHolder:modifiedChannel.
       
  1891 
       
  1892         helpTool := UIHelpTool new.
       
  1893         helpTool createBuilder.
       
  1894         applBuilder := helpTool builder.
       
  1895         applWindow  := SimpleView origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
       
  1896         applWindow level:0.
  1880         helpTool buildFromClass:specClass.
  1897         helpTool buildFromClass:specClass.
  1881         specTool   := UISpecificationTool new.
  1898         helpTool masterApplication:self.
  1882         modifiedChannel    := self modifiedChannel.
  1899         applBuilder window:applWindow.
  1883 
  1900         applWindow client:helpTool spec:#windowSpec builder:applBuilder.
  1884         layoutTool masterApplication:self.
  1901         applBuilder window:applWindow.
  1885         specTool   masterApplication:self.
  1902         helpTool modifiedHolder:modifiedChannel.
  1886         helpTool   masterApplication:self.
  1903 
  1887 
  1904         specTool := UISpecificationTool new.
  1888         layoutCanvas := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
  1905         specTool createBuilder.
  1889         helpCanvas   := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
  1906         applBuilder := specTool builder.
  1890         specCanvas   := SubCanvas origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
  1907         applWindow  := SimpleView origin:0.0@0.0 corner:1.0@1.0 in:noteBook.
  1891 
  1908         specTool masterApplication:self.
  1892         layoutCanvas level:0.
  1909         applWindow level:0.
  1893         helpCanvas   level:0.
  1910 
  1894         specCanvas   level:0.
  1911         applBuilder window:applWindow.
  1895 
  1912         applWindow client:specTool spec:#windowSpec builder:applBuilder.
  1896         layoutCanvas client:layoutTool.
  1913         applBuilder window:applWindow.
  1897         helpCanvas   client:helpTool.
  1914 
  1898         specTool builder:(specCanvas client:specTool).
  1915         specTool modifiedHolder:modifiedChannel.
  1899 
       
  1900         layoutTool masterApplication:self.
       
  1901         specTool   masterApplication:self.
       
  1902         helpTool   masterApplication:self.
       
  1903 
       
  1904         layoutTool modifiedHolder:modifiedChannel.
       
  1905         helpTool   modifiedHolder:modifiedChannel.
       
  1906         specTool   modifiedHolder:modifiedChannel.
       
  1907 
       
  1908         builder aspectAt:#noteBookView put:noteBook.
       
  1909     ].
  1916     ].
  1910     ^ noteBook
  1917     ^ noteBook
  1911 !
  1918 !
  1912 
  1919 
  1913 painterShown
  1920 painterShown
  2436     aView beIndependent.
  2443     aView beIndependent.
  2437     aView unmap.
  2444     aView unmap.
  2438 !
  2445 !
  2439 
  2446 
  2440 raiseTabView
  2447 raiseTabView
       
  2448     |appl|
  2441 
  2449 
  2442     self isLayoutToolSelected ifTrue:[
  2450     self isLayoutToolSelected ifTrue:[
  2443         helpCanvas   unmap.
  2451         helpTool   window unmap.
  2444         specCanvas   unmap.
  2452         specTool   window unmap.
  2445         layoutCanvas realize.
  2453         layoutTool window realize.
  2446     ] ifFalse:[
  2454     ] ifFalse:[
  2447         self isHelpToolSelected ifTrue:[
  2455         self isHelpToolSelected ifTrue:[
  2448             layoutCanvas unmap.
  2456             layoutTool window unmap.
  2449             specCanvas   unmap.
  2457             specTool   window unmap.
  2450             helpCanvas   realize.
  2458             helpTool   window realize.
  2451         ] ifFalse:[
  2459         ] ifFalse:[
  2452             layoutCanvas unmap.
  2460             specTool selection:tabSelection.
  2453             helpCanvas   unmap.
  2461             helpTool   window unmap.
  2454             specCanvas   realize.
  2462             layoutTool window unmap.
  2455             specCanvas application selection:tabSelection.
  2463             specTool   window realize.
       
  2464 
       
  2465 "/            specTool selection:tabSelection.
  2456         ]
  2466         ]
  2457     ]
  2467     ]
  2458 
  2468 
  2459 !
  2469 !
  2460 
  2470 
  2542 !UIPainter methodsFor:'private tools'!
  2552 !UIPainter methodsFor:'private tools'!
  2543 
  2553 
  2544 helpTool
  2554 helpTool
  2545     "returns the help tool"
  2555     "returns the help tool"
  2546 
  2556 
  2547     helpCanvas isNil ifTrue:[
  2557     helpTool isNil ifTrue:[self noteBookView].
  2548 	self noteBookView
  2558   ^ helpTool
  2549     ].
       
  2550     ^ helpCanvas application
       
  2551 !
  2559 !
  2552 
  2560 
  2553 layoutTool
  2561 layoutTool
  2554     "returns the layout tool"
  2562     "returns the layout tool"
  2555 
  2563 
  2556     layoutCanvas isNil ifTrue:[
  2564     layoutTool isNil ifTrue:[self noteBookView].
  2557 	self noteBookView
  2565   ^ layoutTool
  2558     ].
       
  2559     ^ layoutCanvas application
       
  2560 !
  2566 !
  2561 
  2567 
  2562 painter
  2568 painter
  2563     "returns the canvas view"
  2569     "returns the canvas view"
  2564 
  2570 
  2566 !
  2572 !
  2567 
  2573 
  2568 specTool
  2574 specTool
  2569     "returns the spec tool"
  2575     "returns the spec tool"
  2570 
  2576 
  2571     specCanvas isNil ifTrue:[
  2577     specTool isNil ifTrue:[self noteBookView].
  2572 	self noteBookView
  2578   ^ specTool
  2573     ].
       
  2574     ^ specCanvas application
       
  2575 ! !
  2579 ! !
  2576 
  2580 
  2577 !UIPainter methodsFor:'queries'!
  2581 !UIPainter methodsFor:'queries'!
  2578 
  2582 
  2579 hasSpecClass
  2583 hasSpecClass