Java Doc for Table.java in  » J2EE » enhydra » com » nwalsh » xalan » 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.xalan 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.nwalsh.xalan.Table

Table
public class Table (Code)

Xalan extensions supporting Tables

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

Copyright (C) 2000 Norman Walsh.

This class provides a Xalan implementation of some code to adjust CALS Tables to HTML Tables.

Column Widths

The adjustColumnWidths method takes a result tree fragment (assumed to contain the colgroup of an HTML Table) and returns the result tree fragment with the column widths adjusted to HTML terms.

Convert Lengths

The convertLength method takes a length specification of the form 9999.99xx (where "xx" is a unit) and returns that length as an integral number of pixels. For convenience, percentage lengths are returned unchanged.

The recognized units are: inches (in), centimeters (cm), millimeters (mm), picas (pc, 1pc=12pt), points (pt), and pixels (px). A number with no units is assumed to be pixels.

Change Log:

1.0

Initial release.


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


Field Summary
protected static  StringfoURI
     The FO namespace name.
protected static  HashtableunitHash
     The hash used to associate units with a length in pixels.

Constructor Summary
public  Table()
    

Method Summary
public  DocumentFragmentadjustColumnWidths(ExpressionContext context, NodeIterator xalanNI)
    

Adjust column widths in an HTML table.

The specification of column widths in CALS (a relative width plus an optional absolute width) are incompatible with HTML column widths.

public static  intconvertLength(String length)
    
protected  String[]correctRoundingError(String widths)
     Correct rounding errors introduced in calculating the width of each column.
public  intgetPixelsPerInch()
     Return the current pixels-per-inch value.
protected static  voidinitializeHash()
     Initialize the internal hash table with proper values.
public static  voidsetPixelsPerInch(int value)
     Set the pixels-per-inch value.

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



unitHash
protected static Hashtable unitHash(Code)
The hash used to associate units with a length in pixels.




Constructor Detail
Table
public Table()(Code)

Constructor for Verbatim

All of the methods are static, so the constructor does nothing.





Method Detail
adjustColumnWidths
public DocumentFragment adjustColumnWidths(ExpressionContext context, NodeIterator xalanNI)(Code)

Adjust column widths in an HTML table.

The specification of column widths in CALS (a relative width plus an optional absolute width) are incompatible with HTML column widths. This method adjusts CALS column width specifiers in an attempt to produce equivalent HTML specifiers.

In order for this method to work, the CALS width specifications should be placed in the "width" attribute of the <col>s within a <colgroup>. Then the colgroup result tree fragment is passed to this method.

This method makes use of two parameters from the XSL stylesheet that calls it: nominal.table.width and table.width. The value of nominal.table.width must be an absolute distance. The value of table.width can be either absolute or relative.

Presented with a mixture of relative and absolute lengths, the table width is used to calculate appropriate values. If the table.width is relative, the nominal width is used for this calculation.

There are three possible combinations of values:

  1. There are no relative widths; in this case the absolute widths are used in the HTML table.
  2. There are no absolute widths; in this case the relative widths are used in the HTML table.
  3. There are a mixture of absolute and relative widths:
    1. If the table width is absolute, all widths become absolute.
    2. If the table width is relative, make all the widths absolute relative to the nominal table width then turn them all back into relative widths.

Parameters:
  context - The stylesheet context; supplied automatically by Xalan
Parameters:
  rtf - The result tree fragment containing the colgroup. The result tree fragment containing the adjusted colgroup.



convertLength
public static int convertLength(String length)(Code)

Convert a length specification to a number of pixels.

The specified length should be of the form [+/-]999.99xx, where xx is a valid unit.




correctRoundingError
protected String[] correctRoundingError(String widths)(Code)
Correct rounding errors introduced in calculating the width of each column. Make sure they sum to 100% in the end.



getPixelsPerInch
public int getPixelsPerInch()(Code)
Return the current pixels-per-inch value.



initializeHash
protected static void initializeHash()(Code)
Initialize the internal hash table with proper values.



setPixelsPerInch
public static void setPixelsPerInch(int value)(Code)
Set the pixels-per-inch value. Only positive values are legal.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.