Exemplo n.º 1
0
/**
 * Start the corresponding action.
 *
 * @author Ingo Mierswa
 */
public class ZoomOutAction extends AbstractAction {

  private static final long serialVersionUID = -7174646500855589718L;

  private static final String ICON_NAME = "zoom_out.png";

  private static final Icon[] ICONS = new Icon[IconSize.values().length];

  static {
    int counter = 0;
    for (IconSize size : IconSize.values()) {
      ICONS[counter++] = SwingTools.createIcon(size.getSize() + "/" + ICON_NAME);
    }
  }

  private GraphViewer graphViewer;

  public ZoomOutAction(GraphViewer graphViewer, IconSize size) {
    super("Zoom Out", ICONS[size.ordinal()]);
    putValue(SHORT_DESCRIPTION, "Zooms out the graph view.");
    putValue(MNEMONIC_KEY, Integer.valueOf(KeyEvent.VK_O));
    this.graphViewer = graphViewer;
  }

  public void actionPerformed(ActionEvent e) {
    graphViewer.zoomOut();
  }
}
/**
 * Start the corresponding action.
 *
 * @author Ingo Mierswa
 * @version $Id: ValidateProcessAction.java,v 1.4 2008/05/09 19:22:46 ingomierswa Exp $
 */
public class ValidateProcessAction extends ConditionalAction {

  private static final long serialVersionUID = -420838202882684287L;

  private static final String ICON_NAME = "checks.png";

  private static final Icon[] ICONS = new Icon[IconSize.values().length];

  static {
    int counter = 0;
    for (IconSize size : IconSize.values()) {
      ICONS[counter++] = SwingTools.createIcon(size.getSize() + "/" + ICON_NAME);
    }
  }

  private MainFrame mainFrame;

  public ValidateProcessAction(MainFrame mainFrame, IconSize size) {
    super("Validate", ICONS[size.ordinal()]);
    putValue(
        SHORT_DESCRIPTION,
        "Validate operator in- and output connections and the process structure");
    putValue(MNEMONIC_KEY, Integer.valueOf(KeyEvent.VK_V));
    putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0));
    setCondition(PROCESS_RUNNING, DISALLOWED);
    this.mainFrame = mainFrame;
  }

  public void actionPerformed(ActionEvent e) {
    this.mainFrame.getProcess().checkProcess(new IOContainer());
    this.mainFrame.getOperatorTree().refresh();
  }
}
Exemplo n.º 3
0
/**
 * Start the corresponding action.
 *
 * @author Ingo Mierswa
 * @version $Id: NewOperatorAction.java,v 1.1 2007/05/27 22:02:33 ingomierswa Exp $
 */
public class NewOperatorAction extends ConditionalAction {

  private static final long serialVersionUID = -5946313817810917200L;

  private static final String ICON_NAME = "element_new.png";

  private static final Icon[] ICONS = new Icon[IconSize.values().length];

  static {
    int counter = 0;
    for (IconSize size : IconSize.values()) {
      ICONS[counter++] = SwingTools.createIcon("icons/" + size.getSize() + "/" + ICON_NAME);
    }
  }

  private OperatorTree operatorTree;

  public NewOperatorAction(OperatorTree operatorTree, IconSize size) {
    super("New Operator...", ICONS[size.ordinal()]);
    putValue(SHORT_DESCRIPTION, "Add a new operator from a dialog");
    putValue(MNEMONIC_KEY, Integer.valueOf(KeyEvent.VK_N));
    putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_I, InputEvent.CTRL_MASK));
    setCondition(OPERATOR_CHAIN_SELECTED, MANDATORY);
    this.operatorTree = operatorTree;
  }

  public void actionPerformed(ActionEvent e) {
    Operator selectedOperator = this.operatorTree.getSelectedOperator();
    if (selectedOperator != null) {
      NewOperatorDialog dialog = new NewOperatorDialog(this.operatorTree);
      dialog.setVisible(true);
    }
  }
}
Exemplo n.º 4
0
 public NewOperatorAction(OperatorTree operatorTree, IconSize size) {
   super("New Operator...", ICONS[size.ordinal()]);
   putValue(SHORT_DESCRIPTION, "Add a new operator from a dialog");
   putValue(MNEMONIC_KEY, Integer.valueOf(KeyEvent.VK_N));
   putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_I, InputEvent.CTRL_MASK));
   setCondition(OPERATOR_CHAIN_SELECTED, MANDATORY);
   this.operatorTree = operatorTree;
 }
 public ValidateProcessAction(MainFrame mainFrame, IconSize size) {
   super("Validate", ICONS[size.ordinal()]);
   putValue(
       SHORT_DESCRIPTION,
       "Validate operator in- and output connections and the process structure");
   putValue(MNEMONIC_KEY, Integer.valueOf(KeyEvent.VK_V));
   putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0));
   setCondition(PROCESS_RUNNING, DISALLOWED);
   this.mainFrame = mainFrame;
 }
Exemplo n.º 6
0
 public ZoomOutAction(GraphViewer graphViewer, IconSize size) {
   super("Zoom Out", ICONS[size.ordinal()]);
   putValue(SHORT_DESCRIPTION, "Zooms out the graph view.");
   putValue(MNEMONIC_KEY, Integer.valueOf(KeyEvent.VK_O));
   this.graphViewer = graphViewer;
 }
Exemplo n.º 7
0
 static {
   int counter = 0;
   for (IconSize size : IconSize.values()) {
     ICONS[counter++] = SwingTools.createIcon(size.getSize() + "/" + ICON_NAME);
   }
 }