Package engine

Examples of engine.SchemeSet


      action = new UndoAction(type,null,null,null,currentSchemeIndex,currentSchemeIndex,currentSchemeSet.size());
      break;
    }
    case UndoAction.EDIT_SCHEMESET_PROPERTIES:
    case UndoAction.EDIT_REMOVE_ALL_SCHEMES_MOVES: {
      action = new UndoAction(type,new SchemeSet(currentSchemeSet),new ArrayList<Integer>(currentMoveIndexes),null,0,0,0);
      break;
    }
    case UndoAction.EDIT_MOVE_SCHEME_FORWARD:
    case UndoAction.EDIT_MOVE_SCHEME_BACKWARD:
    case UndoAction.EDIT_DUPLICATE_SCHEME:
View Full Code Here


    if (undoActions.size() == 0) return;
    UndoAction action = undoActions.removeLast();
    // Construct redo action
    switch (action.type) {
    case UndoAction.EDIT_APPEND_SET: {
      redoActions.addLast(new UndoAction(action.type,new SchemeSet(currentSchemeSet),new ArrayList<Integer>(currentMoveIndexes),null,action.schemeIndex,action.prevMoveIndex,action.nextMoveIndex));
      break;
    }
    case UndoAction.EDIT_SCHEMESET_PROPERTIES:
    case UndoAction.EDIT_REMOVE_ALL_SCHEMES_MOVES: {
      redoActions.addLast(new UndoAction(action.type,new SchemeSet(currentSchemeSet),new ArrayList<Integer>(currentMoveIndexes),null,action.schemeIndex,action.prevMoveIndex,action.nextMoveIndex));
      break;
    }
    case UndoAction.EDIT_REMOVE_SCHEME: {
      redoActions.addLast(new UndoAction(action.type,null,null,null,action.schemeIndex,action.prevMoveIndex,action.nextMoveIndex));
      break;
View Full Code Here

    if (redoActions.size() == 0) return;
    UndoAction action = redoActions.removeLast();
    // Construct undo action
    switch (action.type) {
    case UndoAction.EDIT_APPEND_SET: {
      undoActions.addLast(new UndoAction(action.type,new SchemeSet(currentSchemeSet),new ArrayList<Integer>(currentMoveIndexes),null,action.schemeIndex,action.prevMoveIndex,action.nextMoveIndex));
      break;
    }
    case UndoAction.EDIT_SCHEMESET_PROPERTIES:
    case UndoAction.EDIT_REMOVE_ALL_SCHEMES_MOVES: {
      undoActions.addLast(new UndoAction(action.type,new SchemeSet(currentSchemeSet),new ArrayList<Integer>(currentMoveIndexes),null,action.schemeIndex,action.prevMoveIndex,action.nextMoveIndex));
      break;
    }
    case UndoAction.EDIT_REMOVE_SCHEME: {
      undoActions.addLast(new UndoAction(action.type,null,null,null,action.schemeIndex,action.prevMoveIndex,action.nextMoveIndex));
      break;
View Full Code Here

    if (dialog != null) {
      if (dialog instanceof SchemeDialog) {
        setScheme(new Scheme(currentSchemeSet.get(currentSchemeIndex)),false);
        ((SchemeDialog)dialog).setScheme(currentSchemeSet.get(currentSchemeIndex));
      } else {
        setSchemeSet(new SchemeSet(currentSchemeSet),currentMoveIndexes);
        ((SchemeSetDialog)dialog).setSchemeSet(currentSchemeSet);
      }
      dialog.setVisible(true);
    }
    mnSet.setEnabled(enabled);
View Full Code Here

  }

  @Override
  public void schemesetDialogDone(SchemeSetDialog dialog) {
    setDialog(null);
    SchemeSet newSchemeSet = currentSchemeSet;
    setSchemeSet(dialog.originalSchemeSet,currentMoveIndexes);
    beginUndoAction(UndoAction.EDIT_SCHEMESET_PROPERTIES);
    setSchemeSet(newSchemeSet,currentMoveIndexes,currentSchemeIndex);
    endUndoAction();
  }
View Full Code Here

       
    if (ev.getSource() == miEditAppendSet) {
      viewBoard.pause();
      if (dialogFileChooser.showDialog(this,"Dołącz układy...") == JFileChooser.APPROVE_OPTION) {
        try {
        SchemeSet appendingSet = new SchemeSet(new FileInputStream(dialogFileChooser.getSelectedFile()));
        currentSchemeIndex++;
        beginUndoAction(UndoAction.EDIT_APPEND_SET);
        currentSchemeSet.addAll(currentSchemeIndex,appendingSet);
        for (int i=0;i<appendingSet.size();i++)
          currentMoveIndexes.add(currentSchemeIndex+i,0);
        setSchemeSet(currentSchemeSet,currentMoveIndexes,currentSchemeIndex);
        endUndoAction();
        } catch (IOException e) {}
      }
View Full Code Here

    taDesc.setText(originalSchemeSet.getDesc());
  }
 
  public void actionPerformed(ActionEvent ev) {
    if (ev.getSource() == btOK) {
      SchemeSet newSchemeSet = new SchemeSet(originalSchemeSet);
      newSchemeSet.setDesc(taDesc.getText());
      dialogResult(newSchemeSet);
      dialogDone();
    } else
    if (ev.getSource() == btCancel) {
      dialogCanceled();
View Full Code Here

  private static final int DEFAULT_BOARD_WIDTH = 0;
  private static final int DEFAULT_BOARD_HEIGHT = 0;
 
  private void openSet(File setFile) {
    currentSetFile = setFile;
    currentSchemeSet = new SchemeSet();
    boolean loaded = false;
    if (setFile != null)
      try {
        // Open and load set from given file
        currentSchemeSet.load(new FileInputStream(currentSetFile));
View Full Code Here

TOP

Related Classes of engine.SchemeSet

Copyright © 2018 www.massapicom. 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.