Package org.shaitu.easyphoto.vo

Examples of org.shaitu.easyphoto.vo.ImageActionParamsVO


        cbOnTop.setSelected(optionsVO.isOnTop());
        cbOnTopActionPerformed(null);
        cbAutoOpen.setSelected(optionsVO.isAutoOpenOutput());
        cbOutputNoAsk.setSelected(optionsVO.isOutputNoAsk());
        //reset image operation param
        ImageActionParamsVO paramsVO = AppUtil.retrieveOperParams();
        if(paramsVO != null){
            //reset image choose
            if(paramsVO.getOutputFolder() != null){
                outputFolder = paramsVO.getOutputFolder();
            }
            cbOverride.setSelected(paramsVO.isOverride());
            //image export
            sdQuality.setValue(paramsVO.getQuality());
            tfQuality.setText(String.valueOf(sdQuality.getValue()));
            sdSize.setValue(paramsVO.getResizeIndex());
            javax.swing.JLabel lbSize = (javax.swing.JLabel)sdSize.getLabelTable().get(paramsVO.getResizeIndex());
            tfSize.setText(lbSize.getText());
            //corner round
            cbApplyRound.setSelected(paramsVO.isApplyRound());
            sdCornerSize.setValue(paramsVO.getCornerSize());
            //exif
            cbApplyExif.setSelected(paramsVO.isApplyExif());
            UIUtil.retrieveButtonGroup(btgStyle, paramsVO.getExifStyle());
            if(paramsVO.getExifFont() != null){
                exifFont = paramsVO.getExifFont();
            }
            tfExifSign.setText(paramsVO.getSign());
            cbExifCamera.setSelected(paramsVO.isAppendCamera());
            cbExifApt.setSelected(paramsVO.isAppendApt());
            cbExifDate.setSelected(paramsVO.isAppendDate());
            cbExifExp.setSelected(paramsVO.isAppendExp());
            cbExifFocal.setSelected(paramsVO.isAppendFocal());
            cbExifIso.setSelected(paramsVO.isAppendIso());
            //text watermark
            cbApplyTextWm.setSelected(paramsVO.isApplyWatermarkText());
            UIUtil.retrieveButtonGroup(btgWmStyle, paramsVO.getWatermarkTextStyle());
            tfWmText.setText(paramsVO.getWatermarkText());
            if(paramsVO.getWatermarkTextFont() != null){
                wmTextFont = paramsVO.getWatermarkTextFont();
            }
            if(paramsVO.getWatermarkColor() != null){
                wmTextColor = paramsVO.getWatermarkColor();
            }
            sdWmTextOpaque.setValue(paramsVO.getWatermarkTextAlpha());
        }
        if(paramsVO.getInputFiles() != null && paramsVO.getInputFiles().length > 0){
            fcInput.setCurrentDirectory(paramsVO.getInputFiles()[0]);
        }
        //auto check update
        if(AppUtil.isUpdateCheckNeed()){
            doCheckUpdateAction(true);
            AppUtil.rememberUpdateCheck();          
View Full Code Here


    /**
     * get image decorative params
     * @return ImageActionParamsVO istance
     */
    public ImageActionParamsVO getImageActionParamsVO(){
        ImageActionParamsVO vo = new ImageActionParamsVO();
        //image
        vo.setInputFiles(inputFiles);
        vo.setOutputFolder(outputFolder);
        vo.setOverride(cbOverride.isSelected());
        //export options
        vo.setQuality(sdQuality.getValue());
        vo.setResizeIndex(sdSize.getValue());
        if(sdSize.getValue() == 1){
            vo.setApplyResize(false);
            vo.setResize(0);
        } else {
            vo.setApplyResize(true);
            try{
                vo.setResize(Integer.parseInt(tfSize.getText()))
            }catch(Exception e){
                vo.setResize(AppConstants.DEFAULT_RESIZE);
            }          
        }
        //corner round
        vo.setApplyRound(cbApplyRound.isSelected());
        vo.setCornerSize(sdCornerSize.getValue());
        //exif
        vo.setApplyExif(cbApplyExif.isSelected());
        vo.setExifStyle(UIUtil.getSelectedValue(btgStyle));
        vo.setAppendDate(cbExifDate.isSelected());
        vo.setAppendCamera(cbExifCamera.isSelected());
        vo.setAppendApt(cbExifApt.isSelected());
        vo.setAppendExp(cbExifExp.isSelected());
        vo.setAppendFocal(cbExifFocal.isSelected());
        vo.setAppendIso(cbExifIso.isSelected());
        vo.setSign(tfExifSign.getText());
        vo.setExifFont(exifFont);
        //text watermark
        vo.setApplyWatermarkText(cbApplyTextWm.isSelected());
        vo.setWatermarkTextFont(wmTextFont);
        vo.setWatermarkColor(wmTextColor);
        vo.setWatermarkTextStyle(UIUtil.getSelectedValue(btgWmStyle));
        vo.setWatermarkText(tfWmText.getText());
        vo.setWatermarkTextAlpha(sdWmTextOpaque.getValue());
        return vo;
    }
View Full Code Here

  @Override
  protected Object doInBackground() throws Exception {
    try {
            autoOpenOutput = main.getAppOptionsVO().isAutoOpenOutput();
      // generate ImageProceedVO instance
      ImageActionParamsVO vo = main.getImageActionParamsVO();
          outputFolder = vo.getOutputFolder();
          if(vo.isOverride()){
            outputFolder = vo.getInputFiles()[0];
          }
      //print action vo info for debug
      logger.info(vo.toString());
      imageAction.handle(vo);
      // monitor progress status
      while (!imageAction.isDone()) {
        Thread.sleep(100);
        // publish(controller.getImgDoneCount());
View Full Code Here

     * @return
     */
    public static ImageActionParamsVO retrieveOperParams(){
        try{
            Config config = Config.getInstance();
            ImageActionParamsVO vo = new ImageActionParamsVO();
            //image choose
            if(!StringUtil.isNullOrBlank(config.getValue("input_files"))){
                File[] inputFiles = {new File(config.getValue("input_files"))};
                vo.setInputFiles(inputFiles);
            }
            if(!StringUtil.isNullOrBlank(config.getValue("output_folder"))){
                vo.setOutputFolder(new File(config.getValue("output_folder")));
            }
            vo.setOverride(config.getBooleanValue("override"));
            //export
            vo.setQuality(config.getIntValue("quality",AppConstants.DEFAULT_QUALITY));
            vo.setApplyResize(config.getBooleanValue("apply_resize"));
            vo.setResize(config.getIntValue("resize",AppConstants.DEFAULT_RESIZE));
            vo.setResizeIndex(config.getIntValue("resize_index",AppConstants.DEFAULT_RESIZE_INDEX));
            //corner round
            vo.setApplyRound(Boolean.valueOf(config.getValue("apply_round")));
            vo.setCornerSize(config.getIntValue("corner_size",AppConstants.DEFAULT_CORNER_SIZE));
            //exif info
            vo.setApplyExif(Boolean.valueOf(config.getValue("apply_exif")));
            vo.setExifStyle(config.getValue("exif_style"));
            vo.setAppendApt(Boolean.valueOf(config.getValue("append_apt")));
            vo.setAppendCamera(Boolean.valueOf(config.getValue("append_camera")));
            vo.setAppendDate(Boolean.valueOf(config.getValue("append_date")));
            vo.setAppendExp(Boolean.valueOf(config.getValue("append_exp")));
            vo.setAppendFocal(Boolean.valueOf(config.getValue("append_focal")));
            vo.setAppendIso(Boolean.valueOf(config.getValue("append_iso")));
            String sign = config.getValue("sign");
            vo.setSign((sign==null)?"":sign);
            if(!StringUtil.isNullOrBlank(config.getValue("exif_font"))){
                vo.setExifFont(Font.decode(config.getValue("exif_font")));
            }
            //text watermark
            vo.setApplyWatermarkText(config.getBooleanValue("apply_text_watermark"));
            vo.setWatermarkTextStyle(config.getValue("text_watermark_style"));
            vo.setWatermarkText(config.getValue("text_watermark"));
            if(!StringUtil.isNullOrBlank(config.getValue("text_watermakr_font"))){
                vo.setWatermarkTextFont(Font.decode(config.getValue("text_watermakr_font")));
            }
            if(!StringUtil.isNullOrBlank(config.getValue("text_watermakr_color"))){
                vo.setWatermarkColor(Color.decode(config.getValue("text_watermakr_color")));
            }
            vo.setWatermarkTextAlpha(config.getIntValue("text_watermark_alpha",0));
            return vo;
        }catch(Exception e){
            e.printStackTrace();
        }
        return null;
View Full Code Here

TOP

Related Classes of org.shaitu.easyphoto.vo.ImageActionParamsVO

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.