From seam-commits at lists.jboss.org Mon Jan 28 18:40:13 2008
Content-Type: multipart/mixed; boundary="===============4413811331739563757=="
MIME-Version: 1.0
From: seam-commits at lists.jboss.org
To: seam-commits at lists.jboss.org
Subject: [seam-commits] Seam SVN: r7274 - in trunk:
examples/itext/resources/WEB-INF and 4 other directories.
Date: Mon, 28 Jan 2008 18:40:13 -0500
Message-ID:
--===============4413811331739563757==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: norman.richards(a)jboss.com
Date: 2008-01-28 18:40:13 -0500 (Mon, 28 Jan 2008)
New Revision: 7274
Added:
trunk/examples/itext/src/org/jboss/seam/example/pdf/SwingComponent.java
trunk/examples/itext/view/html.xhtml
trunk/examples/itext/view/swing.xhtml
Modified:
trunk/doc/reference/en/modules/itext.xml
trunk/examples/itext/resources/WEB-INF/components.xml
trunk/examples/itext/view/index.xhtml
trunk/src/main/org/jboss/seam/core/SeamResourceBundle.java
trunk/src/pdf/org/jboss/seam/pdf/DocumentData.java
Log:
merge 2.0 branch changes
Modified: trunk/doc/reference/en/modules/itext.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/doc/reference/en/modules/itext.xml 2008-01-28 23:21:19 UTC (rev 7=
273)
+++ trunk/doc/reference/en/modules/itext.xml 2008-01-28 23:40:13 UTC (rev 7=
274)
@@ -1,6 +1,6 @@
iText PDF generation
- Seam now includes an component set for generating documents usin=
g iText. The primary focus of Seam's iText
+ Seam now includes a component set for generating documents using=
iText. The primary focus of Seam's iText
document support is for the generation of PDF doucuments, but Seam=
also offers basic support for RTF document
generation.
=
@@ -38,7 +38,7 @@
Description
- Documents are generated by facelets=
documents using tags in the
+ Documents are generated by facelet =
XHTML files using tags in the
http://jboss.com/products=
/seam/pdf namespace. Documents
should always have the docume=
nt tag at the root of the document.
The document tag pr=
epares Seam to generate a document into the
@@ -87,6 +87,15 @@
marginMirroring — Indicates that margin
settings should be reversed an=
alternating pages.
+
+
+
+ disposition=
— When generating PDFs in a web browser, this determines the HTTP
+ Content-Disposition=
literal> of the document. Valid values are inline, which
+ indicates the document should =
be displayed in the browser window if possible,
+ and attachment, which indicates that the document should be treated as a download. =
+ The default value is =
inline.
+
=
=
@@ -288,7 +297,64 @@
=
=
+
+
+
+
=
+
+
+
+
+ <p:html>
+
+
+
+
+ Description
+
+
+ The html tag ren=
ders HTML content into the PDF. =
=
+
+
+
+ Attributes
+
+
+
+
+
+ value =
212; The text to be displayed.
+
+
+
+
+ Usage
+
+
+
+<p:html value=3D"This is HTML with <b>some markup&am=
p;lt;/b>." />
+<p:html>
+ <h1>This is more complex HTML</h1>
+ <ul>
+ <li>one</li>
+ <li>two</li>
+ <li>three</li>
+ </ul>
+</p:html>
+
+<p:html>
+ <s:formattedText value=3D"*This* is |Seam Text| as HTML. It&a=
pos;s very^cool^." />
+</p:html> =
+
+
+
+
+
+
+
+
+
@@ -341,7 +407,7 @@
Usage
=
- <p:font family=3D"=
courier" style=3D"bold" size=3D"24">
+ <p:font name=3D"co=
urier" style=3D"bold" size=3D"24">
<p:paragraph>My Title</p:paragraph>
</p:font>
=
@@ -1443,11 +1509,11 @@
Charting
=
- Charting support is also provided with jboss-seam-=
pdf.jar. Charts can be used in =
- PDF documents or can be used as images in an HTML page.
- Charting requires the JFreeChart library (jfreechart.=
jar and jcommon.jar) to be added to the =
- WEB-INF/lib directory. Three types of char=
ts are currently supported: pie charts, bar charts and line charts.
-
+ Charting support is also provided with jboss-seam-=
pdf.jar. Charts can be used in PDF
+ documents or can be used as images in an HTML page. Charting r=
equires the JFreeChart library
+ (jfreechart.jar and jcommon.ja=
r) to be added to the
+ WEB-INF/lib directory. Three types of c=
harts are currently supported: pie charts, bar
+ charts and line charts.
=
@@ -1895,8 +1961,7 @@
=
- title— Th=
e chart title text. =
-
+ title— Th=
e chart title text.
@@ -1905,13 +1970,13 @@
- legend— A=
boolean value indicating whether or not the chart should include a legend.=
Default value is true =
-
+ legend— A=
boolean value indicating whether or not
+ the chart should include a legend.=
Default value is true
- is3D—A bo=
olean value indicating that the chart should be rendered in 3D instead of 2=
D. =
-
+ is3D—A bo=
olean value indicating that the chart
+ should be rendered in 3D instead o=
f 2D.
@@ -1920,98 +1985,97 @@
- labelLinkPaint&=
#8212; The paint used for the label linking lines. =
-
+ labelLinkPaint&=
#8212; The paint used for the label
+ linking lines.
- labelLinkStroke=
— he stroke used for the label linking lines. =
-
+ labelLinkStroke=
— he stroke used for the label
+ linking lines.
=
- labelLinksVisible— A flag that controls whether or not the label links are drawn. =
-
+ labelLinksVisible— A flag that controls whether or
+ not the label links are drawn.
- labelOutlinePaint— The paint used to draw the outline of the section labels.
-
+ labelOutlinePaint— The paint used to draw the
+ outline of the section labels.
- labelOutlineStroke— The stroke used to draw the outline of the section labels.
-
+ labelOutlineStroke— The stroke used to draw the
+ outline of the section labels.
- labelShadowPaint— The paint used to draw the shadow for the section labels.
-
+ labelShadowPaint— The paint used to draw the shadow
+ for the section labels.
- labelPaint̵=
2; The color used to draw the section labels =
-
+ labelPaint̵=
2; The color used to draw the section
+ labels
- labelGap—=
The gap between the labels and the plot as a percentage of the plot width. =
-
+ labelGap—=
The gap between the labels and the plot
+ as a percentage of the plot width.=
- labelBackgroundPaint— The color used to draw the background of the section labels. I=
f this is null, the background is not filled. =
+ labelBackgroundPaint— The color used to draw the
+ background of the section labels. =
If this is null, the background is not filled.
=
- startAngle̵=
2; The starting angle of the first section.
-
+ startAngle̵=
2; The starting angle of the first
+ section.
- circular—=
A boolean value indicating that the chart should be drawn as a circle.
- If false, the chart is drawn as an=
ellipse. The default is true.
-
+ circular—=
A boolean value indicating that the chart
+ should be drawn as a circle. If fa=
lse, the chart is drawn as an ellipse. The
+ default is true.
- direction—=
; =
- The direction the pie section are =
drawn. One of: clockwise or anticlockwise. =
- The default is clockwise<=
/literal>.
-
+ direction—=
; The direction the pie section are drawn.
+ One of: clockwise or anticlockwise. The
+ default is clockwise.
- sectionOutlinePaint— The outline paint for all sections.
-
+ sectionOutlinePaint— The outline paint for all
+ sections.
- sectionOutlineStroke— The outline stroke for all sections
-
+ sectionOutlineStroke— The outline stroke for all
+ sections
- sectionOutlinesVisible— Indicates whether an outline is drawn for each section in t=
he plot. =
-
+ sectionOutlinesVisible— Indicates whether an
+ outline is drawn for each section =
in the plot.
- baseSectionOutlinePaint=
literal>— The base section outline paint.
-
+ baseSectionOutlinePaint=
literal>— The base section outline
+ paint.
- baseSectionPaint— The base section paint.
-
+ baseSectionPaint— The base section paint.
- baseSectionOutlineStroke<=
/literal>— The base section outline stroke.
-
+ baseSectionOutlineStroke<=
/literal>— The base section outline
+ stroke.
@@ -2167,15 +2231,18 @@
=
- sectionOutlinePaint — For bar charts, the color of the section outline.
+ sectionOutlinePaint — For bar charts, the color of
+ the section outline.
- sectionOutlineStroke — For bar charts, the stroke type for the section outline.
+ sectionOutlineStroke — For bar charts, the stroke
+ type for the section outline.
- sectionPaint =
8212; For bar charts, the color of the section.
+ sectionPaint =
8212; For bar charts, the color of the
+ section.
@@ -2333,7 +2400,10 @@
=
Bar codes
- ...
+ Seam can use iText to generate barcodes in a wide variety of=
formats. These barcodes can
+ be embedded in a PDF document or displayed as an image on a web pa=
ge. Note that =
+ when used with HTML images, barcodes can not currently display bar=
code text in the barcode. =
+
=
@@ -2351,7 +2421,8 @@
Description
-
+ Displays a barcode image.
+
Attributes
@@ -2360,15 +2431,13 @@
=
- type — A=
barcode type supported by iText. =
- Valid values include:
- EAN13, EAN8, UPCA, =
- UPCE, =
- SUPP2, SUPP5, POSTNET, =
+ type — A =
barcode type supported by iText. Valid
+ values include: EAN13, EAN8,
+ UPCA, =
UPCE, SUPP2,
+ SUPP5, POSTNET,
PLANET, CODE128,
- CODE128_UCC, CODE128_RAW and CODABAR.
- =
-
+ CODE128_UCC, CODE128_RAW and
+ CODABAR. =
para>
@@ -2377,18 +2446,18 @@
- xpos— For=
PDFs, the absolute y position of the barcode on the page.
-
+ xpos— For=
PDFs, the absolute y position of the
+ barcode on the page.
- ypos— For=
PDFs, the absolute y position of the barcode on the page.
-
+ ypos— For=
PDFs, the absolute y position of the
+ barcode on the page.
- rotDegrees R=
12; For PDFs, the rotation factor of the barcode in degrees.
-
+ rotDegrees R=
12; For PDFs, the rotation factor of the
+ barcode in degrees.
@@ -2398,34 +2467,36 @@
=
- minBarWidth =
212; The minimum bar width.
-
+ minBarWidth =
212; The minimum bar width.
- barMultiplier &=
#8212; The bar multiplier for wide bars or the
- distance between bars for POSTNET and PLANET code.
- =
-
+ barMultiplier &=
#8212; The bar multiplier for wide bars or
+ the distance between bars for POSTNET and
+ PLANET code. =
para>
- barColor ̵=
2; The color to draw the bars.
-
- =
- =
+ barColor —=
; The color to draw the bars.
+
+
- textColor R=
12; The color of any text on the barcode.
+ textColor ̵=
2; The color of any text on the barcode.
-
+
textSize —=
; The size of the barcode text, if any.
- =
- =
+
+
+ altText —=
The alt text for HTML image links.
+
+ =
=
+
+
Usage
@@ -2446,7 +2517,66 @@
=
=
+
+ Rendering Swing/AWT components
+ Seam now provides experimental support for rendering Swing c=
omponents to into a PDF
+ image. Some Swing look and feels supports, notably ones that use =
native widgets, will not
+ render correctly.
+
=
+
+
+
+
+
+
+
+
+
+ <p:swing>
+
+
+
+
+ Description =
+
+ =
+ Renders a Swing component into a PDF doc=
ument.
+
+ Attributes
+
+
+
+
+
+
+ width — T=
he width of the component to be rendered.
+
+
+
+ height — =
..The height of the component to be rendered.
+
+
+
+ component ̵=
2; An expression whose value is a Swing or AWT component.
+ =
+
+
+
+ Usage
+
+
+<p:swing width=3D"310" height=3D"120" component=3D&=
quot;#{aButton}" />
+
+
+
+
+
+
+
+
+
+
Further documentation
=
Modified: trunk/examples/itext/resources/WEB-INF/components.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/examples/itext/resources/WEB-INF/components.xml 2008-01-28 23:21:=
19 UTC (rev 7273)
+++ trunk/examples/itext/resources/WEB-INF/components.xml 2008-01-28 23:40:=
13 UTC (rev 7274)
@@ -17,4 +17,7 @@
=
=
+
+ A JButton!
+
Copied: trunk/examples/itext/src/org/jboss/seam/example/pdf/SwingComponent.=
java (from rev 7271, branches/Seam_2_0/examples/itext/src/org/jboss/seam/ex=
ample/pdf/SwingComponent.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/examples/itext/src/org/jboss/seam/example/pdf/SwingComponent.java=
(rev 0)
+++ trunk/examples/itext/src/org/jboss/seam/example/pdf/SwingComponent.java=
2008-01-28 23:40:13 UTC (rev 7274)
@@ -0,0 +1,29 @@
+package org.jboss.seam.example.pdf;
+
+import java.awt.*;
+import javax.swing.*;
+
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Name;
+
+(a)Name("swing")
+public class SwingComponent
+{
+ @Create
+ public void init() {
+ try {
+ UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeel=
ClassName());
+ } catch(Exception e) {
+ System.out.println("Error setting Java LAF: " + e);
+ }
+ =
+ System.out.println("** " + UIManager.getLookAndFeel());
+ }
+ =
+ public Component getButton() {
+ JLabel label =3D new JLabel("Hello, Seam", SwingConstants.CENTER);
+
+ return label; =
+ }
+
+}
Copied: trunk/examples/itext/view/html.xhtml (from rev 7271, branches/Seam_=
2_0/examples/itext/view/html.xhtml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/examples/itext/view/html.xhtml (rev 0)
+++ trunk/examples/itext/view/html.xhtml 2008-01-28 23:40:13 UTC (rev 7274)
@@ -0,0 +1,29 @@
+
+
+ This is a regular paragraph.
+
+
+
+
+
+
+ This is HTML with text with text in the body.
+
+
+
+
+ This is more complex HTML
+
+
+
+
+
+
+
+ =
Modified: trunk/examples/itext/view/index.xhtml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/examples/itext/view/index.xhtml 2008-01-28 23:21:19 UTC (rev 7273)
+++ trunk/examples/itext/view/index.xhtml 2008-01-28 23:40:13 UTC (rev 7274)
@@ -34,6 +34,8 @@
=
li>
=
+ =
+
[]
@@ -42,9 +44,9 @@
[]
+ =
=
=
-
Copied: trunk/examples/itext/view/swing.xhtml (from rev 7271, branches/Seam=
_2_0/examples/itext/view/swing.xhtml)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/examples/itext/view/swing.xhtml (rev 0)
+++ trunk/examples/itext/view/swing.xhtml 2008-01-28 23:40:13 UTC (rev 7274)
@@ -0,0 +1,12 @@
+
+
+
+ A JLabel, from Java:
+
+
+ A JButton, defined in components.xml:
+
+ =
+ =
Modified: trunk/src/main/org/jboss/seam/core/SeamResourceBundle.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/src/main/org/jboss/seam/core/SeamResourceBundle.java 2008-01-28 2=
3:21:19 UTC (rev 7273)
+++ trunk/src/main/org/jboss/seam/core/SeamResourceBundle.java 2008-01-28 2=
3:40:13 UTC (rev 7274)
@@ -80,15 +80,16 @@
List pageBundles =3D getPageResourceBundle=
s();
List bundles =3D getBundlesForCurrentLocale();
Enumeration[] enumerations =3D new Enumeration[bundles.size(=
) + pageBundles.size()];
+
int i =3D 0;
- for (; i < pageBundles.size(); i++)
- {
- enumerations[i++] =3D pageBundles.get(i).getKeys();
+ for (java.util.ResourceBundle bundle: pageBundles) {
+ enumerations[i++] =3D bundle.getKeys();
}
- for (; i < bundles.size(); i++)
- {
- enumerations[i] =3D bundles.get(i).getKeys();
+ =
+ for (ResourceBundle bundle: bundles) {
+ enumerations[i++] =3D bundle.getKeys();
}
+
return new EnumerationEnumeration(enumerations);
}
=
@@ -150,4 +151,4 @@
return org.jboss.seam.core.Locale.instance();
}
=
-}
\ No newline at end of file
+}
Modified: trunk/src/pdf/org/jboss/seam/pdf/DocumentData.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/src/pdf/org/jboss/seam/pdf/DocumentData.java 2008-01-28 23:21:19 =
UTC (rev 7273)
+++ trunk/src/pdf/org/jboss/seam/pdf/DocumentData.java 2008-01-28 23:40:13 =
UTC (rev 7274)
@@ -1,6 +1,10 @@
package org.jboss.seam.pdf;
=
-public class DocumentData {
+import java.io.Serializable;
+
+public class DocumentData =
+ implements Serializable
+{
byte[] data;
DocumentType documentType;
String baseName;
--===============4413811331739563757==--