-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Neop
committed
Apr 15, 2018
1 parent
38332f9
commit 00470ab
Showing
6 changed files
with
138 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
src/main/java/mudmap2/backend/WorldFileReader/WorldFileFilterJSON.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* MUD Map (v2) - A tool to create and organize maps for text-based games | ||
* Copyright (C) 2018 Neop (email: mneop@web.de) | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with this program; if not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package mudmap2.backend.WorldFileReader; | ||
|
||
import java.io.File; | ||
import java.util.logging.Level; | ||
import java.util.logging.Logger; | ||
import javax.swing.filechooser.FileFilter; | ||
import mudmap2.backend.WorldFileReader.current.WorldFileDefault; | ||
import mudmap2.frontend.dialog.OpenWorldDialog; | ||
|
||
/** | ||
* | ||
* @author neop | ||
*/ | ||
public class WorldFileFilterJSON extends FileFilter { | ||
|
||
@Override | ||
public boolean accept(File file) { | ||
if(file == null) return false; | ||
if(file.isDirectory()) return true; | ||
String worldname = null; | ||
|
||
try { | ||
worldname = (new WorldFileDefault(file.getPath()).readWorldName()); | ||
} catch (Exception ex) { | ||
Logger.getLogger(OpenWorldDialog.class.getName()).log(Level.SEVERE, null, ex); | ||
} | ||
|
||
return worldname != null && !worldname.equals(""); | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "MUD Map 2 World Files (all)"; | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/mudmap2/backend/WorldFileReader/WorldFileFilterM2W.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* MUD Map (v2) - A tool to create and organize maps for text-based games | ||
* Copyright (C) 2018 Neop (email: mneop@web.de) | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
* for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with this program; if not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package mudmap2.backend.WorldFileReader; | ||
|
||
import java.io.File; | ||
import javax.swing.filechooser.FileFilter; | ||
|
||
/** | ||
* | ||
* @author neop | ||
*/ | ||
public class WorldFileFilterM2W extends FileFilter { | ||
|
||
@Override | ||
public boolean accept(File file) { | ||
if(file == null) return false; | ||
if(file.isDirectory()) return true; | ||
return file.getName().endsWith(".m2w"); | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "MUD Map 2 World Files (.m2w)"; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters