Examples of SlideShowException


Examples of org.pdfsam.console.exceptions.console.SlideShowException

        File outFile = new File(inputCommand.getOutputFile() ,prefixParser.generateFileName());
          FileUtility.renameTemporaryFile(tmpFile, outFile, inputCommand.isOverwrite());
          LOG.debug("File "+outFile.getCanonicalPath()+" created.");
          LOG.info("Slide show options set.");
      }catch(Exception e){       
        throw new SlideShowException(e);
      }finally{
        setWorkCompleted();
      }
    }else{
      throw new ConsoleException(ConsoleException.ERR_BAD_COMMAND);
View Full Code Here

Examples of org.pdfsam.console.exceptions.console.SlideShowException

          Node defType = rootNode.selectSingleNode("@defaulttype");
          Node defTransDur = rootNode.selectSingleNode("@defaulttduration");
          Node defDur = rootNode.selectSingleNode("@defaultduration");
          if(defType != null && defTransDur != null && defDur != null){
            if(transitions.getDefaultTransition() != null){
              throw new SlideShowException(SlideShowException.ERR_DEFAULT_TRANSITION_ALREADY_SET);
            }else{
              transitions.setDefaultTransition(new Transition(Transition.EVERY_PAGE, new Integer(defTransDur.getText().trim()).intValue(), defType.getText().trim(), new Integer(defDur.getText().trim()).intValue()));
            }
          }
          List transitionsList = document.selectNodes("/transitions/transition");
          for (int i = 0; transitionsList != null && i < transitionsList.size(); i++) {
            Node transitionNode = (Node) transitionsList.get(i);
            Node type = transitionNode.selectSingleNode("@type");
            Node transDuration = transitionNode.selectSingleNode("@tduration");
            Node duration = transitionNode.selectSingleNode("@duration");
            Node page = transitionNode.selectSingleNode("@pagenumber");
            if(type != null && transDuration != null && duration != null && page != null){             
              transitions.addTransition(new Transition(new Integer(page.getText().trim()).intValue(), new Integer(transDuration.getText().trim()).intValue(), type.getText().trim(), new Integer(duration.getText().trim()).intValue()));             
            }else{
              throw new SlideShowException(SlideShowException.ERR_READING_TRANSITION, new String[] {i+""});
            }
          }
        }else{
          throw new SlideShowException(SlideShowException.ERR_READING_XML_TRANSITIONS_FILE);
        }
      }
      catch(Exception e){
        throw new SlideShowException(SlideShowException.ERR_READING_XML_TRANSITIONS_FILE, e);
      }
    }
    return retVal;
  }
View Full Code Here

Examples of org.pdfsam.console.exceptions.console.SlideShowException

            HashSet transitionsList = new HashSet(tOption.getValues().size());
            for(Iterator tIterator = tOption.getValues().iterator(); tIterator.hasNext();){
              String transition = (String) tIterator.next();
              Transition transitionObject = stringToTransition(transition);
              if(!transitionsList.add(transitionObject)){
                throw new SlideShowException(SlideShowException.UNABLE_TO_ADD_TRANSITION, new String[]{transition,transitionObject.toString()});
              }
            }
            parsedCommandDTO.setTransitions((Transition[])transitionsList.toArray(new Transition[transitionsList.size()]));
          }
         
View Full Code Here

Examples of org.pdfsam.console.exceptions.console.SlideShowException

          int transitionDuration = Integer.parseInt(transParams[1]);
          int duration = Integer.parseInt(transParams[2]);
          int pageNumber = (transParams.length>3)? Integer.parseInt(transParams[3]): Transition.EVERY_PAGE;
          retVal = new Transition(pageNumber, transitionDuration, transition, duration);
        }catch(Exception e){
          throw new SlideShowException(SlideShowException.ERR_BAD_INPUT_STRING, new String[]{inputString}, e);
        }
      }else{
        throw new SlideShowException(SlideShowException.ERR_UNCOMPLETE_INPUT_STRING, new String[]{inputString});
      }
    }else{
      throw new SlideShowException(SlideShowException.ERR_EMPTY_INPUT_STRING);
    }
    return retVal;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.