Gridarta Editor
CollectArchesCommand.java
Go to the documentation of this file.
1 /*
2  * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
3  * Copyright (C) 2000-2015 The Gridarta Developers.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 package net.sf.gridarta.commands;
21 
23 import net.sf.japi.swing.misc.ConsoleProgress;
24 import org.apache.log4j.Category;
25 import org.apache.log4j.Logger;
26 import org.jetbrains.annotations.NotNull;
27 
35 public class CollectArchesCommand implements Command {
36 
40  @NotNull
41  private static final Category LOG = Logger.getLogger(CollectArchesCommand.class);
42 
46  @NotNull
48 
54  this.projectModel = projectModel;
55  }
56 
57  @Override
58  public int execute() {
60  LOG.fatal("Cannot collect resources");
61  return 1;
62  }
63  final Collector collector = new Collector(new ConsoleProgress(), projectModel.getResources(), projectModel.getProjectSettings().getCollectedDirectory());
64  collector.start();
65  try {
66  collector.waitUntilFinished();
67  } catch (final InterruptedException ignored) {
68  Thread.currentThread().interrupt();
69  return 1;
70  }
71  return 0;
72  }
73 
74 }
net.sf.gridarta.project.ProjectModel.getProjectSettings
ProjectSettings getProjectSettings()
Definition: ProjectModel.java:420
net.sf.gridarta.commands.CollectArchesCommand.CollectArchesCommand
CollectArchesCommand(@NotNull final ProjectModel<?, ?, ?> projectModel)
Definition: CollectArchesCommand.java:53
net.sf.gridarta.commands.CollectArchesCommand.LOG
static final Category LOG
Definition: CollectArchesCommand.java:41
net.sf.gridarta
net.sf.gridarta.commands.CollectArchesCommand
Definition: CollectArchesCommand.java:35
net.sf.gridarta.project.ProjectModel
Definition: ProjectModel.java:122
net.sf.gridarta.commands.Collector
Definition: Collector.java:37
net.sf.gridarta.commands.CollectArchesCommand.execute
int execute()
Definition: CollectArchesCommand.java:58
net.sf
net.sf.gridarta.commands.Collector.waitUntilFinished
void waitUntilFinished()
Definition: Collector.java:96
net
net.sf.gridarta.commands.Collector.start
void start()
Definition: Collector.java:87
net.sf.gridarta.model.resource.AbstractResources.canWriteCollected
boolean canWriteCollected()
Definition: AbstractResources.java:119
net.sf.gridarta.project.ProjectModel.getResources
AbstractResources< G, A, R > getResources()
Definition: ProjectModel.java:475
net.sf.gridarta.commands.CollectArchesCommand.projectModel
final ProjectModel<?, ?, ?> projectModel
Definition: CollectArchesCommand.java:47
net.sf.gridarta.model.settings.ProjectSettings.getCollectedDirectory
File getCollectedDirectory()
net.sf.gridarta.project
Definition: ProjectFactory.java:20
net.sf.gridarta.commands.Command
Definition: Command.java:26