You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(103) |
Jun
(121) |
Jul
(16) |
Aug
(67) |
Sep
(126) |
Oct
(161) |
Nov
(164) |
Dec
(588) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(394) |
Feb
(181) |
Mar
(131) |
Apr
(180) |
May
(255) |
Jun
(11) |
Jul
(79) |
Aug
(70) |
Sep
(274) |
Oct
(138) |
Nov
(195) |
Dec
(8) |
2008 |
Jan
(3) |
Feb
(142) |
Mar
(162) |
Apr
(124) |
May
(148) |
Jun
(157) |
Jul
(425) |
Aug
(373) |
Sep
(264) |
Oct
(315) |
Nov
(225) |
Dec
(6) |
2009 |
Jan
(67) |
Feb
(78) |
Mar
(279) |
Apr
(294) |
May
(92) |
Jun
(65) |
Jul
(134) |
Aug
(41) |
Sep
(138) |
Oct
(125) |
Nov
(126) |
Dec
(122) |
2010 |
Jan
(15) |
Feb
(48) |
Mar
(9) |
Apr
(195) |
May
(373) |
Jun
(507) |
Jul
(42) |
Aug
(16) |
Sep
(38) |
Oct
(81) |
Nov
(64) |
Dec
(18) |
2011 |
Jan
(13) |
Feb
(12) |
Mar
(39) |
Apr
(1) |
May
(2) |
Jun
(27) |
Jul
(27) |
Aug
(31) |
Sep
(14) |
Oct
(102) |
Nov
(20) |
Dec
(37) |
2012 |
Jan
(22) |
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(2) |
Jun
(18) |
Jul
(6) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(47) |
Jun
(7) |
Jul
(107) |
Aug
|
Sep
|
Oct
(112) |
Nov
(31) |
Dec
(17) |
2014 |
Jan
(29) |
Feb
(111) |
Mar
(34) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(18) |
Dec
(10) |
From: <chr...@us...> - 2006-05-28 19:23:18
|
Revision: 59 Author: christianhujer Date: 2006-05-28 12:22:32 -0700 (Sun, 28 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=59&view=rev Log Message: ----------- Unified ActionFactory usage. Modified Paths: -------------- trunk/daimonin/src/daieditor/CArchPanelPan.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CFJavaEditor.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainStatusbar.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/CMapArchPanel.java trunk/daimonin/src/daieditor/CMapTileList.java trunk/daimonin/src/daieditor/CNewMapDialog.java trunk/daimonin/src/daieditor/CPickmapPanel.java trunk/daimonin/src/daieditor/CPreview.java trunk/daimonin/src/daieditor/MapTilePane.java trunk/daimonin/src/daieditor/ProcessRunner.java trunk/daimonin/src/daieditor/ReplaceDialog.java trunk/daimonin/src/daieditor/ScriptArchData.java trunk/daimonin/src/daieditor/Spells.java trunk/daimonin/src/daieditor/Updater.java trunk/daimonin/src/daieditor/arch/ArchObjectStack.java trunk/daimonin/src/daieditor/arch/NamedObjects.java trunk/daimonin/src/daieditor/arch/face/FaceObjects.java trunk/daimonin/src/daieditor/gui/AboutDialog.java trunk/daimonin/src/daieditor/gui/MapFileFilter.java trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java trunk/daimonin/src/daieditor/gui/map/MapTilePane.java trunk/daimonin/src/daieditor/gui/prefs/AppPrefs.java trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java trunk/daimonin/src/daieditor/gui/prefs/MiscPrefs.java trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java trunk/daimonin/src/daieditor/gui/prefs/UpdatePrefs.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/MapControl.java trunk/daimonin/src/daieditor/map/validation/AbstractValidator.java trunk/daimonin/src/daieditor/map/validation/ValidationError.java Modified: trunk/daimonin/src/daieditor/CArchPanelPan.java =================================================================== --- trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-05-28 16:15:18 UTC (rev 58) +++ trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-05-28 19:22:32 UTC (rev 59) @@ -24,6 +24,7 @@ package daieditor; +import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.arch.ArchObject; import daieditor.arch.ArchObjectStack; import java.awt.BorderLayout; @@ -55,7 +56,7 @@ private static final long serialVersionUID = 1L; /** ActionFactory. */ - private static final ActionFactory actionFactory = ActionFactory.getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); /** Controller of this subview. */ private final CMainControl mainControl; @@ -139,7 +140,7 @@ private JPopupMenu createListPopupMenu() { final JPopupMenu menu = new JPopupMenu(); - menu.add(actionFactory.createAction(false, "editPopup", this)); + menu.add(ACTION_FACTORY.createAction(false, "editPopup", this)); return menu; } Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-05-28 16:15:18 UTC (rev 58) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-05-28 19:22:32 UTC (rev 59) @@ -123,7 +123,7 @@ private static final long serialVersionUID = 1L; /** Action Factory. */ - private static final ActionFactory actionFactory = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); // store width of input-textfields, then JChooseBoxes are set to this width too public static final int TEXTFIELD_COLUMNS = 18; // number of columns for textfields @@ -155,10 +155,10 @@ private final CardLayout cardLayout = new CardLayout(); /** The Action for switching to the summary. */ - private Action summaryAction = actionFactory.createAction(false, "attribSummary", this); + private Action summaryAction = ACTION_FACTORY.createAction(false, "attribSummary", this); /** The Action for switching to the edit. */ - private Action editAction = actionFactory.createAction(false, "attribEdit", this); + private Action editAction = ACTION_FACTORY.createAction(false, "attribEdit", this); /** The Button for toggling the summary. */ private JButton summaryEditButton; @@ -857,12 +857,12 @@ */ private Object[] buildOptions() { return new Object[]{ - new JButton(actionFactory.createAction(false, "attribHelp", this)), + new JButton(ACTION_FACTORY.createAction(false, "attribHelp", this)), summaryEditButton = new JButton(summaryAction), Box.createHorizontalStrut(32), - okButton = new JButton(actionFactory.createAction(false, "attribOk", this)), - new JButton(actionFactory.createAction(false, "attribApply", this)), - cancelButton = new JButton(actionFactory.createAction(false, "attribCancel", this)), + okButton = new JButton(ACTION_FACTORY.createAction(false, "attribOk", this)), + new JButton(ACTION_FACTORY.createAction(false, "attribApply", this)), + cancelButton = new JButton(ACTION_FACTORY.createAction(false, "attribCancel", this)), }; } Modified: trunk/daimonin/src/daieditor/CFJavaEditor.java =================================================================== --- trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-05-28 16:15:18 UTC (rev 58) +++ trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-05-28 19:22:32 UTC (rev 59) @@ -33,7 +33,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import static java.util.prefs.Preferences.userNodeForPackage; -import net.sf.japi.swing.ActionFactory; +import static net.sf.japi.swing.ActionFactory.getFactory; /** * Main Class, launches the level editor application. @@ -64,7 +64,7 @@ Locale.setDefault(new Locale(locName)); } // Now add prefs to the ActionFactory. - ActionFactory.getFactory("daieditor").addPref(CMainControl.class); + getFactory("daieditor").addPref(CMainControl.class); final SplashScreen splashScreen = new SplashScreen(); splashScreen.show(); final List<String> infiles = new ArrayList<String>(); // map file names to open initially Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-05-28 16:15:18 UTC (rev 58) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-05-28 19:22:32 UTC (rev 59) @@ -25,6 +25,7 @@ package daieditor; +import static net.sf.japi.swing.ActionFactory.getFactory; import static daieditor.CMainView.MAP_TILE_LIST_BOTTOM_KEY; import static daieditor.CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT; import static daieditor.IGUIConstants.TILE_EDIT_NONE; @@ -131,7 +132,7 @@ public final class CMainControl implements ThrowableHandler, MapModelListener { /** ActionFactory. */ - private static final ActionFactory actionFactory = ActionFactory.getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); /** Logger. */ private static final Logger logger = Logger.getLogger("daieditor"); @@ -429,8 +430,8 @@ ArchObject.setMControl(this); // our global object parser archObjectParser = new ArchObjectParser(this); - animationObjects = new AnimationObjects(actionFactory.getString("nameOfAnimationObject")); - faceObjects = new FaceObjects(actionFactory.getString("nameOfFaceObject")); + animationObjects = new AnimationObjects(ACTION_FACTORY.getString("nameOfAnimationObject")); + faceObjects = new FaceObjects(ACTION_FACTORY.getString("nameOfFaceObject")); // read in the type & type field definitions //loadTypeDef(); @@ -445,7 +446,7 @@ // Delete the old settings file. Remove me after a while. File settings = new File(new File(System.getProperty("user.home"), IGUIConstants.APP_SETTINGS_DIR), IGUIConstants.APP_NAME); - if (settings.exists() && actionFactory.showOnetimeConfirmDialog(mainView, YES_NO_OPTION, INFORMATION_MESSAGE, "oldSettingsFound", settings.toString()) == YES_OPTION) + if (settings.exists() && ACTION_FACTORY.showOnetimeConfirmDialog(mainView, YES_NO_OPTION, INFORMATION_MESSAGE, "oldSettingsFound", settings.toString()) == YES_OPTION) { settings.delete(); } @@ -457,11 +458,11 @@ // Delete libraries. final File libs = new File(System.getProperty("user.dir"), "lib"); - final String libsString = actionFactory.getString("oldLibs.okayLibs"); + final String libsString = ACTION_FACTORY.getString("oldLibs.okayLibs"); assert libsString != null; final String[] patterns = libsString.split("\\s+"); final File[] libFiles = libs.listFiles(Factory.not(new GlobFileFilter(patterns))); - if (libFiles != null && libFiles.length > 0 && actionFactory.showOnetimeConfirmDialog(mainView, YES_NO_OPTION, INFORMATION_MESSAGE, "oldLibsFound", libs.toString()) == YES_OPTION) + if (libFiles != null && libFiles.length > 0 && ACTION_FACTORY.showOnetimeConfirmDialog(mainView, YES_NO_OPTION, INFORMATION_MESSAGE, "oldLibsFound", libs.toString()) == YES_OPTION) { for (final File libFile : libFiles) { libFile.delete(); @@ -477,7 +478,7 @@ public void controlServer() { if (controlServer == null) { controlServer = new ProcessRunner("controlServer", prefs.get(PREFS_APP_SERVER, PREFS_APP_SERVER_DEFAULT)); - actionFactory.showOnetimeMessageDialog(mainView, WARNING_MESSAGE, "controlServerWarning"); + ACTION_FACTORY.showOnetimeMessageDialog(mainView, WARNING_MESSAGE, "controlServerWarning"); } else { controlServer.setCommand(prefs.get(PREFS_APP_SERVER, PREFS_APP_SERVER_DEFAULT)); } @@ -735,16 +736,16 @@ public static final FileFilter mapFileFilter = new HideFileFilterProxy(MapFileFilter.getInstance()); /** Swing FileFilter for Lua scripts. */ - public static final FileFilter luaFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, actionFactory.getString("fileDialog.filter.lua"), ".lua")); + public static final FileFilter luaFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.lua"), ".lua")); /** Swing FileFilter for png graphics. */ - public static final FileFilter pngFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, actionFactory.getString("fileDialog.filter.png"), ".png")); + public static final FileFilter pngFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.png"), ".png")); /** Swing FileFilter for .arc files. */ - public static final FileFilter arcFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, actionFactory.getString("fileDialog.filter.arc"), ".arc")); + public static final FileFilter arcFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.arc"), ".arc")); /** Swing FileFilter for .anim files. */ - public static final FileFilter animFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, actionFactory.getString("fileDialog.filter.anim"), ".anim")); + public static final FileFilter animFileFilter = new HideFileFilterProxy(new EndingFileFilter(true, ACTION_FACTORY.getString("fileDialog.filter.anim"), ".anim")); public String getMapDefaultFolder() { return strMapDir; @@ -956,24 +957,24 @@ /** Invoked when the user wants to close the active pickmap */ public void closePickmap() { if (!CPickmapPanel.getInstance().isLoadComplete()) { - actionFactory.showMessageDialog(mainView, "closePickmapNotLoaded"); + ACTION_FACTORY.showMessageDialog(mainView, "closePickmapNotLoaded"); } else { if (!mainView.isPickmapActive()) { - actionFactory.showMessageDialog(mainView, "closePickmapHidden"); + ACTION_FACTORY.showMessageDialog(mainView, "closePickmapHidden"); } else { final MapControl activePickmap = CPickmapPanel.getInstance().getCurrentPickmap(); if (activePickmap == null) { - actionFactory.showMessageDialog(mainView, "closePickmapNoPickmaps"); + ACTION_FACTORY.showMessageDialog(mainView, "closePickmapNoPickmaps"); } else { // if pickmap was modified, ask for confirmation: - if (!activePickmap.isLevelChanged() || actionFactory.showQuestionDialog(mainView, "confirmClosePickmap", activePickmap.getMapFileName())) + if (!activePickmap.isLevelChanged() || ACTION_FACTORY.showQuestionDialog(mainView, "confirmClosePickmap", activePickmap.getMapFileName())) { final File pickmapFile = activePickmap.getMapFile(); // close pickmap closeLevel(activePickmap, true); // also delete pickmap file? - if (actionFactory.showQuestionDialog(mainView, "confirmDeletePickmap", activePickmap.getMapFileName(), activePickmap.getMapFileName())) + if (ACTION_FACTORY.showQuestionDialog(mainView, "confirmDeletePickmap", activePickmap.getMapFileName(), activePickmap.getMapFileName())) { pickmapFile.delete(); } @@ -1001,12 +1002,12 @@ public boolean closeLevel(final MapControl level, final boolean forced) { if (level == null) { - actionFactory.showMessageDialog(mainView, "closeLevelNullLevel", levels.size(), currentMap); + ACTION_FACTORY.showMessageDialog(mainView, "closeLevelNullLevel", levels.size(), currentMap); return false; } if (!forced && level.isLevelChanged()) { - final int result = actionFactory.showConfirmDialog(mainView, YES_NO_CANCEL_OPTION, WARNING_MESSAGE, "confirmSaveChanges", level.getMapArch().getMapNameWithoutMusic()); + final int result = ACTION_FACTORY.showConfirmDialog(mainView, YES_NO_CANCEL_OPTION, WARNING_MESSAGE, "confirmSaveChanges", level.getMapArch().getMapNameWithoutMusic()); if (result == YES_OPTION) { if (level.isPlainSaveEnabled()) { level.save(); @@ -1047,19 +1048,19 @@ /** Open active pickmap as normal map for extensive editing */ public void openPickmapMap() { if (!CPickmapPanel.getInstance().isLoadComplete()) { - actionFactory.showMessageDialog(mainView, "openPickmapMapNotLoaded"); + ACTION_FACTORY.showMessageDialog(mainView, "openPickmapMapNotLoaded"); } else { if (!mainView.isPickmapActive()) { - actionFactory.showMessageDialog(mainView, "openPickmapMapHidden"); + ACTION_FACTORY.showMessageDialog(mainView, "openPickmapMapHidden"); } else { final MapControl activePickmap = CPickmapPanel.getInstance().getCurrentPickmap(); if (activePickmap == null) { - actionFactory.showMessageDialog(mainView, "openPickmapNoPickmaps"); + ACTION_FACTORY.showMessageDialog(mainView, "openPickmapNoPickmaps"); } else { // open pickmap as map final File pickmapFile = activePickmap.getMapFile(); if (!pickmapFile.exists()) { - if (actionFactory.showQuestionDialog(mainView, "confirmCreatePickmap", activePickmap.getMapFileName())) { + if (ACTION_FACTORY.showQuestionDialog(mainView, "confirmCreatePickmap", activePickmap.getMapFileName())) { savePickmap(); openFile(pickmapFile); } @@ -1080,7 +1081,7 @@ /** Create the JFileChooser for opening a file. */ private void createFileChooser() { fileChooser = new JFileChooser(); - fileChooser.setDialogTitle(actionFactory.getString("fileDialog.title")); + fileChooser.setDialogTitle(ACTION_FACTORY.getString("fileDialog.title")); fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); fileChooser.setMultiSelectionEnabled(true); fileChooser.addChoosableFileFilter(luaFileFilter); @@ -1114,7 +1115,7 @@ if (returnVal == JFileChooser.APPROVE_OPTION) { if (ArchObjectStack.getLoadStatus() == ArchObjectStack.IS_EMPTY) { // ArchStack is empty -> abort! - actionFactory.showMessageDialog(mainView, "openFileWantedNoArches"); + ACTION_FACTORY.showMessageDialog(mainView, "openFileWantedNoArches"); } else { hasChangedDir = true; // user has chosen an active dir openFiles(fileChooser.getCurrentDirectory(), fileChooser.getSelectedFiles()); @@ -1217,17 +1218,17 @@ objects = mapFileDecoder.decodeMapFile(file, mapDir.getAbsolutePath()); // parse mapfile maparch = mapFileDecoder.getMapArch(); // get map arch } catch (final FileNotFoundException e) { - actionFactory.showMessageDialog(mainView, "openFileLoadMap", e.getMessage()); + ACTION_FACTORY.showMessageDialog(mainView, "openFileLoadMap", e.getMessage()); return false; } catch (final IOException e) { - actionFactory.showMessageDialog(mainView, "openFileLoadMap", e.getMessage()); + ACTION_FACTORY.showMessageDialog(mainView, "openFileLoadMap", e.getMessage()); return false; } catch (final CGridderException e) { - actionFactory.showMessageDialog(mainView, "openFileLoadMap", e.getMessage()); + ACTION_FACTORY.showMessageDialog(mainView, "openFileLoadMap", e.getMessage()); return false; } catch (final OutOfMemoryError ignore) { // out of memory!! - display error - actionFactory.showMessageDialog(mainView, "mapOutOfMemory"); + ACTION_FACTORY.showMessageDialog(mainView, "mapOutOfMemory"); return false; } @@ -1263,11 +1264,11 @@ public void openAttrDialog(final ArchObject arch) { if (typeList.isEmpty()) { // types.txt is missing! - actionFactory.showMessageDialog(mainView, "openAttrDialogNoTypes"); + ACTION_FACTORY.showMessageDialog(mainView, "openAttrDialogNoTypes"); } else if (arch != null && arch.hasDefaultArch()) { CAttribDialog.showAttribDialog(typeList, arch, this); } else { - actionFactory.showMessageDialog(mainView, "openAttrDialogNoDefaultArch"); + ACTION_FACTORY.showMessageDialog(mainView, "openAttrDialogNoDefaultArch"); } } @@ -1280,9 +1281,9 @@ try { mapFileEncoder.encodeMapFile(file, mapModel); } catch (final FileNotFoundException e) { - actionFactory.showMessageDialog(mainView, "encodeMapFile", file); + ACTION_FACTORY.showMessageDialog(mainView, "encodeMapFile", file); } catch (final IOException e) { - actionFactory.showMessageDialog(mainView, "encodeMapFile", file); + ACTION_FACTORY.showMessageDialog(mainView, "encodeMapFile", file); } } @@ -1319,7 +1320,7 @@ objects.add(tail); } if (noarchcount > 0) { - actionFactory.showMessageDialog(mainView, "collectTemplistAutodelete", file.getName(), noarchcount, noarch); + ACTION_FACTORY.showMessageDialog(mainView, "collectTemplistAutodelete", file.getName(), noarchcount, noarch); } return true; } @@ -1337,17 +1338,17 @@ public void savePickmap() { if (CPickmapPanel.getInstance().isLoadComplete()) { if (!mainView.isPickmapActive()) { - actionFactory.showMessageDialog(mainView, "savePickmapHidden"); + ACTION_FACTORY.showMessageDialog(mainView, "savePickmapHidden"); } else { final MapControl activePickmap = CPickmapPanel.getInstance().getCurrentPickmap(); if (activePickmap == null) { - actionFactory.showMessageDialog(mainView, "savePickmapNoPickmaps"); + ACTION_FACTORY.showMessageDialog(mainView, "savePickmapNoPickmaps"); } else { activePickmap.save(); } } } else { - actionFactory.showMessageDialog(mainView, "savePickmapNotLoaded"); + ACTION_FACTORY.showMessageDialog(mainView, "savePickmapNotLoaded"); } } @@ -1391,7 +1392,7 @@ if (returnVal == JFileChooser.APPROVE_OPTION) { hasChangedDir = true; // user has chosen an active dir final File file = fileChooser.getSelectedFile(); - if (!file.exists() || actionFactory.showConfirmDialog(mainView, WARNING_MESSAGE, OK_CANCEL_OPTION, "overwriteOtherFile", file.getName()) == OK_OPTION) + if (!file.exists() || ACTION_FACTORY.showConfirmDialog(mainView, WARNING_MESSAGE, OK_CANCEL_OPTION, "overwriteOtherFile", file.getName()) == OK_OPTION) { level.saveAs(file); level.setMapFileName(file.getName()); // window title and file name @@ -1417,7 +1418,7 @@ if (mc == null) { // there is no map open (should not happen due to disabled menus) - actionFactory.showMessageDialog(mainView, "createImgNoMap"); + ACTION_FACTORY.showMessageDialog(mainView, "createImgNoMap"); } else { String filename = null; try { @@ -1442,13 +1443,13 @@ if (!filename.endsWith(".png")) { filename += ".png"; } - if (!new File(filename).exists() || actionFactory.showConfirmDialog(mainView, YES_NO_OPTION, WARNING_MESSAGE, "overwriteOtherFile", filename) == YES_OPTION) + if (!new File(filename).exists() || ACTION_FACTORY.showConfirmDialog(mainView, YES_NO_OPTION, WARNING_MESSAGE, "overwriteOtherFile", filename) == YES_OPTION) { mc.getMapViewFrame().printFullImage(filename); } } } catch (final IOException e) { - actionFactory.showMessageDialog(mainView, "createImgIOException", filename); + ACTION_FACTORY.showMessageDialog(mainView, "createImgIOException", filename); } } } @@ -1464,7 +1465,7 @@ if (mapc == null) { // there is no map open (should not happen due to disabled menus) - actionFactory.showMessageDialog(mainView, "createImgNoMap"); + ACTION_FACTORY.showMessageDialog(mainView, "createImgNoMap"); } else { try { if (!filename.endsWith(".png")) { @@ -1473,7 +1474,7 @@ mapc.getMapViewFrame().printFullImage(filename); logger.log(Level.INFO, "imageCreated", new Object[]{filename, mapc.getMapFileName()}); } catch (final IOException e) { - actionFactory.showMessageDialog(mainView, "createImgIOException", filename); + ACTION_FACTORY.showMessageDialog(mainView, "createImgIOException", filename); } } } @@ -1564,7 +1565,7 @@ } if (exit == null) { // no exit found - actionFactory.showMessageDialog(mainView, "enterExitNoExit"); + ACTION_FACTORY.showMessageDialog(mainView, "enterExitNoExit"); return; } final Point d = new Point(); @@ -1573,7 +1574,7 @@ final String path = exit.getAttributeString("slaying", true); // exit path if (path == null || path.length() == 0) { - actionFactory.showMessageDialog(mainView, "enterExitNoExit"); + ACTION_FACTORY.showMessageDialog(mainView, "enterExitNoExit"); return; } @@ -1630,7 +1631,7 @@ final String path = currentMap.getMapArch().getTilePath(direction); if (path == null || path.length() == 0) { // tile direction not set (due to disabled menus this should normally not happen) - actionFactory.showMessageDialog(mainView, "enterTileNoTile"); + ACTION_FACTORY.showMessageDialog(mainView, "enterTileNoTile"); return; } enterMapWanted(new Point(), path); @@ -1659,17 +1660,17 @@ if (d != null && (path.length() == 0 || currentMap.getMapFile() != null && newfile != null && newfile.equals(currentMap.getMapFile()))) { // path points to the same map if (d.x == 0 && d.y == 0) { - actionFactory.showMessageDialog(mainView, "enterExitNowhere"); + ACTION_FACTORY.showMessageDialog(mainView, "enterExitNowhere"); } else if (currentMap.isPointValid(d)) { currentMap.getMapViewFrame().setHotspot(d); } else { - actionFactory.showMessageDialog(mainView, "enterExitOutside"); + ACTION_FACTORY.showMessageDialog(mainView, "enterExitOutside"); } return; } if (!newfile.exists() || newfile.isDirectory()) { // The path is wrong - actionFactory.showMessageDialog(mainView, "enterExitInvalidPath", newfile.getAbsolutePath()); + ACTION_FACTORY.showMessageDialog(mainView, "enterExitInvalidPath", newfile.getAbsolutePath()); return; } // its important to force the canonical file here or the @@ -1681,7 +1682,7 @@ try { newFileOpened = openFile(newfile.getCanonicalFile()); } catch (final IOException e) { - actionFactory.showMessageDialog(mainView, "enterTileIOException", newfile.getAbsolutePath()); + ACTION_FACTORY.showMessageDialog(mainView, "enterTileIOException", newfile.getAbsolutePath()); return; } if (d.x == 0 && d.y == 0) { @@ -1690,7 +1691,7 @@ d.y = currentMap.getMapModel().getMapArch().getEnterY(); } currentMap.getMapViewFrame().setHotspot(d); // set hotspot TODO set cursor instead - if (newFileOpened && YES_OPTION == actionFactory.showOnetimeConfirmDialog(mainView, YES_NO_OPTION, QUESTION_MESSAGE, "enterExitClose")) { + if (newFileOpened && YES_OPTION == ACTION_FACTORY.showOnetimeConfirmDialog(mainView, YES_NO_OPTION, QUESTION_MESSAGE, "enterExitClose")) { // only close current level if a new file was opened and user wants to close it closeLevel(oldmap); // close the old map } @@ -1721,7 +1722,7 @@ /** Invoked when user wants to revert the current map to previously saved state */ public void revert() { final MapControl modmap = currentMap; // "modified map" to be reverted - if (actionFactory.showQuestionDialog(mainView, "confirmRevertMap", modmap.getMapFileName())) { + if (ACTION_FACTORY.showQuestionDialog(mainView, "confirmRevertMap", modmap.getMapFileName())) { final File mfile = modmap.getMapFile(); // store file closeLevel(modmap, true); // close the old map openFile(mfile); // open the new map @@ -1734,21 +1735,21 @@ /** Invoked when user wants to revert the current map to previously saved state */ public void revertPickmap() { if (!CPickmapPanel.getInstance().isLoadComplete()) { - actionFactory.showMessageDialog(mainView, "revertPickmapNotLoaded"); + ACTION_FACTORY.showMessageDialog(mainView, "revertPickmapNotLoaded"); } else { if (!mainView.isPickmapActive()) { - actionFactory.showMessageDialog(mainView, "revertPickmapHidden"); + ACTION_FACTORY.showMessageDialog(mainView, "revertPickmapHidden"); } else { final MapControl activePickmap = CPickmapPanel.getInstance().getCurrentPickmap(); if (activePickmap == null) { - actionFactory.showMessageDialog(mainView, "revertPickmapNoPickmaps"); + ACTION_FACTORY.showMessageDialog(mainView, "revertPickmapNoPickmaps"); } else { // ask for confirmation - if (!activePickmap.isLevelChanged() || actionFactory.showQuestionDialog(mainView, "confirmRevertPickmap", activePickmap.getMapFileName())) + if (!activePickmap.isLevelChanged() || ACTION_FACTORY.showQuestionDialog(mainView, "confirmRevertPickmap", activePickmap.getMapFileName())) { final File mfile = activePickmap.getMapFile(); // store file if (!mfile.exists()) { - actionFactory.showMessageDialog(mainView, "pickmapRevertGone", activePickmap.getMapFileName()); + ACTION_FACTORY.showMessageDialog(mainView, "pickmapRevertGone", activePickmap.getMapFileName()); return; } @@ -2057,7 +2058,7 @@ /** Update wanted. */ public void update() { if (levels.size() > 0) { - actionFactory.showMessageDialog(mainView, "updateCloseMaps"); + ACTION_FACTORY.showMessageDialog(mainView, "updateCloseMaps"); } else { Updater.update(mainView); } @@ -2192,7 +2193,7 @@ super(title); this.filename = filename; this.title = title; - putValue(SHORT_DESCRIPTION, actionFactory.format("recentItem.shortdescriptionformat", title, getShortFileName())); + putValue(SHORT_DESCRIPTION, ACTION_FACTORY.format("recentItem.shortdescriptionformat", title, getShortFileName())); putValue(SMALL_ICON, getIcon()); } @@ -2203,7 +2204,7 @@ Recent(final int index) { title = prefs.get("recentTitle[" + Integer.toString(index - 1) + ']', null); filename = prefs.get("recentFilename[" + Integer.toString(index - 1) + ']', null); - putValue(SHORT_DESCRIPTION, actionFactory.format("recentItem.shortdescriptionformat", title, getShortFileName())); + putValue(SHORT_DESCRIPTION, ACTION_FACTORY.format("recentItem.shortdescriptionformat", title, getShortFileName())); putValue(SMALL_ICON, getIcon()); setIndex(index); } Modified: trunk/daimonin/src/daieditor/CMainStatusbar.java =================================================================== --- trunk/daimonin/src/daieditor/CMainStatusbar.java 2006-05-28 16:15:18 UTC (rev 58) +++ trunk/daimonin/src/daieditor/CMainStatusbar.java 2006-05-28 19:22:32 UTC (rev 59) @@ -25,6 +25,7 @@ package daieditor; +import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.gui.map.DefaultLevelRenderer; import daieditor.gui.map.MapCursor; import daieditor.gui.map.MapCursorEvent; @@ -59,7 +60,7 @@ private static final long serialVersionUID = 1L; /** The ActionFactory. */ - private static final ActionFactory actionFactory = ActionFactory.getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); /** Controller of this statusbar view. */ private final CMainControl mainControl; @@ -130,7 +131,7 @@ final long totMem = runtime.totalMemory(); final long usedMem = totMem - freeMem; - memory.setText(actionFactory.format("memory", + memory.setText(ACTION_FACTORY.format("memory", mainControl.getArchObjectStack().getArchObjCount(), mainControl.getArchObjectStack().getArchCount(), mainControl.getFaceObjects().size(), @@ -187,12 +188,12 @@ assert offset != null; final int offsetX = Math.abs(offset.width) + 1; final int offsetY = Math.abs(offset.height) + 1; - formatCursor = actionFactory.format("statusSelect", cursorX, cursorY, offsetX, offsetY); + formatCursor = ACTION_FACTORY.format("statusSelect", cursorX, cursorY, offsetX, offsetY); } else { - formatCursor = actionFactory.format("statusNormal", cursorX, cursorY); + formatCursor = ACTION_FACTORY.format("statusNormal", cursorX, cursorY); } } else { - formatCursor = actionFactory.format("statusCursorOff"); + formatCursor = ACTION_FACTORY.format("statusCursorOff"); } cursor.setText(formatCursor); } @@ -218,9 +219,9 @@ if (mouseMap != null) { final int mouseMapX = mouseMap.x; final int mouseMapY = mouseMap.y; - mouse.setText(actionFactory.format("statusMouseOn", mouseX, mouseY, mouseMapX, mouseMapY)); + mouse.setText(ACTION_FACTORY.format("statusMouseOn", mouseX, mouseY, mouseMapX, mouseMapY)); } else { - mouse.setText(actionFactory.format("statusMouseOff", mouseX, mouseY)); + mouse.setText(ACTION_FACTORY.format("statusMouseOff", mouseX, mouseY)); } } } // class CMainStatusbar Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-05-28 16:15:18 UTC (rev 58) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-05-28 19:22:32 UTC (rev 59) @@ -24,6 +24,7 @@ package daieditor; +import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.arch.ArchObject; import daieditor.arch.ArchObjectStack; import daieditor.gui.AboutDialog; @@ -76,7 +77,7 @@ public final class CMainView extends JFrame implements ErrorHandler, InternalFrameListener, ThrowableHandler, WindowListener { /** Action Factory to create Actions. */ - private static final ActionFactory actionFactory = ActionFactory.getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); /** Serial Version UID. */ private static final long serialVersionUID = 1L; @@ -177,8 +178,8 @@ final int defwidth = (int) (0.9 * screen.getWidth()); final int defheight = (int) (0.9 * screen.getHeight()); - setJMenuBar(actionFactory.createMenuBar(true, "main")); - add(actionFactory.createToolBar("main"), BorderLayout.NORTH); + setJMenuBar(ACTION_FACTORY.createMenuBar(true, "main")); + add(ACTION_FACTORY.createToolBar("main"), BorderLayout.NORTH); add(createCenterPanel(prefs, defwidth, defheight), BorderLayout.CENTER); // set bounds (location and size) of the main frame @@ -208,7 +209,7 @@ final int divLocation = prefs.getInt(DIVIDER_LOCATION_KEY, (int) (defwidth * 0.17)); pickmapPanel = new JTabbedPane(SwingConstants.TOP); - pickmapPanel.setComponentPopupMenu(actionFactory.createPopupMenu(true, "pickmaps")); + pickmapPanel.setComponentPopupMenu(ACTION_FACTORY.createPopupMenu(true, "pickmaps")); pickmapPanel.setBorder(BorderFactory.createEmptyBorder(IGUIConstants.SPACE_PICKARCH_TOP, 0, 0, 0)); CPickmapPanel.getInstance().addPickmapSelectionListener(pickmapPanel); @@ -432,7 +433,7 @@ */ void refreshMenusAndToolbars() { archPanel.refresh(); - mapTileList.refresh(); + //mapTileList.refresh(); mapArchPanel.refresh(); statusBar.refresh(); @@ -659,7 +660,7 @@ * @param recents Current recents. */ public void updateRecent(final List<CMainControl.Recent> recents) { - final JMenu recentMenu = (JMenu) actionFactory.find(getJMenuBar(), "recent"); + final JMenu recentMenu = (JMenu) ACTION_FACTORY.find(getJMenuBar(), "recent"); recentMenu.removeAll(); for (final CMainControl.Recent recent : recents) { recentMenu.add(recent); @@ -668,7 +669,7 @@ /** Rebuilds the window menu. */ private void rebuildWindowMenu() { - final JMenu menuWindow = (JMenu) actionFactory.find(getJMenuBar(), "window"); + final JMenu menuWindow = (JMenu) ACTION_FACTORY.find(getJMenuBar(), "window"); menuWindow.removeAll(); menuWindow.add(aCloseAll); if (mapViews.size() != 0) { @@ -713,74 +714,74 @@ private final String[] directionsGo = {"goNorth", "goEast", "goSouth", "goWest", "goNorthEast", "goSouthEast", "goSouthWest", "goNorthWest"}; private void initActions() { - actionFactory.createActions(true, mainControl, "createNew", "open", "options", "exit", "newScript", "editScript", "controlServer", "controlClient", "checkMap", "zoom", "gc", "prevWindow", "nextWindow", "onlineHelp", "tod", "about", "update"); - actionFactory.createActions(true, mainControl, directionsMap); - actionFactory.createActions(true, mainControl.getMapCursorControl(), directionsGo); - actionFactory.createActions(true, mainControl.getMapCursorControl(), "selectTile", "startStopDrag", "addToSelection", "subFromSelection", "releaseDrag"); - actionFactory.createActions(true, mainControl.getMapCursorControl(), "insertArch", "deleteArch"); - actionFactory.createActions(true, mainControl.getMapCursorControl(), "selectArchAbove", "selectArchBelow"); - actionFactory.createAction(true, "archAttributes", mainControl.getMapCursorControl()); - actionFactory.createToggles(true, mainControl, "useDouble", "gridVisible"); - actionFactory.createToggles(true, this, "lockAllPickmaps"); + ACTION_FACTORY.createActions(true, mainControl, "createNew", "open", "options", "exit", "newScript", "editScript", "controlServer", "controlClient", "checkMap", "zoom", "gc", "prevWindow", "nextWindow", "onlineHelp", "tod", "about", "update"); + ACTION_FACTORY.createActions(true, mainControl, directionsMap); + ACTION_FACTORY.createActions(true, mainControl.getMapCursorControl(), directionsGo); + ACTION_FACTORY.createActions(true, mainControl.getMapCursorControl(), "selectTile", "startStopDrag", "addToSelection", "subFromSelection", "releaseDrag"); + ACTION_FACTORY.createActions(true, mainControl.getMapCursorControl(), "insertArch", "deleteArch"); + ACTION_FACTORY.createActions(true, mainControl.getMapCursorControl(), "selectArchAbove", "selectArchBelow"); + ACTION_FACTORY.createAction(true, "archAttributes", mainControl.getMapCursorControl()); + ACTION_FACTORY.createToggles(true, mainControl, "useDouble", "gridVisible"); + ACTION_FACTORY.createToggles(true, this, "lockAllPickmaps"); } - private final Action aClose = actionFactory.createAction(true, "close", mainControl); + private final Action aClose = ACTION_FACTORY.createAction(true, "close", mainControl); - private final Action aRevert = actionFactory.createAction(true, "revert", mainControl); + private final Action aRevert = ACTION_FACTORY.createAction(true, "revert", mainControl); - private final Action aSave = actionFactory.createAction(true, "save", mainControl); + private final Action aSave = ACTION_FACTORY.createAction(true, "save", mainControl); - private final Action aSaveAs = actionFactory.createAction(true, "saveAs", mainControl); + private final Action aSaveAs = ACTION_FACTORY.createAction(true, "saveAs", mainControl); - private final Action aCreateImg = actionFactory.createAction(true, "createImg", mainControl); + private final Action aCreateImg = ACTION_FACTORY.createAction(true, "createImg", mainControl); - private final Action aUndo = actionFactory.createAction(true, "undo", mainControl); + private final Action aUndo = ACTION_FACTORY.createAction(true, "undo", mainControl); - private final Action aRedo = actionFactory.createAction(true, "redo", mainControl); + private final Action aRedo = ACTION_FACTORY.createAction(true, "redo", mainControl); - private final Action aClear = actionFactory.createAction(true, "clear", mainControl); + private final Action aClear = ACTION_FACTORY.createAction(true, "clear", mainControl); - private final Action aCut = actionFactory.createAction(true, "cut", mainControl); + private final Action aCut = ACTION_FACTORY.createAction(true, "cut", mainControl); - private final Action aCopy = actionFactory.createAction(true, "copy", mainControl); + private final Action aCopy = ACTION_FACTORY.createAction(true, "copy", mainControl); - private final Action aPaste = actionFactory.createAction(true, "paste", mainControl); + private final Action aPaste = ACTION_FACTORY.createAction(true, "paste", mainControl); - private final Action aReplace = actionFactory.createAction(true, "replace", mainControl); + private final Action aReplace = ACTION_FACTORY.createAction(true, "replace", mainControl); - private final Action aFillAbove = actionFactory.createAction(true, "fillAbove", mainControl); + private final Action aFillAbove = ACTION_FACTORY.createAction(true, "fillAbove", mainControl); - private final Action aFillBelow = actionFactory.createAction(true, "fillBelow", mainControl); + private final Action aFillBelow = ACTION_FACTORY.createAction(true, "fillBelow", mainControl); - private final Action aRandFillAbove = actionFactory.createAction(true, "randFillAbove", mainControl); + private final Action aRandFillAbove = ACTION_FACTORY.createAction(true, "randFillAbove", mainControl); - private final Action aRandFillBelow = actionFactory.createAction(true, "randFillBelow", mainControl); + private final Action aRandFillBelow = ACTION_FACTORY.createAction(true, "randFillBelow", mainControl); - private final Action aSelectAll = actionFactory.createAction(true, "selectAll", mainControl); + private final Action aSelectAll = ACTION_FACTORY.createAction(true, "selectAll", mainControl); - private final Action aEnterExit = actionFactory.createAction(true, "enterExit", mainControl); + private final Action aEnterExit = ACTION_FACTORY.createAction(true, "enterExit", mainControl); - private final Action aMapProperties = actionFactory.createAction(true, "mapProperties", mainControl); + private final Action aMapProperties = ACTION_FACTORY.createAction(true, "mapProperties", mainControl); - private final Action aAddNewPickmap = actionFactory.createAction(true, "addNewPickmap", mainControl); + private final Action aAddNewPickmap = ACTION_FACTORY.createAction(true, "addNewPickmap", mainControl); - private final Action aClosePickmap = actionFactory.createAction(true, "closePickmap", mainControl); + private final Action aClosePickmap = ACTION_FACTORY.createAction(true, "closePickmap", mainControl); - private final Action aOpenPickmap = actionFactory.createAction(true, "openPickmapMap", mainControl); + private final Action aOpenPickmap = ACTION_FACTORY.createAction(true, "openPickmapMap", mainControl); - private final Action aSavePickmap = actionFactory.createAction(true, "savePickmap", mainControl); + private final Action aSavePickmap = ACTION_FACTORY.createAction(true, "savePickmap", mainControl); - private final Action aRevertPickmap = actionFactory.createAction(true, "revertPickmap", mainControl); + private final Action aRevertPickmap = ACTION_FACTORY.createAction(true, "revertPickmap", mainControl); - private final Action aCollectArches = actionFactory.createAction(true, "collectArches", mainControl); + private final Action aCollectArches = ACTION_FACTORY.createAction(true, "collectArches", mainControl); - private final Action aReloadFaces = actionFactory.createAction(true, "reloadFaces", mainControl); + private final Action aReloadFaces = ACTION_FACTORY.createAction(true, "reloadFaces", mainControl); - private final Action aCollectSpells = actionFactory.createAction(true, "collectSpells", mainControl); + private final Action aCollectSpells = ACTION_FACTORY.createAction(true, "collectSpells", mainControl); - private final Action aViewTreasurelists = actionFactory.createAction(true, "viewTreasurelists", mainControl); + private final Action aViewTreasurelists = ACTION_FACTORY.createAction(true, "viewTreasurelists", mainControl); - private final Action aCloseAll = actionFactory.createAction(true, "closeAll", mainControl); + private final Action aCloseAll = ACTION_FACTORY.createAction(true, "closeAll", mainControl); /** * Refresh actions from toolbar. @@ -830,8 +831,8 @@ aSelectAll.setEnabled(mapState); for (int direction = 0; direction < 8; direction++) { final String mtp = mapState ? mainControl.getCurrentMap().getMapArch().getTilePath(direction) : null; - actionFactory.getAction(directionsMap[direction]).setEnabled(mtp != null && mtp.length() > 0); - actionFactory.getAction(directionsGo[direction]).setEnabled(selState); + ACTION_FACTORY.getAction(directionsMap[direction]).setEnabled(mtp != null && mtp.length() > 0); + ACTION_FACTORY.getAction(directionsGo[direction]).setEnabled(selState); } aClear.setEnabled(selState); aCut.setEnabled(selState); Modified: trunk/daimonin/src/daieditor/CMapArchPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-05-28 16:15:18 UTC (rev 58) +++ trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-05-28 19:22:32 UTC (rev 59) @@ -24,6 +24,7 @@ package daieditor; +import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.arch.ArchObject; import daieditor.arch.ArchObjectParser; import daieditor.gui.ConnectionView; @@ -84,7 +85,7 @@ private static final long serialVersionUID = 1L; /** The ActionFactory. */ - private static final ActionFactory actionFactory = ActionFactory.getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); // constants for the 'task' parameter in editScriptWanted() public static final int SCRIPT_OPEN = 0; @@ -173,20 +174,20 @@ // private JLabel archTileText = new JLabel(); private final JPanel mapArchPanel = new JPanel(); - private final Action aSubmitChange = actionFactory.createAction(false, "mapArchApply", this); + private final Action aSubmitChange = ACTION_FACTORY.createAction(false, "mapArchApply", this); - private final Action aInvChange = actionFactory.createAction(false, "mapArchAddInv", this); + private final Action aInvChange = ACTION_FACTORY.createAction(false, "mapArchAddInv", this); - private final Action aAttrWin = actionFactory.createAction(false, "mapArchAttrib", this); + private final Action aAttrWin = ACTION_FACTORY.createAction(false, "mapArchAttrib", this); // stuff for scripting tab - private final Action aNew = actionFactory.createAction(false, "scriptAddNew", this); + private final Action aNew = ACTION_FACTORY.createAction(false, "scriptAddNew", this); - private final Action aPath = actionFactory.createAction(false, "scriptEditData", this); + private final Action aPath = ACTION_FACTORY.createAction(false, "scriptEditData", this); - private final Action aModify = actionFactory.createAction(false, "scriptEdit", this); + private final Action aModify = ACTION_FACTORY.createAction(false, "scriptEdit", this); - private final Action aRemove = actionFactory.createAction(false, "scriptRemove", this); + private final Action aRemove = ACTION_FACTORY.createAction(false, "scriptRemove", this); private JList eventList; @@ -647,7 +648,7 @@ * @param y y position of button */ private void createButton(final int direction, final JPanel panel, final GridBagConstraints gbc, final int x, final int y) { - final JToggleButton button = new JToggleButton(actionFactory.createAction(true, "direction" + direction, this)); + final JToggleButton button = new JToggleButton(ACTION_FACTORY.createAction(true, "direction" + direction, this)); directionButtonGroup.add(button); button.setFocusable(false); button.setEnabled(false); Modified: trunk/daimonin/src/daieditor/CMapTileList.java =================================================================== --- trunk/daimonin/src/daieditor/CMapTileList.java 2006-05-28 16:15:18 UTC (rev 58) +++ trunk/daimonin/src/daieditor/CMapTileList.java 2006-05-28 19:22:32 UTC (rev 59) @@ -25,6 +25,7 @@ package daieditor; +import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.arch.ArchObject; import daieditor.gui.map.MapCursorEvent; import daieditor.gui.map.MapCursorListener; @@ -60,6 +61,7 @@ * @author <a href="mailto:mic...@no...">Michael Toennies</a> * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:Chr...@it...">Christian Hujer</a> + * @todo turn this into a tree */ public final class CMapTileList extends JPanel implements ListSelectionListener, MouseListener, MapCursorListener { @@ -67,7 +69,7 @@ private static final long serialVersionUID = 1L; /** ActionFactory. */ - private static final ActionFactory actionFactory = ActionFactory.getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); /** Controller of this subview. */ private final CMainControl mainControl; @@ -106,8 +108,8 @@ } else { add(arrows, BorderLayout.SOUTH); // put up/down buttons south } - arrows.add(new JButton(actionFactory.createAction(true, "moveTileUp", this))); - arrows.add(new JButton(actionFactory.createAction(true, "moveTileDown", this))); + arrows.add(new JButton(ACTION_FACTORY.createAction(true, "moveTileUp", this))); + arrows.add(new JButton(ACTION_FACTORY.createAction(true, "moveTileDown", this))); final JPanel compass = new JPanel(); compass.add(new JLabel(CGUIUtils.getSysIcon(IGUIConstants.TILE_NORTH))); @@ -363,11 +365,7 @@ return selListCounter; } - /** - * This is called when position of mapCursor changes or - * when it appeares or disappears. - * @param e Event that contains the MapCursor - */ + /** {@inheritDoc} */ public void mapCursorChangedPos(final MapCursorEvent e) { if (e.getSource().isActive()) { // Position changed @@ -378,6 +376,7 @@ } } + /** {@inheritDoc} */ public void mapCursorChangedMode(final MapCursorEvent e) { // A mode change can be ignored } Modified: trunk/daimonin/src/daieditor/CNewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-05-28 16:15:18 UTC (rev 58) +++ trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-05-28 19:22:32 UTC (rev 59) @@ -25,6 +25,7 @@ package daieditor; +import static net.sf.japi.swing.ActionFactory.getFactory; import static daieditor.CMainControl.PREFS_USERNAME; import static daieditor.CMainControl.PREFS_USERNAME_DEFAULT; import daieditor.map.MapArchObject; @@ -63,7 +64,7 @@ private static final long serialVersionUID = 1L; /** ActionFactory. */ - private static final ActionFactory actionFactory = ActionFactory.getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); /** Map types. */ public enum MapType { @@ -100,10 +101,10 @@ private final JFormattedTextField mapHeightField = new JFormattedTextField(); /** JButton for ok. */ - private final JButton okButton = new JButton(actionFactory.createAction(false, "mapOkay", this)); + private final JButton okButton = new JButton(ACTION_FACTORY.createAction(false, "mapOkay", this)); /** JButton for cancel. */ - private final JButton cancelButton = new JButton(actionFactory.createAction(false, "mapCancel", this)); + private final JButton cancelButton = new JButton(ACTION_FACTORY.createAction(false, "mapCancel", this)); /** * Constructs a new level dialog. Builds the dialog UI. @@ -204,7 +205,7 @@ maparch.setWidth((Integer) mapWidthField.getValue()); } catch (final IllegalArgumentException e) { final String key = e instanceof NumberFormatException ? "newMapDimensionNotANumber" : "newMapDimensionOutOfRange"; - actionFactory.showMessageDialog(this, key); + ACTION_FACTORY.showMessageDialog(this, key); mapWidthField.requestFocus(); return false; } @@ -214,7 +215,7 @@ maparch.setHeight((Integer) mapHeightField.getValue()); } catch (final IllegalArgumentException e) { final String key = e instanceof NumberFormatException ? "newMapDimensionNotANumber" : "newMapDimensionOutOfRange"; - actionFactory.showMessageDialog(this, key); + ACTION_FACTORY.showMessageDialog(this, key); mapHeightField.requestFocus(); return false; } @@ -222,7 +223,7 @@ // the mapmaker must enter a mapname to create a new map final String mapName = mapNameField.getText(); if (mapType == MapType.GAMEMAP && (mapName == null || mapName.length() <= 0)) { - actionFactory.showMessageDialog(this, "newMapNoName"); + ACTION_FACTORY.showMessageDialog(this, "newMapNoName"); mapNameField.requestFocus(); return false; } @@ -268,7 +269,7 @@ */ public static void showNewMapDialog(final CMainControl mainControl, final Component parentComponent, final String filename, final MapType mapType) { final CNewMapDialog pane = new CNewMapDialog(mainControl, filename, mapType); - final JDialog dialog = pane.createDialog(parentComponent, actionFactory.getString(mapType == MapType.PICKMAP ? "newPickmap.title" : "newMap.title")); + final JDialog dialog = pane.createDialog(parentComponent, ACTION_FACTORY.getString(mapType == MapType.PICKMAP ? "newPickmap.title" : "newMap.title")); dialog.getRootPane().setDefaultButton(pane.okButton); dialog.setModal(false); Modified: trunk/daimonin/src/daieditor/CPickmapPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-05-28 16:15:18 UTC (rev 58) +++ trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-05-28 19:22:32 UTC (rev 59) @@ -24,6 +24,7 @@ package daieditor; +import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.arch.ArchObject; import daieditor.arch.ArchObjectParser; import daieditor.map.MapArchObject; @@ -46,7 +47,7 @@ public final class CPickmapPanel { /** ActionFactory. */ - private static final ActionFactory actionFactory = ActionFactory.getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); /** static instance of this class */ private static CPickmapPanel instance; @@ -186,7 +187,7 @@ final File mapFile = new File(new File(CMainControl.getInstance().getArchDefaultFolder(), IGUIConstants.PICKMAP_DIR), maparch.getFileName()); if (mapFile.exists()) { - actionFactory.showMessageDialog(tabpane, "pickmapExists", mapFile); + ACTION_FACTORY.showMessageDialog(tabpane, "pickmapExists", mapFile); return false; } if (!mapFile.getParentFile().exists()) { Modified: trunk/daimonin/src/daieditor/CPreview.java =================================================================== --- trunk/daimonin/src/daieditor/CPreview.java 2006-05-28 16:15:18 UTC (rev 58) +++ trunk/daimonin/src/daieditor/CPreview.java 2006-05-28 19:22:32 UTC (rev 59) @@ -26,6 +26,7 @@ package daieditor; +import static net.sf.japi.swing.ActionFactory.getFactory; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; @@ -60,7 +61,7 @@ private static final long serialVersionUID = 1L; /** Action Factory. */ - private static final ActionFactory actionFactory = ActionFactory.getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); /** Original image. */ private final Image original; @@ -101,7 +102,7 @@ //if (icon != null) { // frame.setIconImage(icon.getImage()); //} - frame.setJMenuBar(actionFactory.createMenuBar(false, "zoomBar", this)); + frame.setJMenuBar(ACTION_FACTORY.createMenuBar(false, "zoomBar", this)); final JScrollPane scroll = new JScrollPane(this); scroll.setFocusable(true); frame.add(scroll); @@ -199,7 +200,7 @@ chooser.setFileFilter(CMainControl.pngFileFilter); if (chooser.showSaveDialog(frame) == JFileChooser.APPROVE_OPTION) { final File file = chooser.getSelectedFile(); - if (!file.exists() || actionFactory.showQuestionDialog(this, "overwriteOtherFile", file)) { + if (!file.exists() || ACTION_FACTORY.showQuestionDialog(this, "overwriteOtherFile", file)) { try { final RenderedImage img; if (image instanceof RenderedImage) { @@ -211,9 +212,9 @@ } ImageIO.write(img, "png", file); } catch (final Exception e) { - actionFactory.showMessageDialog(this, "zoomSaveException", e); + ACTION_FACTORY.showMessageDialog(this, "zoomSaveException", e); } catch (final OutOfMemoryError e) { - actionFactory.showMessageDialog(this, "zoomSaveOutOfMem"); + ACTION_FACTORY.showMessageDialog(this, "zoomSaveOutOfMem"); } } } @@ -304,7 +305,7 @@ image = null; image = original.getScaledInstance(width, height, algorithm); } catch (final OutOfMemoryError e) { - actionFactory.showMessageDialog(this, "zoomOutOfMem"); + ACTION_FACTORY.showMessageDialog(this, "zoomOutOfMem"); image = original; width = image.getWidth(this); height = image.getHeight(this); Modified: trunk/daimonin/src/daieditor/MapTilePane.java =================================================================== --- trunk/daimonin/src/daieditor/MapTilePane.java 2006-05-28 16:15:18 UTC (rev 58) +++ trunk/daimonin/src/daieditor/MapTilePane.java 2006-05-28 19:22:32 UTC (rev 59) @@ -23,6 +23,7 @@ package daieditor; +import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.gui.DirectionLayout; import daieditor.map.MapArchObject; import daieditor.map.MapControl; @@ -70,7 +71,7 @@ private static final long serialVersionUID = 1L; /** ActionFactory. */ - private static final ActionFactory actionFactory = ActionFactory.getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); /** The mainControl to use. */ private final CMainControl mainControl; @@ -83,14 +84,14 @@ /** The tile link names for the labels / borders. */ private static final String[] tile_link_name = { - actionFactory.getString("mapNorth"), - actionFactory.getString("mapEast"), - actionFactory.getString("mapSouth"), - action... [truncated message content] |
From: <chr...@us...> - 2006-05-28 16:15:30
|
Revision: 58 Author: christianhujer Date: 2006-05-28 09:15:18 -0700 (Sun, 28 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=58&view=rev Log Message: ----------- Added history documentation. Modified Paths: -------------- trunk/src/doc/start.xhtml Added Paths: ----------- trunk/src/doc/history.xhtml Added: trunk/src/doc/history.xhtml =================================================================== --- trunk/src/doc/history.xhtml (rev 0) +++ trunk/src/doc/history.xhtml 2006-05-28 16:15:18 UTC (rev 58) @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> + <head> + <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <title>History of Gridarta</title> + </head> + <body> + <p> + This document describes the history of the Gridarta project. + </p> + <p> + In 2000, Pasi Keränen published <a href="http://www.gamedev.net/hosted/javanerd/gridder.asp">Gridder</a>, a simple level editor for 2D games. + Based on Gridder, Michael Toennis created CFJavaEditor, a map editor for the popular MMORPG <a href="http://crossfire.real-time.com/">CrossFire</a>, which soon replaced the original cfeditor application for editing maps for CrossFire. + </p> + <p> + In 2001, Andreas Vogl started maintaining CFJavaEditor, adding a lot of features. + </p> + <p> + In 2002, Michael Toennis created <a href="http://www.daimonin.net/">Daimonin</a> as an independent branch of CrossFire out of ISO-CrossFire, the version of CrossFire with isometric graphics. + For Daimonin, CFJavaEditor became DaimoninEditor. + </p> + <p> + Since 2002, CFJavaEditor and DaimoninEditor were projects developed independently of each other. + </p> + <p> + In 2005, Christian Hujer started lead maintenance of DaimoninEditor, adding numeruous features. + </p> + <p> + In 2006, Christian Hujer, Daniel Viegas (Daimonin) and Andreas Kirschbaum (CrossFire) decided that it would be a good idea to reunite the + development effort of these two editors. + They created "Gridarta" as a project for merging the two editors CFJavaEditor and DaimoninEditor into a single one. + </p> + <p> + The name "Gridarta" was chosen as a combination of the words "grid" and "art". + It's an imitation of the original "Gridder" name. + It's reminiscence of "Siddharta" is a coincidence. + </p> + </body> +</html> Property changes on: trunk/src/doc/history.xhtml ___________________________________________________________________ Name: svn:mime-type + text/html Name: svn:eol-style + LF Modified: trunk/src/doc/start.xhtml =================================================================== --- trunk/src/doc/start.xhtml 2006-05-28 00:02:03 UTC (rev 57) +++ trunk/src/doc/start.xhtml 2006-05-28 16:15:18 UTC (rev 58) @@ -33,6 +33,7 @@ <li><a href="news/">Project News</a></li> <li><a href="dev/">Developer Documentation</a> Information for Gridarta Developers</li> <li><a href="subversion">Accessing Gridarta's Subversion Repository</a></li> + <li><a href="history">History of Gridarta</a></li> </ul> <h2>Contact the developers</h2> <ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-28 00:02:14
|
Revision: 57 Author: christianhujer Date: 2006-05-27 17:02:03 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=57&view=rev Log Message: ----------- Fixed broken tod message. Modified Paths: -------------- trunk/daimonin/src/daieditor/tod_de.properties Modified: trunk/daimonin/src/daieditor/tod_de.properties =================================================================== --- trunk/daimonin/src/daieditor/tod_de.properties 2006-05-27 23:56:34 UTC (rev 56) +++ trunk/daimonin/src/daieditor/tod_de.properties 2006-05-28 00:02:03 UTC (rev 57) @@ -5,6 +5,6 @@ tod.text.1=<html>Sie k\xF6nnen mit Hilfe der Pfeiltasten durch die Tipps navigieren.<br>(Pfeil links / Pfeil rechts) tod.text.2=<html>Dieses Tips-Fenster ist nicht modal.<p>Das bedeutet, Sie k\xF6nnen es offen lassen, w\xE4hrend Sie den Editor verwenden. -tod.text.3=<html>Sie k\xF6nnen den Editor online aktualisieren, um die neueste Version zu erhalten.<p>Men\xFC: <code>Hilfe -> Aktualisieren</code>.<br>Tastatur: +tod.text.3=<html>Sie k\xF6nnen den Editor online aktualisieren, um die neueste Version zu erhalten.<p>Men\xFC: <code>Hilfe -> Aktualisieren</code>.<br>Tastatur: <kbd>Strg-U</kbd>.<p>Das wird den Editor auf die neueste verf\xFCgbare Version aktualisieren (nightly build). tod.text.4=<html>Sie k\xF6nnen schnell zwischen ge\xF6ffneten Fenstern wechseln.<p>Men\xFC: <code>Ansicht->Vorheriges / N\xE4chstes Fenster.</code>.<br>Tastatur: <kbd>Umschalt-Bild Auf</kbd> / <kbd>Umschalt-Bild Ab</kbd>. tod.text.17=<html>Der Editor wurde unter Linux entwickelt, haupts\xE4chlich mit vim und Ant.<p>Zus\xE4tzlich wurden NetBeans 4.1, Eclipse 3.1 und <em>IntelliJ IDEA 5</em> verwendet.<p>JetBrains (<a href="http://www.jetbrains.com/">http://www.jetbrains.com/</a>) gaben uns eine kostenlose Lizenz f\xFCr IntelliJ IDEA.<br>Vielen Dank, JetBrains! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-27 23:56:39
|
Revision: 56 Author: christianhujer Date: 2006-05-27 16:56:34 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=56&view=rev Log Message: ----------- Released new update version, committing next build number. Modified Paths: -------------- trunk/daimonin/nextBuildNumber.properties Modified: trunk/daimonin/nextBuildNumber.properties =================================================================== --- trunk/daimonin/nextBuildNumber.properties 2006-05-27 23:54:44 UTC (rev 55) +++ trunk/daimonin/nextBuildNumber.properties 2006-05-27 23:56:34 UTC (rev 56) @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sun May 28 00:34:51 CEST 2006 -build.number=2917 +#Sun May 28 01:56:31 CEST 2006 +build.number=2918 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-27 23:54:59
|
Revision: 55 Author: christianhujer Date: 2006-05-27 16:54:44 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=55&view=rev Log Message: ----------- Fixed bogus behaviour regarding map tile pane preferences. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-05-27 22:48:31 UTC (rev 54) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-05-27 23:54:44 UTC (rev 55) @@ -25,6 +25,8 @@ package daieditor; +import static daieditor.CMainView.MAP_TILE_LIST_BOTTOM_KEY; +import static daieditor.CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT; import static daieditor.IGUIConstants.TILE_EDIT_NONE; import daieditor.arch.ArchObject; import daieditor.arch.ArchObjectParser; @@ -704,7 +706,7 @@ loadFromArchive = prefs.getBoolean(LOAD_ARCH_COLL, true); - mainView.setMapTileListBottom(prefs.getBoolean(CMainView.MAPTILE_BOTTOM_KEY, true)); + mainView.setMapTileListBottom(prefs.getBoolean(MAP_TILE_LIST_BOTTOM_KEY, MAP_TILE_LIST_BOTTOM_DEFAULT)); pickmapsLocked = prefs.getBoolean(PICKMAPS_LOCKED, false); Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-05-27 22:48:31 UTC (rev 54) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-05-27 23:54:44 UTC (rev 55) @@ -111,9 +111,12 @@ /** The key used to store the main windows divider location to the preferences. */ private static final String DIVIDER_LOCATION_KEY3 = "MainWindow.dividerLocation3"; - /** key for info weither map-tile panel is seperate or at bottom. */ - public static final String MAPTILE_BOTTOM_KEY = "MapTileBottom"; + /** Key for info whether map-tile panel is seperate or at bottom. */ + public static final String MAP_TILE_LIST_BOTTOM_KEY = "MapTileBottom"; + /** Default value for {@link MAP_TILE_LIST_BOTTOM_KEY}. */ + public static final boolean MAP_TILE_LIST_BOTTOM_DEFAULT = true; + /** The controller of this view. */ private static final CMainControl mainControl = CMainControl.getInstance(); @@ -151,7 +154,7 @@ private boolean pickmapActive; /** <code>true</code> when archpanel is merged into the bottom panel. */ - private boolean maptileBottom = true; + private boolean mapTileListBottom = true; /** Constructs the main view and registers the given main controller. */ CMainView() { @@ -215,7 +218,7 @@ mapDesktop = new JDesktopPane(); mapArchPanel = new CMapArchPanel(mainControl, this); - if (!maptileBottom) { + if (!mapTileListBottom) { splitRightPane = new DSplitPane(HORIZONTAL_SPLIT, mapDesktop, mapTileList); splitRightPane.setDividerLocation(divLocationRight); splitDownPane = new DSplitPane(VERTICAL_SPLIT, splitRightPane, mapArchPanel); @@ -389,14 +392,20 @@ statusBar.setStatusText(statusText); } - // is the map tile list in the bottom panel + /** + * Returns <code>true</code> when archpanel is merged into the bottom panel. + * @return <code>true</code> when archpanel is merged into the bottom panel. + */ public boolean isMapTileListBottom() { - return maptileBottom; + return mapTileListBottom; } - // is the map tile list in the bottom panel - public void setMapTileListBottom(final boolean state) { - maptileBottom = state; + /** + * Sets <code>true</code> when archpanel is merged into the bottom panel. + * @param mapTileListBottom <code>true</code> when archpanel is merged into the bottom panel + */ + public void setMapTileListBottom(final boolean mapTileListBottom) { + this.mapTileListBottom = mapTileListBottom; } /** Notifies that the application is about to exit. */ Modified: trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java 2006-05-27 22:48:31 UTC (rev 54) +++ trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java 2006-05-27 23:54:44 UTC (rev 55) @@ -23,7 +23,8 @@ import daieditor.CMainControl; import static daieditor.CMainControl.PREFS_LANGUAGE; -import static daieditor.CMainView.MAPTILE_BOTTOM_KEY; +import static daieditor.CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT; +import static daieditor.CMainView.MAP_TILE_LIST_BOTTOM_KEY; import static daieditor.IGUIConstants.DIALOG_BORDER; import java.awt.Component; import static java.util.Arrays.binarySearch; @@ -57,14 +58,11 @@ private static final long serialVersionUID = 1L; /** Action Facotry. */ - private static final ActionFactory actionFactory = ActionFactory.getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ - private static final Preferences prefs = userNodeForPackage(CMainControl.class); + private static final Preferences PREFS = userNodeForPackage(CMainControl.class); - /** Main Control. */ - private final CMainControl mainControl; - /** ComboBox for choosing the locale. */ private JComboBox localeBox; @@ -82,9 +80,8 @@ * @param mainControl The controller of this dialog. */ public GUIPrefs(final CMainControl mainControl) { - setListLabelText(actionFactory.getString("prefsGUI.title")); - setListLabelIcon(actionFactory.getIcon("prefsGUI.icon")); - this.mainControl = mainControl; + setListLabelText(ACTION_FACTORY.getString("prefsGUI.title")); + setListLabelIcon(ACTION_FACTORY.getIcon("prefsGUI.icon")); add(createGlobalPanel()); add(createLayoutPanel()); @@ -97,31 +94,31 @@ * @return titled border */ private static Border createTitledBorder(final String titleKey) { - return new CompoundBorder(new TitledBorder(actionFactory.getString(titleKey)), DIALOG_BORDER); + return new CompoundBorder(new TitledBorder(ACTION_FACTORY.getString(titleKey)), DIALOG_BORDER); } /** {@inheritDoc} */ public void apply() { final Locale loc = (Locale) localeBox.getSelectedItem(); if (loc != null) { - prefs.put(PREFS_LANGUAGE, loc.getLanguage()); + PREFS.put(PREFS_LANGUAGE, loc.getLanguage()); } else { - prefs.remove(PREFS_LANGUAGE); + PREFS.remove(PREFS_LANGUAGE); } - prefs.putBoolean(MAPTILE_BOTTOM_KEY, !mapPanelBottom.isSelected()); + PREFS.putBoolean(MAP_TILE_LIST_BOTTOM_KEY, mapPanelBottom.isSelected()); } /** {@inheritDoc} */ public void revert() { final String current = userNodeForPackage(CMainControl.class).get(PREFS_LANGUAGE, null); localeBox.setSelectedIndex(binarySearch(locales, current != null ? new Locale(current) : null, comp)); - mapPanelBottom.setSelected(!mainControl.getMainView().isMapTileListBottom()); + mapPanelBottom.setSelected(PREFS.getBoolean(MAP_TILE_LIST_BOTTOM_KEY, MAP_TILE_LIST_BOTTOM_DEFAULT)); } /** {@inheritDoc} */ public void defaults() { localeBox.setSelectedIndex(binarySearch(locales, null, comp)); - mapPanelBottom.setSelected(true); + mapPanelBottom.setSelected(MAP_TILE_LIST_BOTTOM_DEFAULT); } /** {@inheritDoc} */ @@ -131,7 +128,7 @@ final Locale current = currentName != null ? new Locale(currentName) : null; return !( (loc == null ? loc == current : loc.equals(current)) - && mapPanelBottom.isSelected() != mainControl.getMainView().isMapTileListBottom() + && mapPanelBottom.isSelected() == PREFS.getBoolean(MAP_TILE_LIST_BOTTOM_KEY, MAP_TILE_LIST_BOTTOM_DEFAULT) ); } @@ -142,7 +139,7 @@ private Component buildLocaleBox() { final Box lineLayout = createHorizontalBox(); - final String[] locNames = actionFactory.getString("availableLocales").split("\\s+"); + final String[] locNames = ACTION_FACTORY.getString("availableLocales").split("\\s+"); locales = new Locale[locNames.length + 1]; // locales[0] is intentionally null. It will be displayed as default and always get sorted to the top. for (int i = 0; i < locNames.length; i++) { @@ -150,7 +147,7 @@ } sort(locales, comp); - lineLayout.add(new JLabel(actionFactory.getString("optionsLanguage"))); // create label + lineLayout.add(new JLabel(ACTION_FACTORY.getString("optionsLanguage"))); // create label localeBox = new JComboBox(locales); // set "content" localeBox.setRenderer(new LocaleListCellRenderer()); @@ -183,8 +180,8 @@ final Box layoutPanel = createVerticalBox(); layoutPanel.setBorder(createTitledBorder("optionsLayout")); - mapPanelBottom = new JCheckBox(actionFactory.createAction(false, "optionsSepMapTile")); - mapPanelBottom.setSelected(!mainControl.getMainView().isMapTileListBottom()); + mapPanelBottom = new JCheckBox(ACTION_FACTORY.createAction(false, "optionsSepMapTile")); + mapPanelBottom.setSelected(PREFS.getBoolean(MAP_TILE_LIST_BOTTOM_KEY, MAP_TILE_LIST_BOTTOM_DEFAULT)); layoutPanel.add(mapPanelBottom); return layoutPanel; } Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2006-05-27 22:48:31 UTC (rev 54) +++ trunk/daimonin/src/daieditor/messages.properties 2006-05-27 23:54:44 UTC (rev 55) @@ -284,8 +284,8 @@ optionsLanguage=Language optionsLayout=Layout Settings optionsUpdate=Automatic Update -optionsSepMapTile.text=Separate Map-Tile Panel -optionsSepMapTile.shortdescription=Checking this moves the Map-Tile Panel to the right side of the screen instead of the bottom right corner. +optionsSepMapTile.text=Display Map-Tile Panel at the bottom +optionsSepMapTile.shortdescription=Unchecking this moves the Map-Tile Panel to the right side of the screen instead of the bottom right corner. optionsLoadArchColl.text=Load Arches from Collection optionsGlobal=Global optionsResPaths=Resource Paths Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2006-05-27 22:48:31 UTC (rev 54) +++ trunk/daimonin/src/daieditor/messages_de.properties 2006-05-27 23:54:44 UTC (rev 55) @@ -119,7 +119,7 @@ optionsTitle=Optionen optionsLanguage=Sprache optionsLayout=Layout-Einstellungen -optionsSepMapTile=Getrenntes Map-Tile-Panel +optionsSepMapTile.title=Map-Tile-Panel unten anzeigen optionsLoadArchColl.text=Vorbereitete Archetypen laden optionsGlobal=Global optionsResPaths=Pfade This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-27 22:48:37
|
Revision: 54 Author: christianhujer Date: 2006-05-27 15:48:31 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=54&view=rev Log Message: ----------- Cosmetic changes. Modified Paths: -------------- trunk/daimonin/src/daieditor/Updater.java Modified: trunk/daimonin/src/daieditor/Updater.java =================================================================== --- trunk/daimonin/src/daieditor/Updater.java 2006-05-27 22:34:54 UTC (rev 53) +++ trunk/daimonin/src/daieditor/Updater.java 2006-05-27 22:48:31 UTC (rev 54) @@ -36,6 +36,8 @@ import java.util.MissingResourceException; import java.util.PropertyResourceBundle; import java.util.ResourceBundle; +import java.util.logging.Logger; +import java.util.logging.Level; import java.util.prefs.Preferences; import static java.util.prefs.Preferences.userNodeForPackage; import static javax.swing.JOptionPane.QUESTION_MESSAGE; @@ -55,10 +57,13 @@ public final class Updater implements Runnable { /** ActionFactory. */ - private static final ActionFactory actionFactory = ActionFactory.getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); + /** Logger. */ + private static final Logger LOGGER = Logger.getLogger("daieditor"); + /** Preferences. */ - private static final Preferences prefs = userNodeForPackage(CMainControl.class); + private static final Preferences PREFS = userNodeForPackage(CMainControl.class); /** Preferences key whether to automatically check for updates. */ public static final String AUTO_CHECK_KEY = "UpdaterAutoCheck"; @@ -82,7 +87,7 @@ private static final int BUF_SIZE = 4096; /** The times for update calculation. */ - private static final long[] updateTimes = { + private static final long[] UPDATE_TIMES = { 0L, // Every startup 86400000L, // Once a day 604800000L, // Once a week @@ -105,11 +110,11 @@ * @param parentComponent Component to show dialogs on */ public static void startup(final Component parentComponent) { - if (!prefs.getBoolean(AUTO_CHECK_KEY, AUTO_CHECK_DEFAULT)) { + if (!PREFS.getBoolean(AUTO_CHECK_KEY, AUTO_CHECK_DEFAULT)) { return; } - final long timeDifference = updateTimes[prefs.getInt(INTERVAL_KEY, INTERVAL_DEFAULT)]; - final long lastUpdate = prefs.getLong(LAST_UPDATE_KEY, 0); + final long timeDifference = UPDATE_TIMES[PREFS.getInt(INTERVAL_KEY, INTERVAL_DEFAULT)]; + final long lastUpdate = PREFS.getLong(LAST_UPDATE_KEY, 0); if (currentTimeMillis() > lastUpdate + timeDifference) { update(parentComponent); } @@ -128,7 +133,7 @@ try { InputStream pin = null; try { - final String propUrl = actionFactory.getString("update.url"); + final String propUrl = ACTION_FACTORY.getString("update.url"); pin = openStream(propUrl); final ResourceBundle updateBundle = new PropertyResourceBundle(pin); final String downloadUrl = updateBundle.getString("update.url"); @@ -137,9 +142,9 @@ try { active = new VersionInfo(ResourceBundle.getBundle("build"), "build"); } catch (final MissingResourceException e) { - actionFactory.showMessageDialog(parentComponent, "updateActiveVersionUnavailable"); + ACTION_FACTORY.showMessageDialog(parentComponent, "updateActiveVersionUnavailable"); } - prefs.putLong(LAST_UPDATE_KEY, currentTimeMillis()); + PREFS.putLong(LAST_UPDATE_KEY, currentTimeMillis()); if (active == null || update.isNewerThan(active)) { if (askIfUserWantsUpdate(active, update, propUrl, downloadUrl)) { downloadAndInstallUpdate(downloadUrl); @@ -148,10 +153,10 @@ noNewUpdate(active, update, propUrl, downloadUrl); } } catch (final UnknownHostException e) { - actionFactory.showMessageDialog(parentComponent, "updateError", e.getLocalizedMessage()); + ACTION_FACTORY.showMessageDialog(parentComponent, "updateError", e.getLocalizedMessage()); } catch (final Exception e) { - e.printStackTrace(); - actionFactory.showMessageDialog(parentComponent, "updateError", e); + LOGGER.log(Level.WARNING, "updateError", e); + ACTION_FACTORY.showMessageDialog(parentComponent, "updateError", e); } finally { try { pin.close(); @@ -176,7 +181,7 @@ */ private boolean askIfUserWantsUpdate(final VersionInfo active, final VersionInfo update, final String propUrl, final String downloadUrl) { return - actionFactory.showConfirmDialog(parentComponent, YES_NO_OPTION, QUESTION_MESSAGE, "updateAvailable", + ACTION_FACTORY.showConfirmDialog(parentComponent, YES_NO_OPTION, QUESTION_MESSAGE, "updateAvailable", active.version, update.version, active.developer, update.developer, active.tstamp, update.tstamp, @@ -192,7 +197,7 @@ * @param downloadUrl URL where the update would be downloaded from */ private void noNewUpdate(final VersionInfo active, final VersionInfo update, final String propUrl, final String downloadUrl) { - actionFactory.showMessageDialog(parentComponent, "updateUnavailable", + ACTION_FACTORY.showMessageDialog(parentComponent, "updateUnavailable", active.version, update.version, active.developer, update.developer, active.tstamp, update.tstamp, @@ -219,19 +224,19 @@ } out.close(); if (/* !backup.delete() || */ !orig.renameTo(backup)) { - actionFactory.showMessageDialog(parentComponent, "updateFailedNoBackup"); + ACTION_FACTORY.showMessageDialog(parentComponent, "updateFailedNoBackup"); } else if (!download.renameTo(orig)) { backup.renameTo(orig); - actionFactory.showMessageDialog(parentComponent, "updateFailedNoDownload"); + ACTION_FACTORY.showMessageDialog(parentComponent, "updateFailedNoDownload"); } else { - actionFactory.showMessageDialog(parentComponent, "updateRestart"); + ACTION_FACTORY.showMessageDialog(parentComponent, "updateRestart"); CMainControl.getInstance().doExit(); } } catch (final InterruptedIOException e) { - actionFactory.showMessageDialog(parentComponent, "updateAborted"); + ACTION_FACTORY.showMessageDialog(parentComponent, "updateAborted"); } catch (final Exception e) { - e.printStackTrace(); - actionFactory.showMessageDialog(parentComponent, "updateError", e); + LOGGER.log(Level.WARNING, "updateError", e); + ACTION_FACTORY.showMessageDialog(parentComponent, "updateError", e); } finally { try { in.close(); @@ -256,10 +261,10 @@ @SuppressWarnings({"IOResourceOpenedButNotSafelyClosed"}) private InputStream openStream(final String url) throws IOException { final URLConnection con = new URL(url).openConnection(Proxy.NO_PROXY); - final ProgressMonitorInputStream stream = new ProgressMonitorInputStream(parentComponent, actionFactory.getString("updateProgress.title"), con.getInputStream()); + final ProgressMonitorInputStream stream = new ProgressMonitorInputStream(parentComponent, ACTION_FACTORY.getString("updateProgress.title"), con.getInputStream()); final ProgressMonitor monitor = stream.getProgressMonitor(); monitor.setMaximum(con.getContentLength()); - monitor.setNote(actionFactory.getString("updateProgress")); + monitor.setNote(ACTION_FACTORY.getString("updateProgress")); monitor.setMillisToDecideToPopup(10); monitor.setMillisToPopup(10); return stream; @@ -268,9 +273,15 @@ /** Class for holding version information and quickly comparing it. */ private static final class VersionInfo { - /** Update information. */ - private final String version, tstamp, developer; + /** Update information: Version of update version, usually the build number. */ + private final String version; + /** Update information: Time stamp of update version. */ + private final String tstamp; + + /** Update information: Developer that created the update version. */ + private final String developer; + /** Special Version "unavailable". */ private static final VersionInfo UNAVAILABLE = new VersionInfo(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-27 22:34:59
|
Revision: 53 Author: christianhujer Date: 2006-05-27 15:34:54 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=53&view=rev Log Message: ----------- Released new update version, committing next build number. Modified Paths: -------------- trunk/daimonin/nextBuildNumber.properties Modified: trunk/daimonin/nextBuildNumber.properties =================================================================== --- trunk/daimonin/nextBuildNumber.properties 2006-05-27 22:30:22 UTC (rev 52) +++ trunk/daimonin/nextBuildNumber.properties 2006-05-27 22:34:54 UTC (rev 53) @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sun May 28 00:08:50 CEST 2006 -build.number=2916 +#Sun May 28 00:34:51 CEST 2006 +build.number=2917 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-27 22:30:29
|
Revision: 52 Author: christianhujer Date: 2006-05-27 15:30:22 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=52&view=rev Log Message: ----------- Updated JAPI to fix NPE bug with changed prefs. Modified Paths: -------------- trunk/lib/japi.jar Modified: trunk/lib/japi.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-27 22:08:57
|
Revision: 51 Author: christianhujer Date: 2006-05-27 15:08:52 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=51&view=rev Log Message: ----------- Released new update version, committing next build number. Modified Paths: -------------- trunk/daimonin/nextBuildNumber.properties Modified: trunk/daimonin/nextBuildNumber.properties =================================================================== --- trunk/daimonin/nextBuildNumber.properties 2006-05-27 22:05:53 UTC (rev 50) +++ trunk/daimonin/nextBuildNumber.properties 2006-05-27 22:08:52 UTC (rev 51) @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sat May 27 18:19:28 CEST 2006 -build.number=2915 +#Sun May 28 00:08:50 CEST 2006 +build.number=2916 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-27 22:05:59
|
Revision: 50 Author: christianhujer Date: 2006-05-27 15:05:53 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=50&view=rev Log Message: ----------- Fixed missing japi license. Modified Paths: -------------- trunk/daimonin/build.xml Modified: trunk/daimonin/build.xml =================================================================== --- trunk/daimonin/build.xml 2006-05-27 16:19:30 UTC (rev 49) +++ trunk/daimonin/build.xml 2006-05-27 22:05:53 UTC (rev 50) @@ -123,6 +123,9 @@ <fileset dir="lib"> <include name="LICENSE-*" /> </fileset> + <fileset dir="../lib"> + <include name="LICENSE-japi.jar" /> + </fileset> <fileset dir=".."> <include name="arch/dev/editor/conf/ArchObjectMatchers.dtd" /> <include name="arch/dev/editor/conf/ArchObjectMatchers.xml" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-27 16:19:36
|
Revision: 49 Author: christianhujer Date: 2006-05-27 09:19:30 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=49&view=rev Log Message: ----------- Released new update version, committing next build number. Modified Paths: -------------- trunk/daimonin/nextBuildNumber.properties Modified: trunk/daimonin/nextBuildNumber.properties =================================================================== --- trunk/daimonin/nextBuildNumber.properties 2006-05-27 16:18:05 UTC (rev 48) +++ trunk/daimonin/nextBuildNumber.properties 2006-05-27 16:19:30 UTC (rev 49) @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sat May 27 18:08:04 CEST 2006 -build.number=2914 +#Sat May 27 18:19:28 CEST 2006 +build.number=2915 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-27 16:18:26
|
Revision: 48 Author: christianhujer Date: 2006-05-27 09:18:05 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=48&view=rev Log Message: ----------- Changed cfeditor to daieditor in html parts of javadoc. Modified Paths: -------------- trunk/daimonin/src/daieditor/gui/map/package.html trunk/daimonin/src/daieditor/map/validation/checks/package.html trunk/daimonin/src/daieditor/overview.html Modified: trunk/daimonin/src/daieditor/gui/map/package.html =================================================================== --- trunk/daimonin/src/daieditor/gui/map/package.html 2006-05-27 16:17:29 UTC (rev 47) +++ trunk/daimonin/src/daieditor/gui/map/package.html 2006-05-27 16:18:05 UTC (rev 48) @@ -7,8 +7,8 @@ </head> <body> <p> - The package <code>cfeditor.gui.map</code> is about displaying and rendering maps. - Note that the management of maps is in a different package: {@link cfeditor.map}. + The package <code>daieditor.gui.map</code> is about displaying and rendering maps. + Note that the management of maps is in a different package: {@link daieditor.map}. </p> </body> </html> Modified: trunk/daimonin/src/daieditor/map/validation/checks/package.html =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/package.html 2006-05-27 16:17:29 UTC (rev 47) +++ trunk/daimonin/src/daieditor/map/validation/checks/package.html 2006-05-27 16:18:05 UTC (rev 48) @@ -12,21 +12,21 @@ <h3>How to create your own checks</h3> <p>The easiest way to create your own checks is this:</p> <ol> - <li>Extend {@link cfeditor.map.validation.AbstractValidator} by a class named like cfeditor.map.validation.checks.MyMapChecker that additionally implements one of the {@link cfeditor.map.validation.Validator} subinterfaces</li> - <li>Extend {@link cfeditor.map.validation.ValidationError} or one of its subclasses by a class named like cfeditor.map.validation.checks.MyError</li> + <li>Extend {@link daieditor.map.validation.AbstractValidator} by a class named like daieditor.map.validation.checks.MyMapChecker that additionally implements one of the {@link daieditor.map.validation.Validator} subinterfaces</li> + <li>Extend {@link daieditor.map.validation.ValidationError} or one of its subclasses by a class named like daieditor.map.validation.checks.MyError</li> </ol> <p> Note: To use the automatic localization feature, the error class and validator class must match name like the existing checkers. </p> <h3>Caveats</h3> <p> - If you extend {@link cfeditor.map.validation.AbstractValidator} without actually really implementing one of the {@link cfeditor.map.validation.Validator}, your validator will be a valid and compilable validator but also a disfunctional stub. + If you extend {@link daieditor.map.validation.AbstractValidator} without actually really implementing one of the {@link daieditor.map.validation.Validator}, your validator will be a valid and compilable validator but also a disfunctional stub. So don't forget to extend the corresponding subinterface. </p> <h3>FAQ</h3> <dl> - <dt>Do I really have to always extend {@link cfeditor.map.validation.ValidationError} for my validator's errors?</dt> - <dd>Well not really. But the automatic localization of ValidationErrors depends on separate error class names. Also, {@link cfeditor.map.validation.CorrectableError} depends on separate error classes.</dd> + <dt>Do I really have to always extend {@link daieditor.map.validation.ValidationError} for my validator's errors?</dt> + <dd>Well not really. But the automatic localization of ValidationErrors depends on separate error class names. Also, {@link daieditor.map.validation.CorrectableError} depends on separate error classes.</dd> </dl> </body> </html> Modified: trunk/daimonin/src/daieditor/overview.html =================================================================== --- trunk/daimonin/src/daieditor/overview.html 2006-05-27 16:17:29 UTC (rev 47) +++ trunk/daimonin/src/daieditor/overview.html 2006-05-27 16:18:05 UTC (rev 48) @@ -12,17 +12,17 @@ </p> <h3>UI Classes</h3> <p> - The most important UI class is {@link cfeditor.CMainView}. + The most important UI class is {@link daieditor.CMainView}. It is the main window, creates the main layout and holds all actions. - Most actions are delegated to {@link cfeditor.CMainControl} upon performation. + Most actions are delegated to {@link daieditor.CMainControl} upon performation. </p> <p> - Map Visualisation is done by {@link cfeditor.CMapViewBasic}, which renders the map, and {@link cfeditor.CMapViewIFrame}, which is + Map Visualisation is done by {@link daieditor.CMapViewBasic}, which renders the map, and {@link daieditor.CMapViewIFrame}, which is a JInternalFrame wrapping CMapViewBasic. </p> <h3>Data Model</h3> <p> - Each archetype is an instance of {@link cfeditor.arch.ArchObject}. + Each archetype is an instance of {@link daieditor.arch.ArchObject}. </p> <h3>Daimonin Editor Terminology Glossary</h3> <dl> @@ -45,7 +45,7 @@ An animation can be anonymously defined inside a default arch; such animations inherit the name from the defining arch. Or an animation can be defined in a separate file in the <code>arch/</code> folder. <p /> - Animations are NamedObjects, override Faces, they are implemented by {@link cfeditor.arch.anim.AnimationObject} and {@link cfeditor.arch.anim.AnimationObjects}. + Animations are NamedObjects, override Faces, they are implemented by {@link daieditor.arch.anim.AnimationObject} and {@link daieditor.arch.anim.AnimationObjects}. <p /> </dd> <dt id="Archetype">Archetype</dt> @@ -63,9 +63,9 @@ After the migration is finished, Artifacts are special "appliable" Archetypes. You'd select an ArchObject and apply an Artifact on it, which would copy all Artifact attributes over the ArchObject attributes. <p /> - The class that implements Archetypes is {@link cfeditor.arch.ArchObject}. - The class that parses text for modifying ArchObjects is {@link cfeditor.arch.ArchObjectParser}. - The class that holds all Default Archetypes, including those for Default Artifacts, is {@link cfeditor.arch.ArchObjectStack}. + The class that implements Archetypes is {@link daieditor.arch.ArchObject}. + The class that parses text for modifying ArchObjects is {@link daieditor.arch.ArchObjectParser}. + The class that holds all Default Archetypes, including those for Default Artifacts, is {@link daieditor.arch.ArchObjectStack}. <p /> </dd> <dt id="Artifact">Artifact</dt> @@ -78,7 +78,7 @@ The Face is the appearance of an Archetype. A Face is defined by a String that uniquely defines the appearance and is used to reference a corresponding graphic image, usually a PNG file. - The {@link cfeditor.arch.ArchObjectStack} contains a collection of all available faces. + The {@link daieditor.arch.ArchObjectStack} contains a collection of all available faces. <p /> Animations override Faces. <p /> @@ -90,7 +90,7 @@ At those grid positions, Map Squares with Arch Objects can be found and make up the world, its surface, obstacles, items etc.. <p /> The Map itself is defined by a Map Arch. - The class storing the Map is {@link cfeditor.map.MapModel}. + The class storing the Map is {@link daieditor.map.MapModel}. <p /> </dd> <dt id="MapSquare">(Map )Square</dt> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-27 16:17:38
|
Revision: 47 Author: christianhujer Date: 2006-05-27 09:17:29 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=47&view=rev Log Message: ----------- Replaced cvs with svn. Modified Paths: -------------- trunk/daimonin/build.xml Modified: trunk/daimonin/build.xml =================================================================== --- trunk/daimonin/build.xml 2006-05-27 16:08:06 UTC (rev 46) +++ trunk/daimonin/build.xml 2006-05-27 16:17:29 UTC (rev 47) @@ -325,7 +325,9 @@ </fileset> </scp> <buildnumber file="nextBuildNumber.properties" /> - <cvs command="commit -m "Released new update version, committing next build number." nextBuildNumber.properties" /> + <exec executable="svn"> + <arg line="commit -m "Released new update version, committing next build number." nextBuildNumber.properties" /> + </exec> </target> </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-27 16:08:18
|
Revision: 46 Author: christianhujer Date: 2006-05-27 09:08:06 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=46&view=rev Log Message: ----------- Released new update version, committing next build number. Modified Paths: -------------- trunk/daimonin/nextBuildNumber.properties Modified: trunk/daimonin/nextBuildNumber.properties =================================================================== --- trunk/daimonin/nextBuildNumber.properties 2006-05-27 15:57:44 UTC (rev 45) +++ trunk/daimonin/nextBuildNumber.properties 2006-05-27 16:08:06 UTC (rev 46) @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sun May 14 19:07:52 CEST 2006 -build.number=2911 +#Sat May 27 18:08:04 CEST 2006 +build.number=2914 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-27 15:57:51
|
Revision: 45 Author: christianhujer Date: 2006-05-27 08:57:44 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=45&view=rev Log Message: ----------- Removed binary from repository. Removed Paths: ------------- trunk/daimonin/DaimoninEditor.jar Deleted: trunk/daimonin/DaimoninEditor.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-27 12:41:46
|
Revision: 44 Author: christianhujer Date: 2006-05-27 05:41:41 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=44&view=rev Log Message: ----------- Added date to project news. Modified Paths: -------------- trunk/src/doc/news/2006-05-27_1.xhtml Modified: trunk/src/doc/news/2006-05-27_1.xhtml =================================================================== --- trunk/src/doc/news/2006-05-27_1.xhtml 2006-05-27 12:35:42 UTC (rev 43) +++ trunk/src/doc/news/2006-05-27_1.xhtml 2006-05-27 12:41:41 UTC (rev 44) @@ -6,6 +6,7 @@ <title>Project Gridarta Started</title> </head> <body> + <p>2006-05-27</p> <pre>Dear People, (intended audience: map makers, active gamers and developers of crossfire and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-27 12:35:55
|
Revision: 43 Author: christianhujer Date: 2006-05-27 05:35:42 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=43&view=rev Log Message: ----------- Added project news. Modified Paths: -------------- trunk/src/doc/start.xhtml Added Paths: ----------- trunk/src/doc/news/ trunk/src/doc/news/2006-05-27_1.xhtml trunk/src/doc/news/start.xhtml Added: trunk/src/doc/news/2006-05-27_1.xhtml =================================================================== --- trunk/src/doc/news/2006-05-27_1.xhtml (rev 0) +++ trunk/src/doc/news/2006-05-27_1.xhtml 2006-05-27 12:35:42 UTC (rev 43) @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> + <head> + <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <title>Project Gridarta Started</title> + </head> + <body> + <pre>Dear People, + +(intended audience: map makers, active gamers and developers of crossfire and +derived mmorpgs, especially angelion, crossfire, daimonin) + +The DaimoninEditor, Daimonin's successor of the CFJavaEditor, has "grown up" and +become a sourceforge project of its own. It is called "Gridarta" now. The name +Gridarta combines "grid" and "art" and coincidently also reminds of +"Siddhartha". +The project "Gridarta" was founded by zergus and me (Cher). + +@devs: I hope I have added all relevant (in the sense of interested in active + Java map editor development) developers of Crossfire and Daimonin to the + Gridarta development team. If you think you should belong there but were + forgotten, please send me an e-mail. + +IMPORTANT +@devs: Also don't forget to subscribe the gridarta mailling lists. +@all: read more on the new gridarta homepage http://gridarta.sourceforge.net/ + +CURRENT PROJECT PLAN +1. Import source of both, Crossfire and Daimonin's Java map editors in Gridarta. + (done) +2. Setup build environment which fits the needs of both projects. (done) +3. Release the first version of Gridarta for Daimonin. +4. Replace Daimonin's Java map editor in Daimonin's cvs repository with + something that gets Gridarta instead. +5. Merge Crossfire's editor into Daimonin's editor, whilst creating a test suite + which performs the required tests whether gridarta works correctly with + current crossfire resp. daimonin data. + +FINAL STATEMENT +Long live Crossfire and Daimonin! Happy mapping :) + +-- +Christian Hujer +Free software developer +E-Mail: ch...@ri... +WWW: http://www.riedquat.de/</pre> + </body> +</html> Property changes on: trunk/src/doc/news/2006-05-27_1.xhtml ___________________________________________________________________ Name: svn:mime-type + text/html Name: svn:eol-style + LF Added: trunk/src/doc/news/start.xhtml =================================================================== --- trunk/src/doc/news/start.xhtml (rev 0) +++ trunk/src/doc/news/start.xhtml 2006-05-27 12:35:42 UTC (rev 43) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> + <head> + <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <title>Gridarta Project News</title> + </head> + <body> + <ul> + <li><a href="2006-05-27_1">2006-05-27: Project Gridarta Started</a></li> + </ul> + </body> +</html> Property changes on: trunk/src/doc/news/start.xhtml ___________________________________________________________________ Name: svn:mime-type + text/html Name: svn:eol-style + LF Modified: trunk/src/doc/start.xhtml =================================================================== --- trunk/src/doc/start.xhtml 2006-05-27 11:41:27 UTC (rev 42) +++ trunk/src/doc/start.xhtml 2006-05-27 12:35:42 UTC (rev 43) @@ -23,11 +23,6 @@ Gridarta is an open source (GPL) Map Editor for 2D MMORPGs. Gridarta currently supports Angelion, Crossfire and Daimonin. </p> - <h2>News</h2> - <p> - Gridarta project created. - First step: Merge CFJavaEditor and DaimoninEditor. - </p> <h2>Download Gridarta</h2> <p> Gridarta can't be downloaded yet. @@ -35,6 +30,7 @@ </p> <h2>Documentation</h2> <ul> + <li><a href="news/">Project News</a></li> <li><a href="dev/">Developer Documentation</a> Information for Gridarta Developers</li> <li><a href="subversion">Accessing Gridarta's Subversion Repository</a></li> </ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-27 11:41:38
|
Revision: 42 Author: christianhujer Date: 2006-05-27 04:41:27 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=42&view=rev Log Message: ----------- Added subversion access documentation. Modified Paths: -------------- trunk/src/doc/start.xhtml Added Paths: ----------- trunk/src/doc/subversion.xhtml Modified: trunk/src/doc/start.xhtml =================================================================== --- trunk/src/doc/start.xhtml 2006-05-27 09:17:54 UTC (rev 41) +++ trunk/src/doc/start.xhtml 2006-05-27 11:41:27 UTC (rev 42) @@ -36,6 +36,7 @@ <h2>Documentation</h2> <ul> <li><a href="dev/">Developer Documentation</a> Information for Gridarta Developers</li> + <li><a href="subversion">Accessing Gridarta's Subversion Repository</a></li> </ul> <h2>Contact the developers</h2> <ul> Added: trunk/src/doc/subversion.xhtml =================================================================== --- trunk/src/doc/subversion.xhtml (rev 0) +++ trunk/src/doc/subversion.xhtml 2006-05-27 11:41:27 UTC (rev 42) @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- $Id: releasePlan.xhtml,v 1.6 2006/03/29 22:21:14 christianhujer Exp $ --> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> + <head> + <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <meta name="Date" content="$Date: 2006-04-03 23:00:14 +0200 (Mon, 03 Apr 2006) $" /> + <title>Gridarta Subversion Developer Access</title> + </head> + <body> + <h2>Checking out a normal working copy</h2> + <p> + To checkout a normal working copy of the latest development, checkout the trunk. + This is what's called HEAD or MAIN/LATEST in other version control systems. + </p> + <p><code>svn co https://svn.sourceforge.net/svnroot/gridarta gridarta/trunk</code></p> + <h2>Rules</h2> + <p> + Current rules are this: + </p> + <ul> + <li> + All files need a mime type. + For normal source code, use <code>text/plain</code>. + Use <code>svn propset svn:mime-type text/plain <var>filename</var></code> to set the mime type. + </li> + <li> + All files with a text based mime type need a line ending setting. + Gridarta convention is to always use <code>LF</code>. + Use <code>svn propset svn:eol-style LF <var>filename</var></code> to set the line ending style. + </li> + </ul> + <h2>Releases</h2> + <p> + Releases are created in the following way: + </p> + <ol> + <li> + A branch with the new release name is created. + Usually the branch will increase the minor revision and use it as its name. + Example: <code>svn copy trunk branch/0.8</code>. + The policy for branches is that they aren't completely frozen, but only changes required for release and bug fixing are allowed. + </li> + <li> + The branch is braught into releasable state. + This usually should be zero effort, yet consider this a separate step. + </li> + <li> + The release is published. + As a part of the release publishing, a tag with the new release name and patch level is created. + Example: <code>svn copy branch/0.8 tag/0.8.0</code>. + The policy for tags is that they are completely frozen, tags must never ever be changed. + </li> + </ol> + <h2>Checking out a released version</h2> + <p> + To checkout a released version, use <code>svn co https://svn.sourceforge.net/svnroot/gridarta gridarta/tag/<var>version</var></code> with + <var>version</var> being the release name. + To checkout, for example, version <samp>0.8.0</samp>, use <samp>svn co https://svn.sourceforge.net/svnroot/gridarta gridarta/tag/0.8.0</samp>. + </p> + </body> +</html> Property changes on: trunk/src/doc/subversion.xhtml ___________________________________________________________________ Name: svn:mime-type + text/html Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <der...@us...> - 2006-05-27 09:18:18
|
Revision: 41 Author: derdanny Date: 2006-05-27 02:17:54 -0700 (Sat, 27 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=41&view=rev Log Message: ----------- Added support for multiple views. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainStatusbar.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/CMapViewIFrame.java trunk/daimonin/src/daieditor/action.properties trunk/daimonin/src/daieditor/gui/map/MapUserListener.java trunk/daimonin/src/daieditor/map/MapControl.java Added Paths: ----------- trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java trunk/daimonin/src/daieditor/gui/map/LevelRenderer.java trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java Removed Paths: ------------- trunk/daimonin/src/daieditor/gui/map/LevelRenderer.java Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-05-27 00:42:33 UTC (rev 40) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-05-27 09:17:54 UTC (rev 41) @@ -496,7 +496,9 @@ public void checkMap(final MapModel map) { final ErrorCollector errorCollector = new DefaultErrorCollector(); validators.validateAll(map, errorCollector); - map.getMapControl().getMapViewFrame().view.setErrors(errorCollector); + for (final CMapViewIFrame mapViewIFrame : map.getMapControl().getMapViewFrames()) { + mapViewIFrame.view.setErrors(errorCollector); + } mainView.setErrors(errorCollector); } @@ -916,6 +918,18 @@ } /** + * Invoked when the user wants to close the current view. + * If there is only 1 view left the level will be closed. + * @param mapViewIFrame View to close + */ + public void closeView(final CMapViewIFrame mapViewIFrame) { + final MapControl mapControl = mapViewIFrame.getMapControl(); + mapControl.closeView(mapViewIFrame); + if (mapControl.nViews() == 0) { + closeLevel(mapControl); + } + } + /** * Invoked when the user wants to close all levels. * @return <code>true</code> if all levels closed, <code>false</code> if user cancelled */ @@ -1012,15 +1026,16 @@ // Notify the level about the closing mainView.setMapTileList(null, null); level.levelCloseNotify(); - if (level.getMapViewFrame() != null) { - mainView.removeLevelView(level.getMapViewFrame()); + while (level.getMapViewFrame() != null) { + level.closeView(level.getMapViewFrame()); } levels.remove(level); - currentMap = null; if (levels.size() > 0) { // get next open map we can find and set it to m_currentMap currentMap = levels.get(levels.size() - 1); + } else { + currentMap = null; } } refreshMenusAndToolbars(); @@ -1182,7 +1197,7 @@ if (levelFile != null && can.equals(levelFile.getCanonicalFile())) { lastOpenedMap = level; if (view) { - level.initView(); + level.createView(); setCurrentLevel(level); setCurrentLevelView(level.getMapViewFrame()); } Modified: trunk/daimonin/src/daieditor/CMainStatusbar.java =================================================================== --- trunk/daimonin/src/daieditor/CMainStatusbar.java 2006-05-27 00:42:33 UTC (rev 40) +++ trunk/daimonin/src/daieditor/CMainStatusbar.java 2006-05-27 09:17:54 UTC (rev 41) @@ -25,7 +25,7 @@ package daieditor; -import daieditor.gui.map.LevelRenderer; +import daieditor.gui.map.DefaultLevelRenderer; import daieditor.gui.map.MapCursor; import daieditor.gui.map.MapCursorEvent; import daieditor.gui.map.MapCursorListener; @@ -213,7 +213,7 @@ final Point mousePos = e.getPoint(); final int mouseX = mousePos.x; final int mouseY = mousePos.y; - final LevelRenderer renderer = (LevelRenderer) e.getSource(); + final DefaultLevelRenderer renderer = (DefaultLevelRenderer) e.getSource(); final Point mouseMap = renderer.getTileLocationAt(mousePos, mouseMapTmp); if (mouseMap != null) { final int mouseMapX = mouseMap.x; Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-05-27 00:42:33 UTC (rev 40) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-05-27 09:17:54 UTC (rev 41) @@ -27,7 +27,6 @@ import daieditor.arch.ArchObject; import daieditor.arch.ArchObjectStack; import daieditor.gui.AboutDialog; -import net.sf.gridarta.help.Help; import daieditor.map.MapControl; import daieditor.map.validation.ErrorCollector; import daieditor.map.validation.ErrorHandler; @@ -61,6 +60,7 @@ import javax.swing.SwingConstants; import javax.swing.event.InternalFrameEvent; import javax.swing.event.InternalFrameListener; +import net.sf.gridarta.help.Help; import net.sf.japi.swing.ActionFactory; import net.sf.japi.util.ThrowableHandler; import org.jetbrains.annotations.Nullable; @@ -469,13 +469,10 @@ * Removes (closes) the level view. * @param mapView the map view to be removed (closed). */ - void removeLevelView(final CMapViewIFrame mapView) { - if (!mapViews.contains(mapView)) { - return; - } + public void removeLevelView(final CMapViewIFrame mapView) { + assert mapViews.contains(mapView); mapViews.remove(mapView); - mapView.closeNotify(); mapDesktop.remove(mapView); mapView.dispose(); mapDesktop.repaint(); @@ -608,7 +605,8 @@ public void levelViewFocusGainedNotify(final CMapViewIFrame view) { mapViews.remove(view); mapViews.add(0, view); - final MapControl level = view.getLevel(); + final MapControl level = view.getMapControl(); + level.setFocus(view); mainControl.setCurrentLevel(level); // m_statusbar.setLevelInfo( level ); @@ -620,7 +618,7 @@ /** {@inheritDoc} */ public void internalFrameClosing(final InternalFrameEvent event) { - mainControl.close(); + mainControl.closeView((CMapViewIFrame) event.getInternalFrame()); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/daieditor/CMapViewBasic.java =================================================================== --- trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-05-27 00:42:33 UTC (rev 40) +++ trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-05-27 09:17:54 UTC (rev 41) @@ -25,7 +25,7 @@ package daieditor; import daieditor.arch.ArchObject; -import daieditor.gui.map.LevelRenderer; +import daieditor.gui.map.DefaultLevelRenderer; import daieditor.gui.map.MapCursor; import daieditor.gui.map.MapCursorEvent; import daieditor.gui.map.MapCursorListener; @@ -89,8 +89,7 @@ private final CMainControl mainControl; /** The tile palette renderer. */ - private final LevelRenderer renderer; - + private final DefaultLevelRenderer renderer; private MapCursor mapCursor; private MapGrid mapGrid; @@ -104,8 +103,7 @@ private Map<MapSquare, ValidationError> erraneousMapSquares = new HashMap<MapSquare, ValidationError>(); /** The ArchObjects that are known to contain errors. */ - private Map<ArchObject, ValidationError> erraneousArchObjects = new HashMap<ArchObject, ValidationError>(); - //MapUserListener mapUserListener; + private Map<ArchObject,ValidationError> erraneousArchObjects = new HashMap<ArchObject,ValidationError>(); /** * Constructs a level view. @@ -116,15 +114,20 @@ super(VERTICAL_SCROLLBAR_AS_NEEDED, HORIZONTAL_SCROLLBAR_AS_NEEDED); mapControl = control; mapModel = mapControl.getMapModel(); - mapGrid = mapControl.getMapGrid(); - mapCursor = mapControl.getMapCursor(); + mapGrid = new MapGrid(mapModel.getMapSize()); + mapCursor = new MapCursor(mapGrid); + mapCursor.addMapCursorListener(this); + if (!mapControl.isPickmap()) { + mapCursor.addMapCursorListener(mainControl.getMainView().getMapTileList()); + mapCursor.addMapCursorListener(mainControl.getMainView().getStatusBar()); + } this.mainControl = mainControl; frameInterface = fi; if (isPickmap()) { setBackground(IGUIConstants.BG_COLOR); } - renderer = mapControl.getRenderer(); + renderer = new DefaultLevelRenderer(mainControl, mapControl, mapControl.isPickmap(), mapGrid); setViewportView(renderer); getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); @@ -148,6 +151,20 @@ setFocusable(true); } + /** Get MapGrid of this view. + * @return MapGrid of this view. + */ + public MapGrid getMapGrid() { + return mapGrid; + } + + /** Get MapCursor of this view. + * @return MapCursor of this view. + */ + public MapCursor getMapCursor() { + return mapCursor; + } + public boolean isChanged() { return changed; } @@ -201,11 +218,6 @@ renderer.setGridVisibility(gridVisibility); } - /** Notifies that this level view is about to be closed. */ - void closeNotify() { - mapControl.viewCloseNotify(); - } - /** * Returns the controller of this view. * @return The controller of this view. @@ -287,8 +299,8 @@ * Get the selected squares. * @return selected squares */ - public ArrayList<MapSquare> getSelectedSquares() { - final ArrayList<MapSquare> selection = new ArrayList<MapSquare>(); + public List<MapSquare> getSelectedSquares() { + final List<MapSquare> selection = new ArrayList<MapSquare>(); final Dimension mapSize = mapModel.getMapSize(); final Point pos = new Point(); for (pos.x = 0; pos.x < mapSize.width; pos.x++) { @@ -307,7 +319,7 @@ */ public Iterable<MapSquare> getAllSquares() { final Dimension mapSize = mapModel.getMapSize(); - final ArrayList<MapSquare> selection = new ArrayList<MapSquare>(mapSize.width * mapSize.height); + final List<MapSquare> selection = new ArrayList<MapSquare>(mapSize.width * mapSize.height); final Point pos = new Point(); for (pos.x = 0; pos.x < mapSize.width; pos.x++) { for (pos.y = 0; pos.y < mapSize.height; pos.y++) { @@ -402,7 +414,7 @@ renderer.setPaintOnlyMap(b); } - public LevelRenderer getRenderer() { + public DefaultLevelRenderer getRenderer() { return renderer; } Modified: trunk/daimonin/src/daieditor/CMapViewIFrame.java =================================================================== --- trunk/daimonin/src/daieditor/CMapViewIFrame.java 2006-05-27 00:42:33 UTC (rev 40) +++ trunk/daimonin/src/daieditor/CMapViewIFrame.java 2006-05-27 09:17:54 UTC (rev 41) @@ -60,16 +60,21 @@ public final CMapViewBasic view; // the underlying mapview object + /** Number of this view. */ + private final int viewNumber; + /** * Constructs a level view. * @param mainControl the main controller * @param control the controller of this view + * @param number Each view of a level will get a number */ - public CMapViewIFrame(final CMainControl mainControl, final MapControl control) { + public CMapViewIFrame(final CMainControl mainControl, final MapControl control, final int number) { // set title - super(control.getMapFileName() + " [ " + control.getMapArch().getMapNameWithoutMusic() + " ]", true, true, true, true); + super(control.getMapFileName() + " [ " + control.getMapArch().getMapNameWithoutMusic() + " ] ("+ number + ')', true, true, true, true); mapControl = control; this.mainControl = mainControl; + viewNumber = number; setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); @@ -101,7 +106,8 @@ } final StringBuilder strTitle = new StringBuilder(); - strTitle.append(mapControl.getMapFileName()).append(" [ ").append(mapControl.getMapArch().getMapNameWithoutMusic()).append(" ]"); + strTitle.append(mapControl.getMapFileName()).append(" [ ").append(mapControl.getMapArch().getMapNameWithoutMusic()).append(" ] ("); + strTitle.append(viewNumber).append(')'); if (view.isChanged()) { strTitle.append('*'); // * map has changed @@ -110,19 +116,8 @@ setTitle(strTitle.toString()); // display new title } - /** - * Returns the controller of this view. - * @return The controller of this view. - */ - public MapControl getLevel() { - return mapControl; - } - // following a bunch of wrapper methods which just pass access // to the basic mapview object 'view': - public Point getMapMouseRightPos() { - return view.getMapMouseRightPos(); - } public boolean isHighlight() { return view.isHighlight(); @@ -140,10 +135,6 @@ return mapControl; } - public void closeNotify() { - view.closeNotify(); - } - public void setHotspot(final Point pos) { view.setHotspot(pos); } Modified: trunk/daimonin/src/daieditor/action.properties =================================================================== --- trunk/daimonin/src/daieditor/action.properties 2006-05-27 00:42:33 UTC (rev 40) +++ trunk/daimonin/src/daieditor/action.properties 2006-05-27 09:17:54 UTC (rev 41) @@ -1,7 +1,7 @@ # Warning: This file MUST be ISO-8859-1 # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding -ActionFactory.additionalBundles=cfeditor.messages +ActionFactory.additionalBundles=daieditor.messages # Extend this if you add a new locale. The order is irrelevant. availableLocales=en de fr sv Copied: trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java (from rev 24, trunk/daimonin/src/daieditor/gui/map/LevelRenderer.java) =================================================================== --- trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java (rev 0) +++ trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2006-05-27 09:17:54 UTC (rev 41) @@ -0,0 +1,508 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2000 Michael Toennies + * Copyright (C) 2001 Andreas Vogl + * Copyright (C) 2006 The Gridarta Developers + * + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package daieditor.gui.map; + +import daieditor.CMainControl; +import daieditor.IGUIConstants; +import daieditor.MultiPositionData; +import daieditor.arch.ArchObject; +import daieditor.map.MapControl; +import daieditor.map.MapModel; +import daieditor.map.MapSquare; +import daieditor.map.validation.ValidationError; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.event.MouseEvent; +import java.awt.image.BufferedImage; +import java.util.Map; +import javax.swing.ImageIcon; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * This is the default renderer of a map. It visualizes selections and validation errors. + */ +public class DefaultLevelRenderer extends LevelRenderer implements MapGridListener { + + /** Serial Version UID. */ + private static final long serialVersionUID = 1L; + + /** + * Declares this CLevelRenderer as a renderer for a Pickmap. + * Pickmaps have a special behaviour that's different from normal maps. + * Value: <code>true</code> if pickmap, otherwise <code>false</code>. + */ + private final boolean isPickmap; + + /** offset to map borders (32 for std. rect. maps, 0 for pickmaps). */ + private Point borderOffset = new Point(); + + /** Time of last selection painting. */ + private transient long lastSelectionPaint; + + /** Time of last core painting (includes selection painting). */ + private transient long lastCorePaint; + + /** Time of last overall painting (includes core and thus selection). */ + private transient long lastPaint; + + /** The origin is the point in the north-west corner */ + private Point origin = new Point(); + + private MapModel mapModel; + + private CMainControl mainControl; + + private final Dimension mapSize = new Dimension(); + + private final MapGrid mapGrid; + + /** The MapSquares that are known to contain errors. */ + private Map<MapSquare,ValidationError> erraneousMapSquares; + + /** The ArchObjects that are known to contain errors. */ + private Map<ArchObject,ValidationError> erraneousArchObjects; + + private boolean gridVisibility; + + /** Used to avoid creation millions of points */ + private final Point tmpPoint = new Point(); + + /** If true selection and grid will not be painted */ + private boolean paintOnlyMap; + + /** + * Constructor + */ + public DefaultLevelRenderer(final CMainControl mainControl, final MapControl mapControl, final boolean pickmap, final MapGrid mapGrid) { + this.mainControl = mainControl; + checkDouble = mainControl.isUseDouble(); + mapModel = mapControl.getMapModel(); + mapSize.setSize(mapModel.getMapSize()); + this.mapGrid = mapGrid; + isPickmap = pickmap; + if (isPickmap) { + setBorderOffset(0, IGUIConstants.TILE_ISO_YLEN); + setBackground(IGUIConstants.BG_COLOR); + } else { + setBorderOffset(IGUIConstants.TILE_ISO_XLEN, 2 * IGUIConstants.TILE_ISO_YLEN); + } + setToolTipText("dummy"); + setFocusable(true); + } + + /** + * The origin which is located in the NW-corner of the map is calculated. + * On non-pickmaps there is an extra border. + */ + private void calculateOrigin() { + if (isPickmap) { + origin.setLocation(borderOffset.x + 4 * IGUIConstants.TILE_ISO_XLEN2, borderOffset.y); + } else { + origin.setLocation(borderOffset.x + mapSize.height * IGUIConstants.TILE_ISO_XLEN2, borderOffset.y); + } + } + + /** + * Returns offset to map borders (32 for std. rect. maps, 0 for pickmaps). + * @return offset to map borders (32 for std. rect. maps, 0 for pickmaps) + */ + public final Point getBorderOffset() { + return new Point(borderOffset); + } + + /** Sets offset to map borders (32 for std. rect. maps, 0 for pickmaps). + * @param offset offset to map borders (32 for std. rect. maps, 0 for pickmaps) + */ + public void setBorderOffset(final Point offset) { + borderOffset.setLocation(offset); + calculateOrigin(); + } + + /** Sets offset to map borders (32 for std. rect. maps, 0 for pickmaps). + * @param x x offset to map borders (32 for std. rect. maps, 0 for pickmaps) + * @param y y offset to map borders (32 for std. rect. maps, 0 for pickmaps) + */ + public void setBorderOffset(final int x, final int y) { + borderOffset.setLocation(x, y); + calculateOrigin(); + } + + /** {@inheritDoc} */ + @Nullable @Override public String getToolTipText(final MouseEvent event) { + final Point mapLocation = getTileLocationAt(event.getPoint(), tmpPoint); + if (mapLocation == null) { + return null; + } + if (mapGrid.hasError(mapLocation)){ + final MapSquare mapSquare = mapModel.getMapSquare(mapLocation); + + if (erraneousMapSquares.containsKey(mapSquare)) { + final ValidationError error = erraneousMapSquares.get(mapSquare); + return error.getMessage(); + } else { + return null; + } + } else { + return null; + } + } + + /** + * @return whether rendered map is a pickmap + */ + public boolean isPickmap() { + return isPickmap; + } + + /** + * @return an image of the entire mapview + */ + @Override public BufferedImage getFullImage() { + // set map dimensions for iso view + final int sum = mapSize.width + mapSize.height; + final int viewWidth = sum * IGUIConstants.TILE_ISO_XLEN2; + final int viewHeight = sum * IGUIConstants.TILE_ISO_YLEN2; + + // first create a storing place for the image + final BufferedImage bufImage = new BufferedImage(viewWidth, viewHeight, BufferedImage.TYPE_INT_ARGB); + final Graphics2D bufGrfx = bufImage.createGraphics(); + bufGrfx.setColor(new Color(255, 255, 255, 0)); + bufGrfx.fillRect(0, 0, viewWidth, viewHeight); + + // paint the mapview into the image + final Point storeOffset = new Point(borderOffset); + setBorderOffset(0, 0); + paintComponent2(bufGrfx); + setBorderOffset(storeOffset); + return bufImage; + } + + @Override public void paintComponent(final Graphics grfx) { + final long start = System.currentTimeMillis(); + paintComponent2((Graphics2D) grfx); + lastPaint = System.currentTimeMillis() - start; + mainControl.setStatusText("Sel: " + lastSelectionPaint + " Core: " + lastCorePaint + " All: " + lastPaint); + } + + /** Whether to check for double arches. */ + private transient boolean checkDouble; + + private final ImageIcon unknownTileIcon = CMainControl.unknownTileIcon; + private final ImageIcon warningSquareIcon = CMainControl.warningSquareIcon; + + private final Rectangle tmpRec = new Rectangle(); + + /** + * Get coordinates, length and width of map position + * @param p Map coordinates + * @return Boundary rectangle of tile + */ + public Rectangle getBounds(final Point p) { + tmpRec.x = origin.x - (p.y + 1) * IGUIConstants.TILE_ISO_XLEN2 + p.x * IGUIConstants.TILE_ISO_XLEN2; + tmpRec.y = origin.y + p.y * IGUIConstants.TILE_ISO_YLEN2 + p.x * IGUIConstants.TILE_ISO_YLEN2; + tmpRec.width = IGUIConstants.TILE_ISO_XLEN; + tmpRec.height = IGUIConstants.TILE_ISO_YLEN; + return tmpRec; + } + + /** + * Paints this component. + * @param grfx The graphics context to paint to. + */ + private void paintComponent2(final Graphics2D grfx) { + final long start = System.currentTimeMillis(); + checkDouble = mainControl.isUseDouble(); + //ImageIcon selIcon = mainControl.mapSelIcon; + + if (isPickmap) { + grfx.setColor(getBackground()); + grfx.fillRect(0, 0, getWidth(), getHeight()); + } + final Rectangle rec = getRepaintRec(getVisibleRect()); + final Point pos = new Point(); + final Point endPos = rec.getLocation(); + endPos.translate(rec.width, rec.height); + for (pos.y = rec.y; pos.y < endPos.y; pos.y++) { + int xstart = origin.x - (pos.y - rec.x + 1) * IGUIConstants.TILE_ISO_XLEN2; + int ystart = origin.y + (pos.y + rec.x) * IGUIConstants.TILE_ISO_YLEN2; + for (pos.x = rec.x; pos.x < endPos.x; pos.x++) { + if (grfx.hitClip(xstart, ystart - (IGUIConstants.TILE_ISO_YLEN << 2), IGUIConstants.TILE_ISO_XLEN, IGUIConstants.TILE_ISO_YLEN * 5)) { + final MapSquare square = mapModel.getMapSquare(pos); + if (square.isEmpty()) { + // empty square: Draw unknown tile icon if not a pickmap + if (!isPickmap) { + unknownTileIcon.paintIcon(this, grfx, xstart, ystart); + //grfx.drawImage(unknownTile, xstart, ystart, this); + } + } else { + // normal square + for (final ArchObject node : square) { + paint(grfx, xstart, ystart, node); + } + } + } + xstart += IGUIConstants.TILE_ISO_XLEN2; + ystart += IGUIConstants.TILE_ISO_YLEN2; + } + } + + if (!paintOnlyMap) { + paintGrid(grfx); + paintSelection(grfx); + } + + lastCorePaint = System.currentTimeMillis() - start; + } + + /** + * Get smallest Rectangle on map that needs to be repaint. + * @param visRec visible Rectangle. + * @return rectangle on the map. + */ + private Rectangle getRepaintRec(final Rectangle visRec) { + // This Rectangle will be returned + final Rectangle rec = new Rectangle(); + // Upper left corner of viewport + final Point posUL = visRec.getLocation(); + // Dimension of viewport + final Dimension visDim = visRec.getSize(); + // Other positions of viewport corners + final Point posUR = new Point(posUL.x + visDim.width, posUL.y); + final Point posDL = new Point(posUL.x , posUL.y + visDim.height); + final Point posDR = new Point(posUR.x , posDL.y); + // Calculate map positions of corners and from them properties of Rectangle + final Point mapPosUL = getTileLocationAt(posUL, tmpPoint); + rec.x = mapPosUL == null ? 0 : mapPosUL.x; + final Point mapPosUR = getTileLocationAt(posUR, tmpPoint); + rec.y = mapPosUR == null ? 0 : mapPosUR.y; + final Point mapPosDL = getTileLocationAt(posDL, tmpPoint); + rec.height = mapPosDL == null ? mapSize.height - rec.y : mapPosDL.y - rec.y + 1; + final Point mapPosDR = getTileLocationAt(posDR, tmpPoint); + rec.width = mapPosDR == null ? mapSize.width - rec.x : mapPosDR.x - rec.x + 1; + return rec; + } + + /** + * Paints a single ArchObject. + * @param grfx Graphics to paint to + * @param xstart x offset for painting + * @param ystart y offset for painting + * @param node ArchObject to paint + */ + private void paint(final Graphics2D grfx, final int xstart, final int ystart, ArchObject node) { + ArchObject tmpNode = null; + if (node.isMulti() && node.getMapMultiHead() != null) { + // this is a multipart tail: + tmpNode = node; // save old node + node = node.getMapMultiHead(); // go to multipart head + } + if (mainControl.isTileEdit(node) || isPickmap) { + final ImageIcon img = "trans.101".equals(node.getFaceObjName()) ? unknownTileIcon : + mainControl.isAlphaType(node.getEditType()) ? node.getTransparentImage() : node.getNormalImage(); + int yoff = 0; + if (img.getIconHeight() > IGUIConstants.TILE_ISO_YLEN) { + yoff = img.getIconHeight() - IGUIConstants.TILE_ISO_YLEN; + } + if (node.isMulti() && node.getMultiRefCount() > 0) { + // multipart images have to be painted with correct offset + // TODO: This should be improved, especially regarding multi arch mobs inside spawn points. + if (tmpNode != null && tmpNode.isLowestPart() || node.isLowestPart()) { + img.paintIcon(this, grfx, xstart - MultiPositionData.getXOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr()), ystart - yoff + MultiPositionData.getYOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr())); + } else if (node.isInContainer() && ((ArchObject) node.getContainer()).getArchTypNr() == 81) { + img.paintIcon(this, grfx, xstart - MultiPositionData.getXOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr()), ystart - yoff + MultiPositionData.getYOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr())); + } + } else { + int xoff = 0; + if (img.getIconWidth() > IGUIConstants.TILE_ISO_XLEN) { + xoff = img.getIconWidth() - IGUIConstants.TILE_ISO_XLEN >> 1; + } + img.paintIcon(this, grfx, xstart - xoff, ystart - yoff); + if (checkDouble && mainControl.getFaceObjects().get(node.getFaceObjName()).isDouble()) { + img.paintIcon(this, grfx, xstart - xoff, ystart - yoff - 22); + } + } + // Paint first object (most likely a mob) in spawn points. + if (node.getArchTypNr() == 81) { + final ArchObject mob = node.getFirst(); + if (mob != null) { + paint(grfx, xstart, ystart, mob); + } + } + } + } + + /** + * Paints the selection. + * It's recommended to paint the complete selection after the map itself, otherwise map elements actually might hide selections. + * @param grfx Graphics for painting + */ + private void paintSelection(final Graphics2D grfx) { + if (mapGrid == null) { + return; + } + final long start = System.currentTimeMillis(); + final Image selImg = CMainControl.mapSelIcon.getImage(); + final Image preSelImg = CMainControl.mapPreSelIcon.getImage(); + final Image cursorImg = CMainControl.mapCursorIcon.getImage(); + for (int y = 0; y < mapSize.height; y++) { + int xstart = origin.x - (y + 1) * IGUIConstants.TILE_ISO_XLEN2; + int ystart = origin.y + y * IGUIConstants.TILE_ISO_YLEN2; + for (int x = 0; x < mapSize.width; x++) { + if (grfx.hitClip(xstart, ystart, IGUIConstants.TILE_ISO_XLEN, IGUIConstants.TILE_ISO_YLEN)) { + final int gridFlags = mapGrid.getFlags(x, y); + if ((gridFlags & MapGrid.GRID_FLAG_SELECTION) != 0) { + grfx.drawImage(selImg, xstart, ystart, this); + } + if ((gridFlags & MapGrid.GRID_FLAG_SELECTING) != 0) { + grfx.drawImage(preSelImg, xstart, ystart, this); + } + if ((gridFlags & MapGrid.GRID_FLAG_CURSOR) != 0) { + grfx.drawImage(cursorImg, xstart, ystart, this); + } + if ((gridFlags & MapGrid.GRID_FLAG_ERROR) != 0) { + warningSquareIcon.paintIcon(this, grfx, xstart, ystart); + } + } else { + /* DO NOTHING if outside clip region. + * DO NOT use continue. xstart and ystart are recalculated at the end of the loop. + */ + } + xstart += IGUIConstants.TILE_ISO_XLEN2; + ystart += IGUIConstants.TILE_ISO_YLEN2; + } + } + lastSelectionPaint = System.currentTimeMillis() - start; + } + + /** + * Paints the grid if desired. + * The grid is not painted if <code><var>gridVisibility</var></code> is <code>false</code>. + * It's recommended to paint the complete grid after the map itself, otherwise map elements actually might hide parts of the grid. + * @param grfx Graphics for painting + */ + private void paintGrid(final Graphics grfx) { + if (gridVisibility) { + // draw iso grid + grfx.setColor(Color.black); + + for (int x = 0; x <= mapSize.width; x++) { + grfx.drawLine(origin.x + x * IGUIConstants.TILE_ISO_XLEN2 - 1, + origin.y + x * IGUIConstants.TILE_ISO_YLEN2 - 1, + origin.x - (mapSize.width - x) * IGUIConstants.TILE_ISO_XLEN2 - 1, + origin.y + (mapSize.width + x) * IGUIConstants.TILE_ISO_YLEN2 - 1); + } + + for (int y = 0; y <= mapSize.height; y++) { + grfx.drawLine(origin.x - y * IGUIConstants.TILE_ISO_XLEN2 - 1, + origin.y + y * IGUIConstants.TILE_ISO_YLEN2 - 1, + origin.x + (mapSize.height - y) * IGUIConstants.TILE_ISO_XLEN2 - 1, + origin.y + (mapSize.height + y) * IGUIConstants.TILE_ISO_YLEN2 - 1); + } + } + } + + /** + * Returns the map location at the given point or null if no map location + * is at the point. + * @param point The coordinates in the renderer view. + * @param retPoint if <cod>(retPoint != null)</code> this point will be returned otherwise a new point will be created + * @return The map location. + */ + @Nullable public Point getTileLocationAt(@NotNull final Point point, @Nullable final Point retPoint) { + + final int x0 = point.x - origin.x; + final int y0 = point.y - origin.y; + final int yt = 2 * y0 - x0 >> 1; + final int xt = yt + x0; + final int xm = xt / IGUIConstants.TILE_ISO_XLEN2; + final int ym = yt / (IGUIConstants.TILE_ISO_YLEN2 << 1); + if (xm < 0 || xm >= mapSize.width || ym < 0 || ym >= mapSize.height) { + return null; + } + if (retPoint != null) { + retPoint.setLocation(xm, ym); + return retPoint; + } + + return new Point(xm, ym); + } + + /** {@inheritDoc} */ + public void mapGridChanged(final MapGridEvent e) { + repaint(); + } + + /** {@inheritDoc} */ + public void mapGridResized(final MapGridEvent e) { + mapSize.setSize(e.getSource().getSize()); + calculateOrigin(); + repaint(); + } + + public boolean isGridVisible() { + return gridVisibility; + } + + public void setGridVisibility(final boolean gridVisibility) { + if (this.gridVisibility != gridVisibility) { + this.gridVisibility = gridVisibility; + repaint(); + } + } + + /** + * Set draw mode + * @param paintOnlyMap <code>true</code>: grid and selections will not be painted + * @note This is only a fast hack. Don't look too much at it. + */ + public void setPaintOnlyMap(final boolean paintOnlyMap) { + this.paintOnlyMap = paintOnlyMap; + } + + /** + * Sets the ArchObjects that are known to contain errors. + * @param erraneousArchObjects the ArchObjects that are known to contain errors. + */ + public void setErraneousArchObjects(final Map<ArchObject, ValidationError> erraneousArchObjects) { + this.erraneousArchObjects = erraneousArchObjects; + } + + /** + * Sets the MapSquares that are known to contain errors. + * @param erraneousMapSquares the MapSquares that are known to contain errors. + */ + public void setErraneousMapSquares(final Map<MapSquare, ValidationError> erraneousMapSquares) { + this.erraneousMapSquares = erraneousMapSquares; + } + +} // class CLevelRenderer + Deleted: trunk/daimonin/src/daieditor/gui/map/LevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/LevelRenderer.java 2006-05-27 00:42:33 UTC (rev 40) +++ trunk/daimonin/src/daieditor/gui/map/LevelRenderer.java 2006-05-27 09:17:54 UTC (rev 41) @@ -1,499 +0,0 @@ -/* - * Daimonin Java Editor. - * Copyright (C) 2000 Michael Toennies - * Copyright (C) 2001 Andreas Vogl - * Copyright (C) 2006 Daniel Viegas - * - * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) - * - * 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 2 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, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - * - */ - -package daieditor.gui.map; - -import daieditor.CMainControl; -import daieditor.IGUIConstants; -import daieditor.MultiPositionData; -import daieditor.arch.ArchObject; -import daieditor.map.MapControl; -import daieditor.map.MapModel; -import daieditor.map.MapSquare; -import daieditor.map.validation.ValidationError; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Image; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.event.MouseEvent; -import java.awt.image.BufferedImage; -import java.util.Map; -import javax.swing.ImageIcon; -import javax.swing.JComponent; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class LevelRenderer extends JComponent implements MapGridListener { - - /** Serial Version UID. */ - private static final long serialVersionUID = 1L; - - /** - * Declares this CLevelRenderer as a renderer for a Pickmap. - * Pickmaps have a special behaviour that's different from normal maps. - * Value: <code>true</code> if pickmap, otherwise <code>false</code>. - */ - private final boolean isPickmap; - - /** offset to map borders (32 for std. rect. maps, 0 for pickmaps). */ - private Point borderOffset = new Point(); - - /** Time of last selection painting. */ - private transient long lastSelectionPaint; - - /** Time of last core painting (includes selection painting). */ - private transient long lastCorePaint; - - /** Time of last overall painting (includes core and thus selection). */ - private transient long lastPaint; - - /** The origin is the point in the north-west corner */ - private Point origin = new Point(); - - private MapModel mapModel; - - private CMainControl mainControl; - - private final Dimension mapSize = new Dimension(); - - private final MapGrid mapGrid; - - /** The MapSquares that are known to contain errors. */ - private Map<MapSquare, ValidationError> erraneousMapSquares; - - /** The ArchObjects that are known to contain errors. */ - private Map<ArchObject, ValidationError> erraneousArchObjects; - - private boolean gridVisibility; - - /** Used to avoid creation millions of points */ - private final Point tmpPoint = new Point(); - - /** If true selection and grid will not be painted */ - private boolean paintOnlyMap; - - /** Constructor */ - public LevelRenderer(final CMainControl mainControl, final MapControl mapControl, final boolean pickmap) { - this.mainControl = mainControl; - checkDouble = mainControl.isUseDouble(); - mapModel = mapControl.getMapModel(); - mapSize.setSize(mapModel.getMapSize()); - mapGrid = mapControl.getMapGrid(); - isPickmap = pickmap; - if (isPickmap) { - setBorderOffset(0, IGUIConstants.TILE_ISO_YLEN); - setBackground(IGUIConstants.BG_COLOR); - } else { - setBorderOffset(IGUIConstants.TILE_ISO_XLEN, 2 * IGUIConstants.TILE_ISO_YLEN); - } - setToolTipText("dummy"); - setFocusable(true); - } - - private void calculateOrigin() { - if (isPickmap) { - origin.setLocation(borderOffset.x + 4 * IGUIConstants.TILE_ISO_XLEN2, borderOffset.y); - } else { - origin.setLocation(borderOffset.x + mapSize.height * IGUIConstants.TILE_ISO_XLEN2, borderOffset.y); - } - } - - /** - * Returns offset to map borders (32 for std. rect. maps, 0 for pickmaps). - * @return offset to map borders (32 for std. rect. maps, 0 for pickmaps) - */ - public final Point getBorderOffset() { - return new Point(borderOffset); - } - - /** - * Sets offset to map borders (32 for std. rect. maps, 0 for pickmaps). - * @param offset offset to map borders (32 for std. rect. maps, 0 for pickmaps) - */ - public void setBorderOffset(final Point offset) { - borderOffset.setLocation(offset); - calculateOrigin(); - } - - /** - * Sets offset to map borders (32 for std. rect. maps, 0 for pickmaps). - * @param x x offset to map borders (32 for std. rect. maps, 0 for pickmaps) - * @param y y offset to map borders (32 for std. rect. maps, 0 for pickmaps) - */ - public void setBorderOffset(final int x, final int y) { - borderOffset.setLocation(x, y); - calculateOrigin(); - } - - /** {@inheritDoc} */ - @Nullable @Override public String getToolTipText(final MouseEvent event) { - final Point mapLocation = getTileLocationAt(event.getPoint(), tmpPoint); - if (mapLocation == null) { - return null; - } - if (mapGrid.hasError(mapLocation)) { - final MapSquare mapSquare = mapModel.getMapSquare(mapLocation); - - if (erraneousMapSquares.containsKey(mapSquare)) { - final ValidationError error = erraneousMapSquares.get(mapSquare); - return error.getMessage(); - } else { - return null; - } - } else { - return null; - } - } - - /** @return whether rendered map is a pickmap */ - public boolean isPickmap() { - return isPickmap; - } - - /** @return an image of the entire mapview */ - public BufferedImage getFullImage() { - // set map dimensions for iso view - final int sum = mapSize.width + mapSize.height; - final int viewWidth = sum * IGUIConstants.TILE_ISO_XLEN2; - final int viewHeight = sum * IGUIConstants.TILE_ISO_YLEN2; - - // first create a storing place for the image - final BufferedImage bufImage = new BufferedImage(viewWidth, viewHeight, BufferedImage.TYPE_INT_ARGB); - final Graphics2D bufGrfx = bufImage.createGraphics(); - bufGrfx.setColor(new Color(255, 255, 255, 0)); - bufGrfx.fillRect(0, 0, viewWidth, viewHeight); - - // paint the mapview into the image - final Point storeOffset = new Point(borderOffset); - setBorderOffset(0, 0); - paintComponent2(bufGrfx); - setBorderOffset(storeOffset); - return bufImage; - } - - @Override public void paintComponent(final Graphics grfx) { - final long start = System.currentTimeMillis(); - paintComponent2((Graphics2D) grfx); - lastPaint = System.currentTimeMillis() - start; - mainControl.setStatusText("Sel: " + lastSelectionPaint + " Core: " + lastCorePaint + " All: " + lastPaint); - } - - /** Whether to check for double arches. */ - private transient boolean checkDouble; - - private final ImageIcon unknownTileIcon = CMainControl.unknownTileIcon; - - private final ImageIcon warningSquareIcon = CMainControl.warningSquareIcon; - - private final Rectangle tmpRec = new Rectangle(); - - /** - * Get coordinates, length and width of map position - * @param p Map coordinates - * @return Boundary rectangle of tile - */ - public Rectangle getBounds(final Point p) { - tmpRec.x = origin.x - (p.y + 1) * IGUIConstants.TILE_ISO_XLEN2 + p.x * IGUIConstants.TILE_ISO_XLEN2; - tmpRec.y = origin.y + p.y * IGUIConstants.TILE_ISO_YLEN2 + p.x * IGUIConstants.TILE_ISO_YLEN2; - tmpRec.width = IGUIConstants.TILE_ISO_XLEN; - tmpRec.height = IGUIConstants.TILE_ISO_YLEN; - return tmpRec; - } - - /** - * Paints this component. - * @param grfx The graphics context to paint to. - */ - private void paintComponent2(final Graphics2D grfx) { - final long start = System.currentTimeMillis(); - checkDouble = mainControl.isUseDouble(); - //ImageIcon selIcon = mainControl.mapSelIcon; - - if (isPickmap) { - grfx.setColor(getBackground()); - grfx.fillRect(0, 0, getWidth(), getHeight()); - } - final Rectangle rec = getRepaintRec(getVisibleRect()); - final Point pos = new Point(); - final Point endPos = rec.getLocation(); - endPos.translate(rec.width, rec.height); - for (pos.y = rec.y; pos.y < endPos.y; pos.y++) { - int xstart = origin.x - (pos.y - rec.x + 1) * IGUIConstants.TILE_ISO_XLEN2; - int ystart = origin.y + (pos.y + rec.x) * IGUIConstants.TILE_ISO_YLEN2; - for (pos.x = rec.x; pos.x < endPos.x; pos.x++) { - if (grfx.hitClip(xstart, ystart - (IGUIConstants.TILE_ISO_YLEN << 2), IGUIConstants.TILE_ISO_XLEN, IGUIConstants.TILE_ISO_YLEN * 5)) { - final MapSquare square = mapModel.getMapSquare(pos); - if (square.isEmpty()) { - // empty square: Draw unknown tile icon if not a pickmap - if (!isPickmap) { - unknownTileIcon.paintIcon(this, grfx, xstart, ystart); - //grfx.drawImage(unknownTile, xstart, ystart, this); - } - } else { - // normal square - for (final ArchObject node : square) { - paint(grfx, xstart, ystart, node); - } - } - } - xstart += IGUIConstants.TILE_ISO_XLEN2; - ystart += IGUIConstants.TILE_ISO_YLEN2; - } - } - - if (!paintOnlyMap) { - paintGrid(grfx); - paintSelection(grfx); - } - - lastCorePaint = System.currentTimeMillis() - start; - } - - /** - * Get smallest Rectangle on map that needs to be repaint. - * @param visRec visible Rectangle. - * @return rectangle on the map. - */ - private Rectangle getRepaintRec(final Rectangle visRec) { - // This Rectangle will be returned - final Rectangle rec = new Rectangle(); - // Upper left corner of viewport - final Point posUL = visRec.getLocation(); - // Dimension of viewport - final Dimension visDim = visRec.getSize(); - // Other positions of viewport corners - final Point posUR = new Point(posUL.x + visDim.width, posUL.y); - final Point posDL = new Point(posUL.x, posUL.y + visDim.height); - final Point posDR = new Point(posUR.x, posDL.y); - // Calculate map positions of corners and from them properties of Rectangle - final Point mapPosUL = getTileLocationAt(posUL, tmpPoint); - rec.x = mapPosUL == null ? 0 : mapPosUL.x; - final Point mapPosUR = getTileLocationAt(posUR, tmpPoint); - rec.y = mapPosUR == null ? 0 : mapPosUR.y; - final Point mapPosDL = getTileLocationAt(posDL, tmpPoint); - rec.height = mapPosDL == null ? mapSize.height - rec.y : mapPosDL.y - rec.y + 1; - final Point mapPosDR = getTileLocationAt(posDR, tmpPoint); - rec.width = mapPosDR == null ? mapSize.width - rec.x : mapPosDR.x - rec.x + 1; - return rec; - } - - /** - * Paints a single ArchObject. - * @param grfx Graphics to paint to - * @param xstart x offset for painting - * @param ystart y offset for painting - * @param node ArchObject to paint - */ - private void paint(final Graphics2D grfx, final int xstart, final int ystart, ArchObject node) { - ArchObject tmpNode = null; - if (node.isMulti() && node.getMapMultiHead() != null) { - // this is a multipart tail: - tmpNode = node; // save old node - node = node.getMapMultiHead(); // go to multipart head - } - if (mainControl.isTileEdit(node) || isPickmap) { - final ImageIcon img = "trans.101".equals(node.getFaceObjName()) ? unknownTileIcon : - mainControl.isAlphaType(node.getEditType()) ? node.getTransparentImage() : node.getNormalImage(); - int yoff = 0; - if (img.getIconHeight() > IGUIConstants.TILE_ISO_YLEN) { - yoff = img.getIconHeight() - IGUIConstants.TILE_ISO_YLEN; - } - if (node.isMulti() && node.getMultiRefCount() > 0) { - // multipart images have to be painted with correct offset - // TODO: This should be improved, especially regarding multi arch mobs inside spawn points. - if (tmpNode != null && tmpNode.isLowestPart() || node.isLowestPart()) { - img.paintIcon(this, grfx, xstart - MultiPositionData.getXOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr()), ystart - yoff + MultiPositionData.getYOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr())); - } else if (node.isInContainer() && ((ArchObject) node.getContainer()).getArchTypNr() == 81) { - img.paintIcon(this, grfx, xstart - MultiPositionData.getXOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr()), ystart - yoff + MultiPositionData.getYOffset(node.getMultiShapeID(), tmpNode == null ? node.getMultiPartNr() : tmpNode.getMultiPartNr())); - } - } else { - int xoff = 0; - if (img.getIconWidth() > IGUIConstants.TILE_ISO_XLEN) { - xoff = img.getIconWidth() - IGUIConstants.TILE_ISO_XLEN >> 1; - } - img.paintIcon(this, grfx, xstart - xoff, ystart - yoff); - if (checkDouble && mainControl.getFaceObjects().get(node.getFaceObjName()).isDouble()) { - img.paintIcon(this, grfx, xstart - xoff, ystart - yoff - 22); - } - } - // Paint first object (most likely a mob) in spawn points. - if (node.getArchTypNr() == 81) { - final ArchObject mob = node.getFirst(); - if (mob != null) { - paint(grfx, xstart, ystart, mob); - } - } - } - } - - /** - * Paints the selection. - * It's recommended to paint the complete selection after the map itself, otherwise map elements actually might hide selections. - * @param grfx Graphics for painting - */ - private void paintSelection(final Graphics2D grfx) { - if (mapGrid == null) { - return; - } - final long start = System.currentTimeMillis(); - final Image selImg = CMainControl.mapSelIcon.getImage(); - final Image preSelImg = CMainControl.mapPreSelIcon.getImage(); - final Image cursorImg = CMainControl.mapCursorIcon.getImage(); - for (int y = 0; y < mapSize.height; y++) { - int xstart = origin.x - (y + 1) * IGUIConstants.TILE_ISO_XLEN2; - int ystart = origin.y + y * IGUIConstants.TILE_ISO_YLEN2; - for (int x = 0; x < mapSize.width; x++) { - if (grfx.hitClip(xstart, ystart, IGUIConstants.TILE_ISO_XLEN, IGUIConstants.TILE_ISO_YLEN)) { - final int gridFlags = mapGrid.getFlags(x, y); - if ((gridFlags & MapGrid.GRID_FLAG_SELECTION) != 0) { - grfx.drawImage(selImg, xstart, ystart, this); - } - if ((gridFlags & MapGrid.GRID_FLAG_SELECTING) != 0) { - grfx.drawImage(preSelImg, xstart, ystart, this); - } - if ((gridFlags & MapGrid.GRID_FLAG_CURSOR) != 0) { - grfx.drawImage(cursorImg, xstart, ystart, this); - } - if ((gridFlags & MapGrid.GRID_FLAG_ERROR) != 0) { - warningSquareIcon.paintIcon(this, grfx, xstart, ystart); - } - } else { - /* DO NOTHING if outside clip region. - * DO NOT use continue. xstart and ystart are recalculated at the end of the loop. - */ - } - xstart += IGUIConstants.TILE_ISO_XLEN2; - ystart += IGUIConstants.TILE_ISO_YLEN2; - } - } - lastSelectionPaint = System.currentTimeMillis() - start; - } - - /** - * Paints the grid if desired. - * The grid is not painted if <code><var>gridVisibility</var></code> is <code>false</code>. - * It's recommended to paint the complete grid after the map itself, otherwise map elements actually might hide parts of the grid. - * @param grfx Graphics for painting - */ - private void paintGrid(final Graphics grfx) { - if (gridVisibility) { - // draw iso grid - grfx.setColor(Color.black); - - for (int x = 0; x <= mapSize.width; x++) { - grfx.drawLine(origin.x + x * IGUIConstants.TILE_ISO_XLEN2 - 1, - origin.y + x * IGUIConstants.TILE_ISO_YLEN2 - 1, - origin.x - (mapSize.width - x) * IGUIConstants.TILE_ISO_XLEN2 - 1, - origin.y + (mapSize.width + x) * IGUIConstants.TILE_ISO_YLEN2 - 1); - } - - for (int y = 0; y <= mapSize.height; y++) { - grfx.drawLine(origin.x - y * IGUIConstants.TILE_ISO_XLEN2 - 1, - origin.y + y * IGUIConstants.TILE_ISO_YLEN2 - 1, - origin.x + (mapSize.height - y) * IGUIConstants.TILE_ISO_XLEN2 - 1, - origin.y + (mapSize.height + y) * IGUIConstants.TILE_ISO_YLEN2 - 1); - } - } - } - - /** - * Returns the map location at the given point or null if no map location - * is at the point. - * @param point The coordinates in the renderer view. - * @param retPoint if <cod>(retPoint != null)</code> this point will be returned otherwise a new point will be created - * @return The map location. - */ - @Nullable public Point getTileLocationAt(@NotNull final Point point, @Nullable final Point retPoint) { - - final int x0 = point.x - origin.x; - final int y0 = point.y - origin.y; - final int yt = 2 * y0 - x0 >> 1; - final int xt = yt + x0; - final int xm = xt / IGUIConstants.TILE_ISO_XLEN2; - final int ym = yt / (IGUIConstants.TILE_ISO_YLEN2 << 1); - if (xm < 0 || xm >= mapSize.width || ym < 0 || ym >= mapSize.height) { - return null; - } - if (retPoint != null) { - retPoint.setLocation(xm, ym); - return retPoint; - } - - return new Point(xm, ym); - } - - /** {@inheritDoc} */ - public void mapGridChanged(final MapGridEvent e) { - repaint(); - } - - /** {@inheritDoc} */ - public void mapGridResized(final MapGridEvent e) { - mapSize.setSize(e.getSource().getSize()); - calculateOrigin(); - repaint(); - } - - public boolean isGridVisible() { - return gridVisibility; - } - - public void setGridVisibility(final boolean gridVisibility) { - if (this.gridVisibility != gridVisibility) { - this.gridVisibility = gridVisibility; - repaint(); - } - } - - /** - * Set draw mode - * @param paintOnlyMap <code>true</code>: grid and selections will not be painted - * @note This is only a fast hack. Don't look too much at it. - */ - public void setPaintOnlyMap(final boolean paintOnlyMap) { - this.paintOnlyMap = paintOnlyMap; - } - - /** - * Sets the ArchObjects that are known to contain errors. - * @param erraneousArchObjects the ArchObjects that are known to contain errors. - */ - public void setErraneousArchObjects(final Map<ArchObject, ValidationError> erraneousArchObjects) { - this.erraneousArchObjects = erraneousArchObjects; - } - - /** - * Sets the MapSquares that are known to contain errors. - * @param erraneousMapSquares the MapSquares that are known to contain errors. - */ - public void setErraneousMapSquares(final Map<MapSquare, ValidationError> erraneousMapSquares) { - this.erraneousMapSquares = erraneousMapSquares; - } - -} // class CLevelRenderer - Added: trunk/daimonin/src/daieditor/gui/map/LevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/LevelRenderer.java (rev 0) +++ trunk/daimonin/src/daieditor/gui/map/LevelRenderer.java 2006-05-27 09:17:54 UTC (rev 41) @@ -0,0 +1,29 @@ +/* + * Gridarta Java Editor. + * Copyright (C) 2006 The Gridarta Developers + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package daieditor.gui.map; + +import java.awt.image.BufferedImage; +import javax.swing.JComponent; + +public abstract class LevelRenderer extends JComponent { + public abstract BufferedImage getFullImage(); +} // class LevelRenderer Property changes on: trunk/daimonin/src/daieditor/gui/map/LevelRenderer.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/daimonin/src/daieditor/gui/map/MapUserListener.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapUserListener.java 2006-05-27 00:42:33 UTC (rev 40) +++ trunk/daimonin/src/daieditor/gui/map/MapUserListener.java 2006-05-27 09:17:54 UTC (rev 41) @@ -55,9 +55,8 @@ }; private MapCursor mapCursor; + private DefaultLevelRenderer renderer; - private LevelRenderer renderer; - private MapControl mapControl; private CMainControl mainControl; @@ -69,7 +68,7 @@ public MapUserListener(final CMainControl mainControl, final MapControl mapControl, final CMapViewBasic mapView) { this.mainControl = mainControl; this.mapControl = mapControl; - mapCursor = mapControl.getMapCursor(); + mapCursor = mapView.getMapCursor(); renderer = mapView.getRenderer(); } Added: trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java (rev 0) +++ trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java 2006-05-27 09:17:54 UTC (rev 41) @@ -0,0 +1,176 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2000 Michael Toennies + * Copyright (C) 2001 Andreas Vogl + * Copyright (C) 2006 The Gridarta Developers + * + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) +... [truncated message content] |
From: <chr...@us...> - 2006-05-27 00:42:39
|
Revision: 40 Author: christianhujer Date: 2006-05-26 17:42:33 -0700 (Fri, 26 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=40&view=rev Log Message: ----------- Fixed changelog title. Modified Paths: -------------- trunk/src/doc/dev/changelog.xslt Modified: trunk/src/doc/dev/changelog.xslt =================================================================== --- trunk/src/doc/dev/changelog.xslt 2006-05-26 22:59:26 UTC (rev 39) +++ trunk/src/doc/dev/changelog.xslt 2006-05-27 00:42:33 UTC (rev 40) @@ -22,7 +22,7 @@ <head> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> <meta name="Date" content="$Date: {current-dateTime()}$" /> - <title>JAPI Changelog</title> + <title>Gridarta Changelog</title> <style type="text/css"> .paths, .hide { display:none; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-26 23:46:57
|
Revision: 36 Author: christianhujer Date: 2006-05-26 15:51:23 -0700 (Fri, 26 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=36&view=rev Log Message: ----------- Unified builds. Modified Paths: -------------- trunk/crossfire/build.xml trunk/daimonin/build.xml Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2006-05-26 21:13:33 UTC (rev 35) +++ trunk/crossfire/build.xml 2006-05-26 22:51:23 UTC (rev 36) @@ -1,50 +1,89 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- - This is the ANT buildfile for the CFJavaEditor - (c) 2003 by Andreas Vogl - Apache Ant is a Java-based cross-platform build tool. - For more information about Ant, visit <http://ant.apache.org/> - - Do not move, edit or delete this file. It should stay in the - main directory of the CFJavaEditor. - - How to use Ant for the CFJavaEditor: - - o Install Ant on your system. Make sure both the JAVA_HOME - and ANT_HOME environment variables are set correctly. - - o Change into the CFJavaEditor main directory. - On the console type "ant" to compile, then "ant run" - to run the CFJavaEditor. ---> -<project name="CFJavaEditor" default="jar" basedir="."> + - This is the Ant buildfile for the Gridarta Editor for Crossfire + - (c) 2003 by Andreas Vogl + - (c) 2005-2006 by Christian Hujer + - + - Apache Ant is a Java-based cross-platform build tool. + - For more information about Ant, visit <http://ant.apache.org/> + - + - Do not move, edit or delete this file. It should stay in the + - main directory of the Crossfire Editor. + - + - How to use Ant for the Crossfire Editor: + - + - o Install Ant on your system. Make sure both the JAVA_HOME + - and ANT_HOME environment variables are set correctly. + - + - o Change into the Crossfire Editor main directory. + - run "ant" to compile, + - run "ant run" to run the editor. + --> +<project name="Gridarta Editor for Crossfire" default="jar"> <!-- set properties and clean build directory --> <target name="init"> - <property name="src.dir" value="src" /> - <property name="lib.dir" value="lib" /> + <property file="developer.properties" /> + <property file="nextBuildNumber.properties" /> + <property name="src.dir" value="src" /> + <property name="lib.dir" value="lib" /> + <property name="devlib.dir" value="devlib/" /><!-- Don't forget trailing / ! --> + <property name="test.dir" value="test" /> <property name="resource.dir" value="resource" /> - <property name="doc.dir" value="docs" /> - <property name="build.dir" value="class" /> - <property name="jarname" value="CFJavaEditor.jar" /> + <property name="doc.dir" value="docs" /> + <property name="build.dir" value="class" /> + <property name="jarname" value="CFJavaEditor.jar" /> + <property name="build.source.version" value="1.5" /> + <property name="build.target.version" value="${build.source.version}" /> + <property name="build.source.encoding" value="utf-8" /> + <property name="todo.file" value="todo.txt" /> + <property name="debug" value="false" /> + <property name="user.ftp.depends" value="yes" /> + <property name="user.ftp.passive" value="yes" /> + <property name="user.ftp.ignoreNoncriticalErrors" value="yes" /> + <property name="build.developer" value="unknown" /> + <property name="javac.args" value="-Xlint:all,-path,-unchecked,-fallthrough,-serial" /> + <tstamp><format property="build.tstamp" pattern="yyyy-MM-dd HH:mm:ss z" timezone="UTC"/></tstamp> + <echoproperties destfile="build.properties"> + <propertyset negate="true"> + <propertyref prefix="user.ftp"/> + <propertyref prefix="user.scp"/> + </propertyset> + </echoproperties> </target> - + + <!-- create ctags. --> + <target name="ctags" if="user.ctags" depends="init" description="creates tags file with symbol definitions for vim and other editors."> + <exec executable="ctags"> + <arg line="-R ${src.dir}" /> + </exec> + </target> + <!-- delete and recreate the build directory --> - <target name="clean"> + <target name="clean" description="deletes compiled classes." depends="init"> <delete dir="${build.dir}" /> <mkdir dir="${build.dir}" /> </target> - + <!-- compiling all Java classes --> - <target name="compile" depends="init,clean"> - <javac srcdir="${src.dir}" destdir="${build.dir}" debug="true" encoding="utf-8"> + <target name="compile" depends="init,clean,ctags" description="compiles source."> + <javac + srcdir = "${src.dir}:../src/app" + destdir = "${build.dir}" + encoding = "${build.source.encoding}" + source = "${build.source.version}" + target = "${build.target.version}" + debug = "${debug}" + excludes = "test/**/*.java" + > <classpath> <fileset dir="${lib.dir}" includes="*.jar" excludes="LICENSE-*.jar" /> <fileset dir="../lib/" includes="*.jar" excludes="LICENSE-*.jar" /> </classpath> + <compilerarg line="${javac.args}" /> </javac> </target> - + <!-- create JAR file --> <target name="jar" depends="compile" description="compiles source and creates jar."> <!-- extract classes from jar files into the build dir --> @@ -58,11 +97,11 @@ <unjar src="${lib.dir}/bsh-util.jar" dest="${build.dir}" /> <unjar src="${lib.dir}/log4j.jar" dest="${build.dir}" /> <delete dir="${build.dir}/META-INF" /> - + <!-- copy the resource files into the build dir --> <copy todir="${build.dir}"> <fileset dir="${resource.dir}"> - <exclude name="**/Entries,**/Repository,**/Root"/> + <exclude name="**/.xvpics/**"/> </fileset> </copy> <copy todir="${build.dir}"> @@ -70,7 +109,7 @@ </copy> <delete dir="${build.dir}/pickmaps" /> <delete dir="${build.dir}/conf" /> - + <jar destfile = "${jarname}" index = "true" @@ -86,38 +125,161 @@ <attribute name="Main-Class" value="cfeditor.CFJavaEditor"/> </manifest> </jar> - + <!-- delete the build directory --> <delete dir="${build.dir}" /> </target> - - <!-- run the jar file with default memory (60 Mb) --> - <target name="run_low" depends="init"> + + <!-- run the jar file with default memory (64 Mb on most systems) --> + <target name="run" depends="init" description="runs editor."> <java jar="${jarname}" fork="true" failonerror="true" /> </target> - + <!-- run the jar file with extra memory (128 Mb) --> - <target name="run" depends="init"> - <java jar="${jarname}" fork="true" failonerror="true" - maxmemory="128m" /> + <target name="run_high" depends="init" description="runs editor with extra memory (128m)."> + <java jar="${jarname}" fork="true" failonerror="true" maxmemory="128m" /> </target> - - <!-- run javadoc to generate documentation --> - <target name="doc" depends="init"> - <!-- remove and re-create documentation directory --> - <delete dir="${doc.dir}" /> - <mkdir dir="${doc.dir}" /> - <javadoc destdir="${doc.dir}" sourcepath="${src.dir}" - author="true" - version="true" - use="true" - windowtitle="CFJavaEditor API"> + + <!-- Create API documentation. --> + <target name="doc" depends="init" description="creates JavaDoc documentation for editor source."> + <mkdir dir="javadoc" /> + <javadoc + destdir = "javadoc" + locale = "en_US" + version = "yes" + author = "yes" + use = "yes" + splitindex = "yes" + windowtitle = "Daimonin Editor — API Documentation" + doctitle = "Daimonin Editor<br />API Documentation" + header = "Daimonin Editor<br />API Documentation" + footer = "Daimonin Editor<br />API Documentation" + bottom = "<div style="text-align:center;">© 2003 Andreas Vogl, Michael Toennis, 2004-2006 The Daimonin Developers, 2006 The Gridarta Developers. All rights reserved.</div>" + serialwarn = "yes" + charset = "utf-8" + docencoding = "utf-8" + source = "${build.source.version}" + encoding = "${build.source.encoding}" + linksource = "yes" + private = "yes" + overview = "src/cfeditor/overview.html" + link = "${user.javadoc.link}" + > <classpath> <fileset dir="${lib.dir}" includes="*.jar" /> </classpath> - <fileset dir="${src.dir}" defaultexcludes="no" /> - <doctitle><![CDATA[<h1>Crossfire Java Editor</h1>]]></doctitle> - <bottom><![CDATA[<i>Copyright (C) 2003 Andreas Vogl, Michael Toennies</i>]]></bottom> + <sourcepath path="${src.dir}" /> + <packageset + dir="src" + defaultexcludes="yes" + > + <include name="**" /> + </packageset> + <tag + name="todo" + description="Todo:" + /> + <tag + name="used" + description="Manually marked as used." + enabled="false" + /> + <tag + name="fixme" + description="Fixme:" + /> + <tag + name="xxx" + description="XXX:" + /> + <tag + name="note" + description="Note:" + /> + <tag + name="devs" + description="At Developers:" + /> </javadoc> </target> + + <!-- Check the source style. + - @see http://checkstyle.sf.net/ + --> + <target name="checkstyle" depends="init" description="performs style checks for source."> + <taskdef resource="checkstyletask.properties" classpath="${checkstyle.path}"/> + <mkdir dir="${test.dir}" /> + <checkstyle config="${checkstyle.conv}"> + <fileset dir="${src.dir}" includes="**/*.java"/> + <formatter type="plain"/> + <formatter type="xml" toFile="${test.dir}/checkstyle_errors.xml"/> + </checkstyle> + </target> + + <!-- Prints a todo list. + - Useful e.g. to parse the list from within vi and jump from todo change to todo change. + --> + <target name="todo" depends="init" description="prints a file with todo information"> + <concat> + <fileset file="${todo.file}" /> + </concat> + </target> + + <target + name = "preparePublish" + description = "preparse files to publish" + depends = "jar" + > + <property name="update.number" value="${build.number}"/> + <property name="update.tstamp" value="${build.tstamp}"/> + <property name="update.developer" value="${build.developer}"/> + <property name="update.url" value="${user.update.url}"/> + <echoproperties destfile="update.properties"> + <propertyset> + <propertyref prefix="update" /> + </propertyset> + </echoproperties> + </target> + + <target + name = "ftpPublish" + description = "publishes ${jarname} using ftp" + depends="preparePublish" + > + <ftp + server="${user.ftp.host}" + userid="${user.ftp.user}" + password="${user.ftp.pass}" + remotedir="${user.ftp.dir}" + depends="${user.ftp.depends}" + passive="${user.ftp.passive}" + ignoreNoncriticalErrors="${user.ftp.ignoreNoncriticalErrors}" + > + <fileset dir="."> + <include name="${jarname}" /> + <include name="update.properties" /> + </fileset> + </ftp> + </target> + + <target + name = "scpPublish" + description = "publishes ${jarname} using scp" + depends = "preparePublish" + > + <scp + todir="${user.scp.dir}" + passphrase="${user.scp.passphrase}" + trust="${user.scp.trust}" + keyfile="${user.scp.keyfile}" + > + <fileset dir="."> + <include name="${jarname}" /> + <include name="update.properties" /> + </fileset> + </scp> + <buildnumber file="nextBuildNumber.properties" /> + <cvs command="commit -m "Released new update version, committing next build number." nextBuildNumber.properties" /> + </target> + </project> Modified: trunk/daimonin/build.xml =================================================================== --- trunk/daimonin/build.xml 2006-05-26 21:13:33 UTC (rev 35) +++ trunk/daimonin/build.xml 2006-05-26 22:51:23 UTC (rev 36) @@ -1,21 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- This is the ANT buildfile for the DaimoninEditor - - (c) 2003 by Andreas Vogl - - (c) 2005 by Christian Hujer +<!-- + - This is the Ant buildfile for the Gridarta Editor for Daimonin + - (c) 2003 by Andreas Vogl + - (c) 2005-2006 by Christian Hujer - - Apache Ant is a Java-based cross-platform build tool. - For more information about Ant, visit <http://ant.apache.org/> - - - How to use Ant for the DaimoninEditor: - + - Do not move, edit or delete this file. It should stay in the + - main directory of the Daimonin Editor. + - + - How to use Ant for the Daimonin Editor: + - - o Install Ant on your system. Make sure both the JAVA_HOME - and ANT_HOME environment variables are set correctly. - - - o Change into the DaimoninEditor main directory. - - run "ant -f make/ant/build.xml" to compile, - - run "ant -f make/ant/build.xml run" to run the DaimoninEditor. + - o Change into the Daimonin Editor main directory. + - run "ant" to compile, + - run "ant run" to run the editor. --> -<project name="DaimoninEditor" default="jar"> +<project name="Gridarta Editor for Daimonin" default="jar"> <!-- set properties and clean build directory --> <target name="init"> @@ -69,7 +73,7 @@ <!-- compiling all Java classes --> <target name="compile" depends="init,clean,ctags" description="compiles source."> <javac - srcdir = "${src.dir}" + srcdir = "${src.dir}:../src/app" destdir = "${build.dir}" encoding = "${build.source.encoding}" source = "${build.source.version}" @@ -196,7 +200,7 @@ doctitle = "Daimonin Editor<br />API Documentation" header = "Daimonin Editor<br />API Documentation" footer = "Daimonin Editor<br />API Documentation" - bottom = "<div style="text-align:center;">© 2005 The Daimonin Developers. All rights reserved.</div>" + bottom = "<div style="text-align:center;">© 2003 Andreas Vogl, Michael Toennis, 2004-2006 The Daimonin Developers, 2006 The Gridarta Developers. All rights reserved.</div>" serialwarn = "yes" charset = "utf-8" docencoding = "utf-8" @@ -258,38 +262,6 @@ </checkstyle> </target> - <!-- Beautifies the source. - - WARNING: DO NOT ARBITRARILY USE THIS AND THEN COMMIT!!! - - Jalopy currently has some serious limitations and flaws that - - interfer with the code conventions used for the Daimonin source. - - @see http://jalopy.sf.net/ - --> - <target name="beautify" depends="init" description="runs a source code beautifier."> - <taskdef name="jalopy" classname="de.hunsicker.jalopy.plugin.ant.AntPlugin"> - <classpath> - <fileset dir="${jalopy.path}"> - <include name="*.jar" /> - </fileset> - </classpath> - </taskdef> - <path id="project.classpath"> - <fileset dir="${lib.dir}" includes="*.jar" /> - </path> - <jalopy - fileformat="unix" - history="file" - historymethod="adler32" - loglevel="info" - threads="1" - classpathref="project.classpath" - convention="../../${jalopy.conv}" - > - <fileset dir="${src.dir}"> - <include name="**/*.java"/> - </fileset> - </jalopy> - </target> - <!-- Prints a todo list. - Useful e.g. to parse the list from within vi and jump from todo change to todo change. --> @@ -317,7 +289,7 @@ <target name = "ftpPublish" - description = "publishes DaimoninEditor.jar using ftp" + description = "publishes ${jarname} using ftp" depends="preparePublish" > <ftp @@ -330,7 +302,7 @@ ignoreNoncriticalErrors="${user.ftp.ignoreNoncriticalErrors}" > <fileset dir="."> - <include name="DaimoninEditor.jar" /> + <include name="${jarname}" /> <include name="update.properties" /> </fileset> </ftp> @@ -338,7 +310,7 @@ <target name = "scpPublish" - description = "publishes DaimoninEditor.jar using scp" + description = "publishes ${jarname} using scp" depends = "preparePublish" > <scp @@ -348,7 +320,7 @@ keyfile="${user.scp.keyfile}" > <fileset dir="."> - <include name="DaimoninEditor.jar" /> + <include name="${jarname}" /> <include name="update.properties" /> </fileset> </scp> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-26 23:46:54
|
Revision: 37 Author: christianhujer Date: 2006-05-26 15:52:35 -0700 (Fri, 26 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=37&view=rev Log Message: ----------- Unified help. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java trunk/daimonin/DaimoninEditor.jar trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CFTreasureListTree.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditMenuBar.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/CommonConstants.java trunk/src/app/net/sf/gridarta/help/ trunk/src/app/net/sf/gridarta/help/Help.java trunk/src/app/net/sf/gridarta/help/HtmlPane.java trunk/src/app/net/sf/gridarta/help/package.html Removed Paths: ------------- trunk/crossfire/src/cfeditor/help/ trunk/daimonin/src/daieditor/help/ Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-05-26 22:51:23 UTC (rev 36) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-05-26 22:52:35 UTC (rev 37) @@ -25,7 +25,7 @@ package cfeditor; import cfeditor.arch.ArchObject; -import cfeditor.help.CFHelp; +import net.sf.gridarta.help.Help; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -1048,7 +1048,7 @@ help_button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // create html-docu on the current type and display it - new CFHelp(m_control.getMainView(), type.createHtmlDocu()).setVisible(true); + new Help(m_control.getMainView(), type.createHtmlDocu()).setVisible(true); } }); Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-05-26 22:51:23 UTC (rev 36) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-05-26 22:52:35 UTC (rev 37) @@ -26,7 +26,7 @@ import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectStack; -import cfeditor.help.CFHelp; +import net.sf.gridarta.help.Help; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -674,7 +674,7 @@ helpButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { // open the help window - new CFHelp(CMainControl.getInstance().getMainView(), "treasurelists.html").setVisible(true); + new Help(CMainControl.getInstance().getMainView(), "treasurelists.html").setVisible(true); } }); leftSide.add(helpButton); Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-05-26 22:51:23 UTC (rev 36) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-05-26 22:52:35 UTC (rev 37) @@ -25,7 +25,7 @@ package cfeditor; import cfeditor.arch.ArchObject; -import cfeditor.help.CFHelp; +import net.sf.gridarta.help.Help; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; @@ -275,7 +275,7 @@ /** open the online help window */ public void openHelpWindow() { - new CFHelp(this, null).setVisible(true); + new Help(this, null).setVisible(true); } public void setPickmapActive(boolean state) { Modified: trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-05-26 22:51:23 UTC (rev 36) +++ trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-05-26 22:52:35 UTC (rev 37) @@ -50,7 +50,7 @@ import javax.swing.border.EmptyBorder; import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; -import cfeditor.help.CFHelp; +import net.sf.gridarta.help.Help; /** * Dialog used to ask the user the properties for the new level. @@ -353,7 +353,7 @@ button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { // open the help window - new CFHelp(m_control.getMainView(), "tut_mapattr.html").setVisible(true); + new Help(m_control.getMainView(), "tut_mapattr.html").setVisible(true); } }); left_buttons.add(button); Modified: trunk/daimonin/DaimoninEditor.jar =================================================================== (Binary files differ) Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-05-26 22:51:23 UTC (rev 36) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-05-26 22:52:35 UTC (rev 37) @@ -44,7 +44,7 @@ import daieditor.arch.ArchObject; import daieditor.arch.NamedObject; import daieditor.arch.NamedObjects; -import daieditor.help.DHelp; +import net.sf.gridarta.help.Help; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Color; @@ -871,7 +871,7 @@ * @used */ public void attribHelp() { - new DHelp(mainControl.getMainView(), type.createHtmlDocu()).setVisible(true); + new Help(mainControl.getMainView(), type.createHtmlDocu()).setVisible(true); } /** Modified: trunk/daimonin/src/daieditor/CFTreasureListTree.java =================================================================== --- trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-05-26 22:51:23 UTC (rev 36) +++ trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-05-26 22:52:35 UTC (rev 37) @@ -26,7 +26,7 @@ import static daieditor.CGUIUtils.getSysIcon; import daieditor.arch.ArchObject; -import daieditor.help.DHelp; +import net.sf.gridarta.help.Help; import java.awt.BorderLayout; import static java.awt.Color.gray; import java.awt.Component; @@ -649,7 +649,7 @@ final JButton helpButton = new JButton("Help"); helpButton.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent event) { - new DHelp(CMainControl.getInstance().getMainView(), "treasurelists.html").setVisible(true); + new Help(CMainControl.getInstance().getMainView(), "treasurelists.html").setVisible(true); } }); leftSide.add(helpButton); Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-05-26 22:51:23 UTC (rev 36) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-05-26 22:52:35 UTC (rev 37) @@ -27,7 +27,7 @@ import daieditor.arch.ArchObject; import daieditor.arch.ArchObjectStack; import daieditor.gui.AboutDialog; -import daieditor.help.DHelp; +import net.sf.gridarta.help.Help; import daieditor.map.MapControl; import daieditor.map.validation.ErrorCollector; import daieditor.map.validation.ErrorHandler; @@ -235,7 +235,7 @@ /** Open the online help window. */ public void openHelpWindow() { - new DHelp(this, null).setVisible(true); + new Help(this, null).setVisible(true); } public void setPickmapActive(final boolean state) { Modified: trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-05-26 22:51:23 UTC (rev 36) +++ trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-05-26 22:52:35 UTC (rev 37) @@ -28,7 +28,7 @@ import daieditor.CMainControl; import daieditor.CMainView; import daieditor.IGUIConstants; -import daieditor.help.DHelp; +import net.sf.gridarta.help.Help; import daieditor.map.MapArchObject; import daieditor.map.MapControl; import java.awt.BorderLayout; @@ -319,7 +319,7 @@ /** Action method for help. */ public void mapHelp() { - new DHelp(mainControl.getMainView(), "tut_mapattr.html").setVisible(true); + new Help(mainControl.getMainView(), "tut_mapattr.html").setVisible(true); } /** Action method for okay. */ Modified: trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditMenuBar.java =================================================================== --- trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditMenuBar.java 2006-05-26 22:51:23 UTC (rev 36) +++ trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditMenuBar.java 2006-05-26 22:52:35 UTC (rev 37) @@ -24,7 +24,7 @@ package daieditor.textedit.scripteditor; import daieditor.IGUIConstants; -import daieditor.help.DHelp; +import net.sf.gridarta.help.Help; import daieditor.textedit.textarea.InputHandler; import daieditor.textedit.textarea.JEditTextArea; import java.awt.Event; @@ -244,7 +244,7 @@ miOnlineHelp.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent event) { // FIXME: "pystart.html" shouldn't be hardcoded - new DHelp(control.getView(), "pystart.html").setVisible(true); + new Help(control.getView(), "pystart.html").setVisible(true); } }); menuHelp.add(miOnlineHelp); Added: trunk/src/app/net/sf/gridarta/CommonConstants.java =================================================================== --- trunk/src/app/net/sf/gridarta/CommonConstants.java (rev 0) +++ trunk/src/app/net/sf/gridarta/CommonConstants.java 2006-05-26 22:52:35 UTC (rev 37) @@ -0,0 +1,39 @@ +/* + * Crossfire Java Editor. + * Copyright (C) 2000 Michael Toennies + * Copyright (C) 2001 Andreas Vogl + * + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package net.sf.gridarta; + +import static java.io.File.separator; + +/** + * Interface with constants used in Gridarta and derivates. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @deprecated This uses the constant interface anti pattern + */ +@Deprecated public interface CommonConstants { + + /** The directory that contains all (html) help files. */ + String HELP_DIR = "resource" + separator + "HelpFiles"; + +} // interface CommonConstants Property changes on: trunk/src/app/net/sf/gridarta/CommonConstants.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Copied: trunk/src/app/net/sf/gridarta/help/Help.java (from rev 33, trunk/crossfire/src/cfeditor/help/CFHelp.java) =================================================================== --- trunk/src/app/net/sf/gridarta/help/Help.java (rev 0) +++ trunk/src/app/net/sf/gridarta/help/Help.java 2006-05-26 22:52:35 UTC (rev 37) @@ -0,0 +1,84 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2000 Michael Toennies + * Copyright (C) 2001 Andreas Vogl + * + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package net.sf.gridarta.help; + +import java.awt.Rectangle; +import javax.swing.JDialog; +import javax.swing.JFrame; +import net.sf.japi.swing.DisposeAction; + +/** + * <code>CFHelp</code> implements the Help Window is a seperate frame with html content. + * @author <a href="mailto:mic...@no...">Michael Toennies</a> + * @author <a href="mailto:and...@gm...">Andreas Vogl</a> + * @author <a href="mailto:ch...@it...">Christian Hujer</a> + * @todo make 1 single class out of these two + * @todo add back and home buttons so they needn't be in the documentation + * @todo add method to set the currently displayed help page from the outside + * @todo add bookmarks to help + * @todo add index to help + * @deprecated We'll use JavaHelp instead. + */ +@Deprecated public final class Help extends JDialog { + + /** Serial Version UID. */ + private static final long serialVersionUID = 1L; + + /** + * Constructor + * @param parent the main view to get bounds from to position the help + * @param fname may contain different things: + * 1. null -> the file "start.html" is opened + * 2. File name of a html-file to be opened + * 3. html-text to be displayed directly (no file) + * (this text must start with "<HTML>") + * @todo refactor this. The dual semantic of fname is a Bad Thing. + * @todo always creating new help windows is a Bad Thing as well, make this constructor private + */ + public Help(final JFrame parent, String fname) { + super(parent, "Help", false); // super constructor + setResizable(true); + + final Rectangle mvb = parent.getBounds(); // get main view bounds + setBounds(mvb.x + (mvb.width >> 1) - 260, mvb.y + 70, 520, 600); // standard + + if (fname == null) { // FIXME: Do not hardcode "start.html" + fname = "start.html"; + } + final HtmlPane html; + if (fname.startsWith("<HTML>") || fname.startsWith("<html")) { + if (fname.startsWith("<HTML")) { + System.err.println("Wrong formatted HTML!"); + } + html = new HtmlPane("text/html", fname); // direct text + } else { + html = new HtmlPane(fname); // read html file + } + DisposeAction.install(this); + setContentPane(html); + setDefaultCloseOperation(DISPOSE_ON_CLOSE); + } + +} // class CFHelp Copied: trunk/src/app/net/sf/gridarta/help/HtmlPane.java (from rev 31, trunk/daimonin/src/daieditor/help/HtmlPane.java) =================================================================== --- trunk/src/app/net/sf/gridarta/help/HtmlPane.java (rev 0) +++ trunk/src/app/net/sf/gridarta/help/HtmlPane.java 2006-05-26 22:52:35 UTC (rev 37) @@ -0,0 +1,226 @@ +/* + * Daimonin Java Editor. + * Copyright (C) 2000 Michael Toennies + * Copyright (C) 2001 Andreas Vogl + * + * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen) + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + */ + +package net.sf.gridarta.help; + +import java.awt.Container; +import java.awt.Cursor; +import java.io.File; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.logging.Logger; +import java.util.logging.Level; +import javax.swing.JEditorPane; +import javax.swing.JScrollPane; +import javax.swing.JViewport; +import javax.swing.SwingUtilities; +import javax.swing.event.HyperlinkEvent; +import javax.swing.event.HyperlinkListener; +import javax.swing.text.Document; +import net.sf.gridarta.CommonConstants; + +/** + * Pane for displaying HTML. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +final class HtmlPane extends JScrollPane implements HyperlinkListener { + + /** Logger for logging what's going on here. */ + private static final Logger log = Logger.getLogger("HtmlPane.class"); + + /** Serial Version UID. */ + private static final long serialVersionUID = 1L; + + /** The JEditorPane that displays the html page. */ + private final JEditorPane html; + + /** + * Constructor to load the html-file <fname> and display + * it's contents in this HtmlPane. + * @param fname Name of the hmtl-file + */ + HtmlPane(final String fname) { + try { + // first looking for the html file in extracted form + final File file = new File(CommonConstants.HELP_DIR, fname); + if (file.exists()) { + // file exists in expected directory + final String s = "file:" + file.getAbsolutePath(); + html = new JEditorPane(s); + } else { + // file missing, so let's look if we can get it from the jar + URL url = ClassLoader.getSystemResource(CommonConstants.HELP_DIR.replace('\\', '/') + '/' + fname); + + if (url != null) { + html = new JEditorPane(url); + } else { + // let's try it again without first directory + log.info("trying: HelpFiles/" + fname); + url = ClassLoader.getSystemResource("HelpFiles/" + fname); + if (url != null) { + html = new JEditorPane(url); + } else { + log.info("Failed to open help file '" + fname + "'!"); + throw new RuntimeException(); // FIXME + } + } + } + + html.setEditable(false); + html.addHyperlinkListener(this); + final JViewport vp = getViewport(); + + // under windows, the content of the panel get detroyed after scrolling + // this will avoid this problem! + // but it will make the scrolling slower + // so test this! + // FIXME: This problem should be fixed in the latest versions of the JRE. + getViewport().putClientProperty("EnableWindowBlit", Boolean.TRUE); + vp.setScrollMode(JViewport.SIMPLE_SCROLL_MODE); + + vp.add(html); + setFocusable(true); + requestFocus(); + setAutoscrolls(true); + } catch (final NullPointerException e) { + // failed to open the html file + throw new RuntimeException(e); // FIXME + } catch (final MalformedURLException e) { + log.log(Level.WARNING, "Malformed URL: %s", e); + throw new RuntimeException(e); // FIXME + } catch (final IOException e) { + log.log(Level.WARNING, "IOException: %s", e); + throw new RuntimeException(e); // FIXME + } + } + + /** + * Constructor to load the html-file <fname> and display + * it's contents in this HtmlPane. + * @param type mime-type of the given text (e.g. "text/html") + * @param text text to display (can be html-text for example) + */ + HtmlPane(final String type, final String text) { + // open new JEditorPane + html = new JEditorPane(type, text); + html.setEditable(false); + html.addHyperlinkListener(this); + final JViewport vp = getViewport(); + + // under windows, the content of the panel get detroyed after scrolling + // this will avoid this problem! + // but it will make the scrolling slower + // so test this! + // XXX The main issue probably is extending JScrollPane (Cher) + getViewport().putClientProperty("EnableWindowBlit", Boolean.TRUE); + vp.setScrollMode(JViewport.SIMPLE_SCROLL_MODE); + + vp.add(html); + //vp.setView(html); + //vp.setViewPosition(new Point(0, 0)); + + setAutoscrolls(true); + } + + /** + * Notification of a change relative to a + * hyperlink. + * @param e occurred <code>HyperlinkEvent</code> + */ + public void hyperlinkUpdate(final HyperlinkEvent e) { + if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { + linkActivated(e.getURL()); + } + } + + /** + * Follows the reference in an + * link. The given url is the requested reference. + * By default this calls <a href="#setPage">setPage</a>, + * and if an exception is thrown the original previous + * document is restored and a beep sounded. If an + * attempt was made to follow a link, but it represented + * a malformed url, this method will be called with a + * null argument. + * @param u the URL to follow + */ + void linkActivated(final URL u) { + final Cursor cursor = html.getCursor(); + final Cursor waitCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR); + html.setCursor(waitCursor); + SwingUtilities.invokeLater(new PageLoader(u, cursor)); + } + + /** + * Synchronuous page loader, loads a page and handles the cursor. + */ + private final class PageLoader implements Runnable { + + /** URL to load. */ + private URL url; + + /** Original cursor that should be restored once the document is loaded. */ + private final Cursor cursor; + + /** + * Create a PageLoader. + * @param url URL to load + * @param cursor Cursor to restore once the document is loaded + */ + private PageLoader(final URL url, final Cursor cursor) { + this.url = url; + this.cursor = cursor; + } + + /** {@inheritDoc} */ + public void run() { + if (url == null) { + // restore the original cursor + html.setCursor(cursor); + + // PENDING(prinz) remove this hack when + // automatic validation is activated. + final Container parent = html.getParent(); + parent.repaint(); + } else { + final Document doc = html.getDocument(); + try { + html.setPage(url); + } catch (final IOException ioe) { + html.setDocument(doc); + getToolkit().beep(); + // TODO not just beep but display an error message as well. + } finally { + // schedule the cursor to revert after + // the paint has happended. + url = null; + SwingUtilities.invokeLater(this); + } + } + } + + } // class PageLoader + +} // class HtmlPane Copied: trunk/src/app/net/sf/gridarta/help/package.html (from rev 30, trunk/daimonin/src/daieditor/help/package.html) =================================================================== --- trunk/src/app/net/sf/gridarta/help/package.html (rev 0) +++ trunk/src/app/net/sf/gridarta/help/package.html 2006-05-26 22:52:35 UTC (rev 37) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> + <head> + <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> + <title></title> + </head> + <body> + <p> + This packages implements the online help system for the Daimonin editor. + @deprecated This whole package is deprecated in favor of using JavaHelp. + </p> + </body> +</html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-26 23:46:53
|
Revision: 38 Author: christianhujer Date: 2006-05-26 15:55:57 -0700 (Fri, 26 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=38&view=rev Log Message: ----------- Set ignore property properly. Property Changed: ---------------- trunk/ Property changes on: trunk ___________________________________________________________________ Name: svn:ignore + dest classes developer.properties This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-05-26 23:46:50
|
Revision: 39 Author: christianhujer Date: 2006-05-26 15:59:26 -0700 (Fri, 26 May 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=39&view=rev Log Message: ----------- Removed unused help directory constant. Modified Paths: -------------- trunk/crossfire/src/cfeditor/IGUIConstants.java trunk/daimonin/src/daieditor/IGUIConstants.java Modified: trunk/crossfire/src/cfeditor/IGUIConstants.java =================================================================== --- trunk/crossfire/src/cfeditor/IGUIConstants.java 2006-05-26 22:55:57 UTC (rev 38) +++ trunk/crossfire/src/cfeditor/IGUIConstants.java 2006-05-26 22:59:26 UTC (rev 39) @@ -133,9 +133,6 @@ /** The directory that contains the system icons. */ String SYSTEM_DIR = "resource" + File.separator + "system"; - /** The directory that contains all (html) helpfiles. */ - String HELP_DIR = "resource" + File.separator + "HelpFiles"; - /** The directory that contains all pickmaps. */ String PICKMAP_DIR = "resource" + File.separator + "pickmaps"; Modified: trunk/daimonin/src/daieditor/IGUIConstants.java =================================================================== --- trunk/daimonin/src/daieditor/IGUIConstants.java 2006-05-26 22:55:57 UTC (rev 38) +++ trunk/daimonin/src/daieditor/IGUIConstants.java 2006-05-26 22:59:26 UTC (rev 39) @@ -128,9 +128,6 @@ // The directory that contains the system icons. String SYSTEM_DIR = "resource" + File.separator + "system"; - // The directory that contains all (html) helpfiles. - String HELP_DIR = "resource" + File.separator + "HelpFiles"; - // The directory that contains all pickmaps. // public static final String PICKMAP_DIR = "resource"+File.separator+"pickmaps"; String PICKMAP_DIR = "dev" + File.separator + "editor" + File.separator + "pickmaps"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |