Java Doc for CalloutEmitter.java in  » J2EE » enhydra » com » nwalsh » saxon » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » enhydra » com.nwalsh.saxon 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.nwalsh.saxon.CopyEmitter
   com.nwalsh.saxon.CalloutEmitter

CalloutEmitter
public class CalloutEmitter extends CopyEmitter (Code)

Saxon extension to decorate a result tree fragment with callouts.

$Id: CalloutEmitter.java,v 1.4 2005-08-30 08:14:58 draganr Exp $

Copyright (C) 2000 Norman Walsh.

This class provides the guts of a Saxon 6.* implementation of callouts for verbatim environments. (It is used by the Verbatim class.)

The general design is this: the stylesheets construct a result tree fragment for some verbatim environment. The Verbatim class initializes a CalloutEmitter with information about the callouts that should be applied to the verbatim environment in question. Then the result tree fragment is "replayed" through the CalloutEmitter; the CalloutEmitter builds a new result tree fragment from this event stream, decorated with callouts, and that is returned.

Change Log:

1.0

Initial release.


See Also:   Verbatim
author:
   Norman Walsh
author:
   ndw@nwalsh.com
version:
   $Id: CalloutEmitter.java,v 1.4 2005-08-30 08:14:58 draganr Exp $


Field Summary
protected  intdefaultColumn
     The default column for callouts that specify only a line.
protected  StackelementStack
     A stack for the preserving information about open elements.
protected  booleanfirstElement
    
protected  booleanfoStylesheet
    
protected static  StringfoURI
     The FO namespace name.
protected  StacktempStack
     A stack for holding information about temporarily closed elements.
protected static  StringxhURI
     The XHTML namespace name.

Constructor Summary
public  CalloutEmitter(Controller controller, NamePool namePool, int defaultColumn, boolean foStylesheet, FormatCallout fCallout)
    

Method Summary
protected  voidaddCallout(int coNum, Node node, int defaultColumn)
    

Add a callout to the global callout array

This method examines a callout area and adds it to the global callout array if it can be interpreted.

Only the linecolumn and linerange units are supported.

public  voidcharacters(char[] chars, int start, int len)
     Process characters.
public  voidendElement(int nameCode)
     Process end element events.
protected  voidformatPad(int numBlanks)
    

Add blanks to the result tree fragment.

This method adds numBlanks to the result tree fragment.

public  voidsetupCallouts(NodeList areaspecNodeList)
    
protected  booleanskipThisElement(int nameCode)
    

Protect the outer-most block wrapper.

Open elements in the result tree fragment are closed and reopened around callouts (so that callouts don't appear inside links or other environments).

public  voidstartElement(int nameCode, org.xml.sax.Attributes attributes, int[] namespaces, int nscount)
     Process start element events.

Field Detail
defaultColumn
protected int defaultColumn(Code)
The default column for callouts that specify only a line.



elementStack
protected Stack elementStack(Code)
A stack for the preserving information about open elements.



firstElement
protected boolean firstElement(Code)
Is the next element absolutely the first element in the fragment?



foStylesheet
protected boolean foStylesheet(Code)
Is the stylesheet currently running an FO stylesheet?



foURI
protected static String foURI(Code)
The FO namespace name.



tempStack
protected Stack tempStack(Code)
A stack for holding information about temporarily closed elements.



xhURI
protected static String xhURI(Code)
The XHTML namespace name.




Constructor Detail
CalloutEmitter
public CalloutEmitter(Controller controller, NamePool namePool, int defaultColumn, boolean foStylesheet, FormatCallout fCallout)(Code)

Constructor for the CalloutEmitter.


Parameters:
  namePool - The name pool to use for constructing elements and attributes.
Parameters:
  graphicsPath - The path to callout number graphics.
Parameters:
  graphicsExt - The extension for callout number graphics.
Parameters:
  graphicsMax - The largest callout number that can be represented as a graphic.
Parameters:
  defaultColumn - The default column for callouts.
Parameters:
  foStylesheet - Is this an FO stylesheet?




Method Detail
addCallout
protected void addCallout(int coNum, Node node, int defaultColumn)(Code)

Add a callout to the global callout array

This method examines a callout area and adds it to the global callout array if it can be interpreted.

Only the linecolumn and linerange units are supported. If no unit is specifed, linecolumn is assumed. If only a line is specified, the callout decoration appears in the defaultColumn.


Parameters:
  coNum - The callout number.
Parameters:
  node - The area.
Parameters:
  defaultColumn - The default column for callouts.



characters
public void characters(char[] chars, int start, int len) throws TransformerException(Code)
Process characters.



endElement
public void endElement(int nameCode) throws TransformerException(Code)
Process end element events.



formatPad
protected void formatPad(int numBlanks)(Code)

Add blanks to the result tree fragment.

This method adds numBlanks to the result tree fragment. It's used to pad lines when callouts occur after the last existing characater in a line.


Parameters:
  numBlanks - The number of blanks to add.



setupCallouts
public void setupCallouts(NodeList areaspecNodeList)(Code)

Examine the areaspec and determine the number and position of callouts.

The areaspecNodeSet is examined and a sorted list of the callouts is constructed.

This data structure is used to augment the result tree fragment with callout bullets.


Parameters:
  areaspecNodeSet - The source document <areaspec> element.



skipThisElement
protected boolean skipThisElement(int nameCode)(Code)

Protect the outer-most block wrapper.

Open elements in the result tree fragment are closed and reopened around callouts (so that callouts don't appear inside links or other environments). But if the result tree fragment is a single block (a div or pre in HTML, an fo:block in FO), that outer-most block is treated specially.

This method returns true if the element in question is that outermost block.


Parameters:
  nameCode - The name code for the element True if the element is the outer-most block, false otherwise.



startElement
public void startElement(int nameCode, org.xml.sax.Attributes attributes, int[] namespaces, int nscount) throws TransformerException(Code)
Process start element events.



Fields inherited from com.nwalsh.saxon.CopyEmitter
protected NamePool namePool(Code)(Java Doc)
protected FragmentValue rtf(Code)(Java Doc)
protected Emitter rtfEmitter(Code)(Java Doc)

Methods inherited from com.nwalsh.saxon.CopyEmitter
public void characters(char[] chars, int start, int len) throws TransformerException(Code)(Java Doc)
public void comment(char[] chars, int start, int length) throws TransformerException(Code)(Java Doc)
public void endDocument() throws TransformerException(Code)(Java Doc)
public void endElement(int nameCode) throws TransformerException(Code)(Java Doc)
public FragmentValue getResultTreeFragment()(Code)(Java Doc)
public void processingInstruction(java.lang.String name, java.lang.String data) throws TransformerException(Code)(Java Doc)
public void setDocumentLocator(org.xml.sax.Locator locator)(Code)(Java Doc)
public void setEscaping(boolean escaping) throws TransformerException(Code)(Java Doc)
public void setNamePool(NamePool namePool)(Code)(Java Doc)
public void setUnparsedEntity(java.lang.String name, java.lang.String uri) throws TransformerException(Code)(Java Doc)
public void setWriter(java.io.Writer writer)(Code)(Java Doc)
public void startDocument() throws TransformerException(Code)(Java Doc)
public void startElement(int nameCode, org.xml.sax.Attributes attributes, int[] namespaces, int nscount) throws TransformerException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.