You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Factory.java 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.afp;
  19. import java.io.OutputStream;
  20. import org.apache.commons.logging.Log;
  21. import org.apache.commons.logging.LogFactory;
  22. import org.apache.fop.afp.goca.GraphicsData;
  23. import org.apache.fop.afp.ioca.ImageContent;
  24. import org.apache.fop.afp.ioca.ImageRasterData;
  25. import org.apache.fop.afp.ioca.ImageSegment;
  26. import org.apache.fop.afp.ioca.ImageSizeParameter;
  27. import org.apache.fop.afp.modca.ActiveEnvironmentGroup;
  28. import org.apache.fop.afp.modca.ContainerDataDescriptor;
  29. import org.apache.fop.afp.modca.Document;
  30. import org.apache.fop.afp.modca.GraphicsDataDescriptor;
  31. import org.apache.fop.afp.modca.GraphicsObject;
  32. import org.apache.fop.afp.modca.IMImageObject;
  33. import org.apache.fop.afp.modca.ImageDataDescriptor;
  34. import org.apache.fop.afp.modca.ImageObject;
  35. import org.apache.fop.afp.modca.IncludeObject;
  36. import org.apache.fop.afp.modca.IncludePageSegment;
  37. import org.apache.fop.afp.modca.InvokeMediumMap;
  38. import org.apache.fop.afp.modca.MapCodedFont;
  39. import org.apache.fop.afp.modca.MapContainerData;
  40. import org.apache.fop.afp.modca.MapDataResource;
  41. import org.apache.fop.afp.modca.ObjectAreaDescriptor;
  42. import org.apache.fop.afp.modca.ObjectAreaPosition;
  43. import org.apache.fop.afp.modca.ObjectContainer;
  44. import org.apache.fop.afp.modca.ObjectEnvironmentGroup;
  45. import org.apache.fop.afp.modca.Overlay;
  46. import org.apache.fop.afp.modca.PageDescriptor;
  47. import org.apache.fop.afp.modca.PageGroup;
  48. import org.apache.fop.afp.modca.PageObject;
  49. import org.apache.fop.afp.modca.PresentationEnvironmentControl;
  50. import org.apache.fop.afp.modca.PresentationTextDescriptor;
  51. import org.apache.fop.afp.modca.PresentationTextObject;
  52. import org.apache.fop.afp.modca.ResourceEnvironmentGroup;
  53. import org.apache.fop.afp.modca.ResourceGroup;
  54. import org.apache.fop.afp.modca.ResourceObject;
  55. import org.apache.fop.afp.modca.StreamedResourceGroup;
  56. import org.apache.fop.afp.modca.TagLogicalElement;
  57. import org.apache.fop.afp.util.StringUtils;
  58. /**
  59. * Creator of MO:DCA structured field objects
  60. */
  61. public class Factory {
  62. /** Static logging instance */
  63. private static final Log log = LogFactory.getLog(Factory.class);
  64. private static final String OBJECT_ENVIRONMENT_GROUP_NAME_PREFIX = "OEG";
  65. private static final String ACTIVE_ENVIRONMENT_GROUP_NAME_PREFIX = "AEG";
  66. private static final String IMAGE_NAME_PREFIX = "IMG";
  67. private static final String GRAPHIC_NAME_PREFIX = "GRA";
  68. private static final String BARCODE_NAME_PREFIX = "BAR";
  69. // private static final String OTHER_NAME_PREFIX = "OTH";
  70. private static final String OBJECT_CONTAINER_NAME_PREFIX = "OC";
  71. private static final String RESOURCE_NAME_PREFIX = "RES";
  72. private static final String RESOURCE_GROUP_NAME_PREFIX = "RG";
  73. private static final String PAGE_GROUP_NAME_PREFIX = "PGP";
  74. private static final String PAGE_NAME_PREFIX = "PGN";
  75. private static final String OVERLAY_NAME_PREFIX = "OVL";
  76. private static final String PRESENTATION_TEXT_NAME_PREFIX = "PT";
  77. private static final String DOCUMENT_NAME_PREFIX = "DOC";
  78. private static final String IM_IMAGE_NAME_PREFIX = "IMIMG";
  79. private static final String IMAGE_SEGMENT_NAME_PREFIX = "IS";
  80. /** the page group count */
  81. private int pageGroupCount = 0;
  82. /** the page count */
  83. private int pageCount = 0;
  84. /** the image count */
  85. private int imageCount = 0;
  86. /** the im image count */
  87. private int imImageCount = 0;
  88. /** the image segment count */
  89. private int imageSegmentCount = 0;
  90. /** the graphic count */
  91. private int graphicCount = 0;
  92. /** the object container count */
  93. private int objectContainerCount = 0;
  94. /** the resource count */
  95. private int resourceCount = 0;
  96. /** the resource group count */
  97. private int resourceGroupCount = 0;
  98. /** the overlay count */
  99. private int overlayCount = 0;
  100. /** the presentation text object count */
  101. private int textObjectCount = 0;
  102. /** the active environment group count */
  103. private int activeEnvironmentGroupCount = 0;
  104. /** the document count */
  105. private int documentCount = 0;
  106. /** the object environment group count */
  107. private int objectEnvironmentGroupCount = 0;
  108. /**
  109. * Main constructor
  110. */
  111. public Factory() {
  112. }
  113. /**
  114. * Creates a new IOCA {@link ImageObject}
  115. *
  116. * @return a new {@link ImageObject}
  117. */
  118. public ImageObject createImageObject() {
  119. String name = IMAGE_NAME_PREFIX
  120. + StringUtils.lpad(String.valueOf(++imageCount), '0', 5);
  121. ImageObject imageObject = new ImageObject(this, name);
  122. return imageObject;
  123. }
  124. /**
  125. * Creates an IOCA {@link IMImageObject}
  126. *
  127. * @return a new {@link IMImageObject}
  128. */
  129. public IMImageObject createIMImageObject() {
  130. String name = IM_IMAGE_NAME_PREFIX
  131. + StringUtils.lpad(String.valueOf(++imImageCount), '0', 3);
  132. IMImageObject imImageObject = new IMImageObject(name);
  133. return imImageObject;
  134. }
  135. /**
  136. * Creates a new GOCA {@link GraphicsObject}
  137. *
  138. * @return a new {@link GraphicsObject}
  139. */
  140. public GraphicsObject createGraphicsObject() {
  141. String name = GRAPHIC_NAME_PREFIX
  142. + StringUtils.lpad(String.valueOf(++graphicCount), '0', 5);
  143. GraphicsObject graphicsObj = new GraphicsObject(this, name);
  144. return graphicsObj;
  145. }
  146. /**
  147. * Creates a new MO:DCA {@link ObjectContainer}
  148. *
  149. * @return a new {@link ObjectContainer}
  150. */
  151. public ObjectContainer createObjectContainer() {
  152. String name = OBJECT_CONTAINER_NAME_PREFIX
  153. + StringUtils.lpad(String.valueOf(++objectContainerCount), '0', 6);
  154. return new ObjectContainer(this, name);
  155. }
  156. /**
  157. * Creates a new MO:DCA {@link ResourceObject}
  158. *
  159. * @param resourceName the resource object name
  160. * @return a new {@link ResourceObject}
  161. */
  162. public ResourceObject createResource(String resourceName) {
  163. return new ResourceObject(resourceName);
  164. }
  165. /**
  166. * Creates a new MO:DCA {@link ResourceObject}
  167. *
  168. * @return a new {@link ResourceObject}
  169. */
  170. public ResourceObject createResource() {
  171. String name = RESOURCE_NAME_PREFIX
  172. + StringUtils.lpad(String.valueOf(++resourceCount), '0', 5);
  173. return createResource(name);
  174. }
  175. /**
  176. * Creates a new MO:DCA {@link PageGroup}
  177. *
  178. * @return a new {@link PageGroup}
  179. */
  180. public PageGroup createPageGroup() {
  181. String name = PAGE_GROUP_NAME_PREFIX
  182. + StringUtils.lpad(String.valueOf(++pageGroupCount), '0', 5);
  183. return new PageGroup(this, name);
  184. }
  185. /**
  186. * Creates a new MO:DCA {@link ActiveEnvironmentGroup}
  187. *
  188. * @param width the page width
  189. * @param height the page height
  190. * @param widthRes the page width resolution
  191. * @param heightRes the page height resolution
  192. * @return a new {@link ActiveEnvironmentGroup}
  193. */
  194. public ActiveEnvironmentGroup createActiveEnvironmentGroup(
  195. int width, int height, int widthRes, int heightRes) {
  196. String name = ACTIVE_ENVIRONMENT_GROUP_NAME_PREFIX
  197. + StringUtils.lpad(String.valueOf(++activeEnvironmentGroupCount ), '0', 5);
  198. return new ActiveEnvironmentGroup(this, name, width, height, widthRes, heightRes);
  199. }
  200. /**
  201. * Creates a new MO:DCA {@link ResourceGroup}
  202. *
  203. * @return a new {@link ResourceGroup}
  204. */
  205. public ResourceGroup createResourceGroup() {
  206. String name = RESOURCE_GROUP_NAME_PREFIX
  207. + StringUtils.lpad(String.valueOf(++resourceGroupCount), '0', 6);
  208. return new ResourceGroup(name);
  209. }
  210. /**
  211. * Creates a new MO:DCA {@link StreamedResourceGroup}
  212. *
  213. * @param os the outputstream of the streamed resource group
  214. * @return a new {@link StreamedResourceGroup}
  215. */
  216. public StreamedResourceGroup createStreamedResourceGroup(OutputStream os) {
  217. String name = RESOURCE_GROUP_NAME_PREFIX
  218. + StringUtils.lpad(String.valueOf(++resourceGroupCount), '0', 6);
  219. return new StreamedResourceGroup(name, os);
  220. }
  221. /**
  222. * Creates a new MO:DCA {@link PageObject}.
  223. *
  224. * @param pageWidth
  225. * the width of the page
  226. * @param pageHeight
  227. * the height of the page
  228. * @param pageRotation
  229. * the rotation of the page
  230. * @param pageWidthRes
  231. * the width resolution of the page
  232. * @param pageHeightRes
  233. * the height resolution of the page
  234. *
  235. * @return a new {@link PageObject}
  236. */
  237. public PageObject createPage(int pageWidth, int pageHeight, int pageRotation,
  238. int pageWidthRes, int pageHeightRes) {
  239. String pageName = PAGE_NAME_PREFIX
  240. + StringUtils.lpad(String.valueOf(++pageCount), '0', 5);
  241. return new PageObject(this, pageName, pageWidth, pageHeight,
  242. pageRotation, pageWidthRes, pageHeightRes);
  243. }
  244. /**
  245. * Creates a new MO:DCA {@link PresentationTextObject}.
  246. *
  247. * @return a new {@link PresentationTextObject}
  248. */
  249. public PresentationTextObject createPresentationTextObject() {
  250. String textObjectName = PRESENTATION_TEXT_NAME_PREFIX
  251. + StringUtils.lpad(String.valueOf(++textObjectCount), '0', 6);
  252. return new PresentationTextObject(textObjectName);
  253. }
  254. /**
  255. * Creates a new MO:DCA {@link Overlay}.
  256. *
  257. * @param width
  258. * the width of the overlay
  259. * @param height
  260. * the height of the overlay
  261. * @param widthRes
  262. * the width resolution of the overlay
  263. * @param heightRes
  264. * the height resolution of the overlay
  265. * @param overlayRotation
  266. * the rotation of the overlay
  267. *
  268. * @return a new {@link Overlay}.
  269. */
  270. public Overlay createOverlay(int width, int height,
  271. int widthRes, int heightRes, int overlayRotation) {
  272. String overlayName = OVERLAY_NAME_PREFIX
  273. + StringUtils.lpad(String.valueOf(++overlayCount), '0', 5);
  274. Overlay overlay = new Overlay(this, overlayName, width, height,
  275. overlayRotation, widthRes, heightRes);
  276. return overlay;
  277. }
  278. /**
  279. * Creates a MO:DCA {@link Document}
  280. *
  281. * @return a new {@link Document}
  282. */
  283. public Document createDocument() {
  284. String documentName = DOCUMENT_NAME_PREFIX
  285. + StringUtils.lpad(String.valueOf(++documentCount), '0', 5);
  286. Document document = new Document(this, documentName);
  287. return document;
  288. }
  289. /**
  290. * Creates a MO:DCA {@link MapCodedFont}
  291. *
  292. * @return a new {@link MapCodedFont}
  293. */
  294. public MapCodedFont createMapCodedFont() {
  295. MapCodedFont mapCodedFont = new MapCodedFont();
  296. return mapCodedFont;
  297. }
  298. /**
  299. * Creates a MO:DCA {@link IncludePageSegment}
  300. *
  301. * @param name the page segment name
  302. * @param x the x coordinate
  303. * @param y the y coordinate
  304. *
  305. * @return a new {@link IncludePageSegment}
  306. */
  307. public IncludePageSegment createIncludePageSegment(String name, int x, int y) {
  308. IncludePageSegment includePageSegment = new IncludePageSegment(name, x, y);
  309. return includePageSegment;
  310. }
  311. /**
  312. * Creates a MO:DCA {@link IncludeObject}
  313. *
  314. * @param name the name of this include object
  315. * @return a new {@link IncludeObject}
  316. */
  317. public IncludeObject createInclude(String name) {
  318. IncludeObject includeObject = new IncludeObject(name);
  319. return includeObject;
  320. }
  321. /**
  322. * Creates a MO:DCA {@link TagLogicalElement}
  323. *
  324. * @param name name of the element
  325. * @param value value of the element
  326. * @return a new {@link TagLogicalElement}
  327. */
  328. public TagLogicalElement createTagLogicalElement(String name, String value) {
  329. TagLogicalElement tle = new TagLogicalElement(name, value);
  330. return tle;
  331. }
  332. /**
  333. * Creates a new {@link DataStream}
  334. *
  335. * @param paintingState the AFP painting state
  336. * @param outputStream an outputstream to write to
  337. * @return a new {@link DataStream}
  338. */
  339. public DataStream createDataStream(AFPPaintingState paintingState, OutputStream outputStream) {
  340. DataStream dataStream = new DataStream(this, paintingState, outputStream);
  341. return dataStream;
  342. }
  343. /**
  344. * Creates a new MO:DCA {@link PageDescriptor}
  345. *
  346. * @param width the page width.
  347. * @param height the page height.
  348. * @param widthRes the page width resolution.
  349. * @param heightRes the page height resolution.
  350. * @return a new {@link PageDescriptor}
  351. */
  352. public PageDescriptor createPageDescriptor(int width, int height, int widthRes, int heightRes) {
  353. PageDescriptor pageDescriptor = new PageDescriptor(width, height, widthRes, heightRes);
  354. return pageDescriptor;
  355. }
  356. /**
  357. * Returns a new MO:DCA {@link ObjectEnvironmentGroup}
  358. *
  359. * @return a new {@link ObjectEnvironmentGroup}
  360. */
  361. public ObjectEnvironmentGroup createObjectEnvironmentGroup() {
  362. String oegName = OBJECT_ENVIRONMENT_GROUP_NAME_PREFIX
  363. + StringUtils.lpad(String.valueOf(++objectEnvironmentGroupCount), '0', 5);
  364. ObjectEnvironmentGroup objectEnvironmentGroup = new ObjectEnvironmentGroup(oegName);
  365. return objectEnvironmentGroup;
  366. }
  367. /**
  368. * Creates a new GOCA {@link GraphicsData}
  369. *
  370. * @return a new {@link GraphicsData}
  371. */
  372. public GraphicsData createGraphicsData() {
  373. GraphicsData graphicsData = new GraphicsData();
  374. return graphicsData;
  375. }
  376. /**
  377. * Creates a new {@link ObjectAreaDescriptor}
  378. *
  379. * @param width the object width.
  380. * @param height the object height.
  381. * @param widthRes the object width resolution.
  382. * @param heightRes the object height resolution.
  383. * @return a new {@link ObjectAreaDescriptor}
  384. */
  385. public ObjectAreaDescriptor createObjectAreaDescriptor(
  386. int width, int height, int widthRes, int heightRes) {
  387. ObjectAreaDescriptor objectAreaDescriptor
  388. = new ObjectAreaDescriptor(width, height, widthRes, heightRes);
  389. return objectAreaDescriptor;
  390. }
  391. /**
  392. * Creates a new {@link ObjectAreaPosition}
  393. *
  394. * @param x the x coordinate.
  395. * @param y the y coordinate.
  396. * @param rotation the coordinate system rotation (must be 0, 90, 180, 270).
  397. * @return a new {@link ObjectAreaPosition}
  398. */
  399. public ObjectAreaPosition createObjectAreaPosition(int x, int y,
  400. int rotation) {
  401. ObjectAreaPosition objectAreaPosition = new ObjectAreaPosition(
  402. x, y, rotation);
  403. return objectAreaPosition;
  404. }
  405. /**
  406. * Creates a new {@link ImageDataDescriptor}
  407. *
  408. * @param width the image width
  409. * @param height the image height
  410. * @param widthRes the x resolution of the image
  411. * @param heightRes the y resolution of the image
  412. * @return a new {@link ImageDataDescriptor}
  413. */
  414. public ImageDataDescriptor createImageDataDescriptor(
  415. int width, int height, int widthRes, int heightRes) {
  416. ImageDataDescriptor imageDataDescriptor = new ImageDataDescriptor(
  417. width, height, widthRes, heightRes);
  418. return imageDataDescriptor;
  419. }
  420. /**
  421. * Creates a new GOCA {@link GraphicsDataDescriptor}
  422. *
  423. * @param xlwind the left edge of the graphics window
  424. * @param xrwind the right edge of the graphics window
  425. * @param ybwind the top edge of the graphics window
  426. * @param ytwind the bottom edge of the graphics window
  427. * @param widthRes the x resolution of the graphics window
  428. * @param heightRes the y resolution of the graphics window
  429. * @return a new {@link GraphicsDataDescriptor}
  430. */
  431. public GraphicsDataDescriptor createGraphicsDataDescriptor(
  432. int xlwind, int xrwind, int ybwind, int ytwind, int widthRes, int heightRes) {
  433. GraphicsDataDescriptor graphicsDataDescriptor = new GraphicsDataDescriptor(
  434. xlwind, xrwind, ybwind, ytwind, widthRes, heightRes);
  435. return graphicsDataDescriptor;
  436. }
  437. /**
  438. * Creates a new MO:DCA {@link ContainerDataDescriptor}
  439. *
  440. * @param dataWidth the container data width
  441. * @param dataHeight the container data height
  442. * @param widthRes the container data width resolution
  443. * @param heightRes the container data height resolution
  444. * @return a new {@link ContainerDataDescriptor}
  445. */
  446. public ContainerDataDescriptor createContainerDataDescriptor(
  447. int dataWidth, int dataHeight, int widthRes, int heightRes) {
  448. ContainerDataDescriptor containerDataDescriptor
  449. = new ContainerDataDescriptor(dataWidth, dataHeight, widthRes, heightRes);
  450. return containerDataDescriptor;
  451. }
  452. /**
  453. * Creates a new MO:DCA {@link MapContainerData}
  454. *
  455. * @param optionValue the option value
  456. * @return a new {@link MapContainerData}
  457. */
  458. public MapContainerData createMapContainerData(byte optionValue) {
  459. MapContainerData mapContainerData = new MapContainerData(optionValue);
  460. return mapContainerData;
  461. }
  462. /**
  463. * Creates a new MO:DCA {@link MapDataResource}
  464. *
  465. * @return a new {@link MapDataResource}
  466. */
  467. public MapDataResource createMapDataResource() {
  468. MapDataResource mapDataResource = new MapDataResource();
  469. return mapDataResource;
  470. }
  471. /**
  472. * Creates a new PTOCA {@link PresentationTextDescriptor}
  473. *
  474. * @return a new {@link PresentationTextDescriptor}
  475. */
  476. public PresentationTextDescriptor createPresentationTextDataDescriptor(
  477. int width, int height, int widthRes, int heightRes) {
  478. PresentationTextDescriptor presentationTextDescriptor
  479. = new PresentationTextDescriptor(width, height,
  480. widthRes, heightRes);
  481. return presentationTextDescriptor;
  482. }
  483. /**
  484. * Creates a new MO:DCA {@link PresentationEnvironmentControl}
  485. *
  486. * @return a new {@link PresentationEnvironmentControl}
  487. */
  488. public PresentationEnvironmentControl createPresentationEnvironmentControl() {
  489. PresentationEnvironmentControl presentationEnvironmentControl
  490. = new PresentationEnvironmentControl();
  491. return presentationEnvironmentControl;
  492. }
  493. /**
  494. * Creates a new MO:DCA {@link InvokeMediumMap}
  495. *
  496. * @param name the object name
  497. * @return a new {@link InvokeMediumMap}
  498. */
  499. public InvokeMediumMap createInvokeMediumMap(String name) {
  500. InvokeMediumMap invokeMediumMap = new InvokeMediumMap(name);
  501. return invokeMediumMap;
  502. }
  503. /**
  504. * Creates a new MO:DCA {@link ResourceEnvironmentGroup}
  505. *
  506. * @return a new {@link ResourceEnvironmentGroup}
  507. */
  508. public ResourceEnvironmentGroup createResourceEnvironmentGroup() {
  509. ResourceEnvironmentGroup resourceEnvironmentGroup = new ResourceEnvironmentGroup();
  510. return resourceEnvironmentGroup;
  511. }
  512. /**
  513. * Creates a new IOCA {@link ImageSegment}
  514. *
  515. * @return a new {@link ImageSegment}
  516. */
  517. public ImageSegment createImageSegment() {
  518. String name = IMAGE_SEGMENT_NAME_PREFIX
  519. + StringUtils.lpad(String.valueOf(++imageSegmentCount), '0', 2);
  520. ImageSegment imageSegment = new ImageSegment(this, name);
  521. return imageSegment;
  522. }
  523. /**
  524. * Creates an new IOCA {@link ImageContent}
  525. *
  526. * @return an {@link ImageContent}
  527. */
  528. public ImageContent createImageContent() {
  529. ImageContent imageContent = new ImageContent();
  530. return imageContent;
  531. }
  532. /**
  533. * Creates a new IOCA {@link ImageRasterData}
  534. *
  535. * @param rasterData raster data
  536. * @return a new {@link ImageRasterData}
  537. */
  538. public ImageRasterData createImageRasterData(byte[] rasterData) {
  539. ImageRasterData imageRasterData = new ImageRasterData(rasterData);
  540. return imageRasterData;
  541. }
  542. /**
  543. * Creates an new IOCA {@link ImageSizeParameter}.
  544. *
  545. * @param hsize The horizontal size of the image.
  546. * @param vsize The vertical size of the image.
  547. * @param hresol The horizontal resolution of the image.
  548. * @param vresol The vertical resolution of the image.
  549. * @return a new {@link ImageSizeParameter}
  550. */
  551. public ImageSizeParameter createImageSizeParameter(int hsize, int vsize,
  552. int hresol, int vresol) {
  553. ImageSizeParameter imageSizeParameter
  554. = new ImageSizeParameter(hsize, vsize, hresol, vresol);
  555. return imageSizeParameter;
  556. }
  557. }