Package javax.swing

Examples of javax.swing.Action.actionPerformed()


          .getInterface("addView");
      addViewAction
          .putValue(
              de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.VIEW_NAME,
              viewInfoPane.getViewName());
      addViewAction.actionPerformed(null);

    }
  }

  class OpenViewAction extends ProjectAction {
View Full Code Here


            @Override
            public void keyPressed(KeyEvent arg0) {
                Action act = keyToActionMap.get(arg0.getKeyCode());
                if (act != null) {
                    act.actionPerformed(null);
                }
            }

            @Override
            public void keyReleased(@SuppressWarnings("unused") KeyEvent arg0) {// this method is intentionally left blank - keypresses/releases are handled by the keyPressed method.
View Full Code Here

            int result = JOptionPane.showConfirmDialog(uiJPanel, "�����Ҫ����Ŀ��ɾ����ǰ��ͼ��?\n�ڴ��̺�,�⽫��ɲ�����صĺ��.\n(������ͨ���������̵ķ�ʽ,�ָ��ϴδ��̺�ɾ�����޸ĵ���ͼ)", "ɾ����ͼ", JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);

            if (result != JOptionPane.OK_OPTION)
                return;

            removeView.actionPerformed(null);
            String viewName = (String) removeView.getValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.VIEW_NAME);
            removeView.putValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.VIEW_NAME, null);

            ((ProjectImplementation) project).removeView(viewName);
        }
View Full Code Here

                JOptionPane.showMessageDialog(uiJPanel, "��ͬ���Ƶ���ͼ�Ѿ�����,�޸�ʧ�ܣ�", "���洰��", JOptionPane.ERROR_MESSAGE);
                return;
            }

            changeViewName.putValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.NEW_VIEW_NAME, newName);
            changeViewName.actionPerformed(null);
            String resultNewViewName = (String) changeViewName.getValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.NEW_VIEW_NAME);
            String resultOldViewName = (String) changeViewName.getValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.OLD_VIEW_NAME);

            if (!newName.equals(resultNewViewName) || !oldName.equals(resultOldViewName)){
                JOptionPane.showMessageDialog(uiJPanel, "�ڲ�����,�޸�ʧ�ܣ�", "���洰��", JOptionPane.ERROR_MESSAGE);
View Full Code Here

                    if (ff.getSuffix().equalsIgnoreCase("more")) {
                        fileChooser.cancelSelection();
                        Action action = (Action) graphicalEditorActionMap.getInterface("exportView");
                        action.putValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.IMAGE_TYPE, "more");
                        action.putValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.UI_FRAME, uiJPanel);
                        action.actionPerformed(null);
                        ((JFileChooser) e.getSource()).removePropertyChangeListener(JFileChooser.FILE_FILTER_CHANGED_PROPERTY, this);
                    }
                }
            };
View Full Code Here

            Action action = (Action) graphicalEditorActionMap.getInterface("exportView");
            action.putValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.FILE, imageFile);
            action.putValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.IMAGE_TYPE, selectedFilter.getSuffix());
            action.putValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.UI_FRAME, uiJPanel);
            action.actionPerformed(null);
        }
    }

    abstract class ProjectAction extends AbstractAction {
        public void firePropertyChange(String propertyName, Object oldValue, Object newValue) {
View Full Code Here

            //�洢��Ŀ�ļ�
            if (result == JOptionPane.YES_OPTION) {
              //TODO ����Ҫ���浽 ���ݿ���, ������ܺ����ټӽ���.
                Action saveAction = (Action) data.get(ConstantDefinition.SAVE_PROJECT_ACTION);
                if ((saveAction != null) && (saveAction.isEnabled())) {
                    saveAction.actionPerformed(e);
                } else {
                    int rst = JOptionPane.showConfirmDialog(uiJPanel, "�޷�������Ŀ�洢ģ�飬�Ƿ�����ر���Ŀ�IJ�����/n����������ϴδ��̺���޸Ľ��޷�������", "���洰��", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
                    if (rst == JOptionPane.CANCEL_OPTION)
                        return;
                }
View Full Code Here

            ((ProjectImplementation) project).addView(viewInfoPane.getViewName());

            Action addViewAction = (Action) graphicalEditorActionMap.getInterface("addView");
            addViewAction.putValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.VIEW_NAME, viewInfoPane.getViewName());
            addViewAction.actionPerformed(null);

        }
    }

    class OpenViewAction extends ProjectAction {
View Full Code Here

        public void actionPerformed(ActionEvent e) {
            if (!isEnabled()) return;

            Action closeView = (Action) graphicalEditorActionMap.getInterface("closeView");

            closeView.actionPerformed(null);
            String viewName = (String) closeView.getValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.VIEW_NAME);
            closeView.putValue(de.FeatureModellingTool.GraphicalEditor.ConstantDefinition.VIEW_NAME, null);

        }
    }
View Full Code Here

    frame.addKeyListener(new KeyListener() {

      public @Override void keyPressed(KeyEvent arg0) {
        Action act = keyToActionMap.get(arg0.getKeyCode());
        if (act != null)
          act.actionPerformed(null);
      }

      public @Override void keyReleased(@SuppressWarnings("unused") KeyEvent arg0)
      {// we handle a combined event (keyPressed) instead
      }
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.