Beispiel #1
0
  // Create a new document
  public void clear() {
    areaEditPanel.clear();
    puzzleEditPanel.clear();

    areaGraph = new mxGraph();
    areaGraph.setAutoSizeCells(true);
    areaGraphComponent.setGraph(areaGraph);
    areaGraphLayout =
        new mxOrganicLayout(
            areaGraph,
            new Rectangle(0, 0, graphPanel.getBounds().width, graphPanel.getBounds().height));
    areaGraph.setEnabled(false);

    puzzleGraph = new mxGraph();
    puzzleGraph.setAutoSizeCells(true);
    puzzleGraphComponent.setGraph(puzzleGraph);
    puzzleGraphOrganicLayout =
        new mxOrganicLayout(
            puzzleGraph,
            new Rectangle(0, 0, graphPanel.getBounds().width, graphPanel.getBounds().height));
    puzzleGraphHierLayout = new mxHierarchicalLayout(puzzleGraph, SwingConstants.WEST);
    hierarchyRoot = null;

    AreaEditPanel.reset();
    CombinePuzzleBlock.reset();
    InsertionPuzzleBlock.reset();
    DoorUnlockBlock.reset();
    FilterBlock.reset();
    InsertionPuzzleBlock.reset();
    ItemRequestPuzzleBlock.reset();
    PropertyChangePuzzleBlock.reset();
    SpawnPuzzleBlock.reset();
    OutputBlock.reset();
    ORBlock.reset();
  }
Beispiel #2
0
 public static String xmlDigest() {
   // Go through our whole list of areas and puzzles and print their xml
   String xml = "<puzzleMap>\n";
   xml += "<areas>\n";
   AreaBlock[] areas = AreaEditPanel.getAreaList();
   for (AreaBlock area : areas) {
     xml += area.toXML() + "\n";
   }
   xml += "</areas>\n<puzzles>\n";
   PuzzleBlock[] puzzles = PuzzleEditPanel.getBlockList();
   for (PuzzleBlock puzzle : puzzles) {
     xml += puzzle.toXML() + "\n";
   }
   xml += "</puzzles>\n</puzzleMap>";
   return xml;
 }