[FOray-commit] SF.net SVN: foray: [7940] trunk/foray/foray-render/src/java/org/foray/ render
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-09-07 19:02:07
|
Revision: 7940
http://svn.sourceforge.net/foray/?rev=7940&view=rev
Author: victormote
Date: 2006-09-07 12:01:57 -0700 (Thu, 07 Sep 2006)
Log Message:
-----------
Style changes only.
Modified Paths:
--------------
trunk/foray/foray-render/src/java/org/foray/render/TempImage.java
trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/GoToPageDialog.java
trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/MessagesDialog.java
trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialog.java
trunk/foray/foray-render/src/java/org/foray/render/ps/ASCII85OutputStream.java
trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/svg/SVGUtilities.java
Modified: trunk/foray/foray-render/src/java/org/foray/render/TempImage.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/TempImage.java 2006-09-07 18:43:16 UTC (rev 7939)
+++ trunk/foray/foray-render/src/java/org/foray/render/TempImage.java 2006-09-07 19:01:57 UTC (rev 7940)
@@ -37,25 +37,25 @@
*/
public class TempImage implements Graphic {
- int m_height;
- int m_width;
- int m_bitsPerPixel;
- ColorSpace m_colorSpace;
- int m_bitmapSiye;
- byte[] m_bitmaps;
- byte[] m_mask;
+ int height;
+ int width;
+ int bitsPerPixel;
+ ColorSpace colorSpace;
+ int bitmapSiye;
+ byte[] bitmaps;
+ byte[] mask;
Color transparent = new Color(255, 255, 255);
URL url;
public TempImage(final URL url, final int width, final int height,
final byte[] result, final byte[] mask) throws GraphicException {
this.url = url;
- this.m_height = height;
- this.m_width = width;
- this.m_bitsPerPixel = 8;
- this.m_colorSpace = ColorSpace.getInstance(ColorSpace.CS_sRGB);
- this.m_bitmaps = result;
- this.m_mask = mask;
+ this.height = height;
+ this.width = width;
+ this.bitsPerPixel = 8;
+ this.colorSpace = ColorSpace.getInstance(ColorSpace.CS_sRGB);
+ this.bitmaps = result;
+ this.mask = mask;
}
/**
@@ -76,28 +76,28 @@
* {@inheritDoc}
*/
public int pixelWidth() throws GraphicException {
- return m_width;
+ return width;
}
/**
* {@inheritDoc}
*/
public int pixelHeight() throws GraphicException {
- return m_height;
+ return height;
}
/**
* {@inheritDoc}
*/
public ColorSpace getColorSpace() throws GraphicException {
- return m_colorSpace;
+ return colorSpace;
}
/**
* {@inheritDoc}
*/
public int getBitsPerPixel() throws GraphicException {
- return m_bitsPerPixel;
+ return bitsPerPixel;
}
/**
@@ -118,14 +118,14 @@
* {@inheritDoc}
*/
public byte[] getContent() throws GraphicException {
- return m_bitmaps;
+ return bitmaps;
}
/**
* {@inheritDoc}
*/
public int getContentSize() throws GraphicException {
- return m_width * m_height * 3;
+ return width * height * 3;
}
/**
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/GoToPageDialog.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/GoToPageDialog.java 2006-09-07 18:43:16 UTC (rev 7939)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/GoToPageDialog.java 2006-09-07 19:01:57 UTC (rev 7940)
@@ -84,7 +84,7 @@
okButton.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
- okButton_actionPerformed(e);
+ okButtonActionPerformed(e);
}
});
@@ -92,7 +92,7 @@
cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
- cancelButton_actionPerformed(e);
+ cancelButtonActionPerformed(e);
}
});
@@ -120,7 +120,7 @@
new Insets(0, 10, 10, 10), 0, 0));
}
- void okButton_actionPerformed(final ActionEvent e) {
+ void okButtonActionPerformed(final ActionEvent e) {
try {
pageNumber = Integer.parseInt(pgNbField.getText());
dispose();
@@ -130,7 +130,7 @@
}
- void cancelButton_actionPerformed(final ActionEvent e) {
+ void cancelButtonActionPerformed(final ActionEvent e) {
pageNumber = -1;
dispose();
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/MessagesDialog.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/MessagesDialog.java 2006-09-07 18:43:16 UTC (rev 7939)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/MessagesDialog.java 2006-09-07 19:01:57 UTC (rev 7940)
@@ -50,11 +50,11 @@
static Translator res;
- static String DETAIL_OPTION;
- static String YES_STRING;
- static String NO_STRING;
- static String CANCEL_STRING;
- static String OK_STRING;
+ static String detailOption;
+ static String yesString;
+ static String noString;
+ static String cancelString;
+ static String okString;
static String[] defaultDetailOption;
static String[] yesNoDetailOption;
@@ -83,36 +83,36 @@
}
private static void iniConstants() {
- DETAIL_OPTION = res.getString("Details");
- YES_STRING = res.getString("Yes");
- NO_STRING = res.getString("No");
- CANCEL_STRING = res.getString("Cancel");
- OK_STRING = res.getString("Ok");
+ detailOption = res.getString("Details");
+ yesString = res.getString("Yes");
+ noString = res.getString("No");
+ cancelString = res.getString("Cancel");
+ okString = res.getString("Ok");
defaultDetailOption = new String[] {
- OK_STRING, DETAIL_OPTION
+ okString, detailOption
};
yesNoDetailOption = new String[] {
- YES_STRING, NO_STRING, DETAIL_OPTION
+ yesString, noString, detailOption
};
yesNoCancelDetailOption = new String[] {
- YES_STRING, NO_STRING, CANCEL_STRING, DETAIL_OPTION
+ yesString, noString, cancelString, detailOption
};
okCancelDetailOption = new String[] {
- OK_STRING, CANCEL_STRING, DETAIL_OPTION
+ okString, cancelString, detailOption
};
defaultOption = new String[] {
- OK_STRING
+ okString
};
yesNoOption = new String[] {
- YES_STRING, NO_STRING
+ yesString, noString
};
yesNoCancelOption = new String[] {
- YES_STRING, NO_STRING, CANCEL_STRING
+ yesString, noString, cancelString
};
okCancelOption = new String[] {
- OK_STRING, CANCEL_STRING
+ okString, cancelString
};
}
@@ -154,16 +154,16 @@
return CLOSED_OPTION;
}
- if (selectedValue.equals(OK_STRING)) {
+ if (selectedValue.equals(okString)) {
return JOptionPane.OK_OPTION;
}
- if (selectedValue.equals(CANCEL_STRING)) {
+ if (selectedValue.equals(cancelString)) {
return JOptionPane.CANCEL_OPTION;
}
- if (selectedValue.equals(YES_STRING)) {
+ if (selectedValue.equals(yesString)) {
return JOptionPane.YES_OPTION;
}
- if (selectedValue.equals(NO_STRING)) {
+ if (selectedValue.equals(noString)) {
return JOptionPane.NO_OPTION;
}
@@ -217,20 +217,20 @@
return CLOSED_OPTION;
}
- if (((String)selectedValue).equals(DETAIL_OPTION)) {
+ if (((String)selectedValue).equals(detailOption)) {
return CLOSED_OPTION;
}
- if (selectedValue.equals(OK_STRING)) {
+ if (selectedValue.equals(okString)) {
return JOptionPane.OK_OPTION;
}
- if (selectedValue.equals(CANCEL_STRING)) {
+ if (selectedValue.equals(cancelString)) {
return JOptionPane.CANCEL_OPTION;
}
- if (selectedValue.equals(YES_STRING)) {
+ if (selectedValue.equals(yesString)) {
return JOptionPane.YES_OPTION;
}
- if (selectedValue.equals(NO_STRING)) {
+ if (selectedValue.equals(noString)) {
return JOptionPane.NO_OPTION;
}
@@ -263,7 +263,7 @@
// Zugriff
public void setValue(final Object aValue) {
- if (aValue != null && DETAIL_OPTION.equals(aValue)) {
+ if (aValue != null && detailOption.equals(aValue)) {
displayDetails(getDialog());
} else {
super.setValue(aValue);
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialog.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialog.java 2006-09-07 18:43:16 UTC (rev 7939)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialog.java 2006-09-07 19:01:57 UTC (rev 7940)
@@ -199,7 +199,7 @@
scale.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
- scale_actionPerformed(e);
+ scaleActionPerformed(e);
}
});
@@ -559,7 +559,7 @@
showPage();
}
- void scale_actionPerformed(final ActionEvent e) {
+ void scaleActionPerformed(final ActionEvent e) {
setScale(new Double((String)scale.getSelectedItem()).doubleValue());
}
@@ -577,14 +577,14 @@
* it is done.
*/
public void progress(final String message) {
- SwingUtilities.invokeLater(new showProgress(message, false));
+ SwingUtilities.invokeLater(new ShowProgress(message, false));
}
/**
* This class is used to show status and error messages in
* a thread safe way.
*/
- class showProgress implements Runnable {
+ class ShowProgress implements Runnable {
/**
* The message to display
*/
@@ -601,7 +601,7 @@
* @param message message to display
* @param isErrorMessage show in status bar or in JOptionPane
*/
- public showProgress(final Object message,
+ public ShowProgress(final Object message,
final boolean isErrorMessage) {
this.message = message;
this.isErrorMessage = isErrorMessage;
@@ -618,7 +618,7 @@
}
public void showPage() {
- final showPageImage viewer = new showPageImage();
+ final ShowPageImage viewer = new ShowPageImage();
if (SwingUtilities.isEventDispatchThread()) {
viewer.run();
@@ -631,7 +631,7 @@
* This class is used to update the page image
* in a thread safe way.
*/
- class showPageImage implements Runnable {
+ class ShowPageImage implements Runnable {
/**
* The run method that does the actuall updating
Modified: trunk/foray/foray-render/src/java/org/foray/render/ps/ASCII85OutputStream.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/ps/ASCII85OutputStream.java 2006-09-07 18:43:16 UTC (rev 7939)
+++ trunk/foray/foray-render/src/java/org/foray/render/ps/ASCII85OutputStream.java 2006-09-07 19:01:57 UTC (rev 7940)
@@ -47,13 +47,13 @@
private static final int EOL = 0x0A; //"\n"
private static final byte[] EOD = {0x7E, 0x3E}; //"~>"
- private static final long base85_4 = 85;
- private static final long base85_3 = ASCII85OutputStream.base85_4
- * ASCII85OutputStream.base85_4;
- private static final long base85_2 = ASCII85OutputStream.base85_3
- * ASCII85OutputStream.base85_4;
- private static final long base85_1 = ASCII85OutputStream.base85_2
- * ASCII85OutputStream.base85_4;
+ private static final long BASE_85_4 = 85;
+ private static final long BASE_85_3 = ASCII85OutputStream.BASE_85_4
+ * ASCII85OutputStream.BASE_85_4;
+ private static final long BASE_85_2 = ASCII85OutputStream.BASE_85_3
+ * ASCII85OutputStream.BASE_85_4;
+ private static final long BASE_85_1 = ASCII85OutputStream.BASE_85_2
+ * ASCII85OutputStream.BASE_85_4;
private static final boolean DEBUG = false;
@@ -145,25 +145,25 @@
if (word < 0) {
word = -word;
}
- final byte c1 = (byte)((word / ASCII85OutputStream.base85_1) & 0xFF);
- final byte c2 = (byte)(((word - (c1 * ASCII85OutputStream.base85_1))
- / ASCII85OutputStream.base85_2) & 0xFF);
+ final byte c1 = (byte)((word / ASCII85OutputStream.BASE_85_1) & 0xFF);
+ final byte c2 = (byte)(((word - (c1 * ASCII85OutputStream.BASE_85_1))
+ / ASCII85OutputStream.BASE_85_2) & 0xFF);
final byte c3 =
- (byte)(((word - (c1 * ASCII85OutputStream.base85_1)
- - (c2 * ASCII85OutputStream.base85_2))
- / ASCII85OutputStream.base85_3)
+ (byte)(((word - (c1 * ASCII85OutputStream.BASE_85_1)
+ - (c2 * ASCII85OutputStream.BASE_85_2))
+ / ASCII85OutputStream.BASE_85_3)
& 0xFF);
final byte c4 =
- (byte)(((word - (c1 * ASCII85OutputStream.base85_1)
- - (c2 * ASCII85OutputStream.base85_2)
- - (c3 * ASCII85OutputStream.base85_3))
- / ASCII85OutputStream.base85_4)
+ (byte)(((word - (c1 * ASCII85OutputStream.BASE_85_1)
+ - (c2 * ASCII85OutputStream.BASE_85_2)
+ - (c3 * ASCII85OutputStream.BASE_85_3))
+ / ASCII85OutputStream.BASE_85_4)
& 0xFF);
final byte c5 =
- (byte)(((word - (c1 * ASCII85OutputStream.base85_1)
- - (c2 * ASCII85OutputStream.base85_2)
- - (c3 * ASCII85OutputStream.base85_3)
- - (c4 * ASCII85OutputStream.base85_4)))
+ (byte)(((word - (c1 * ASCII85OutputStream.BASE_85_1)
+ - (c2 * ASCII85OutputStream.BASE_85_2)
+ - (c3 * ASCII85OutputStream.BASE_85_3)
+ - (c4 * ASCII85OutputStream.BASE_85_4)))
& 0xFF);
final byte[] ret = {
Modified: trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java 2006-09-07 18:43:16 UTC (rev 7939)
+++ trunk/foray/foray-render/src/java/org/foray/render/svg/SVGRenderer.java 2006-09-07 19:01:57 UTC (rev 7940)
@@ -70,7 +70,7 @@
* A {@link Renderer} implementation that writes the document as SVG.
*/
public class SVGRenderer extends Renderer {
- static final String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
+ static final String SVG_NS = SVGDOMImplementation.SVG_NAMESPACE_URI;
Document svgDocument;
Element svgRoot;
Element currentPageG = null;
@@ -247,7 +247,7 @@
+ (this.totalHeight - this.pageHeight) + ")");
final Element lastPageLink = this.svgDocument.createElementNS(
- SVGRenderer.svgNS, "a");
+ SVGRenderer.SVG_NS, "a");
if (this.lastLink != null) {
lastPageLink.setAttributeNS(null, "xlink:href",
"#svgView(viewBox(0, " + (this.totalHeight - this.pageHeight
@@ -266,7 +266,7 @@
rect.setAttributeNS(null, "style", "fill:blue;visibility:hidden");
lastPageLink.appendChild(rect);
- this.lastLink = this.svgDocument.createElementNS(SVGRenderer.svgNS,
+ this.lastLink = this.svgDocument.createElementNS(SVGRenderer.SVG_NS,
"a");
rect = SVGUtilities.createRect(this.svgDocument, this.pageWidth / 2, 0,
this.pageWidth / 2, this.pageHeight);
@@ -509,8 +509,8 @@
protected void renderSVGDocument(final Document doc, final float x,
final float y) {
final SVGSVGElement svg = ((SVGDocument)doc).getRootElement();
- final Element view = this.svgDocument.createElementNS(SVGRenderer.svgNS,
- "svg");
+ final Element view = this.svgDocument.createElementNS(
+ SVGRenderer.SVG_NS, "svg");
final Node newsvg = this.svgDocument.importNode(svg, true);
//view.setAttributeNS(null, "viewBox", "0 0 ");
view.setAttributeNS(null, "x", "" + x);
@@ -519,7 +519,7 @@
// this fixes a problem where the xmlns is repeated sometimes
final Element ele = (Element)newsvg;
ele.setAttributeNS(XMLSupport.XMLNS_NAMESPACE_URI, "xmlns",
- SVGRenderer.svgNS);
+ SVGRenderer.SVG_NS);
if(ele.hasAttributeNS(null, "xmlns")) {
ele.removeAttributeNS(null, "xmlns");
}
@@ -535,7 +535,7 @@
public void startOutput() throws IOException {
final DOMImplementation impl =
SVGDOMImplementation.getDOMImplementation();
- this.svgDocument = impl.createDocument(SVGRenderer.svgNS, "svg", null);
+ this.svgDocument = impl.createDocument(SVGRenderer.SVG_NS, "svg", null);
final ProcessingInstruction pi =
this.svgDocument.createProcessingInstruction(
"xml",
Modified: trunk/foray/foray-render/src/java/org/foray/render/svg/SVGUtilities.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/svg/SVGUtilities.java 2006-09-07 18:43:16 UTC (rev 7939)
+++ trunk/foray/foray-render/src/java/org/foray/render/svg/SVGUtilities.java 2006-09-07 19:01:57 UTC (rev 7940)
@@ -41,14 +41,14 @@
* Some utilities for creating svg DOM documents and elements.
*/
public class SVGUtilities {
- static final String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
+ static final String SVG_NS = SVGDOMImplementation.SVG_NAMESPACE_URI;
public static final Document createSVGDocument(final float width,
final float height) {
final DOMImplementation impl =
SVGDOMImplementation.getDOMImplementation();
- final Document doc = impl.createDocument(SVGUtilities.svgNS, "svg",
+ final Document doc = impl.createDocument(SVGUtilities.SVG_NS, "svg",
null);
final Element svgRoot = doc.getDocumentElement();
@@ -95,7 +95,8 @@
*/
public static final Element createLine(final Document doc, final float x,
final float y, final float x2, final float y2) {
- final Element ellipse = doc.createElementNS(SVGUtilities.svgNS, "line");
+ final Element ellipse = doc.createElementNS(SVGUtilities.SVG_NS,
+ "line");
ellipse.setAttributeNS(null, "x1", "" + x);
ellipse.setAttributeNS(null, "x2", "" + x2);
ellipse.setAttributeNS(null, "y1", "" + y);
@@ -108,7 +109,7 @@
*/
public static final Element createEllipse(final Document doc,
final float cx, final float cy, final float rx, final float ry) {
- final Element ellipse = doc.createElementNS(SVGUtilities.svgNS,
+ final Element ellipse = doc.createElementNS(SVGUtilities.SVG_NS,
"ellipse");
ellipse.setAttributeNS(null, "cx", "" + cx);
ellipse.setAttributeNS(null, "rx", "" + rx);
@@ -122,7 +123,7 @@
*/
public static final Element createPath(final Document doc,
final String str) {
- final Element path = doc.createElementNS(SVGUtilities.svgNS, "path");
+ final Element path = doc.createElementNS(SVGUtilities.SVG_NS, "path");
path.setAttributeNS(null, "d", str);
return path;
}
@@ -132,7 +133,7 @@
*/
public static final Element createText(final Document doc, final float x,
final float y, final String str) {
- final Element textGraph = doc.createElementNS(SVGUtilities.svgNS,
+ final Element textGraph = doc.createElementNS(SVGUtilities.SVG_NS,
"text");
textGraph.setAttributeNS(null, "x", "" + x);
textGraph.setAttributeNS(null, "y", "" + y);
@@ -146,7 +147,7 @@
*/
public static final Element createRect(final Document doc, final float x,
final float y, final float width, final float height) {
- final Element border = doc.createElementNS(SVGUtilities.svgNS, "rect");
+ final Element border = doc.createElementNS(SVGUtilities.SVG_NS, "rect");
border.setAttributeNS(null, "x", "" + x);
border.setAttributeNS(null, "y", "" + y);
border.setAttributeNS(null, "width", "" + width);
@@ -158,7 +159,7 @@
* Create an SVG G.
*/
public static final Element createG(final Document doc) {
- final Element border = doc.createElementNS(SVGUtilities.svgNS, "g");
+ final Element border = doc.createElementNS(SVGUtilities.SVG_NS, "g");
return border;
}
@@ -167,7 +168,7 @@
*/
public static final Element createClip(final Document doc,
final Element els, final String id) {
- final Element border = doc.createElementNS(SVGUtilities.svgNS,
+ final Element border = doc.createElementNS(SVGUtilities.SVG_NS,
"clipPath");
border.setAttributeNS(null, "id", id);
border.appendChild(els);
@@ -176,7 +177,8 @@
public static final Element createImage(final Document doc,
final String ref, final float width, final float height) {
- final Element border = doc.createElementNS(SVGUtilities.svgNS, "image");
+ final Element border = doc.createElementNS(SVGUtilities.SVG_NS,
+ "image");
border.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href",
ref);
border.setAttributeNS(null, "width", "" + width);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|