Nicolas Cellier uploaded a new version of Nebraska to project The Trunk:
http://source.squeak.org/trunk/Nebraska-nice.29.mcz
==================== Summary ====================
Name: Nebraska-nice.29
Author: nice
Time: 27 March 2010, 11:16:50.444 pm
UUID: 5a54f14c-e0b0-014b-8b3e-961ed20e8bb9
Ancestors: Nebraska-nice.28
Remove a _ assignment from a class comment
=============== Diff against Nebraska-nice.28 ===============
Item was changed:
Object subclass: #CanvasEncoder
instanceVariableNames: 'connection lastClipRect lastTransform fontCache cachedObjects cachingEnabled'
classVariableNames: 'SentTypesAndSizes SimpleCounters'
poolDictionaries: ''
category: 'Nebraska-Morphic-Remote'!
+ !CanvasEncoder commentStamp: 'nice 3/24/2010 07:40' prior: 0!
- !CanvasEncoder commentStamp: '<historical>' prior: 0!
Encodes canvas commands into string-arrays format.
---possible further compression for forms ---
600 * 359 * 4 861600
self encodeForRemoteCanvas size 76063
Time millisecondsToRun: [self encodeForRemoteCanvas]
| raw data |
+ data := self encodeForRemoteCanvas.
+ raw := RWBinaryOrTextStream on: (String new: 1000).
- data _ self encodeForRemoteCanvas.
- raw _ RWBinaryOrTextStream on: (String new: 1000).
Time millisecondsToRun: [(GZipWriteStream on: raw) nextPutAll: data; close].
raw contents size
(GZipReadStream on: (ReadStream on: raw contents)) upToEnd size
| raw |
+ raw := RWBinaryOrTextStream on: (String new: bits size).
- raw _ RWBinaryOrTextStream on: (String new: bits size).
raw nextPutAll: bits
Time millisecondsToRun: [bits compressGZip] 50
bits compressGZip size 861620!
Nicolas Cellier uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-nice.399.mcz
==================== Summary ====================
Name: Morphic-nice.399
Author: nice
Time: 27 March 2010, 11:08:14.17 pm
UUID: 627b1685-8c63-354e-abbc-16c45dc4133d
Ancestors: Morphic-tfel.398
Fix an _ assignment in class comment
=============== Diff against Morphic-tfel.398 ===============
Item was changed:
RectangleMorph subclass: #TextMorph
instanceVariableNames: 'textStyle text wrapFlag paragraph editor container predecessor successor backgroundColor margins editHistory'
classVariableNames: 'CaretForm DefaultEditorClass'
poolDictionaries: ''
category: 'Morphic-Basic'!
+ !TextMorph commentStamp: 'nice 3/24/2010 07:40' prior: 0!
- !TextMorph commentStamp: 'sd 2/20/2004 23:25' prior: 0!
TextMorphs support display of text with emphasis. They also support reasonable text-editing capabilities, as well as embedded hot links, and the ability to embed submorphs in the text.
Late in life, TextMorph was made a subclass of BorderedMorph to provide border and background color if desired. In order to keep things compatible, protocols have been redirected so that color (preferably textColor) relates to the text, and backgroundColor relates to the inner fill color.
Text display is clipped to the innerBounds of the rectangle, and text composition is normally performed within a rectangle which is innerBounds inset by the margins parameter.
If text has been embedded in another object, one can elect to fill the owner's shape, in which case the text will be laid out in the shape of the owner's shadow image (including any submorphs other than the text). One can also elect to have the text avoid occlusions, in which case it will avoid the bounds of any sibling morphs that appear in front of it. It may be necessary to update bounds in order for the text runaround to notice the presence of a new occluding shape.
The optional autoFitContents property enables the following feature: if the text contents changes, then the bounds of the morph will be adjusted to fit the minimum rectangle that encloses the text (plus any margins specified). Similarly, any attempt to change the size of the morph will be resisted if this parameter is set. Except...
If the wrapFlag parameter is true, then text will be wrapped at word boundaries based on the composition width (innerBounds insetBy: margins) width. Thus an attempt to resize the morph in autofit mode, if it changes the width, will cause the text to be recomposed with the new width, and then the bounds will be reset to the minimum enclosing rectangle. Similarly, if the text contents are changed with the wrapFlag set to true, word wrap will be performed based on the current compostion width, after which the bounds will be set (or not), based on the autoFitcontents property.
Note that fonts can only be applied to the TextMorph as a whole. While you can change the size, color, and emphasis of a subsection of the text and have it apply to only that subsection, changing the font changes the font for the entire contents of the TextMorph.
Still a TextMorph can be composed of several texts of different fonts
| font1 font2 t1 t2 tMorph|
+ tMorph := TextMorph new.
+ font1 := (TextFontReference toFont: (StrikeFont familyName: 'Atlanta' size: 22)).
+ font2 := (TextFontReference toFont: (StrikeFont familyName: 'Atlanta' size: 11)).
+ t1 := 'this is font1' asText addAttribute: font1.
+ t2 := ' and this is font2' asText addAttribute: font2.
- tMorph _ TextMorph new.
- font1 _ (TextFontReference toFont: (StrikeFont familyName: 'Atlanta' size: 22)).
- font2 _ (TextFontReference toFont: (StrikeFont familyName: 'Atlanta' size: 11)).
- t1 _ 'this is font1' asText addAttribute: font1.
- t2 _ ' and this is font2' asText addAttribute: font2.
tMorph contents: (t1,t2).
tMorph openInHand.
Yet to do:
Make a comprehensive control for the eyedropper, with border width and color, inner color and text color, and margin widths.!
Item was changed:
SimpleBorder subclass: #ComplexBorder
instanceVariableNames: 'style colors lineStyles'
classVariableNames: ''
poolDictionaries: ''
category: 'Morphic-Borders'!
+ !ComplexBorder commentStamp: 'nice 3/24/2010 07:36' prior: 0!
- !ComplexBorder commentStamp: 'kfr 10/27/2003 10:18' prior: 0!
see BorderedMorph.
+ poly := polygon250
- poly _ polygon250
+ baseColor := Color blue twiceLighter.
+ border := (ComplexBorder framed: 10) baseColor: poly color.
- baseColor _ Color blue twiceLighter.
- border _ (ComplexBorder framed: 10) baseColor: poly color.
border frameRectangle: ((100@100 extent: 200@200) insetBy: -5) on: Display getCanvas.
+ baseColor := Color red twiceLighter.
+ border := (ComplexBorder framed: 10) baseColor: baseColor.
- baseColor _ Color red twiceLighter.
- border _ (ComplexBorder framed: 10) baseColor: baseColor.
border drawPolygon: {100@100. 300@100. 300@300. 100@300} on: Display getCanvas.
border drawPolyPatchFrom: 100@200 via: 100@100 via: 200@100 to: 200@200 on: Display getCanvas.
border drawPolyPatchFrom: 100@100 via: 200@100 via: 200@200 to: 100@200 on: Display getCanvas.
border drawPolyPatchFrom: 200@100 via: 200@200 via: 100@200 to: 100@100 on: Display getCanvas.
border drawPolyPatchFrom: 200@200 via: 100@200 via: 100@100 to: 200@100 on: Display getCanvas.
+ border := (ComplexBorder raised: 10) baseColor: poly color.
- border _ (ComplexBorder raised: 10) baseColor: poly color.
border drawPolygon: poly getVertices on: Display getCanvas
360 / 16.0 22.5
+ points := (0 to: 15) collect:[:i| (Point r: 100 degrees: i*22.5) + 200].
- points _ (0 to: 15) collect:[:i| (Point r: 100 degrees: i*22.5) + 200].
Display getCanvas fillOval: (100@100 extent: 200@200) color: baseColor.
border drawPolygon: points on: Display getCanvas.
-1 to: points size + 1 do:[:i|
border drawPolyPatchFrom: (points atWrap: i) via: (points atWrap: i+1) via: (points atWrap: i+2) to: (points atWrap: i+3) on: Display getCanvas.
].
Display getCanvas fillOval: (100@100 extent: 200@200) color: baseColor.
0 to: 36 do:[:i|
border drawLineFrom: (Point r: 100 degrees: i*10) + 200 to: (Point r: 100 degrees: i+1*10) + 200
on: Display getCanvas.
].
drawPolygon:
Point r: 1.0 degrees: 10
MessageTally spyOn:[
Display deferUpdates: true.
+ t1 := [1 to: 1000 do:[:i|
- t1 _ [1 to: 1000 do:[:i|
border drawLineFrom: (100@100) to: (300@100) on: Display getCanvas.
border drawLineFrom: (300@100) to: (300@300) on: Display getCanvas.
border drawLineFrom: (300@300) to: (100@300) on: Display getCanvas.
border drawLineFrom: (100@300) to: (100@100) on: Display getCanvas]] timeToRun.
Display deferUpdates: false.
].
MessageTally spyOn:[
Display deferUpdates: true.
+ t2 := [1 to: 1000 do:[:i|
- t2 _ [1 to: 1000 do:[:i|
border drawLine2From: (100@100) to: (300@100) on: Display getCanvas.
border drawLine2From: (300@100) to: (300@300) on: Display getCanvas.
border drawLine2From: (300@300) to: (100@300) on: Display getCanvas.
border drawLine2From: (100@300) to: (100@100) on: Display getCanvas]] timeToRun.
Display deferUpdates: false.
].
!
Nicolas Cellier uploaded a new version of Files to project The Trunk:
http://source.squeak.org/trunk/Files-nice.79.mcz
==================== Summary ====================
Name: Files-nice.79
Author: nice
Time: 27 March 2010, 10:58:18.301 pm
UUID: 1a2f808c-0bf0-504b-abba-4607dec810b2
Ancestors: Files-ul.78
Fix an _ in comment
=============== Diff against Files-ul.78 ===============
Item was changed:
ReadWriteStream subclass: #CompressedSourceStream
instanceVariableNames: 'segmentFile segmentSize nSegments segmentTable segmentIndex dirty endOfFile'
classVariableNames: ''
poolDictionaries: ''
category: 'Files-System'!
+ !CompressedSourceStream commentStamp: 'nice 3/24/2010 07:36' prior: 0!
- !CompressedSourceStream commentStamp: 'di 11/3/2003 17:58' prior: 0!
I implement a file format that compresses segment by segment to allow incremental writing and browsing. Note that the file can only be written at the end.
Structure:
segmentFile The actual compressed file.
segmentSize This is the quantum of compression. The virtual file is sliced up
into segments of this size.
nSegments The maximum number of segments to which this file can be grown.
endOfFile The user's endOfFile pointer.
segmentTable When a file is open, this table holds the physical file positions
of the compressed segments.
segmentIndex Index of the most recently accessed segment.
Inherited from ReadWriteStream...
collection The segment buffer, uncompressed
position This is the position *local* to the current segment buffer
readLimit ReadLimit for the current buffer
writeLimit WriteLimit for the current buffer
Great care must be exercised to distinguish between the position relative to the segment buffer and the full file position (and, or course, the segment file position ;-).
The implementation defaults to a buffer size of 20k, and a max file size of 34MB (conveniently chosen to be greater than the current 33MB limit of source code pointers). The format of the file is as follows:
segmentSize 4 bytes
nSegments 4 bytes
endOfFile 4 bytes
segmentTable 4 bytes * (nSegments+1)
beginning of first compressed segment
It is possible to override the default allocation by sending the message #segmentSize:nSegments: immediately after opening a new file for writing, as follows:
+ bigFile := (CompressedSourceStream on: (FileStream newFileNamed: 'biggy.stc'))
- bigFile _ (CompressedSourceStream on: (FileStream newFileNamed: 'biggy.stc'))
segmentSize: 50000 maxSize: 200000000
The difference between segment table entries reveals the size of each compressed segment. When a file is being written, it may lack the final segment, but any flush, position:, or close will force a dirty segment to be written.!
>I'll try to fix anything people might find wrong/not configurable
>enough with it.
The buttons look nice, but two buttons disappear when you deselect
the window by selecting another
Bye
T.
--
Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser