index xrefs 2006/08/08 17:41:29

ChemoJunSerialNumberSetting

ChemoJun050 (2006/08/08) Copyright 2002-2006 National Institute of Informatics, Research Organization of Information and Systems.

category:

inheritance:

instance variables:

class instance variables:

class variables:

pool variables:

instance methods:

  1. allFalse [testing] xrefs
    	^self carbon ~= true and: 
    			[self oxygen ~= true and: 
    					[self nitrogen ~= true 
    						and: [self hydrogen ~= true and: [self others ~= true]]]]
  2. allTrue [testing] xrefs
    	^self carbon = true and: 
    			[self oxygen = true and: 
    					[self nitrogen = true and: [self hydrogen = true and: [self others = true]]]]
  3. asSettingArray [converting] xrefs
    	| aCollection |
    	aCollection := OrderedCollection new.
    	aCollection add: #carbon: -> self carbon.
    	aCollection add: #oxygen: -> self oxygen.
    	aCollection add: #nitrogen: -> self nitrogen.
    	aCollection add: #hydrogen: -> self hydrogen.
    	aCollection add: #others: -> self others.
    	^aCollection asArray
  4. carbon [accessing] xrefs
    	^self carbonValueHolder value
  5. carbon: aBoolean [accessing] xrefs
     
    	^self carbonValueHolder value: aBoolean = true
  6. carbonValueHolder [aspects] xrefs
    	carbonValueHolder ifNil: 
    			[carbonValueHolder := ValueHolder with: true.
    			carbonValueHolder 
    				compute: [:value | self expressionValueHolder value: self computeExpression]].
    	^carbonValueHolder
  7. compute: aBlock [constructing] xrefs
     
    	self expressionValueHolder compute: aBlock
  8. computeExpression [private] xrefs
    	| aStream |
    	aStream := String new writeStream.
    	aStream nextPutAll: '[:index :atom | '.
    	self allTrue 
    		ifTrue: [aStream nextPutAll: 'true']
    		ifFalse: 
    			[self allFalse 
    				ifTrue: [aStream nextPutAll: 'false']
    				ifFalse: 
    					[self carbon 
    						ifTrue: [aStream nextPutAll: '(atom = ''C'')']
    						ifFalse: [aStream nextPutAll: '(false)'].
    					aStream nextPutAll: ' | '.
    					self oxygen 
    						ifTrue: [aStream nextPutAll: '(atom = ''O'')']
    						ifFalse: [aStream nextPutAll: '(false)'].
    					aStream nextPutAll: ' | '.
    					self nitrogen 
    						ifTrue: [aStream nextPutAll: '(atom = ''N'')']
    						ifFalse: [aStream nextPutAll: '(false)'].
    					aStream nextPutAll: ' | '.
    					self hydrogen 
    						ifTrue: [aStream nextPutAll: '(atom = ''H'')']
    						ifFalse: [aStream nextPutAll: '(false)'].
    					aStream nextPutAll: ' | '.
    					self others 
    						ifTrue: 
    							[aStream 
    								nextPutAll: '((atom ~= ''C'') & (atom ~= ''O'') & (atom ~= ''N'') & (atom ~= ''H''))']
    						ifFalse: [aStream nextPutAll: '(false)']]].
    	aStream nextPutAll: ']'.
    	^aStream contents
  9. expression [accessing] xrefs
    	^self expressionValueHolder value
  10. expressionValueHolder [aspects] xrefs
    	expressionValueHolder 
    		ifNil: [expressionValueHolder := ValueHolder with: self computeExpression].
    	^expressionValueHolder
  11. getWindow [private] xrefs
    	^(ScheduledControllers scheduledControllers 
    		detect: [:controller | controller model == self]
    		ifNone: [nil]) ifNil: [nil] ifNotNil: [:it | it view]
  12. hydrogen [accessing] xrefs
    	^self hydrogenValueHolder value
  13. hydrogen: aBoolean [accessing] xrefs
     
    	^self hydrogenValueHolder value: aBoolean = true
  14. hydrogenValueHolder [aspects] xrefs
    	hydrogenValueHolder ifNil: 
    			[hydrogenValueHolder := ValueHolder with: false.
    			hydrogenValueHolder 
    				compute: [:value | self expressionValueHolder value: self computeExpression]].
    	^hydrogenValueHolder
  15. initialize [initialize-release] xrefs
    	super initialize.
    	carbonValueHolder := nil.
    	oxygenValueHolder := nil.
    	nitrogenValueHolder := nil.
    	hydrogenValueHolder := nil.
    	othersValueHolder := nil.
    	expressionValueHolder := nil
  16. nitrogen [accessing] xrefs
    	^self nitrogenValueHolder value
  17. nitrogen: aBoolean [accessing] xrefs
     
    	^self nitrogenValueHolder value: aBoolean = true
  18. nitrogenValueHolder [aspects] xrefs
    	nitrogenValueHolder ifNil: 
    			[nitrogenValueHolder := ValueHolder with: true.
    			nitrogenValueHolder 
    				compute: [:value | self expressionValueHolder value: self computeExpression]].
    	^nitrogenValueHolder
  19. others [accessing] xrefs
    	^self othersValueHolder value
  20. others: aBoolean [accessing] xrefs
     
    	^self othersValueHolder value: aBoolean = true
  21. othersValueHolder [aspects] xrefs
    	othersValueHolder ifNil: 
    			[othersValueHolder := ValueHolder with: true.
    			othersValueHolder 
    				compute: [:value | self expressionValueHolder value: self computeExpression]].
    	^othersValueHolder
  22. oxygen [accessing] xrefs
    	^self oxygenValueHolder value
  23. oxygen: aBoolean [accessing] xrefs
     
    	^self oxygenValueHolder value: aBoolean = true
  24. oxygenValueHolder [aspects] xrefs
    	oxygenValueHolder ifNil: 
    			[oxygenValueHolder := ValueHolder with: true.
    			oxygenValueHolder 
    				compute: [:value | self expressionValueHolder value: self computeExpression]].
    	^oxygenValueHolder
  25. setting [accessing] xrefs
    	| aCollection |
    	aCollection := OrderedCollection new: 5.
    	aCollection add: #carbon: -> self carbon.
    	aCollection add: #oxygen: -> self oxygen.
    	aCollection add: #nitrogen: -> self nitrogen.
    	aCollection add: #hydrogen: -> self hydrogen.
    	aCollection add: #others: -> self others.
    	^aCollection
  26. setting: settingCollection [accessing] xrefs
     
    	settingCollection do: 
    			[:anAssociation | 
    			| aSelector aBoolean |
    			aSelector := anAssociation key asSymbol.
    			aBoolean := anAssociation value = true.
    			self perform: aSelector with: aBoolean]

