multivalent.node

Class LeafAscii

public class LeafAscii extends LeafText

Leaf subclass for ASCII. (Media adaptors often have their own Leaf subclass.)

Each word gets its own leaf. I used to think this was wasteful, as opposed to having a leaf per screen line, say, but if a word costs 50 bytes instead of 5, that just means that a 10,000 word page (which is big) costs 500K instead of 50K, and 100,000 words cost 5MB instead of 500K. No sweat for today's memory sizes.

Version: $Revision: 1.3 $ $Date: 2002/04/18 23:44:24 $

See Also: ASCII

Constructor Summary
LeafAscii(String name, Map<String,Object> attr, INode parent)
Method Summary
booleanformatNodeContent(Context cx, int start, int end)
Similar to paintNodeContent, set right font, measure with FontMetrics.stringString();
booleanpaintNodeContent(Context cx, int start, int end)
To paint content, set right font, use Graphics.drawString();

Constructor Detail

LeafAscii

public LeafAscii(String name, Map<String,Object> attr, INode parent)

Method Detail

formatNodeContent

public boolean formatNodeContent(Context cx, int start, int end)
Similar to paintNodeContent, set right font, measure with FontMetrics.stringString();

paintNodeContent

public boolean paintNodeContent(Context cx, int start, int end)
To paint content, set right font, use Graphics.drawString();