Search in sources :

Example 1 with ImageResizePanel

use of cbit.gui.ImageResizePanel in project vcell by virtualcell.

the class ClientRequestManager method queryImageResize.

public static ImageSizeInfo queryImageResize(final Component requester, final ImageSizeInfo origImageSizeInfo, boolean bFullMode) {
    ImageResizePanel imageResizePanel = new ImageResizePanel();
    imageResizePanel.init(origImageSizeInfo, bFullMode);
    imageResizePanel.setPreferredSize(new Dimension(400, 200));
    while (true) {
        int flag = DialogUtils.showComponentOKCancelDialog(requester, imageResizePanel, "Optionally convert imported images.");
        if (flag != JOptionPane.OK_OPTION) {
            throw UserCancelException.CANCEL_GENERIC;
        }
        try {
            ImageSizeInfo imagesizeInfo = imageResizePanel.getNewImageSizeInfo();
            return imagesizeInfo;
        } catch (Exception e) {
            e.printStackTrace();
            DialogUtils.showErrorDialog(requester, "Error getting x,y,z: " + e.getMessage());
        }
    }
}
Also used : ImageResizePanel(cbit.gui.ImageResizePanel) Dimension(java.awt.Dimension) ProgrammingException(org.vcell.util.ProgrammingException) GeometryException(cbit.vcell.geometry.GeometryException) IOException(java.io.IOException) DataAccessException(org.vcell.util.DataAccessException) PropertyVetoException(java.beans.PropertyVetoException) ImageException(cbit.image.ImageException) UtilCancelException(org.vcell.util.UtilCancelException) DataFormatException(java.util.zip.DataFormatException) UserCancelException(org.vcell.util.UserCancelException) ImageSizeInfo(cbit.image.ImageSizeInfo)

Aggregations

ImageResizePanel (cbit.gui.ImageResizePanel)1 ImageException (cbit.image.ImageException)1 ImageSizeInfo (cbit.image.ImageSizeInfo)1 GeometryException (cbit.vcell.geometry.GeometryException)1 Dimension (java.awt.Dimension)1 PropertyVetoException (java.beans.PropertyVetoException)1 IOException (java.io.IOException)1 DataFormatException (java.util.zip.DataFormatException)1 DataAccessException (org.vcell.util.DataAccessException)1 ProgrammingException (org.vcell.util.ProgrammingException)1 UserCancelException (org.vcell.util.UserCancelException)1 UtilCancelException (org.vcell.util.UtilCancelException)1