class methods:

  1. copyright [copyright] xrefs
    	^'ChemoJun050 (2006/08/08) Copyright 2002-2006 National Institute of Informatics, Research Organization of Information and Systems.'
  2. example1 [examples] xrefs
    	"ChemoJunSerialNumberSetting example1."
    
    	| serialNumberSetting |
    	serialNumberSetting := ChemoJunSerialNumberSetting new.
    	serialNumberSetting open.
    	^serialNumberSetting
  3. example2 [examples] xrefs
    	"ChemoJunSerialNumberSetting example2."
    
    	| serialNumberSetting |
    	serialNumberSetting := ChemoJunSerialNumberSetting new.
    	serialNumberSetting compute: 
    			[:expression | 
    			Transcript
    				cr;
    				show: expression].
    	serialNumberSetting open.
    	^serialNumberSetting
  4. example3 [examples] xrefs
    	"ChemoJunSerialNumberSetting example3."
    
    	| settingCollection serialNumberSetting |
    	settingCollection := OrderedCollection new.
    	settingCollection add: #carbon: -> true.
    	settingCollection add: #oxygen: -> false.
    	settingCollection add: #nitrogen: -> false.
    	settingCollection add: #hydrogen: -> false.
    	settingCollection add: #others: -> false.
    	serialNumberSetting := ChemoJunSerialNumberSetting 
    				setting: settingCollection.
    	serialNumberSetting compute: 
    			[:expression | 
    			Transcript
    				cr;
    				show: expression].
    	serialNumberSetting open.
    	^serialNumberSetting
  5. setting: settingCollection [instance creation] xrefs
     
    	^(self new)
    		setting: settingCollection;
    		yourself
  6. system [copyright] xrefs
    	^'ChemoJun'
  7. version [copyright] xrefs
    	^'050'
  8. windowSpec [interface specs] xrefs
    	"Tools.UIPainter new openOnClass: self andSelector: #windowSpec"
    
    	<resource: #canvas>
    	^#(#{UI.FullSpec} 
    		#window: 
    		#(#{UI.WindowSpec} 
    			#label: 
    			#(#{Kernel.UserMessage} 
    				#key: #chemoJun_Serial_Number_Setting 
    				#defaultString: 'Serial Number Setting' ) 
    			#min: #(#{Core.Point} 144 144 ) 
    			#max: #(#{Core.Point} 144 144 ) 
    			#bounds: #(#{Graphics.Rectangle} 700 525 844 669 ) ) 
    		#component: 
    		#(#{UI.SpecCollection} 
    			#collection: #(
    				#(#{UI.CheckBoxSpec} 
    					#layout: #(#{Core.Point} 32 16 ) 
    					#name: #carbonCheckBox 
    					#model: #carbonValueHolder 
    					#label: 
    					#(#{Kernel.UserMessage} 
    						#key: #chemoJun_carbon 
    						#defaultString: 'carbon' ) 
    					#style: #default ) 
    				#(#{UI.CheckBoxSpec} 
    					#layout: #(#{Core.Point} 32 40 ) 
    					#name: #oxygenCheckBox 
    					#model: #oxygenValueHolder 
    					#label: 
    					#(#{Kernel.UserMessage} 
    						#key: #chemoJun_oxygen 
    						#defaultString: 'oxygen' ) 
    					#style: #default ) 
    				#(#{UI.CheckBoxSpec} 
    					#layout: #(#{Core.Point} 32 64 ) 
    					#name: #nitrogenCheckBox 
    					#model: #nitrogenValueHolder 
    					#label: 
    					#(#{Kernel.UserMessage} 
    						#key: #chemoJun_nitrogen 
    						#defaultString: 'nitrogen' ) 
    					#style: #default ) 
    				#(#{UI.CheckBoxSpec} 
    					#layout: #(#{Core.Point} 32 88 ) 
    					#name: #hydrogenCheckBox 
    					#model: #hydrogenValueHolder 
    					#label: 
    					#(#{Kernel.UserMessage} 
    						#key: #chemoJun_hydrogen 
    						#defaultString: 'hydrogen' ) 
    					#style: #default ) 
    				#(#{UI.CheckBoxSpec} 
    					#layout: #(#{Core.Point} 32 112 ) 
    					#name: #othersCheckBox 
    					#model: #othersValueHolder 
    					#label: 
    					#(#{Kernel.UserMessage} 
    						#key: #chemoJun_others 
    						#defaultString: 'others' ) 
    					#style: #default ) ) ) )

index xrefs