0
|
1 |
"{ Package: 'stx:goodies/xmlsuite/xsl-fo' }"
|
|
2 |
|
|
3 |
"{ NameSpace: FO }"
|
|
4 |
|
|
5 |
ContainerElement subclass:#Block
|
|
6 |
instanceVariableNames:''
|
|
7 |
classVariableNames:''
|
|
8 |
poolDictionaries:''
|
|
9 |
category:'FO'
|
|
10 |
!
|
|
11 |
|
|
12 |
|
|
13 |
!Block class methodsFor:'accessing'!
|
|
14 |
|
|
15 |
localName
|
|
16 |
"Superclass says that I am responsible to implement this method"
|
|
17 |
|
|
18 |
^'block'
|
|
19 |
|
|
20 |
"Created: / 07-04-2007 / 10:00:10 / janfrog"
|
|
21 |
! !
|
|
22 |
|
|
23 |
!Block methodsFor:'accessing - dimensions'!
|
|
24 |
|
|
25 |
preferredContentHeight
|
|
26 |
|
|
27 |
^self isTextOnlyBlock
|
|
28 |
ifTrue:
|
|
29 |
[self preferredTextHeight]
|
|
30 |
ifFalse:
|
|
31 |
[super preferredContentHeight]
|
|
32 |
|
|
33 |
"Created: / 07-04-2007 / 15:37:11 / janfrog"
|
|
34 |
!
|
|
35 |
|
|
36 |
preferredContentWidth
|
|
37 |
|
|
38 |
^self isTextOnlyBlock
|
|
39 |
ifTrue:
|
|
40 |
[self preferredTextWidth]
|
|
41 |
ifFalse:
|
|
42 |
[super preferredContentWidth]
|
|
43 |
|
|
44 |
"Created: / 07-04-2007 / 15:36:42 / janfrog"
|
|
45 |
!
|
|
46 |
|
|
47 |
preferredTextHeight
|
|
48 |
|
|
49 |
^self fontLineSkipPx
|
|
50 |
|
|
51 |
"Created: / 07-04-2007 / 15:37:32 / janfrog"
|
|
52 |
!
|
|
53 |
|
|
54 |
preferredTextWidth
|
|
55 |
|
|
56 |
^self font widthOf:self textContent
|
|
57 |
|
|
58 |
"Created: / 07-04-2007 / 15:37:52 / janfrog"
|
|
59 |
! !
|
|
60 |
|
|
61 |
!Block methodsFor:'accessing - font'!
|
|
62 |
|
|
63 |
font
|
|
64 |
|
|
65 |
^Font
|
|
66 |
family:self fontFamily
|
|
67 |
face:'medium'
|
|
68 |
style:'roman'
|
|
69 |
size:self fontSize
|
|
70 |
encoding:#'iso10646-1'
|
|
71 |
|
|
72 |
"Created: / 07-04-2007 / 10:26:36 / janfrog"
|
|
73 |
!
|
|
74 |
|
|
75 |
fontFamily
|
|
76 |
|
|
77 |
^self getStringProperty: 'font-family' ifAbsent:['helvetica']
|
|
78 |
|
|
79 |
"Created: / 07-04-2007 / 10:52:15 / janfrog"
|
|
80 |
!
|
|
81 |
|
|
82 |
fontLineSkipPx
|
|
83 |
|
|
84 |
^(self fontSize * 1.2) rounded
|
|
85 |
|
|
86 |
"Created: / 07-04-2007 / 11:00:29 / janfrog"
|
|
87 |
"Modified: / 08-04-2007 / 09:26:12 / janfrog"
|
|
88 |
!
|
|
89 |
|
|
90 |
fontSize
|
|
91 |
|
|
92 |
^self getIntegerProperty: 'font-size' ifAbsent:[12]
|
|
93 |
|
|
94 |
"Created: / 07-04-2007 / 10:51:14 / janfrog"
|
|
95 |
! !
|
|
96 |
|
|
97 |
!Block methodsFor:'layout computation'!
|
|
98 |
|
|
99 |
layoutChildren
|
|
100 |
|
|
101 |
self isContainerBlock ifTrue:[super layoutChildren]
|
|
102 |
|
|
103 |
"Created: / 07-04-2007 / 23:15:21 / janfrog"
|
|
104 |
! !
|
|
105 |
|
|
106 |
!Block methodsFor:'rendering'!
|
|
107 |
|
|
108 |
acceptRenderer: aRenderer
|
|
109 |
|
|
110 |
aRenderer renderBlock: self
|
|
111 |
|
|
112 |
"Created: / 07-04-2007 / 10:33:46 / janfrog"
|
|
113 |
! !
|
|
114 |
|
|
115 |
!Block methodsFor:'testing'!
|
|
116 |
|
|
117 |
isContainerBlock
|
|
118 |
|
|
119 |
^self childNodes allSatisfy:
|
|
120 |
[:child|child isElement or:[child isIgnorableText]]
|
|
121 |
|
|
122 |
"Created: / 07-04-2007 / 15:24:52 / janfrog"
|
|
123 |
!
|
|
124 |
|
|
125 |
isTextOnlyBlock
|
|
126 |
|
|
127 |
^self childNodes allSatisfy: [:child|child isElement not]
|
|
128 |
|
|
129 |
"Created: / 07-04-2007 / 15:24:30 / janfrog"
|
|
130 |
! !
|
|
131 |
|
|
132 |
!Block class methodsFor:'documentation'!
|
|
133 |
|
|
134 |
version
|
|
135 |
^ '$Header: /opt/data/cvs/stx/goodies/xmlsuite/xsl-fo/FO__Block.st,v 1.1 2007-04-13 15:40:23 vranyj1 Exp $'
|
|
136 |
! !
|