-
attributeTable [attribute accessing]
attributeTable isNil ifTrue: [attributeTable := JunAttributeTable new].
^attributeTable
-
bondType [accessing]
bondType isNil ifTrue: [bondType := self defaultBondType].
^bondType
-
bondType: aNumber [accessing]
aNumber isNil
ifTrue: [bondType := self defaultBondType]
ifFalse: [bondType := aNumber]
-
bondTypeSymbol [accessing]
self bondType = 1 ifTrue: [^#single].
self bondType = 2 ifTrue: [^#double].
self bondType = 3 ifTrue: [^#triple].
self bondType = 4 ifTrue: [^#aromatic].
self bondType = 5 ifTrue: [^#single].
self bondType = 6 ifTrue: [^#single].
self bondType = 7 ifTrue: [^#single].
self bondType = 8 ifTrue: [^#none].
^#unknown
-
connectionColor [attribute accessing]
^self attributeTable at: #connectionColor
ifAbsent: [self defaultConnectionColor]
-
connectionColor: colorValue [attribute accessing]
colorValue ifNil: [self attributeTable removeKey: #connectionColor]
ifNotNil: [:it | self attributeTable at: #connectionColor put: it]
-
defaultBondType [defaults]
^1
-
defaultConnectionColor [defaults]
^ColorValue veryDarkGray
-
defaultFromAtom [defaults]
^self class defaultAtomObjectClass new
-
defaultStereoType [defaults]
^0
-
defaultToAtom [defaults]
^self class defaultAtomObjectClass new
-
fromAtom [accessing]
fromAtom isNil ifTrue: [fromAtom := self defaultFromAtom].
^fromAtom
-
fromAtom: atomObject [accessing]
atomObject isNil
ifTrue: [fromAtom := self defaultFromAtom]
ifFalse: [fromAtom := atomObject]
-
hasConnectionColor [testing]
^self attributeTable includesKey: #connectionColor
-
initialize [initialize-release]
super initialize.
fromAtom := nil.
toAtom := nil.
bondType := nil.
stereoType := nil.
attributeTable := nil
-
isAromatic [testing]
^self bondType = 4
-
isDouble [testing]
^self bondType = 2
-
isSingle [testing]
^self bondType = 1
-
isTriple [testing]
^self bondType = 3
-
postCopy [copying]
super postCopy.
attributeTable := attributeTable copy
"You must copy fromAtom and toAtom."
-
printOn: aStream [printing]
aStream nextPutAll: '('.
aStream nextPutAll: self fromAtom printString.
aStream space.
aStream nextPutAll: self toAtom printString.
aStream space.
aStream nextPutAll: self bondTypeSymbol printString.
aStream space.
aStream nextPutAll: self stereoTypeSymbol printString.
aStream nextPutAll: ')'
-
stereoType [accessing]
stereoType isNil ifTrue: [stereoType := self defaultStereoType].
^stereoType
-
stereoType: aNumber [accessing]
aNumber isNil
ifTrue: [stereoType := self defaultBondType]
ifFalse: [stereoType := aNumber]
-
stereoTypeSymbol [accessing]
self stereoType = 0 ifTrue: [^#none].
self stereoType = 1 ifTrue: [^#up].
self stereoType = 4 ifTrue: [^#either].
self stereoType = 6 ifTrue: [^#down].
^#unknown
-
toAtom [accessing]
toAtom isNil ifTrue: [toAtom := self defaultToAtom].
^toAtom
-
toAtom: atomObject [accessing]
atomObject isNil
ifTrue: [toAtom := self defaultToAtom]
ifFalse: [toAtom := atomObject]