GraphColumnViewSpec.st
author Claus Gittinger <cg@exept.de>
Fri, 15 Jun 2018 10:54:35 +0200
changeset 5816 7876c07931a7
parent 3309 5e33115fabe7
child 4770 6634b540fea2
permissions -rw-r--r--
#DOCUMENTATION by cg class: ComboListView class comment/format in: #documentation

"
 COPYRIGHT (c) 1998 by eXept Software AG
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
"{ Package: 'stx:libwidg2' }"

MenuComponentSpec subclass:#GraphColumnViewSpec
	instanceVariableNames:'listHolder references referenceSelector showGrid showDefaultMenu
		zoomY windowSize graphOriginX scrollUpdatesOriginX'
	classVariableNames:''
	poolDictionaries:''
	category:'Interface-Support-UI-Specs'
!

!GraphColumnViewSpec class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1998 by eXept Software AG
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"


!

documentation
"
    Not normally used by applications.

    [author:]
	Claus Atzkern

    [see also:]
	UIBuilder
	UIPainter
"



! !

!GraphColumnViewSpec class methodsFor:'class initialization'!

initialize
    "add an entry for my new components to the UIPainters
     userDef gallery"

    UISelectionPanel userClass
	addUserSpecHolder:[self graphSpec]
	label:'Graphs'

    "
     self initialize
    "


!

removeFromSystem
    "remove myself - this implies deinstallation from the UIGallery"

    UISelectionPanel userClass removeUserSpecWithLabel:'Graphs'.
    ^ super removeFromSystem.

! !

!GraphColumnViewSpec class methodsFor:'interface - painter'!

addBindingsTo:env for:inst channel:aChannel

    super addBindingsTo:env for:inst channel:aChannel.

    self
	adaptApects:
		    #(
			showGrid
			showDefaultMenu
			scrollUpdatesOriginX
		     )
	to:env
	for:inst
	channel:aChannel.

    self
	adaptApects:
		    #(
			zoomY
			windowSize
			graphOriginX
			references
			referenceSelector
		     )
	to:env
	for:inst
	channel:aChannel
	converter:#symbolOrNil.

! !

!GraphColumnViewSpec class methodsFor:'interface gallery'!

graphSpec
    "this window spec was automatically generated by the ST/X UIPainter"

    "do not manually edit this - the painter/builder may not be able to
     handle the specification if its corrupted."

    "
     UIPainter new openOnClass:self andSelector:#graphSpec
     self new openInterface:#graphSpec
    "

    <resource: #canvas>

    ^

       #(#FullSpec
	  #'window:'
	   #(#WindowSpec
	      #'name:' 'Views'
	      #'layout:' #(#LayoutFrame 212 0 194 0 691 0 422 0)
	      #'label:' 'Views'
	      #'min:' #(#Point 10 10)
	      #'max:' #(#Point 1280 1024)
	      #'bounds:' #(#Rectangle 212 194 692 423)
	      #'usePreferredExtent:' false
	  )
	  #'component:'
	   #(#SpecCollection
	      #'collection:'
	       #(
		 #(#GraphColumnView2DSpec
		    #'name:' '2D Graph'
		    #'layout:' #(#LayoutFrame 15 0 10 0 180 0 90 0)
		    #'showGrid:' true
		    #'gridX:' 2
		    #'gridY:' 2
		)
		 #(#LabelSpec
		    #'name:' '2D Graph Label'
		    #'layout:' #(#Point 15 96)
		    #'label:' 'Graph Column View 2D'
		    #'style:' #(#FontDescription #helvetica #medium #roman #'10')
		    #'adjust:' #left
		    #'resizeForLabel:' true
		    #'canUIDrag:' false
		)
		 #(#GraphColumnView3DSpec
		    #'name:' '3D Graph'
		    #'layout:' #(#LayoutFrame 206 0 10 0 371 0 90 0)
		    #'showGrid:' true
		)
		 #(#LabelSpec
		    #'name:' '3D Graph Label'
		    #'layout:' #(#Point 206 96)
		    #'label:' 'Graph Column View 3D'
		    #'style:' #(#FontDescription #helvetica #medium #roman #'10')
		    #'adjust:' #left
		    #'resizeForLabel:' true
		    #'canUIDrag:' false
		)
	      )
	  )
      )


! !

!GraphColumnViewSpec class methodsFor:'interface specs'!

basicsEditSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:GraphColumnViewSpec andSelector:#basicsEditSpec
    "

    <resource: #canvas>

    ^
     #(#FullSpec
	#name: #basicsEditSpec
	#window:
       #(#WindowSpec
	  #label: 'Graph 2D Basic'
	  #name: 'Graph 2D Basic'
	  #min: #(#Point 10 10)
	  #max: #(#Point 1160 870)
	  #bounds: #(#Rectangle 886 214 1198 539)
	)
	#component:
       #(#SpecCollection
	  #collection: #(
	   #(#LabelSpec
	      #label: 'ID:'
	      #name: 'nameLabel'
	      #layout: #(#AlignmentOrigin 73 0 31 0 1 0.5)
	      #resizeForLabel: true
	      #adjust: #right
	    )
	   #(#InputFieldSpec
	      #attributes:
	     #(#tabable
		true #nameField
		nil
	      )
	      #name: 'nameField'
	      #layout: #(#LayoutFrame 75 0 20 0 -2 1.0 45 0)
	      #activeHelpKey: #id
	      #tabable: true
	      #model: #name
	      #acceptChannel: #acceptChannel
	      #modifiedChannel: #modifiedChannel
	      #acceptOnPointerLeave: false
	    )
	   #(#LabelSpec
	      #label: 'Model:'
	      #name: 'modelLabel'
	      #layout: #(#AlignmentOrigin 73 0 60 0 1 0.5)
	      #resizeForLabel: true
	    )
	   #(#InputFieldSpec
	      #attributes:
	     #(#tabable
		true
	      )
	      #name: 'modelField'
	      #layout: #(#LayoutFrame 75 0 49 0 -2 1 74 0)
	      #activeHelpKey: #model
	      #tabable: true
	      #model: #model
	      #acceptChannel: #acceptChannel
	      #modifiedChannel: #modifiedChannel
	      #acceptOnPointerLeave: false
	    )
	   #(#LabelSpec
	      #label: 'References:'
	      #name: 'referencesLabel'
	      #layout: #(#AlignmentOrigin 168 0 90 0 1 0.5)
	      #resizeForLabel: true
	      #adjust: #left
	    )
	   #(#InputFieldSpec
	      #attributes:
	     #(#referencesField
		nil #tabable
		true
	      )
	      #name: 'referencesField'
	      #layout: #(#LayoutFrame 171 0 80 0 -2 1.0 102 0)
	      #tabable: true
	      #model: #references
	      #acceptChannel: #acceptChannel
	      #modifiedChannel: #modifiedChannel
	      #acceptOnPointerLeave: false
	    )
	   #(#LabelSpec
	      #label: 'Access Selector:'
	      #name: 'referencesSelLabel'
	      #layout: #(#AlignmentOrigin 168 0 116 0 1 0.5)
	      #resizeForLabel: true
	      #adjust: #left
	    )
	   #(#InputFieldSpec
	      #name: 'referencesSelField'
	      #layout: #(#LayoutFrame 171 0 106 0 -2 1.0 128 0)
	      #model: #referenceSelector
	      #acceptChannel: #acceptChannel
	      #modifiedChannel: #modifiedChannel
	      #acceptOnPointerLeave: false
	    )
	   #(#UISubSpecification
	      #name: 'menuSubSpec'
	      #layout: #(#LayoutFrame 0 0.0 144 0 0 1.0 263 0)
	      #majorKey: #UISpecification
	      #minorKey: #menuSubSpec
	    )
	   #(#CheckBoxSpec
	      #attributes:
	     #(#tabable
		true
	      )
	      #label: 'Default Menu'
	      #name: 'showDefaultMenu'
	      #layout: #(#AlignmentOrigin 97 0 280 0 0 0.5)
	      #tabable: true
	      #model: #showDefaultMenu
	    )
	   )

	)
      )
!

subDetailsEditSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:GraphColumnViewSpec andSelector:#subDetailsEditSpec
    "

    <resource: #canvas>

    ^
     #(#FullSpec
	#name: #subDetailsEditSpec
	#window:
       #(#WindowSpec
	  #label: 'Graph 2D Detail'
	  #name: 'Graph 2D Detail'
	  #min: #(#Point 10 10)
	  #max: #(#Point 1160 870)
	  #bounds: #(#Rectangle 886 214 1269 437)
	)
	#component:
       #(#SpecCollection
	  #collection: #(
	   #(#LabelSpec
	      #label: 'Border Width:'
	      #name: 'borderWidthLabel'
	      #layout: #(#AlignmentOrigin 157 0 35 0 1 0.5)
	      #resizeForLabel: true
	      #adjust: #left
	    )
	   #(#InputFieldSpec
	      #attributes:
	     #(#tabable
		true
	      )
	      #name: 'borderWidthField'
	      #layout: #(#LayoutFrame 161 0 24 0 197 0 46 0)
	      #activeHelpKey: #borderWidth
	      #tabable: true
	      #model: #borderWidth
	      #acceptChannel: #acceptChannel
	      #modifiedChannel: #modifiedChannel
	      #acceptOnPointerLeave: false
	    )
	   #(#LabelSpec
	      #label: 'Level:'
	      #name: 'levelLabel'
	      #layout: #(#AlignmentOrigin 157 0 58 0 1 0.5)
	      #resizeForLabel: true
	    )
	   #(#InputFieldSpec
	      #attributes:
	     #(#tabable
		true
	      )
	      #name: 'levelField'
	      #layout: #(#LayoutFrame 161 0 48 0 197 0 70 0)
	      #activeHelpKey: #level
	      #tabable: true
	      #model: #level
	      #acceptChannel: #acceptChannel
	      #modifiedChannel: #modifiedChannel
	      #acceptOnPointerLeave: false
	    )
	   #(#LabelSpec
	      #label: 'Origin X'
	      #name: 'graphOriginXLabel'
	      #layout: #(#AlignmentOrigin 157 0 91 0 1 0.5)
	      #resizeForLabel: true
	      #adjust: #left
	    )
	   #(#InputFieldSpec
	      #attributes:
	     #(#graphOriginXField
		nil #tabable
		true
	      )
	      #name: 'graphOriginXField'
	      #layout: #(#LayoutFrame 161 0 81 0 -2 1.0 103 0)
	      #tabable: true
	      #model: #graphOriginX
	      #acceptChannel: #acceptChannel
	      #modifiedChannel: #modifiedChannel
	      #acceptOnPointerLeave: false
	    )
	   #(#CheckBoxSpec
	      #attributes:
	     #(#tabable
		true
	      )
	      #label: 'Scroll updates X-Origin'
	      #name: 'scrollUpdatesOriginX'
	      #layout: #(#AlignmentOrigin 158 0 117 0 0 0.5)
	      #tabable: true
	      #model: #scrollUpdatesOriginX
	    )
	   #(#LabelSpec
	      #label: 'Window Size:'
	      #name: 'windowSizeLabel'
	      #layout: #(#AlignmentOrigin 157 0 149 0 1 0.5)
	      #resizeForLabel: true
	      #adjust: #left
	    )
	   #(#InputFieldSpec
	      #attributes:
	     #(#windowSizeField
		nil #tabable
		true
	      )
	      #name: 'windowSizeField'
	      #layout: #(#LayoutFrame 161 0 139 0 -2 1.0 161 0)
	      #tabable: true
	      #model: #windowSize
	      #acceptChannel: #acceptChannel
	      #modifiedChannel: #modifiedChannel
	      #acceptOnPointerLeave: false
	    )
	   #(#LabelSpec
	      #label: 'Zoom-Y Factor:'
	      #name: 'zoomYLabel'
	      #layout: #(#AlignmentOrigin 157 0 173 0 1 0.5)
	      #resizeForLabel: true
	      #adjust: #left
	    )
	   #(#InputFieldSpec
	      #attributes:
	     #(#tabable
		true #zoomYField
		nil
	      )
	      #name: 'zoomYField'
	      #layout: #(#LayoutFrame 161 0 163 0 -2 1.0 185 0)
	      #tabable: true
	      #model: #zoomY
	      #acceptChannel: #acceptChannel
	      #modifiedChannel: #modifiedChannel
	      #acceptOnPointerLeave: false
	    )
	   )

	)
      )
! !

!GraphColumnViewSpec methodsFor:'accessing'!

graphOriginX
    "return the value of the instance variable 'graphOriginX' (automatically generated)"

    ^ graphOriginX
!

graphOriginX:something
    "set the value of the instance variable 'graphOriginX' (automatically generated)"

    graphOriginX := something.
!

listHolder
    "return the value of the instance variable 'listHolder' (automatically generated)"

    ^ listHolder
!

listHolder:something
    "set the value of the instance variable 'listHolder' (automatically generated)"

    listHolder := something.
!

referenceSelector
    "return the value of the instance variable 'referenceSelector' (automatically generated)"

    ^ referenceSelector
!

referenceSelector:something
    "set the value of the instance variable 'referenceSelector' (automatically generated)"

    referenceSelector := something.
!

references
    "return the value of the instance variable 'references' (automatically generated)"

    ^ references
!

references:something
    "set the value of the instance variable 'references' (automatically generated)"

    references := something.
!

scrollUpdatesOriginX
    "return the value of the instance variable 'scrollUpdatesOriginX' (automatically generated)"

    ^ scrollUpdatesOriginX ? false
