Revision: 7830
Author: victormote
Date: 2006-07-23 16:42:47 -0700 (Sun, 23 Jul 2006)
ViewCVS: http://svn.sourceforge.net/foray/?rev=7830&view=rev
Log Message:
-----------
Implement standard use of final modifier on local variable and method parameters.
Modified Paths:
--------------
trunk/foray/foray-render/src/java/org/foray/render/awt/AWTPrintRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/Command.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/IconToolBar.java
trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/LoadableProperties.java
trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/MessageException.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/awt/viewer/PreviewDialogAboutBox.java
trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/SecureResourceBundle.java
trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/UserMessage.java
trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java
trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLStream.java
trunk/foray/foray-render/src/java/org/foray/render/pdf/PDFRenderer.java
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/AWTPrintRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/AWTPrintRenderer.java 2006-07-23 23:17:34 UTC (rev 7829)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/AWTPrintRenderer.java 2006-07-23 23:42:47 UTC (rev 7830)
@@ -46,8 +46,8 @@
private int mode = EVEN_AND_ALL;
private PrinterJob printerJob;
- public AWTPrintRenderer(Log logger, OutputConfig renderConfig,
- PrinterJob printerJob) {
+ public AWTPrintRenderer(final Log logger, final OutputConfig renderConfig,
+ final PrinterJob printerJob) {
super(logger, renderConfig);
this.printerJob = printerJob;
@@ -57,11 +57,11 @@
printerJob.setPageable(this);
mode = EVEN_AND_ALL;
- String str = System.getProperty("even");
+ final String str = System.getProperty("even");
if (str != null) {
try {
mode = Boolean.valueOf(str).booleanValue() ? EVEN : ODD;
- } catch (Exception e) {}
+ } catch (final Exception e) {}
}
@@ -75,14 +75,14 @@
endNumber = getPageCount();
}
- ArrayList numbers = getInvalidPageNumbers();
+ final ArrayList numbers = getInvalidPageNumbers();
for (int i = numbers.size() - 1; i > -1; i--) {
removePage(Integer.parseInt((String)numbers.get(i)));
}
try {
printerJob.print();
- } catch (PrinterException e) {
+ } catch (final PrinterException e) {
e.printStackTrace();
throw new IOException(
"Unable to print: " + e.getClass().getName() +
@@ -90,15 +90,15 @@
}
}
- public void renderPage(PageArea page) {
+ public void renderPage(final PageArea page) {
pageWidth = (int)(page.getWidth() / 1000f);
pageHeight = (int)(page.getHeight() / 1000f);
super.renderPage(page);
}
private ArrayList getInvalidPageNumbers() {
- ArrayList vec = new ArrayList();
- int max = getPageCount();
+ final ArrayList vec = new ArrayList();
+ final int max = getPageCount();
boolean isValid;
for (int i = 0; i < max; i++) {
isValid = true;
@@ -120,12 +120,12 @@
return vec;
}
- int getIntProperty(String name, int def) {
- String propValue = System.getProperty(name);
+ int getIntProperty(final String name, final int def) {
+ final String propValue = System.getProperty(name);
if(propValue != null) {
try {
return Integer.parseInt(propValue);
- } catch (Exception e) {
+ } catch (final Exception e) {
return def;
}
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java 2006-07-23 23:17:34 UTC (rev 7829)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/AWTRenderer.java 2006-07-23 23:42:47 UTC (rev 7830)
@@ -150,7 +150,7 @@
*/
protected Component parent;
- public AWTRenderer(Log logger, OutputConfig renderConfig) {
+ public AWTRenderer(final Log logger, final OutputConfig renderConfig) {
super(logger, renderConfig);
}
@@ -160,7 +160,7 @@
* in order to generate valid font measures.
* @param parent the live AWT component reference
*/
- public void setComponent(Component parent) {
+ public void setComponent(final Component parent) {
this.parent = parent;
}
@@ -168,11 +168,11 @@
return pageNumber;
}
- public void setPageNumber(int aValue) {
+ public void setPageNumber(final int aValue) {
pageNumber = aValue;
}
- public void setScaleFactor(double newScaleFactor) {
+ public void setScaleFactor(final double newScaleFactor) {
scaleFactor = newScaleFactor;
}
@@ -187,8 +187,9 @@
/**
* {@inheritDoc}
*/
- protected void drawLine(int x1, int y1, int x2, int y2, int th,
- int ruleStyle, Color strokeColor) {
+ protected void drawLine(final int x1, final int y1, final int x2,
+ final int y2, final int th, final int ruleStyle,
+ final Color strokeColor) {
graphics.setColor(strokeColor);
int x = x1;
int y = y1;
@@ -231,11 +232,11 @@
/**
* {@inheritDoc}
*/
- protected void drawRectangle(int x, int y, int w, int h,
- boolean stroke, Color strokeColor, boolean fill,
- Color fillColor) {
- int startx = (x + 500) / 1000;
- int starty = pageHeight - ((y + 500) / 1000);
+ protected void drawRectangle(final int x, final int y, final int w,
+ final int h, final boolean stroke, final Color strokeColor,
+ final boolean fill, final Color fillColor) {
+ final int startx = (x + 500) / 1000;
+ final int starty = pageHeight - ((y + 500) / 1000);
int endx = (x + w + 500) / 1000;
int endy = pageHeight - ((y + h + 500) / 1000);
if (stroke) {
@@ -268,8 +269,8 @@
*/
// changed by aml/rlc to use helper function that
// corrects for integer roundoff, and to remove 3D effect
- protected void addRect(int x, int y, int w, int h, float r, float g,
- float b) {
+ protected void addRect(final int x, final int y, final int w, final int h,
+ final float r, final float g, final float b) {
graphics.setColor(new Color(r, g, b));
// graphics.setColor(Color.green);
addRect(x, y, w, h, true);
@@ -292,8 +293,9 @@
// changed by aml/rlc to use helper function that
// corrects for integer roundoff
- protected void addRect(int x, int y, int w, int h, float r, float g,
- float b, float fr, float fg, float fb) {
+ protected void addRect(final int x, final int y, final int w, final int h,
+ final float r, final float g, final float b, final float fr,
+ final float fg, final float fb) {
graphics.setColor(new Color(r, g, b));
addRect(x, y, w, h, true);
graphics.setColor(new Color(fr, fg, fb));
@@ -312,10 +314,10 @@
// helper function by aml/rlc to correct integer roundoff problems
//
- protected void addRect(int x, int y, int w, int h,
- boolean drawAsOutline) {
- int startx = (x + 500) / 1000;
- int starty = pageHeight - ((y + 500) / 1000);
+ protected void addRect(final int x, final int y, final int w, final int h,
+ final boolean drawAsOutline) {
+ final int startx = (x + 500) / 1000;
+ final int starty = pageHeight - ((y + 500) / 1000);
int endx = (x + w + 500) / 1000;
int endy = pageHeight - ((y + h + 500) / 1000);
if (drawAsOutline) {
@@ -332,11 +334,11 @@
}
}
- protected void addFilledRect(int x, int y, int w, int h,
- Color col) {
- float r = col.getRed() / 255f;
- float g = col.getGreen() / 255f;
- float b = col.getBlue() / 255f;
+ protected void addFilledRect(final int x, final int y, final int w,
+ final int h, final Color col) {
+ final float r = col.getRed() / 255f;
+ final float g = col.getGreen() / 255f;
+ final float b = col.getBlue() / 255f;
addRect(x, y, w, h, r, g, b, r, g, b);
}
@@ -347,18 +349,18 @@
* Zoom factor
* Page format / Landscape or Portrait
*/
- public void transform(Graphics2D g2d, double zoomPercent, double angle) {
- AffineTransform at = g2d.getTransform();
+ public void transform(final Graphics2D g2d, final double zoomPercent,
+ final double angle) {
+ final AffineTransform at = g2d.getTransform();
at.rotate(angle);
at.scale(zoomPercent / 100.0, zoomPercent / 100.0);
g2d.setTransform(at);
}
protected void drawFrame() {
+ final int width = pageWidth;
+ final int height = pageHeight;
- int width = pageWidth;
- int height = pageHeight;
-
graphics.setColor(Color.white);
graphics.fillRect(0, 0, width, height);
graphics.setColor(Color.black);
@@ -379,18 +381,18 @@
return pageList.size();
}
- public void removePage(int page) {
+ public void removePage(final int page) {
pageList.removeElementAt(page);
}
- public void render(int aPageNumber) {
+ public void render(final int aPageNumber) {
if(aPageNumber >= pageList.size()) {
return;
}
try {
render((PageArea) pageList.get(aPageNumber));
- } catch(IOException e) {
+ } catch(final IOException e) {
e.printStackTrace();
// This exception can't occur because we are not dealing with
// any files
@@ -398,11 +400,12 @@
}
- public void render(PageArea page, OutputStream stream) throws IOException {
+ public void render(final PageArea page, final OutputStream stream)
+ throws IOException {
pageList.add(page);
}
- public void render(PageArea page) throws IOException {
+ public void render(final PageArea page) throws IOException {
pageWidth = (int)(page.getWidth() / 1000f + .5);
pageHeight = (int)(page.getHeight() / 1000f + .5);
@@ -425,7 +428,7 @@
renderPage(page);
}
- public void renderPage(PageArea page) {
+ public void renderPage(final PageArea page) {
this.currentFont = null;
this.currentFontSize = 0;
@@ -439,11 +442,11 @@
*/
}
- protected void markBorder(Area area) {
- int rx = area.brOriginX();
- int ry = area.brOriginY();
- int w = area.brIPD();
- int h = area.brBPD();
+ protected void markBorder(final Area area) {
+ final int rx = area.brOriginX();
+ final int ry = area.brOriginY();
+ final int w = area.brIPD();
+ final int h = area.brBPD();
if (area.getBorderTopWidth() != 0) {
drawLine(rx, ry, rx + w, ry, -area.getBorderTopWidth(),
@@ -468,7 +471,7 @@
- protected Rectangle2D getBounds(Area area) {
+ protected Rectangle2D getBounds(final Area area) {
return new Rectangle2D.Double(area.rrOriginX(), area.rrOriginY(),
area.rrIPD(), area.rrBPD());
}
@@ -476,26 +479,26 @@
/**
* {@inheritDoc}
*/
- protected void drawImage(GraphicArea area, Graphic image,
- Rectangle contentRectangle, Rectangle clipRectangle) {
+ protected void drawImage(final GraphicArea area, final Graphic image,
+ final Rectangle contentRectangle, final Rectangle clipRectangle) {
// TODO: implement this
}
/**
* {@inheritDoc}
*/
- protected void drawSVG(GraphicArea area, SVGGraphic graphic,
- Rectangle contentRectangle, Rectangle clipRectangle) {
+ protected void drawSVG(final GraphicArea area, final SVGGraphic graphic,
+ final Rectangle contentRectangle, final Rectangle clipRectangle) {
/* TODO: Implement this. */
}
- public void render(ExternalGraphicArea area) {
- int x = area.rrOriginX();
- int y = area.rrOriginY();
- int w = area.rrIPD();
- int h = area.rrBPD();
+ public void render(final ExternalGraphicArea area) {
+ final int x = area.rrOriginX();
+ final int y = area.rrOriginY();
+ final int w = area.rrIPD();
+ final int h = area.rrBPD();
- Graphic img = area.getGraphic();
+ final Graphic img = area.getGraphic();
if (img == null) {
getLogger().error("Error while loading image : area.getImage() "
@@ -507,8 +510,8 @@
addRect(x, y, w, h, true); // use helper function
- java.awt.Font f = graphics.getFont();
- java.awt.Font smallFont = new java.awt.Font(f.getFontName(),
+ final java.awt.Font f = graphics.getFont();
+ final java.awt.Font smallFont = new java.awt.Font(f.getFontName(),
f.getStyle(), 8);
graphics.setFont(smallFont);
@@ -525,34 +528,34 @@
} else {
if (img instanceof SVGGraphic) {
try {
- SVGDocument svg = ((SVGGraphic) img).getSVGDocument();
+ final SVGDocument svg = ((SVGGraphic) img).getSVGDocument();
renderSVGDocument(area, svg);
- } catch (GraphicException e) {}
+ } catch (final GraphicException e) {}
} else {
- String urlString = img.getURL().toString();
+ final String urlString = img.getURL().toString();
try {
- URL url = URLFactory.createURL(urlString);
+ final URL url = URLFactory.createURL(urlString);
- ImageIcon icon = new ImageIcon(url);
- Image image = icon.getImage();
+ final ImageIcon icon = new ImageIcon(url);
+ final Image image = icon.getImage();
// correct integer roundoff aml/rlc
// graphics.drawImage(image, x / 1000,
// pageHeight - y / 1000, w / 1000, h / 1000,
// null);
- int startx = (x + 500) / 1000;
- int starty = pageHeight - ((y + 500) / 1000);
- int endx = (x + w + 500) / 1000;
- int endy = pageHeight - ((y + h + 500) / 1000);
+ final int startx = (x + 500) / 1000;
+ final int starty = pageHeight - ((y + 500) / 1000);
+ final int endx = (x + w + 500) / 1000;
+ final int endy = pageHeight - ((y + h + 500) / 1000);
// reverse start and end y because h is positive
graphics.drawImage(image, startx, starty, endx - startx,
starty - endy, null);
- } catch (MalformedURLException mue) {
+ } catch (final MalformedURLException mue) {
/* cannot normally occur because, if URL is wrong,
* constructing Graphic will already have failed earlier. */
}
@@ -561,16 +564,17 @@
}
}
- protected void createBasicLink(BasicLinkArea area) {
+ protected void createBasicLink(final BasicLinkArea area) {
}
- public void renderTextSegment(GeneralInlineArea area, char[] text) {
- FontUse font = area.getPrimaryFont();
- int size = area.traitFontSize();
+ public void renderTextSegment(final GeneralInlineArea area,
+ final char[] text) {
+ final FontUse font = area.getPrimaryFont();
+ final int size = area.traitFontSize();
- float red = area.getColor().getRed() / 255f;
- float green = area.getColor().getGreen() / 255f;
- float blue = area.getColor().getBlue() / 255f;
+ final float red = area.getColor().getRed() / 255f;
+ final float green = area.getColor().getGreen() / 255f;
+ final float blue = area.getColor().getBlue() / 255f;
if ((font != this.currentFont)
|| (size != this.currentFontSize)) {
@@ -585,15 +589,16 @@
this.currentBlue = blue;
}
- int rx = area.rrOriginX();
- int bl = area.rrOriginY();
+ final int rx = area.rrOriginX();
+ final int bl = area.rrOriginY();
- String s = String.copyValueOf(text);
+ final String s = String.copyValueOf(text);
- Color oldColor = graphics.getColor();
- java.awt.Font oldFont = graphics.getFont();
+ final Color oldColor = graphics.getColor();
+ final java.awt.Font oldFont = graphics.getFont();
- java.awt.Font f = area.getPrimaryFont().getFont().getAWTFont(size);
+ final java.awt.Font f = area.getPrimaryFont().getFont().getAWTFont(
+ size);
if (saveColor != null) {
if (saveColor.getRed() != red || saveColor.getGreen() != green
@@ -613,14 +618,14 @@
graphics.setFont(f);
// correct starting location for integer roundoff
- int newx = (rx + 500) / 1000;
- int newy = pageHeight - (bl + 500) / 1000;
+ final int newx = (rx + 500) / 1000;
+ final int newy = pageHeight - (bl + 500) / 1000;
// draw text, corrected for integer roundoff
graphics.drawString(s, newx, newy);
- FontMetrics fm = graphics.getFontMetrics(f);
- int tdwidth = (int)fm.getStringBounds(s, graphics).getWidth();
+ final FontMetrics fm = graphics.getFontMetrics(f);
+ final int tdwidth = (int)fm.getStringBounds(s, graphics).getWidth();
// text decorations
renderTextDecoration(rx, bl, tdwidth, f, " ",
@@ -637,20 +642,19 @@
graphics.setColor(oldColor);
}
- protected void renderTextDecoration(int x, int bl, int width,
- java.awt.Font font, String text,
- boolean underline,
- boolean overline,
- boolean linethrough) {
+ protected void renderTextDecoration(final int x, final int bl,
+ final int width, final java.awt.Font font, final String text,
+ final boolean underline, final boolean overline,
+ final boolean linethrough) {
if (!(underline || overline || linethrough)) {
return;
}
- int newx = (x + 500) / 1000;
- int newy = pageHeight - (bl + 500) / 1000;
+ final int newx = (x + 500) / 1000;
+ final int newy = pageHeight - (bl + 500) / 1000;
// text decorations
- FontMetrics fm = graphics.getFontMetrics(font);
- LineMetrics lm = fm.getLineMetrics(text, graphics);
+ final FontMetrics fm = graphics.getFontMetrics(font);
+ final LineMetrics lm = fm.getLineMetrics(text, graphics);
int ulthick = (int)lm.getUnderlineThickness();
if (ulthick < 1) {
@@ -659,12 +663,12 @@
if (underline) {
// nothing in awt specifies underline location,
// descent/2 seems to match my word processor
- int deltay = fm.getDescent() / 2;
+ final int deltay = fm.getDescent() / 2;
graphics.fillRect(newx, newy + deltay, width, ulthick);
}
if (overline) {
// todo: maybe improve positioning of overline
- int deltay = -(int)(lm.getAscent() * 0.8);
+ final int deltay = -(int)(lm.getAscent() * 0.8);
graphics.fillRect(newx, newy + deltay, width, ulthick);
}
if (linethrough) {
@@ -672,7 +676,7 @@
if (ltthick < 1) {
ltthick = 1; // don't allow it to disappear
}
- int deltay = (int)lm.getStrikethroughOffset();
+ final int deltay = (int)lm.getStrikethroughOffset();
graphics.fillRect(newx, newy + deltay, width, ltthick);
}
}
@@ -686,15 +690,15 @@
// call to addRect corrected by aml/rlc
- public void render(LeaderArea area) {
- int rx = area.rrOriginX();
- int ry = area.rrOriginY();
- int w = area.rrIPD();
- int th = area.traitRuleThickness();
- float r = area.getColor().getRed() / 255f;
- float g = area.getColor().getGreen() / 255f;
- float b = area.getColor().getBlue() / 255f;
- Color oldColor = graphics.getColor();
+ public void render(final LeaderArea area) {
+ final int rx = area.rrOriginX();
+ final int ry = area.rrOriginY();
+ final int w = area.rrIPD();
+ final int th = area.traitRuleThickness();
+ final float r = area.getColor().getRed() / 255f;
+ final float g = area.getColor().getGreen() / 255f;
+ final float b = area.getColor().getBlue() / 255f;
+ final Color oldColor = graphics.getColor();
graphics.setColor(new Color(r, g, b));
@@ -708,34 +712,34 @@
graphics.setColor(oldColor);
}
- public void render(TextArea area) {
+ public void render(final TextArea area) {
renderTextSegment(area, area.getText());
}
- public void render(SVGArea area) {
- Document doc = area.getSVGDocument();
+ public void render(final SVGArea area) {
+ final Document doc = area.getSVGDocument();
renderSVGDocument(area, doc);
}
- protected void renderSVGDocument(Area area, Document doc) {
- int x = area.rrOriginX();
- int y = area.rrOriginY();
- int w = area.rrIPD();
- int h = area.rrBPD();
- GraphicsNode root = getGraphicsNode(area, doc);
+ protected void renderSVGDocument(final Area area, final Document doc) {
+ final int x = area.rrOriginX();
+ final int y = area.rrOriginY();
+ final int w = area.rrIPD();
+ final int h = area.rrBPD();
+ final GraphicsNode root = getGraphicsNode(area, doc);
if (root == null) {
return;
}
graphics.translate((x + 500) / 1000, pageHeight - (y + 500) / 1000);
- SVGSVGElement svg = ((SVGDocument)doc).getRootElement();
- AffineTransform at = ViewBox.getPreserveAspectRatioTransform(svg,
+ final SVGSVGElement svg = ((SVGDocument)doc).getRootElement();
+ final AffineTransform at = ViewBox.getPreserveAspectRatioTransform(svg,
w / 1000f, h / 1000f);
AffineTransform inverse = null;
try {
inverse = at.createInverse();
- } catch(NoninvertibleTransformException e) {
+ } catch (final NoninvertibleTransformException e) {
}
if(!at.isIdentity()) {
graphics.transform(at);
@@ -743,7 +747,7 @@
try {
root.paint(graphics);
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
}
@@ -754,12 +758,13 @@
}
- protected GraphicsNode getGraphicsNode(Area area, Document doc) {
- BridgeContext ctx = makeBridgeContextAWT();
- GVTBuilder builder = new GVTBuilder();
+ protected GraphicsNode getGraphicsNode(final Area area,
+ final Document doc) {
+ final BridgeContext ctx = makeBridgeContextAWT();
+ final GVTBuilder builder = new GVTBuilder();
try {
return builder.build(ctx, doc);
- } catch (Exception e) {
+ } catch (final Exception e) {
getLogger().error("svg graphic could not be built: "
+ e.getMessage());
getLogger().error(e.getMessage());
@@ -767,17 +772,17 @@
}
}
- public void render(BookmarkTreeArea area) {
+ public void render(final BookmarkTreeArea area) {
return;
}
- public int print(Graphics g, PageFormat pageFormat,
- int pageIndex) throws PrinterException {
+ public int print(final Graphics g, final PageFormat pageFormat,
+ final int pageIndex) throws PrinterException {
if (pageIndex >= pageList.size()) {
return NO_SUCH_PAGE;
}
- Graphics2D oldGraphics = graphics;
+ final Graphics2D oldGraphics = graphics;
graphics = (Graphics2D)g;
@@ -787,7 +792,7 @@
graphics.setRenderingHint (RenderingHints.KEY_FRACTIONALMETRICS,
RenderingHints.VALUE_FRACTIONALMETRICS_ON);
- PageArea aPage = (PageArea)pageList.get(pageIndex);
+ final PageArea aPage = (PageArea)pageList.get(pageIndex);
renderPage(aPage);
graphics = oldGraphics;
@@ -798,18 +803,18 @@
return pageList.size();
}
- public PageFormat getPageFormat(int pageIndex)
+ public PageFormat getPageFormat(final int pageIndex)
throws IndexOutOfBoundsException {
if (pageIndex >= pageList.size()) {
return null;
}
- PageArea page = (PageArea)pageList.get(pageIndex);
- PageFormat pageFormat = new PageFormat();
- Paper paper = new Paper();
+ final PageArea page = (PageArea)pageList.get(pageIndex);
+ final PageFormat pageFormat = new PageFormat();
+ final Paper paper = new Paper();
- double width = page.getWidth();
- double height = page.getHeight();
+ final double width = page.getWidth();
+ final double height = page.getHeight();
// if the width is greater than the height assume lanscape mode
// and swap the width and height values in the paper format
@@ -826,12 +831,12 @@
return pageFormat;
}
- public Printable getPrintable(int pageIndex)
+ public Printable getPrintable(final int pageIndex)
throws IndexOutOfBoundsException {
return this;
}
- public void setProgressListener(ProgressListener l) {
+ public void setProgressListener(final ProgressListener l) {
progressListener = l;
}
@@ -874,7 +879,7 @@
* }
*/
- public void render(ForeignObjectArea area) {
+ public void render(final ForeignObjectArea area) {
render(area.getContainedForeignObject());
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/Command.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/Command.java 2006-07-23 23:17:34 UTC (rev 7829)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/Command.java 2006-07-23 23:42:47 UTC (rev 7830)
@@ -56,20 +56,22 @@
public static String IMAGE_DIR = "/org/foray/render/awt/viewer/images/";
PreviewDialog parent;
- public Command(PreviewDialog dialog, String name) {
+ public Command(final PreviewDialog dialog, final String name) {
this(dialog, name, (ImageIcon)null);
}
- public Command(PreviewDialog dialog, String name, ImageIcon anIcon) {
+ public Command(final PreviewDialog dialog, final String name,
+ final ImageIcon anIcon) {
super(name, anIcon);
this.parent = dialog;
}
- public Command(PreviewDialog dialog, String name, String iconName) {
+ public Command(final PreviewDialog dialog, final String name,
+ final String iconName) {
super(name);
this.parent = dialog;
- String path = IMAGE_DIR + iconName + ".gif";
- URL url = getClass().getResource(path);
+ final String path = IMAGE_DIR + iconName + ".gif";
+ final URL url = getClass().getResource(path);
if (url == null) {
getLogger().error("Icon not found: " + path);
} else {
@@ -77,7 +79,7 @@
}
}
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
doit();
}
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-07-23 23:17:34 UTC (rev 7829)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/GoToPageDialog.java 2006-07-23 23:42:47 UTC (rev 7830)
@@ -62,14 +62,14 @@
int pageNumber = -1;
- public GoToPageDialog(Frame frame, String title, boolean modal,
- Translator resource, Log logger) {
+ public GoToPageDialog(final Frame frame, final String title,
+ final boolean modal, final Translator resource, final Log logger) {
super(frame, title, modal);
try {
res = resource;
jbInit();
pack();
- } catch (Exception ex) {
+ } catch (final Exception ex) {
logger.error("GoToPageDialog: Konstruktor: "
+ ex.getMessage());
}
@@ -81,7 +81,7 @@
okButton.setText(res.getString("Ok"));
okButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
okButton_actionPerformed(e);
}
@@ -89,7 +89,7 @@
cancelButton.setText(res.getString("Cancel"));
cancelButton.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
cancelButton_actionPerformed(e);
}
@@ -118,17 +118,17 @@
new Insets(0, 10, 10, 10), 0, 0));
}
- void okButton_actionPerformed(ActionEvent e) {
+ void okButton_actionPerformed(final ActionEvent e) {
try {
pageNumber = Integer.parseInt(pgNbField.getText());
dispose();
- } catch (Exception ex) {
+ } catch (final Exception ex) {
pgNbField.setText("???");
}
}
- void cancelButton_actionPerformed(ActionEvent e) {
+ void cancelButton_actionPerformed(final ActionEvent e) {
pageNumber = -1;
dispose();
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/IconToolBar.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/IconToolBar.java 2006-07-23 23:17:34 UTC (rev 7829)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/IconToolBar.java 2006-07-23 23:42:47 UTC (rev 7830)
@@ -42,24 +42,22 @@
public class IconToolBar extends JToolBar {
static final long serialVersionUID = 726305148932931753L;
- public JButton add(Action a) {
- String name = (String)a.getValue(Action.NAME);
- Icon icon = (Icon)a.getValue(Action.SMALL_ICON);
+ public JButton add(final Action a) {
+ final String name = (String)a.getValue(Action.NAME);
+ final Icon icon = (Icon)a.getValue(Action.SMALL_ICON);
return add(a, name, icon);
}
- public JButton add(Action a, String name, Icon icon) {
- JButton b = new JButton(icon);
+ public JButton add(final Action a, final String name, final Icon icon) {
+ final JButton b = new JButton(icon);
b.setToolTipText(name);
b.setEnabled(a.isEnabled());
b.addActionListener(a);
add(b);
- PropertyChangeListener actionPropertyChangeListener =
+ final PropertyChangeListener actionPropertyChangeListener =
createActionChangeListener(b);
a.addPropertyChangeListener(actionPropertyChangeListener);
return b;
}
}
-
-
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/LoadableProperties.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/LoadableProperties.java 2006-07-23 23:17:34 UTC (rev 7829)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/LoadableProperties.java 2006-07-23 23:42:47 UTC (rev 7830)
@@ -47,16 +47,16 @@
SecureResourceBundle parent;
- public LoadableProperties(SecureResourceBundle bundle) {
+ public LoadableProperties(final SecureResourceBundle bundle) {
super();
this.parent = bundle;
}
- public void load(InputStream inStream) throws IOException {
+ public void load(final InputStream inStream) throws IOException {
- BufferedReader in = new BufferedReader(new InputStreamReader(inStream,
- "UTF-8"));
+ final BufferedReader in = new BufferedReader(new InputStreamReader(
+ inStream, "UTF-8"));
String aKey;
String aValue;
@@ -75,7 +75,7 @@
}
- private boolean isValid(String str) {
+ private boolean isValid(final String str) {
if (str == null) {
return false;
}
@@ -87,7 +87,7 @@
return false;
}
- int index = str.indexOf("=");
+ final int index = str.indexOf("=");
if (index > 0 && str.length() > index) {
return true;
}
@@ -97,10 +97,10 @@
return false;
}
- private String getNextLine(BufferedReader br) {
+ private String getNextLine(final BufferedReader br) {
try {
return br.readLine();
- } catch (Exception e) {
+ } catch (final Exception e) {
return null;
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/MessageException.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/MessageException.java 2006-07-23 23:17:34 UTC (rev 7829)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/MessageException.java 2006-07-23 23:42:47 UTC (rev 7830)
@@ -62,16 +62,17 @@
this("UNKNOWN_EXCEPTION");
}
- public MessageException(String aMessageId) {
+ public MessageException(final String aMessageId) {
this(aMessageId, null);
}
- public MessageException(String aMessageId, String[] aParameterList) {
+ public MessageException(final String aMessageId,
+ final String[] aParameterList) {
this(aMessageId, aParameterList, null);
}
- public MessageException(String aMessageId, String[] aParameterList,
- Exception anException) {
+ public MessageException(final String aMessageId,
+ final String[] aParameterList, final Exception anException) {
super(aMessageId);
messageId = aMessageId;
parameterList = aParameterList;
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-07-23 23:17:34 UTC (rev 7829)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/MessagesDialog.java 2006-07-23 23:42:47 UTC (rev 7830)
@@ -50,7 +50,7 @@
static Translator res;
- public static void setTranslator(Translator aRes) {
+ public static void setTranslator(final Translator aRes) {
res = aRes;
iniConstants();
}
@@ -116,15 +116,16 @@
// MessagesDialog.showConfirmDialog(null,preparedMes,title,
// optionTypeIndex,messageTypeIndex);
- public MessagesDialog(Object message, int messageType, int optionType,
- Icon icon, Object[] options, Object initialValue) {
+ public MessagesDialog(final Object message, final int messageType,
+ final int optionType, final Icon icon, final Object[] options,
+ final Object initialValue) {
super(message, messageType, optionType, icon, options, initialValue);
setMinimumSize(new Dimension(240, 96));
}
- public static int showConfirmDialog(Component parentComponent,
- Object message, String title,
- int optionType, int messageType) {
+ public static int showConfirmDialog(final Component parentComponent,
+ final Object message, final String title, final int optionType,
+ final int messageType) {
Object[] options;
switch (optionType) {
@@ -141,20 +142,20 @@
options = defaultOption;
}
- MessagesDialog pane = new MessagesDialog(message, messageType,
+ final MessagesDialog pane = new MessagesDialog(message, messageType,
JOptionPane.DEFAULT_OPTION,
null, options, options[0]);
pane.setInitialValue(options[0]);
- JDialog dialog = pane.createDialog(parentComponent, title);
+ final JDialog dialog = pane.createDialog(parentComponent, title);
pane.setDialog(dialog);
pane.selectInitialValue();
dialog.setVisible(true);
- Object selectedValue = pane.getValue();
+ final Object selectedValue = pane.getValue();
if (selectedValue == null) {
return CLOSED_OPTION;
@@ -182,11 +183,11 @@
* erscheint die übergebene Detailinformation in einem scrollbaren Bereich
* des Dialogs.
*/
- public static int showDetailDialog(Component parentComponent,
- Object message, String title,
- int optionType, int messageType,
- Icon icon,
- String newDetailInformation) {
+ public static int showDetailDialog(final Component parentComponent,
+ final Object message, final String title,
+ final int optionType, final int messageType,
+ final Icon icon,
+ final String newDetailInformation) {
Object[] options;
switch (optionType) {
@@ -203,21 +204,21 @@
options = defaultDetailOption;
}
- MessagesDialog pane = new MessagesDialog(message, messageType,
+ final MessagesDialog pane = new MessagesDialog(message, messageType,
JOptionPane.DEFAULT_OPTION,
icon, options, options[0]);
pane.setDetailInformation(newDetailInformation);
pane.setInitialValue(options[0]);
- JDialog dialog = pane.createDialog(parentComponent, title);
+ final JDialog dialog = pane.createDialog(parentComponent, title);
pane.setDialog(dialog);
pane.selectInitialValue();
dialog.setVisible(true);
- Object selectedValue = pane.getValue();
+ final Object selectedValue = pane.getValue();
if (selectedValue == null) {
return CLOSED_OPTION;
@@ -249,12 +250,12 @@
* @param dialog Der Dialog, in den die Textkomponente eingefügt werden
* soll
*/
- protected void displayDetails(JDialog dialog) {
+ protected void displayDetails(final JDialog dialog) {
if (getDetailInformation() != null && dialog != null
&& showsDetails == false) {
showsDetails = true;
- JScrollPane aScrollPane = new JScrollPane();
- JTextArea aTextArea = new JTextArea();
+ final JScrollPane aScrollPane = new JScrollPane();
+ final JTextArea aTextArea = new JTextArea();
aTextArea.setText(getDetailInformation());
aTextArea.setEditable(false);
@@ -268,7 +269,7 @@
// Zugriff
- public void setValue(Object aValue) {
+ public void setValue(final Object aValue) {
if (aValue != null && DETAIL_OPTION.equals(aValue)) {
displayDetails(getDialog());
} else {
@@ -280,7 +281,7 @@
return detailInformation;
}
- public void setDetailInformation(String aValue) {
+ public void setDetailInformation(final String aValue) {
detailInformation = aValue;
}
@@ -288,7 +289,7 @@
return dialog;
}
- public void setDialog(JDialog aValue) {
+ public void setDialog(final JDialog aValue) {
dialog = 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-07-23 23:17:34 UTC (rev 7829)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialog.java 2006-07-23 23:42:47 UTC (rev 7830)
@@ -117,8 +117,8 @@
* @param aRes The Translator translator.
* @param logger The logger to use.
*/
- public PreviewDialog(AWTRenderer aRenderer, Translator aRes,
- Log logger) {
+ public PreviewDialog(final AWTRenderer aRenderer, final Translator aRes,
+ final Log logger) {
this(aRenderer, aRes);
this.logger = logger;
}
@@ -129,7 +129,7 @@
* @param aRenderer the to use renderer
* @param aRes the to use translator
*/
- public PreviewDialog(AWTRenderer aRenderer, Translator aRes) {
+ public PreviewDialog(final AWTRenderer aRenderer, final Translator aRes) {
res = aRes;
renderer = aRenderer;
@@ -198,7 +198,7 @@
scale.setPreferredSize(new Dimension(80, 24));
scale.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
scale_actionPerformed(e);
}
});
@@ -396,11 +396,11 @@
*
* @param e a value of type 'ActionEvent'
*/
- public void startHelpAbout(ActionEvent e) {
- PreviewDialogAboutBox dlg = new PreviewDialogAboutBox(this);
- Dimension dlgSize = dlg.getPreferredSize();
- Dimension frmSize = getSize();
- Point loc = getLocation();
+ public void startHelpAbout(final ActionEvent e) {
+ final PreviewDialogAboutBox dlg = new PreviewDialogAboutBox(this);
+ final Dimension dlgSize = dlg.getPreferredSize();
+ final Dimension frmSize = getSize();
+ final Point loc = getLocation();
dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x,
(frmSize.height - dlgSize.height) / 2 + loc.y);
dlg.setModal(true);
@@ -412,7 +412,7 @@
*
* @param number the page number to go to
*/
- private void goToPage(int number) {
+ private void goToPage(final int number) {
currentPage = number;
renderer.setPageNumber(number);
showPage();
@@ -421,7 +421,7 @@
/**
* Shows the previous page.
*/
- private void goToPreviousPage(ActionEvent e) {
+ private void goToPreviousPage(final ActionEvent e) {
if (currentPage <= 0) {
return;
}
@@ -432,7 +432,7 @@
/**
* Shows the next page.
*/
- private void goToNextPage(ActionEvent e) {
+ private void goToNextPage(final ActionEvent e) {
if (currentPage >= pageCount - 1) {
return;
}
@@ -443,7 +443,7 @@
/**
* Shows the last page.
*/
- private void goToLastPage(ActionEvent e) {
+ private void goToLastPage(final ActionEvent e) {
if (currentPage == pageCount - 1) {
return;
}
@@ -454,7 +454,7 @@
/**
* Reloads and reformats document.
*/
- private synchronized void reload(ActionEvent e) {
+ private synchronized void reload(final ActionEvent e) {
if (reloader == null || !reloader.isAlive()) {
reloader = new Reloader();
reloader.start();
@@ -495,8 +495,8 @@
/**
* Shows a page by number.
*/
- private void goToPage(ActionEvent e) {
- GoToPageDialog d = new GoToPageDialog(this,
+ private void goToPage(final ActionEvent e) {
+ final GoToPageDialog d = new GoToPageDialog(this,
res.getString("Go to Page"),
true,
res, getLogger());
@@ -517,7 +517,7 @@
/**
* Shows the first page.
*/
- private void goToFirstPage(ActionEvent e) {
+ private void goToFirstPage(final ActionEvent e) {
if (currentPage == 0) {
return;
}
@@ -526,7 +526,7 @@
}
private void print() {
- PrinterJob pj = PrinterJob.getPrinterJob();
+ final PrinterJob pj = PrinterJob.getPrinterJob();
// Not necessary, Pageable gets a Printable.
// pj.setPrintable(renderer);
pj.setPageable(renderer);
@@ -534,13 +534,13 @@
if (pj.printDialog()) {
try {
pj.print();
- } catch (PrinterException pe) {
+ } catch (final PrinterException pe) {
pe.printStackTrace();
}
}
}
- public void setScale(double scaleFactor) {
+ public void setScale(final double scaleFactor) {
if (scaleFactor == 25.0) {
scale.setSelectedIndex(0);
} else if (scaleFactor == 50.0) {
@@ -559,15 +559,15 @@
showPage();
}
- void scale_actionPerformed(ActionEvent e) {
+ void scale_actionPerformed(final ActionEvent e) {
setScale(new Double((String)scale.getSelectedItem()).doubleValue());
}
- public void progress(int percentage) {
+ public void progress(final int percentage) {
progress(new String(percentage + "%"));
}
- public void progress(int percentage, String message) {
+ public void progress(final int percentage, final String message) {
progress(new String(message + " " + percentage + "%"));
}
@@ -576,7 +576,7 @@
* needs to be done in the EventThread. Here we make sure
* it is done.
*/
- public void progress(String message) {
+ public void progress(final String message) {
SwingUtilities.invokeLater(new showProgress(message, false));
}
@@ -601,7 +601,8 @@
* @param message message to display
* @param isErrorMessage show in status bar or in JOptionPane
*/
- public showProgress(Object message, boolean isErrorMessage) {
+ public showProgress(final Object message,
+ final boolean isErrorMessage) {
this.message = message;
this.isErrorMessage = isErrorMessage;
}
@@ -617,7 +618,7 @@
}
public void showPage() {
- showPageImage viewer = new showPageImage();
+ final showPageImage viewer = new showPageImage();
if (SwingUtilities.isEventDispatchThread()) {
viewer.run();
@@ -660,8 +661,8 @@
}
}
- public void reportException(Exception e) {
- String msg = res.getString("An exception has occured");
+ public void reportException(final Exception e) {
+ final String msg = res.getString("An exception has occured");
progress(msg);
JOptionPane.showMessageDialog(
getContentPane(),
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialogAboutBox.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialogAboutBox.java 2006-07-23 23:17:34 UTC (rev 7829)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/PreviewDialogAboutBox.java 2006-07-23 23:42:47 UTC (rev 7830)
@@ -76,12 +76,13 @@
String copyright;
String comments = ""; // "Print Preview";
- public PreviewDialogAboutBox(PreviewDialog parent) {
+ public PreviewDialogAboutBox(final PreviewDialog parent) {
super(parent);
- Renderer renderer = parent.getRenderer();
- String product = renderer.getApplicationNameShort() + " AWT-Preview";
- String version = "Version: " + renderer.getApplicationVersion();
- String copyright = "See " + renderer.getDeveloperURLShort();
+ final Renderer renderer = parent.getRenderer();
+ final String product = renderer.getApplicationNameShort()
+ + " AWT-Preview";
+ final String version = "Version: " + renderer.getApplicationVersion();
+ final String copyright = "See " + renderer.getDeveloperURLShort();
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
/* imageIcon = new ImageIcon(getClass().getResource("Hier der
@@ -117,7 +118,7 @@
pack();
}
- protected void processWindowEvent(WindowEvent e) {
+ protected void processWindowEvent(final WindowEvent e) {
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
cancel();
}
@@ -128,7 +129,7 @@
dispose();
}
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
if (e.getSource() == button1) {
cancel();
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/SecureResourceBundle.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/SecureResourceBundle.java 2006-07-23 23:17:34 UTC (rev 7829)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/SecureResourceBundle.java 2006-07-23 23:42:47 UTC (rev 7830)
@@ -51,7 +51,7 @@
private boolean isSourceFound = true;
- public void setMissingEmphasized(boolean flag) {
+ public void setMissingEmphasized(final boolean flag) {
isMissingEmphasized = flag;
}
private Log logger;
@@ -60,11 +60,11 @@
* Kreiert ein ResourceBundle mit der Quelle in <strong>in</strong>.
*/
- public SecureResourceBundle(InputStream in, Log logger) {
+ public SecureResourceBundle(final InputStream in, final Log logger) {
this.logger = logger;
try {
lookup.load(in);
- } catch (Exception ex) {
+ } catch (final Exception ex) {
logger.info("Exception caught: " + ex.getMessage());
isSourceFound = false;
}
@@ -95,11 +95,11 @@
* </UL>
*
*/
- public Object handleGetObject(String key) {
+ public Object handleGetObject(final String key) {
if (key == null) {
return "Key is null";
}
- Object obj = lookup.get(key);
+ final Object obj = lookup.get(key);
if (obj != null) {
return obj;
}
@@ -113,12 +113,12 @@
/**
* Stellt fest, ob es den Key gibt.
*/
- public boolean contains(String key) {
+ public boolean contains(final String key) {
return (key == null || lookup.get(key) == null) ? false : true;
}
- private String getMissedRepresentation(String str) {
+ private String getMissedRepresentation(final String str) {
return "<!" + str + "!>";
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/UserMessage.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/UserMessage.java 2006-07-23 23:17:34 UTC (rev 7829)
+++ trunk/foray/foray-render/src/java/org/foray/render/awt/viewer/UserMessage.java 2006-07-23 23:42:47 UTC (rev 7830)
@@ -40,11 +40,11 @@
private Translator res = null;
private Log logger;
- public UserMessage(Log logger) {
+ public UserMessage(final Log logger) {
this.logger = logger;
}
- public void setTranslator(Translator aRes) {
+ public void setTranslator(final Translator aRes) {
res = aRes;
if (res == null) {
logger.info("UserMessage: setTranslator(null) !");
@@ -149,7 +149,7 @@
/**
* Ersetzt die eventuellen Platzhalter durch die übergebenen Parameter
*/
- String prepareMessage(String rawText, String[] par) {
+ String prepareMessage(String rawText, final String[] par) {
logger.info("prepareMessage(): " + rawText + ", parameter: "
+ par);
int index = rawText.indexOf(PARAMETER_TAG);
@@ -176,7 +176,7 @@
index = rawText.indexOf(PARAMETER_TAG);
try {
composedMess += rawText.substring(0, index) + par[tagCount];
- } catch (ArrayIndexOutOfBoundsException ex) {
+ } catch (final ArrayIndexOutOfBoundsException ex) {
logger.info("Anzahl der übergebenen Parameter zu der Meldung "
+ actMessId
+ " ist weniger als erwartet.");
@@ -200,9 +200,9 @@
* Dieser wird durch die Dialogart festgelegt
* (erster Teil in der MeldungsDefinition in der Properties-Datei).
*/
- String getTitle(String strVal) {
+ String getTitle(final String strVal) {
String title = null;
- int choice = getValue(strVal);
+ final int choice = getValue(strVal);
switch (choice) {
case INFO:
title = "Info";
@@ -226,9 +226,9 @@
/**
* Liefert den Wert der über den Nemen übergebenen Klassenvariablen.
*/
- int getValue(String fieldName) {
+ int getValue(final String fieldName) {
- int val = -1;
+ final int val = -1;
if (fieldName.equals("INFO")) {
return INFO;
}
Modified: trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java
===================================================================
--- trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java 2006-07-23 23:17:34 UTC (rev 7829)
+++ trunk/foray/foray-render/src/java/org/foray/render/pcl/PCLRenderer.java 2006-07-23 23:42:47 UTC (rev 7830)
@@ -83,7 +83,7 @@
/**
* Create the PCL renderer
*/
- public PCLRenderer(Log logger, OutputConfig renderConfig) {
+ public PCLRenderer(final Log logger, final OutputConfig renderConfig) {
super(logger, renderConfig);
}
@@ -98,8 +98,8 @@
* @param rs the rule style
* @param strokeColor the line color
*/
- protected void drawLine(int x1, int y1, int x2, int y2, int th, int rs,
- Color strokeColor) {
+ protected void drawLine(final int x1, final int y1, final int x2,
+ final int y2, final int th, final int rs, final Color strokeColor) {
int dashon = 0;
int dashoff = 0;
// if ( rs != null && rs.length() > 5
@@ -158,9 +158,9 @@
/**
* {@inheritDoc}
*/
- protected void drawRectangle(int x, int y, int w, int h,
- boolean stroke, Color strokeColor, boolean fill,
- Color fillColor) {
+ protected void drawRectangle(final int x, final int y, int w, int h,
+ final boolean stroke, final Color strokeColor,
+ final boolean fill, final Color fillColor) {
if ((h >= 0 && h < 720) || (h < 0 && h > -720) || w < 720) {
if (w < 720) {
w = 720;
@@ -189,8 +189,8 @@
* @param fill the fill color/gradient
* @param stroke the stroke color/gradient
*/
- protected void addRect(int x, int y, int w, int h, Color stroke,
- Color fill) {
+ protected void addRect(final int x, int y, final int w, int h,
+ final Color stroke, final Color fill) {
if ((w == 0) || (h == 0)) {
return;
}
@@ -200,10 +200,10 @@
y += h;
}
- int lineshade = (int)(100 - ((0.3f * stroke.getRed()
+ final int lineshade = (int)(100 - ((0.3f * stroke.getRed()
+ 0.59f * stroke.getGreen() + 0.11f * stroke.getBlue())
* 100f));
- int fillshade = (int)(100 - ((0.3f * fill.getRed()
+ final int fillshade = (int)(100 - ((0.3f * fill.getRed()
+ 0.59f * fill.getGreen() + 0.11f * fill.getBlue())
* 100f));
@@ -236,36 +236,36 @@
/**
* {@inheritDoc}
*/
- protected void drawImage(GraphicArea area, Graphic image,
- Rectangle contentRectangle, Rectangle clipRectangle) {
+ protected void drawImage(final GraphicArea area, final Graphic image,
+ final Rectangle contentRectangle, final Rectangle clipRectangle) {
// TODO: implement this
}
/**
* {@inheritDoc}
*/
- protected void drawSVG(GraphicArea area, SVGGraphic graphic,
- Rectangle contentRectangle, Rectangle clipRectangle) {
+ protected void drawSVG(final GraphicArea area, final SVGGraphic graphic,
+ final Rectangle contentRectangle, final Rectangle clipRectangle) {
/* TODO: Implement this. */
}
- boolean printBMP(Graphic img, int x, int y, int w,
- int h) throws GraphicException {
+ boolean printBMP(final Graphic img, final int x, final int y, final int w,
+ final int h) throws GraphicException {
// Print the passed image file in PCL.
- byte imgmap[] = img.getContent();
+ final byte imgmap[] = img.getContent();
int ix = 0;
int iy = 0;
int indx = 0;
- int iw = img.pixelWidth();
- int ih = img.pixelHeight();
+ final int iw = img.pixelWidth();
+ final int ih = img.pixelHeight();
int bytewidth = (iw / 8);
if ((iw % 8) != 0) {
bytewidth++;
}
byte ib;
- char ic[] = new char[bytewidth * 2];
- char icu[] = new char[bytewidth];
+ final char ic[] = new char[bytewidth * 2];
+ final char icu[] = new char[bytewidth];
int lastcount = -1;
byte lastbyte = 0;
int icwidth = 0;
@@ -273,10 +273,10 @@
int cg = 0;
int cb = 0;
int grey = 0;
- boolean iscolor = img.getColorSpace().getType()
+ final boolean iscolor = img.getColorSpace().getType()
!= ColorSpace.TYPE_GRAY;
- int xres = (iw * 72000) / w;
- int yres = (ih * 72000) / h;
+ final int xres = (iw * 72000) / w;
+ final int yres = (ih * 72000) / h;
int resolution = xres;
if (yres > xres) {
resolution = yres;
@@ -372,13 +372,13 @@
*
* @param area the image area to render
*/
- public void render(ExternalGraphicArea area) {
- int x = area.rrOriginX();
- int y = area.rrOriginY();
- int w = area.rrIPD();
- int h = area.rrBPD();
+ public void render(final ExternalGraphicArea area) {
+ final int x = area.rrOriginX();
+ final int y = area.rrOriginY();
+ final int w = area.rrIPD();
+ final int h = area.rrBPD();
- Graphic img = area.getGraphic();
+ final Graphic img = area.getGraphic();
int xpos = xoffset + (x / 100);
if (xpos < 0) {
@@ -391,7 +391,7 @@
try {
printBMP(img, x, y, w, h);
- } catch (GraphicException e) {
+ } catch (final GraphicException e) {
getLogger().error("PCLRenderer.renderImageArea() Error printing "
+ "BMP (" + e.toString() + ")");
}
@@ -400,7 +400,7 @@
/**
* render a foreign object area
*/
- public void render(ForeignObjectArea area) {
+ public void render(final ForeignObjectArea area) {
// if n...
[truncated message content] |