コード例 #1
0
 protected void buttonPressed(int buttonId) {
   if (buttonId == IDialogConstants.OK_ID) {
     editObject.format = formats[comboTextureType.getSelectionIndex()];
     editObject.sizeWidth = sizes[comboTextureSize.getSelectionIndex()];
     editObject.sizeHeight = editObject.sizeWidth;
     try {
       editObject.borderWidth = Integer.parseInt(textBorderWidth.getText());
       if (editObject.borderWidth < 0 || editObject.borderWidth > 10) {
         throw new Exception();
       }
     } catch (Exception e) {
       MessageDialog.openError(this.getShell(), "错误", "描边宽度:请输入0-10之间的整数。");
       return;
     }
     if (CompressTextureOption.ETC1.equals(editObject.format)) {
       String msg = "ETC1格式不支持透明色,你确定你要使用这个格式吗?";
       if (!MessageDialog.openConfirm(getShell(), "确认", msg)) {
         return;
       }
     }
   }
   super.buttonPressed(buttonId);
 }
コード例 #2
0
 /**
  * Create the dialog
  *
  * @param parentShell
  */
 public CompressTextureOptionDialogEx(Shell parentShell) {
   super(parentShell);
   editObject = new CompressTextureOption(CompressTextureOption.PVRTC_4BPP, 1024, 1024);
   editObject.borderWidth = 2;
 }