diff options
author | Adrian Cumiskey <acumiskey@apache.org> | 2007-12-05 17:43:46 +0000 |
---|---|---|
committer | Adrian Cumiskey <acumiskey@apache.org> | 2007-12-05 17:43:46 +0000 |
commit | 836abe43124e0b98995e48152feac7d235c5cd7b (patch) | |
tree | 494f3026698870fc700c1e27381411a9c75a3a59 | |
parent | 57904a9cc5d8e74d9b4a800ae6f149afe7a995b1 (diff) | |
download | xmlgraphics-fop-836abe43124e0b98995e48152feac7d235c5cd7b.tar.gz xmlgraphics-fop-836abe43124e0b98995e48152feac7d235c5cd7b.zip |
Checkstyle fixes
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@601444 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/java/org/apache/fop/render/afp/modca/ImageSegment.java | 76 |
1 files changed, 32 insertions, 44 deletions
diff --git a/src/java/org/apache/fop/render/afp/modca/ImageSegment.java b/src/java/org/apache/fop/render/afp/modca/ImageSegment.java index 3b2e71552..7d6cc18aa 100644 --- a/src/java/org/apache/fop/render/afp/modca/ImageSegment.java +++ b/src/java/org/apache/fop/render/afp/modca/ImageSegment.java @@ -42,25 +42,23 @@ public class ImageSegment extends AbstractAFPObject { /** * The name of the image segment */ - private String _name; + private String name; /** * The name of the image segment as EBCIDIC bytes */ - private byte[] _nameBytes; + private byte[] nameBytes; /** * The ImageContent for the image segment */ - private ImageContent _imageContent = null; + private ImageContent imageContent = null; /** * Default constructor for the ImageSegment. */ public ImageSegment() { - this(DEFAULT_NAME); - } /** @@ -76,21 +74,16 @@ public class ImageSegment extends AbstractAFPObject { throw new IllegalArgumentException(msg); } - _name = name; + this.name = name; try { - - _nameBytes = name.getBytes(AFPConstants.EBCIDIC_ENCODING); - + this.nameBytes = name.getBytes(AFPConstants.EBCIDIC_ENCODING); } catch (UnsupportedEncodingException usee) { - - _nameBytes = name.getBytes(); + this.nameBytes = name.getBytes(); log.warn( "Constructor:: UnsupportedEncodingException translating the name " + name); - } - } /** @@ -102,10 +95,10 @@ public class ImageSegment extends AbstractAFPObject { * @param vsize The vertival size of the image. */ public void setImageSize(int hresol, int vresol, int hsize, int vsize) { - if (_imageContent == null) { - _imageContent = new ImageContent(); + if (imageContent == null) { + imageContent = new ImageContent(); } - _imageContent.setImageSize(hresol, vresol, hsize, vsize); + imageContent.setImageSize(hresol, vresol, hsize, vsize); } /** @@ -113,10 +106,10 @@ public class ImageSegment extends AbstractAFPObject { * @param encoding The image encoding. */ public void setImageEncoding(byte encoding) { - if (_imageContent == null) { - _imageContent = new ImageContent(); + if (imageContent == null) { + imageContent = new ImageContent(); } - _imageContent.setImageEncoding(encoding); + imageContent.setImageEncoding(encoding); } /** @@ -124,10 +117,10 @@ public class ImageSegment extends AbstractAFPObject { * @param compression The image compression. */ public void setImageCompression(byte compression) { - if (_imageContent == null) { - _imageContent = new ImageContent(); + if (imageContent == null) { + imageContent = new ImageContent(); } - _imageContent.setImageCompression(compression); + imageContent.setImageCompression(compression); } /** @@ -135,10 +128,10 @@ public class ImageSegment extends AbstractAFPObject { * @param size The IDE size. */ public void setImageIDESize(byte size) { - if (_imageContent == null) { - _imageContent = new ImageContent(); + if (imageContent == null) { + imageContent = new ImageContent(); } - _imageContent.setImageIDESize(size); + imageContent.setImageIDESize(size); } /** @@ -146,35 +139,34 @@ public class ImageSegment extends AbstractAFPObject { * @param colorModel the IDE color model. */ public void setImageIDEColorModel(byte colorModel) { - if (_imageContent == null) { - _imageContent = new ImageContent(); + if (imageContent == null) { + imageContent = new ImageContent(); } - _imageContent.setImageIDEColorModel(colorModel); + imageContent.setImageIDEColorModel(colorModel); } /** * Set the data of the image. * @param data the image data */ - public void setImageData(byte data[]) { - if (_imageContent == null) { - _imageContent = new ImageContent(); + public void setImageData(byte[] data) { + if (imageContent == null) { + imageContent = new ImageContent(); } - _imageContent.setImageData(data); + imageContent.setImageData(data); } /** * Accessor method to write the AFP datastream for the Image Segment * @param os The stream to write to - * @throws java.io.IOException + * @throws java.io.IOException if an I/O exception occurred */ - public void writeDataStream(OutputStream os) - throws IOException { + public void writeDataStream(OutputStream os) throws IOException { writeStart(os); - if (_imageContent != null) { - _imageContent.writeDataStream(os); + if (imageContent != null) { + imageContent.writeDataStream(os); } writeEnd(os); @@ -197,9 +189,9 @@ public class ImageSegment extends AbstractAFPObject { 0x00, // Name byte 4 }; - for (int i = 0; i < _nameBytes.length; i++) { + for (int i = 0; i < nameBytes.length; i++) { - data[2 + i] = _nameBytes[i]; + data[2 + i] = nameBytes[i]; } @@ -211,16 +203,12 @@ public class ImageSegment extends AbstractAFPObject { * Helper method to write the end of the Image Segment. * @param os The stream to write to */ - private void writeEnd(OutputStream os) - throws IOException { + private void writeEnd(OutputStream os) throws IOException { byte[] data = new byte[] { 0x71, // ID 0x00, // Length }; - os.write(data); - } - } |