private void doMergeImage() {
    if (pastedImage != null) {
      int option =
          JOptionPane.showOptionDialog(
              null,
              "merge images?",
              "merge?",
              JOptionPane.YES_NO_CANCEL_OPTION,
              JOptionPane.QUESTION_MESSAGE,
              getMainFrame().smallLogo,
              null,
              null);

      switch (option) {
        case JOptionPane.YES_OPTION:
          setUpUndo(ImageProcessor.copyImage(getImage()));
          mergePastedImage();
          internalFrame.setModifiedTitle();
          getMainFrame().updateEditMenuStatus();
        case JOptionPane.CANCEL_OPTION:
          setPastedImage(null);
          setStart(null);
          break;
      }
    }
  }
 private int mergeText() {
   int option =
       JOptionPane.showOptionDialog(
           null,
           "merge text into image?",
           "merge?",
           JOptionPane.YES_NO_CANCEL_OPTION,
           JOptionPane.QUESTION_MESSAGE,
           getMainFrame().smallLogo,
           null,
           null);
   switch (option) {
     case JOptionPane.YES_OPTION:
       setUpUndo(ImageProcessor.copyImage(getImage()));
       if (text != null) {
         drawTextToImage();
       }
       internalFrame.setModifiedTitle();
       getMainFrame().updateEditMenuStatus();
     case JOptionPane.CANCEL_OPTION:
       setText(null, null);
       setStart(null);
       break;
   }
   return option;
 }
 private void doBrushOnMousePressed(MouseEvent e) {
   setUpUndo(ImageProcessor.copyImage(getImage()));
   resetRect();
   setBrushWidth(getMainFrame().getBrushValue());
   setStart(e.getPoint());
   repaint();
   internalFrame.setModifiedTitle();
 }