!

scrollUpdatesOriginX:something
    "set the value of the instance variable 'scrollUpdatesOriginX' (automatically generated)"

    scrollUpdatesOriginX := something.
!

showDefaultMenu
    "return the value of the instance variable 'showDefaultMenu' (automatically generated)"

    ^ showDefaultMenu ? false
!

showDefaultMenu:something
    "set the value of the instance variable 'showDefaultMenu' (automatically generated)"

    showDefaultMenu := something.
!

showGrid
    "return the value of the instance variable 'showGrid' (automatically generated)"

    ^ showGrid ? false
!

showGrid:something
    "set the value of the instance variable 'showGrid' (automatically generated)"

    showGrid := something.
!

windowSize
    "return the value of the instance variable 'windowSize' (automatically generated)"

    ^ windowSize
!

windowSize:something
    "set the value of the instance variable 'windowSize' (automatically generated)"

    windowSize := something.
!

zoomY
    "return the value of the instance variable 'zoomY' (automatically generated)"

    ^ zoomY
!

zoomY:something
    "set the value of the instance variable 'zoomY' (automatically generated)"

    zoomY := something.
! !

!GraphColumnViewSpec methodsFor:'building'!

aspectSelectors
    "add more aspect selectors (these generate aspect methods in the definer)"

    |more|

    more := super aspectSelectors.

    windowSize   notNil ifTrue:[more add:windowSize].
    graphOriginX notNil ifTrue:[more add:graphOriginX].
    references   notNil ifTrue:[more add:references].
    zoomY        notNil ifTrue:[more add:zoomY].

    ^ more
!

createViewFor:aBuilder in:aView
    "low level create - no attributes are set.
    "
    aBuilder isEditing ifFalse:[
	^ super createViewFor:aBuilder in:aView
    ].
    ^ GraphColumnView in:aView

!

setAttributesIn:aView with:aBuilder

    super setAttributesIn:aView with:aBuilder.

    aView showGrid:(self showGrid).
    aView scrollUpdatesOriginX:(self scrollUpdatesOriginX).
    aView showDefaultMenu:(self showDefaultMenu).

    aBuilder isEditing ifFalse:[
	windowSize notNil ifTrue:[
	    aView windowSizeHolder:(self getBindingIn:aBuilder binding:windowSize)
	].

	graphOriginX notNil ifTrue:[
	    aView graphOriginXHolder:(self getBindingIn:aBuilder binding:graphOriginX)
	].

	referenceSelector notNil ifTrue:[
	    aView referenceSelector:referenceSelector
	].

	references notNil ifTrue:[
	    aView referenceHolder:(self getBindingIn:aBuilder binding:references)
	].

	zoomY notNil ifTrue:[
	    aView zoomYHolder:(self getBindingIn:aBuilder binding:zoomY)
	].

	self setModelAttributeIn:aView with:aBuilder.
	self setMenuIn:aView with:aBuilder.
    ]
! !

!GraphColumnViewSpec methodsFor:'converting'!

skippedInLiteralEncoding
    "define the inst-slots which are skiped when generating a literalArrayEncoding"

    |l|

    l := super skippedInLiteralEncoding asOrderedCollection.

    zoomY             isNil ifTrue:[l add:#zoomY].
    windowSize        isNil ifTrue:[l add:#windowSize].
    graphOriginX      isNil ifTrue:[l add:#graphOriginX].
    references        isNil ifTrue:[l add:#references].
    referenceSelector isNil ifTrue:[l add:#referenceSelector].

    self showGrid ifFalse:[
	l add:#showGrid
    ].

    self scrollUpdatesOriginX ifFalse:[
	l add:#scrollUpdatesOriginX
    ].

    (self showDefaultMenu and:[menu isNil]) ifFalse:[
	l add:#showDefaultMenu
    ].

  ^ l




! !

!GraphColumnViewSpec methodsFor:'parsing a view'!

fromView:aView callBack:aBlock

    showGrid             := aView showGrid.
    showDefaultMenu      := aView showDefaultMenu.
    scrollUpdatesOriginX := aView scrollUpdatesOriginX.

    super fromView:aView callBack:aBlock


! !

!GraphColumnViewSpec methodsFor:'queries'!

defaultModelClassFor:someAspect
    "used by the UIPainters aspectGenerator
    "
    ^ someAspect == model ifTrue:[List] ifFalse:[ValueHolder]
! !

!GraphColumnViewSpec class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libwidg2/GraphColumnViewSpec.st,v 1.13 2008-01-10 13:00:55 cg Exp $'
! !

GraphColumnViewSpec initialize!