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

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