Package org.activiti.image.exception

Examples of org.activiti.image.exception.ActivitiImageException


   * Throws an {@link ActivitiException} when {@link #close()} is already
   * called.
   */
  public InputStream generateImage(String imageType) {
    if (closed) {
      throw new ActivitiImageException("ProcessDiagramGenerator already closed");
    }

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    try {
      // Try to remove white space
      minX = (minX <= 5) ? 5 : minX;
      minY = (minY <= 5) ? 5 : minY;
      BufferedImage imageToSerialize = processDiagram;
      if (minX >= 0 && minY >= 0) {
        imageToSerialize = processDiagram.getSubimage(minX - 5, minY - 5, canvasWidth - minX + 5, canvasHeight - minY + 5);
      }
      ImageIO.write(imageToSerialize, imageType, out);
     
    } catch (IOException e) {
      throw new ActivitiImageException("Error while generating process image", e);
    } finally {
      try {
        if (out != null) {
          out.close();
        }
View Full Code Here


   * Throws an {@link ActivitiException} when {@link #close()} is already
   * called.
   */
  public BufferedImage generateBufferedImage(String imageType) {
    if (closed) {
      throw new ActivitiImageException("ProcessDiagramGenerator already closed");
    }

    // Try to remove white space
    minX = (minX <= 5) ? 5 : minX;
    minY = (minY <= 5) ? 5 : minY;
View Full Code Here

   * Throws an {@link ActivitiException} when {@link #close()} is already
   * called.
   */
  public InputStream generateImage(String imageType) {
    if (closed) {
      throw new ActivitiImageException("ProcessDiagramGenerator already closed");
    }

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    try {
      // Try to remove white space
      minX = (minX <= 5) ? 5 : minX;
      minY = (minY <= 5) ? 5 : minY;
      BufferedImage imageToSerialize = processDiagram;
      if (minX >= 0 && minY >= 0) {
        imageToSerialize = processDiagram.getSubimage(minX - 5, minY - 5, canvasWidth - minX + 5, canvasHeight - minY + 5);
      }
      ImageIO.write(imageToSerialize, imageType, out);
     
    } catch (IOException e) {
      throw new ActivitiImageException("Error while generating process image", e);
    } finally {
      try {
        if (out != null) {
          out.close();
        }
View Full Code Here

   * Throws an {@link ActivitiException} when {@link #close()} is already
   * called.
   */
  public BufferedImage generateBufferedImage(String imageType) {
    if (closed) {
      throw new ActivitiImageException("ProcessDiagramGenerator already closed");
    }

    // Try to remove white space
    minX = (minX <= 5) ? 5 : minX;
    minY = (minY <= 5) ? 5 : minY;
View Full Code Here

TOP

Related Classes of org.activiti.image.exception.ActivitiImageException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.