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: <aki...@us...> - 2006-11-26 17:25:40
|
Revision: 709 http://svn.sourceforge.net/gridarta/?rev=709&view=rev Author: akirschbaum Date: 2006-11-26 09:25:41 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify logging statements. Modified Paths: -------------- trunk/daimonin/src/daieditor/gameobject/GameObject.java Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-11-26 17:19:20 UTC (rev 708) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2006-11-26 17:25:41 UTC (rev 709) @@ -38,6 +38,7 @@ import javax.swing.ImageIcon; import javax.swing.JList; import net.sf.gridarta.gameobject.GameObjectContainer; +import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -56,6 +57,9 @@ */ public final class GameObject /*extends NamedObject*/ extends net.sf.gridarta.gameobject.GameObject<GameObject> implements Cloneable, Serializable { + /** Logger. */ + private static final Logger log = Logger.getLogger(GameObject.class); + /** Serial Version. */ private static final long serialVersionUID = 1L; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 17:19:20
|
Revision: 708 http://svn.sourceforge.net/gridarta/?rev=708&view=rev Author: akirschbaum Date: 2006-11-26 09:19:20 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify logging statements. Modified Paths: -------------- trunk/daimonin/src/daieditor/CFJavaEditor.java Modified: trunk/daimonin/src/daieditor/CFJavaEditor.java =================================================================== --- trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-11-26 17:10:04 UTC (rev 707) +++ trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-11-26 17:19:20 UTC (rev 708) @@ -31,9 +31,9 @@ import java.util.MissingResourceException; import java.util.ResourceBundle; import java.util.logging.Level; -import java.util.logging.Logger; import static java.util.prefs.Preferences.userNodeForPackage; import net.sf.japi.swing.ActionFactory; +import org.apache.log4j.Logger; /** * Main class, launches the level editor application. @@ -43,6 +43,8 @@ @SuppressWarnings({"UtilityClass", "UseOfSystemOutOrSystemErr"}) public final class CFJavaEditor { + private static final Logger log = Logger.getLogger(CFJavaEditor.class); + /** Private UtilityClass constructor . */ private CFJavaEditor() { } @@ -54,9 +56,11 @@ public static void main(final String... args) { System.setProperty("net.sf.japi.swing.tod", "daieditor.tod"); try { - Logger.getLogger("daieditor", "daieditor.messages").log(Level.INFO, "build number: " + ResourceBundle.getBundle("build").getString("build.number")); + if (log.isInfoEnabled()) { + log.info("build number: " + ResourceBundle.getBundle("build").getString("build.number")); + } } catch (final MissingResourceException e) { - Logger.getLogger("daieditor", "daieditor.messages").log(Level.WARNING, "No build number found:", e); + log.warn ("No build number found:", e); } // Make sure the locale is set before any ActionFactory is used. final String locName = userNodeForPackage(CMainControl.class).get(PREFS_LANGUAGE, null); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 17:10:09
|
Revision: 707 http://svn.sourceforge.net/gridarta/?rev=707&view=rev Author: akirschbaum Date: 2006-11-26 09:10:04 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify method names. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CArchQuickView.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapArchPanel.java trunk/crossfire/src/cfeditor/CMapTileList.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java Modified: trunk/crossfire/src/cfeditor/CArchQuickView.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchQuickView.java 2006-11-26 16:22:58 UTC (rev 706) +++ trunk/crossfire/src/cfeditor/CArchQuickView.java 2006-11-26 17:10:04 UTC (rev 707) @@ -153,7 +153,7 @@ } void refresh() { - mainControl.showArchPanelQuickObject(mainControl.getArchPanelSelection()); + mainControl.showArchPanelQuickObject(mainControl.getArchPanelHighlight()); repaint(); } Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-26 16:22:58 UTC (rev 706) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-26 17:10:04 UTC (rev 707) @@ -485,9 +485,9 @@ } } - // ask arch panel which arch is selectd - public GameObject getArchPanelSelection() { - return mainView.getArchPanelSelection(); + // ask arch panel which arch is highlighted + public GameObject getArchPanelHighlight() { + return mainView.getArchPanelHighlight(); } // setup quick view window Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-11-26 16:22:58 UTC (rev 706) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-11-26 17:10:04 UTC (rev 707) @@ -293,7 +293,7 @@ * IMPORTANT: The returned GameObject is not a clone. A copy * must be generated before inserting such an arch to the map. */ - public GameObject getArchPanelSelection() { + public GameObject getArchPanelHighlight() { if ((isPickmapActive() || archPanel.getArchPanelSelection() == null) && CPickmapPanel.getInstance().isLoadComplete() && Modified: trunk/crossfire/src/cfeditor/CMapArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-11-26 16:22:58 UTC (rev 706) +++ trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-11-26 17:10:04 UTC (rev 707) @@ -257,7 +257,7 @@ invChange.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent event) { - final GameObject arch = mainControl.getArchPanelSelection(); + final GameObject arch = mainControl.getArchPanelHighlight(); if (arch == null) { // nothing selected? return; } Modified: trunk/crossfire/src/cfeditor/CMapTileList.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapTileList.java 2006-11-26 16:22:58 UTC (rev 706) +++ trunk/crossfire/src/cfeditor/CMapTileList.java 2006-11-26 17:10:04 UTC (rev 707) @@ -186,14 +186,14 @@ ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && e.isShiftDown())) { // --- right mouse button: insert arch --- - if (currentSquare != null && mainControl.getArchPanelSelection() != null) { + if (currentSquare != null && mainControl.getArchPanelHighlight() != null) { final int listIndex = getListIndex(e); if (listIndex >= list.getModel().getSize()) { - mainControl.insertArchToMap(mainControl.getArchPanelSelection(), mainControl.getPanelArch(), null, currentSquare, MapModel.JOIN_ENABLE); + mainControl.insertArchToMap(mainControl.getArchPanelHighlight(), mainControl.getPanelArch(), null, currentSquare, MapModel.JOIN_ENABLE); } else { final String entry = model.getElementAt(listIndex).toString(); final int num = Integer.parseInt(entry.substring(0, 10)); - mainControl.insertArchToMap(mainControl.getArchPanelSelection(), mainControl.getPanelArch(), mainControl.getMapArch(num, currentSquare), currentSquare, MapModel.JOIN_ENABLE); + mainControl.insertArchToMap(mainControl.getArchPanelHighlight(), mainControl.getPanelArch(), mainControl.getMapArch(num, currentSquare), currentSquare, MapModel.JOIN_ENABLE); } // refresh Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-11-26 16:22:58 UTC (rev 706) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-11-26 17:10:04 UTC (rev 707) @@ -1240,7 +1240,7 @@ needRedraw = insertSelArchToMap(mapLoc, true); // get name of inserted arch (this is display in status bar while dragging) - @Nullable final GameObject insArch = mainControl.getArchPanelSelection(); + @Nullable final GameObject insArch = mainControl.getArchPanelHighlight(); if (insArch != null) { if (insArch.getObjName() != null && insArch.getObjName().length() > 0) { insertArchName = insArch.getObjName(); @@ -1345,7 +1345,7 @@ // this is the arch that would get inserted from pickmap, but it also could // be a default arch (when pickmap has no selection) - GameObject newarch = mainControl.getArchPanelSelection(); + GameObject newarch = mainControl.getArchPanelHighlight(); if (!mainControl.getMainView().isPickmapActive() || mapControl.isPickmap() || (newarch != null && newarch.isArchetype())) { Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-11-26 16:22:58 UTC (rev 706) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-11-26 17:10:04 UTC (rev 707) @@ -294,7 +294,7 @@ return; // should actually never happen } - if (mainControl.getArchPanelSelection() == null) { // no selected arch to fill with + if (mainControl.getArchPanelHighlight() == null) { // no selected arch to fill with return; } @@ -302,7 +302,7 @@ final GameObject arch; if (offset.x == 0 && offset.y == 0 && !mapControl.containsArchObject(startp)) { - arch = mainControl.getArchPanelSelection(); + arch = mainControl.getArchPanelHighlight(); if (arch != null) { floodfill(mapControl, startp.x, startp.y, arch); } @@ -319,7 +319,7 @@ } // get the arch to fill with - arch = mainControl.getArchPanelSelection(); + arch = mainControl.getArchPanelHighlight(); // cycle through all tile coordinates which are highlighted: for (pos.x = startp.x; pos.x - startp.x <= offset.x; pos.x++) { Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 16:22:58 UTC (rev 706) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 17:10:04 UTC (rev 707) @@ -124,7 +124,7 @@ * @param mapControl MapControl of the active map where the action was invoked */ public void display(final MapControl mapControl) { - replaceArch = mainControl.getArchPanelSelection(); // selected arch + replaceArch = mainControl.getArchPanelHighlight(); // highlighted arch if (!isBuilt) { this.mapControl = mapControl; @@ -372,7 +372,7 @@ switch (selectedIndex) { case 0: // replace with arch - replaceArch = mainControl.getArchPanelSelection(); // selected arch + replaceArch = mainControl.getArchPanelHighlight(); // selected arch updateArchSelection(replaceArch, true); break; Modified: trunk/crossfire/src/cfeditor/gui/ArchComboBox.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-11-26 16:22:58 UTC (rev 706) +++ trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2006-11-26 17:10:04 UTC (rev 707) @@ -141,7 +141,7 @@ fromSelect.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { try { - final GameObject ao = archComboBoxModel.getNearsetMatch(mainControl.getArchPanelSelection().getArchetypeName()); + final GameObject ao = archComboBoxModel.getNearsetMatch(mainControl.getArchPanelHighlight().getArchetypeName()); setSelectedItem(ao); setItem(ao); } catch (final Exception ex) {//null pointer exception This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 16:22:58
|
Revision: 706 http://svn.sourceforge.net/gridarta/?rev=706&view=rev Author: akirschbaum Date: 2006-11-26 08:22:58 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/daimonin/src/daieditor/CopyBuffer.java Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-11-26 16:19:13 UTC (rev 705) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-11-26 16:22:58 UTC (rev 706) @@ -142,8 +142,8 @@ final Point startp = mapControl.getMapViewFrame().getHighlightStart(); // start of highlighted rect final Point offset = mapControl.getMapViewFrame().getHighlightOffset(); // offset of rect from startp - if (!mapControl.getMapViewFrame().isHighlight()) { // should actually never happen - return; + if (!mapControl.getMapViewFrame().isHighlight()) { + return; // should actually never happen } // convert negative 'offset' into positive by flipping 'startp' @@ -230,8 +230,8 @@ public void paste(final MapControl mapControl) { final Point startp = mapControl.getMapViewFrame().getHighlightStart(); // start of highlighted rect - if (!mapControl.getMapViewFrame().isHighlight()) { // should actually never happen - return; + if (!mapControl.getMapViewFrame().isHighlight()) { + return; // should actually never happen } // cycle through all tile coordinates which are highlighted: @@ -290,8 +290,8 @@ final Point offset = mapControl.getMapViewFrame().getHighlightOffset(); // offset of rect from startp final Point pos = new Point(); - if (!mapControl.getMapViewFrame().isHighlight()) { // should actually never happen - return; + if (!mapControl.getMapViewFrame().isHighlight()) { + return; // should actually never happen } if (mainControl.getArchPanelSelection() == null) { // no selected arch to fill with Modified: trunk/daimonin/src/daieditor/CopyBuffer.java =================================================================== --- trunk/daimonin/src/daieditor/CopyBuffer.java 2006-11-26 16:19:13 UTC (rev 705) +++ trunk/daimonin/src/daieditor/CopyBuffer.java 2006-11-26 16:22:58 UTC (rev 706) @@ -241,7 +241,7 @@ public void fill(final MapControl mapControl, final boolean fillBelow, final MapControl seed, final int rand) { if (!mapControl.getMapViewFrame().isHighlight()) { - return; // should actually never happen + return; // should actually never happen } final List<GameObject> archList; if (seed == null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 16:19:13
|
Revision: 705 http://svn.sourceforge.net/gridarta/?rev=705&view=rev Author: akirschbaum Date: 2006-11-26 08:19:13 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Do not crash when map view vanishes. Modified Paths: -------------- trunk/crossfire/src/cfeditor/ReplaceDialog.java Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 16:15:39 UTC (rev 704) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 16:19:13 UTC (rev 705) @@ -138,7 +138,8 @@ line1.add(labelon); line1.add(Box.createVerticalStrut(3)); replaceEntireBox = new JComboBox(new String[]{ACTION_FACTORY.getString("replaceOnMap"), ACTION_FACTORY.getString("replaceOnSelection")}); - if (mapControl.getMapViewFrame().isHighlight()) { + final MapViewIFrame mapViewIFrame = mapControl.getMapViewFrame(); + if (mapViewIFrame != null && mapViewIFrame.isHighlight()) { replaceEntireBox.setSelectedIndex(1); } else { replaceEntireBox.setSelectedIndex(0); @@ -223,7 +224,8 @@ colonLabel.setText(":"); } - if (mapControl.getMapViewFrame().isHighlight()) { + final MapViewIFrame mapViewIFrame = mapControl.getMapViewFrame(); + if (mapViewIFrame != null && mapViewIFrame.isHighlight()) { replaceEntireBox.setSelectedIndex(1); // selected squares } else { replaceEntireBox.setSelectedIndex(0); // entire map @@ -397,10 +399,11 @@ final boolean deleteOnly = replaceWithBox.getSelectedIndex() == 1; final boolean entireMap = replaceEntireBox.getSelectedIndex() == 0; + final MapViewIFrame mapViewIFrame = mapControl.getMapViewFrame(); if (mapControl == null || mapControl.isClosing()) { setVisible(false); ACTION_FACTORY.showMessageDialog(this, "replaceMapGone", mapControl.getMapFileName()); - } else if (!entireMap && !mapControl.getMapViewFrame().isHighlight()) { + } else if (!entireMap && (mapViewIFrame == null || !mapViewIFrame.isHighlight())) { // user selected "replace highlighted" but nothing is highlighted ACTION_FACTORY.showMessageDialog(this, "replaceMapNoSelection", mapControl.getMapFileName()); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 16:15:42
|
Revision: 704 http://svn.sourceforge.net/gridarta/?rev=704&view=rev Author: akirschbaum Date: 2006-11-26 08:15:39 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Whitespace change. Modified Paths: -------------- trunk/daimonin/src/daieditor/ReplaceDialog.java Modified: trunk/daimonin/src/daieditor/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 16:11:14 UTC (rev 703) +++ trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 16:15:39 UTC (rev 704) @@ -232,6 +232,7 @@ rfArchName.setText(" " + replaceArch.getBestName()); colonLabel.setText(":"); } + final MapViewIFrame mapViewIFrame = mapControl.getMapViewFrame(); if (mapViewIFrame != null && mapViewIFrame.isHighlight()) { replaceEntireBox.setSelectedIndex(1); // selected squares This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 16:11:15
|
Revision: 703 http://svn.sourceforge.net/gridarta/?rev=703&view=rev Author: akirschbaum Date: 2006-11-26 08:11:14 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify some comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/MapControl.java trunk/daimonin/src/daieditor/map/MapControl.java Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2006-11-26 16:06:35 UTC (rev 702) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2006-11-26 16:11:14 UTC (rev 703) @@ -62,8 +62,8 @@ private File mapFile; /** - * contains the edit types that have already been (requested and) - * calculated (edit types get calculated only when needed to save time) + * Contains the edit types that have already been (requested and) + * calculated (edit types get calculated only when needed to save time). */ private int activeEditType; @@ -117,9 +117,10 @@ } /** - * Return contains the edit types that have already been (requested and) - * calculated (edit types get calculated only when needed to save time) - * @return contains the edit types that have already been (requested and) + * Return the edit types that have already been (requested and) calculated + * (edit types get calculated only when needed to save time). + * + * @return the edit types that have already been calculated */ public int getActiveEditType() { return activeEditType; Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2006-11-26 16:06:35 UTC (rev 702) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2006-11-26 16:11:14 UTC (rev 703) @@ -96,8 +96,10 @@ */ private SoftReference<SimpleLevelRenderer> simpleLevelRendererReference; - // contains the edit types that have already been (requested and) calculated - // (edit types get calculated only when needed to save time) + /** + * Contains the edit types that have already been (requested and) + * calculated (edit types get calculated only when needed to save time). + */ private int activeEditType; /** @@ -158,6 +160,12 @@ return isPickmap; } + /** + * Return the edit types that have already been (requested and) calculated + * (edit types get calculated only when needed to save time). + * + * @return the edit types that have already been calculated + */ public int getActiveEditType() { return activeEditType; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 16:06:36
|
Revision: 702 http://svn.sourceforge.net/gridarta/?rev=702&view=rev Author: akirschbaum Date: 2006-11-26 08:06:35 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify variable/method names. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CArchPanelPan.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainMenu.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CPickmapPanel.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/crossfire/src/cfeditor/map/MapControl.java Modified: trunk/crossfire/src/cfeditor/CArchPanelPan.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-11-26 16:01:04 UTC (rev 701) +++ trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-11-26 16:06:35 UTC (rev 702) @@ -112,8 +112,8 @@ // In JDK 1.4 it is required to transfer focus back to mapview after // every click in the panel, otherwise the menu-shortcuts stop working if (mainControl.getCurrentMap() != null && - mainControl.getCurrentMap().getMapView() != null) { - mainControl.getCurrentMap().getMapView().requestFocus(); // focus to mapview + mainControl.getCurrentMap().getMapViewFrame() != null) { + mainControl.getCurrentMap().getMapViewFrame().requestFocus(); // focus to mapview } } }); Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-26 16:01:04 UTC (rev 701) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-26 16:06:35 UTC (rev 702) @@ -378,7 +378,7 @@ } void setMapAndArchPosition(final int archid, final Point pos) { - currentMap.getMapView().setMapAndArchPosition(archid, pos); + currentMap.getMapViewFrame().setMapAndArchPosition(archid, pos); } /** @@ -583,7 +583,7 @@ if (levels.size() > 0) { for (final Enumeration<MapControl> enu = levels.elements(); enu.hasMoreElements();) { final MapControl level = enu.nextElement(); - level.getMapView().updateLookAndFeel(); + level.getMapViewFrame().updateLookAndFeel(); if (log.isDebugEnabled()) { log.debug("map " + level.getMapName()); } @@ -602,12 +602,12 @@ return false; } - return currentMap.getMapView().isGridVisible(); + return currentMap.getMapViewFrame().isGridVisible(); } public void setGridVisibility(final boolean fVisible) { if (currentMap != null) { - currentMap.getMapView().setGridVisibility(fVisible); + currentMap.getMapViewFrame().setGridVisibility(fVisible); } } @@ -658,8 +658,8 @@ final MapControl map = new MapControl(this, objects, maparch, false, initial); if (show) { - mainView.addLevelView(map.getMapView()); // one view... - map.getMapView().setAutoscrolls(true); + mainView.addLevelView(map.getMapViewFrame()); // one view... + map.getMapViewFrame().setAutoscrolls(true); levels.addElement(map); setCurrentLevel(map); refreshMenusAndToolbars(); @@ -675,7 +675,7 @@ if (currentMap != null) { closeLevel(currentMap, false); if (currentMap != null) { - mainView.setCurrentLevelView(currentMap.getMapView()); + mainView.setCurrentLevelView(currentMap.getMapViewFrame()); } } } @@ -685,7 +685,7 @@ for (; levels.size() > 0;) { closeLevel(currentMap, false); if (currentMap != null) { - mainView.setCurrentLevelView(currentMap.getMapView()); + mainView.setCurrentLevelView(currentMap.getMapViewFrame()); } } } @@ -751,7 +751,7 @@ // Notify the level about the closing mainView.setMapTileList(null, -1); level.levelCloseNotify(); - mainView.removeLevelView(level.getMapView()); + mainView.removeLevelView(level.getMapViewFrame()); levels.removeElement(level); currentMap = null; @@ -1118,7 +1118,7 @@ if (!filename.endsWith(".png")) { filename += ".png"; } - mc.getMapView().printFullImage(filename); + mc.getMapViewFrame().printFullImage(filename); } } catch (final IOException e) { showMessage("Couln't create Image", "The image could not be created because the" + @@ -1154,7 +1154,7 @@ if (!filename.endsWith(".png")) { filename += ".png"; } - mapc.getMapView().printFullImage(filename); + mapc.getMapViewFrame().printFullImage(filename); if (log.isInfoEnabled()) { log.info("Created image \"" + filename + "\" of map " + mapc.getMapFileName() + "."); } @@ -1253,7 +1253,7 @@ if (exitPos.x == 0 && exitPos.y == 0) { showMessage("Destination Invalid", "This exit points nowhere."); } else if (currentMap.isPointValid(exitPos)) { - currentMap.getMapView().setHotspot(exitPos.x, exitPos.y); + currentMap.getMapViewFrame().setHotspot(exitPos.x, exitPos.y); } else { showMessage("Destination Invalid", "The destination of this exit is outside the map."); } @@ -1294,7 +1294,7 @@ exitPos.x = currentMap.getMapModel().getMapArchObject().getEnterX(); exitPos.y = currentMap.getMapModel().getMapArchObject().getEnterY(); } - currentMap.getMapView().setHotspot(exitPos.x, exitPos.y); // set hotspot + currentMap.getMapViewFrame().setHotspot(exitPos.x, exitPos.y); // set hotspot // Update the main view so the new map instantly pops up. mainView.update(mainView.getGraphics()); @@ -1337,8 +1337,8 @@ openFile(newfile); // open the new map // set viewport view on the new map - final JViewport newViewPort = currentMap.getMapView().getViewPort(); - final JViewport oldViewPort = oldmap.getMapView().getViewPort(); + final JViewport newViewPort = currentMap.getMapViewFrame().getViewPort(); + final JViewport oldViewPort = oldmap.getMapViewFrame().getViewPort(); final Rectangle scrollto; // new vieport rect if (direction == IGUIConstants.SOUTH) { @@ -1452,7 +1452,7 @@ /** "Clear" was selected from the Edit menu. */ public void clearWanted() { - if (currentMap == null || currentMap.getMapView() == null) { + if (currentMap == null || currentMap.getMapViewFrame() == null) { return; // this should never be possible, but I just wanna make sure... } @@ -1461,7 +1461,7 @@ /** "Cut" was selected from the Edit menu. */ public void cutWanted() { - if (currentMap == null || currentMap.getMapView() == null) { + if (currentMap == null || currentMap.getMapViewFrame() == null) { return; // this should never be possible, but I just wanna make sure... } @@ -1470,7 +1470,7 @@ /** "Copy" was selected from the Edit menu. */ public void copyWanted() { - if (currentMap == null || currentMap.getMapView() == null) { + if (currentMap == null || currentMap.getMapViewFrame() == null) { return; // this should never be possible, but I just wanna make sure... } @@ -1479,7 +1479,7 @@ /** "Paste" was selected from the Edit menu. */ public void pasteWanted() { - if (currentMap == null || currentMap.getMapView() == null) { + if (currentMap == null || currentMap.getMapViewFrame() == null) { return; // this should never be possible, but I just wanna make sure... } @@ -1491,7 +1491,7 @@ * @param fillBelow true if "Fill Below" was activated, false if "Fill Above" */ public void fillWanted(final boolean fillBelow) { - if (currentMap == null || currentMap.getMapView() == null) { + if (currentMap == null || currentMap.getMapViewFrame() == null) { return; // this should never be possible, but I just wanna make sure... } @@ -1513,7 +1513,7 @@ * @param fillBelow true if "Fill Below" was activated, false if "Fill Above" */ private void fillRandomWanted(final boolean fillBelow) { - if (currentMap == null || currentMap.getMapView() == null) { + if (currentMap == null || currentMap.getMapViewFrame() == null) { return; // this should never be possible, but I just wanna make sure... } @@ -1541,7 +1541,7 @@ /** "Replace" was selected from the Edit menu. */ public void replace() { - if (currentMap == null || currentMap.getMapView() == null) { + if (currentMap == null || currentMap.getMapViewFrame() == null) { return; // this should never be possible, but I just wanna make sure... } Modified: trunk/crossfire/src/cfeditor/CMainMenu.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainMenu.java 2006-11-26 16:01:04 UTC (rev 701) +++ trunk/crossfire/src/cfeditor/CMainMenu.java 2006-11-26 16:06:35 UTC (rev 702) @@ -1314,7 +1314,7 @@ m_showTiles.setEnabled(foundATile); m_showTiles.setChecked(mainControl.getCurrentMap().isTileShow()); // Cut/Copy only when there is a highlighted tile selection - if (mainControl.getCurrentMap().getMapView().isHighlight()) { + if (mainControl.getCurrentMap().getMapViewFrame().isHighlight()) { m_clear.setEnabled(true); m_cut.setEnabled(true); m_copy.setEnabled(true); Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-11-26 16:01:04 UTC (rev 701) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-11-26 16:06:35 UTC (rev 702) @@ -301,11 +301,11 @@ // get the active pickmap final MapControl pmap = CPickmapPanel.getInstance().getCurrentPickmap(); - if (pmap != null && pmap.getMapView().isHighlight()) { + if (pmap != null && pmap.getMapViewFrame().isHighlight()) { // now try to get the topmost object GameObject arch = null; - if (pmap.isPointValid(pmap.getMapView().getHighlightStart())) { - arch = (GameObject) pmap.getMapModel().getMapSquare(pmap.getMapView().getHighlightStart()).getFirst(); + if (pmap.isPointValid(pmap.getMapViewFrame().getHighlightStart())) { + arch = (GameObject) pmap.getMapModel().getMapSquare(pmap.getMapViewFrame().getHighlightStart()).getFirst(); } if (arch != null) { // so here we return the arch from the pickmap Modified: trunk/crossfire/src/cfeditor/CPickmapPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-11-26 16:01:04 UTC (rev 701) +++ trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-11-26 16:06:35 UTC (rev 702) @@ -209,7 +209,7 @@ */ @Nullable private CMapViewBasic newPickmap(final List<GameObject> objects, final MapArchObject maparch, final File mapFile) { final MapControl map = new MapControl(mainControl, objects, maparch, true, null); - map.getMapView().setAutoscrolls(true); + map.getMapViewFrame().setAutoscrolls(true); map.setMapFile(mapFile); // add pickmap to hashtable @@ -218,7 +218,7 @@ currentPickMap = map; map.getMapModel().resetLevelChangedFlag(); - return map.getMapView().getBasicView(); + return map.getMapViewFrame().getBasicView(); } /** @@ -235,7 +235,7 @@ final MapControl tmpMap = pickmaps.get(tmpKey); if (tmpMap == mapControl) { pickmaps.remove(tmpKey); - tabpane.remove(tmpMap.getMapView().getBasicView()); + tabpane.remove(tmpMap.getMapViewFrame().getBasicView()); mapClosed = true; } } @@ -254,7 +254,7 @@ public void setActivePickmap(final String name) { final MapControl tmpMap = pickmaps.get(name); if (tmpMap != null) { - tabpane.setSelectedComponent(tmpMap.getMapView().getBasicView()); + tabpane.setSelectedComponent(tmpMap.getMapViewFrame().getBasicView()); } } Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-11-26 16:01:04 UTC (rev 701) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-11-26 16:06:35 UTC (rev 702) @@ -139,10 +139,10 @@ * @param mode defines if we have a cut, copy or paste action */ private void copyNCut(final MapControl mapControl, final Mode mode) { - final Point startp = mapControl.getMapView().getHighlightStart(); // start of highlighted rect - final Point offset = mapControl.getMapView().getHighlightOffset(); // offset of rect from startp + final Point startp = mapControl.getMapViewFrame().getHighlightStart(); // start of highlighted rect + final Point offset = mapControl.getMapViewFrame().getHighlightOffset(); // offset of rect from startp - if (!mapControl.getMapView().isHighlight()) { // should actually never happen + if (!mapControl.getMapViewFrame().isHighlight()) { // should actually never happen return; } @@ -228,9 +228,9 @@ * @param mapControl MapControl of the active map we paste on */ public void paste(final MapControl mapControl) { - final Point startp = mapControl.getMapView().getHighlightStart(); // start of highlighted rect + final Point startp = mapControl.getMapViewFrame().getHighlightStart(); // start of highlighted rect - if (!mapControl.getMapView().isHighlight()) { // should actually never happen + if (!mapControl.getMapViewFrame().isHighlight()) { // should actually never happen return; } @@ -286,11 +286,11 @@ * @todo the fill density is ignored for floodfill */ public void fill(final MapControl mapControl, final boolean fillBelow, final int density) { - final Point startp = mapControl.getMapView().getHighlightStart(); // start of highlighted rect - final Point offset = mapControl.getMapView().getHighlightOffset(); // offset of rect from startp + final Point startp = mapControl.getMapViewFrame().getHighlightStart(); // start of highlighted rect + final Point offset = mapControl.getMapViewFrame().getHighlightOffset(); // offset of rect from startp final Point pos = new Point(); - if (!mapControl.getMapView().isHighlight()) { // should actually never happen + if (!mapControl.getMapViewFrame().isHighlight()) { // should actually never happen return; } Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 16:01:04 UTC (rev 701) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 16:06:35 UTC (rev 702) @@ -138,7 +138,7 @@ line1.add(labelon); line1.add(Box.createVerticalStrut(3)); replaceEntireBox = new JComboBox(new String[]{ACTION_FACTORY.getString("replaceOnMap"), ACTION_FACTORY.getString("replaceOnSelection")}); - if (mapControl.getMapView().isHighlight()) { + if (mapControl.getMapViewFrame().isHighlight()) { replaceEntireBox.setSelectedIndex(1); } else { replaceEntireBox.setSelectedIndex(0); @@ -223,7 +223,7 @@ colonLabel.setText(":"); } - if (mapControl.getMapView().isHighlight()) { + if (mapControl.getMapViewFrame().isHighlight()) { replaceEntireBox.setSelectedIndex(1); // selected squares } else { replaceEntireBox.setSelectedIndex(0); // entire map @@ -289,8 +289,8 @@ final Size2D mapSize = mapControl.getMapSize(); offset = new Point(mapSize.getWidth() - 1, mapSize.getHeight() - 1); } else { - startp = mapControl.getMapView().getHighlightStart(); // start of highlighted rect - offset = mapControl.getMapView().getHighlightOffset(); // offset of rect from startp + startp = mapControl.getMapViewFrame().getHighlightStart(); // start of highlighted rect + offset = mapControl.getMapViewFrame().getHighlightOffset(); // offset of rect from startp } // convert negative 'offset' into positive by flipping 'startp' @@ -400,7 +400,7 @@ if (mapControl == null || mapControl.isClosing()) { setVisible(false); ACTION_FACTORY.showMessageDialog(this, "replaceMapGone", mapControl.getMapFileName()); - } else if (!entireMap && !mapControl.getMapView().isHighlight()) { + } else if (!entireMap && !mapControl.getMapViewFrame().isHighlight()) { // user selected "replace highlighted" but nothing is highlighted ACTION_FACTORY.showMessageDialog(this, "replaceMapNoSelection", mapControl.getMapFileName()); } else { Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-11-26 16:01:04 UTC (rev 701) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-11-26 16:06:35 UTC (rev 702) @@ -79,7 +79,7 @@ * @return the position to show */ @Nullable public Point getMouseRightPos() { - final Point pos = mapControl.getMapView().getMapMouseRightPos(); + final Point pos = mapControl.getMapViewFrame().getMapMouseRightPos(); if (pos.x == -1 || pos.y == -1 || !isPointValid(pos)) { return null; @@ -121,8 +121,8 @@ // change status and update title bar levelChanged = false; - if (mapControl.getMapView() != null) { - mapControl.getMapView().changedFlagNotify(); + if (mapControl.getMapViewFrame() != null) { + mapControl.getMapViewFrame().changedFlagNotify(); } } @@ -136,8 +136,8 @@ // change status and update title bar levelChanged = true; - if (mapControl.getMapView() != null) { - mapControl.getMapView().changedFlagNotify(); + if (mapControl.getMapViewFrame() != null) { + mapControl.getMapViewFrame().changedFlagNotify(); } // enable menu file->revert to revert the map @@ -587,7 +587,7 @@ * @return GameObject exit-arch if existent, otherwise null */ @Nullable public GameObject getExit() { - final Point hspot = mapControl.getMapView().getHighlightStart(); // selected spot + final Point hspot = mapControl.getMapViewFrame().getHighlightStart(); // selected spot if (!isPointValid(hspot)) { return null; // out of map @@ -622,12 +622,12 @@ super.resizeMap(newSize); // an important last point: if there is a highlighted area in a region // that got cut off - unhilight it! - final int mposx = mapControl.getMapView().getHighlightStart().x; - final int mposy = mapControl.getMapView().getHighlightStart().y; + final int mposx = mapControl.getMapViewFrame().getHighlightStart().x; + final int mposy = mapControl.getMapViewFrame().getHighlightStart().y; if (!isPointValid(mposx, mposy) || - !isPointValid(mposx + mapControl.getMapView().getHighlightOffset().x, - mposy + mapControl.getMapView().getHighlightOffset().y)) { - mapControl.getMapView().unHighlight(); + !isPointValid(mposx + mapControl.getMapViewFrame().getHighlightOffset().x, + mposy + mapControl.getMapViewFrame().getHighlightOffset().y)) { + mapControl.getMapViewFrame().unHighlight(); } setLevelChangedFlag(); // the map changed for sure! Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2006-11-26 16:01:04 UTC (rev 701) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2006-11-26 16:06:35 UTC (rev 702) @@ -57,7 +57,7 @@ /** * Main view of this map. */ - private final MapViewIFrame mapView; + private final MapViewIFrame mapViewFrame; private File mapFile; @@ -108,7 +108,7 @@ // we create model (= data) mapModel = new DefaultMapModel(mainControl, this, objects, maparch); // and create a view (= window) - mapView = new MapViewIFrame(mainControl, this, initial); + mapViewFrame = new MapViewIFrame(mainControl, this, initial); } /** {@inheritDoc} */ @@ -307,14 +307,14 @@ * Repaints the view. */ public void repaint() { - mapView.modelChanged(); + mapViewFrame.modelChanged(); } /** * Notifies the view that data has changed in the model. */ void notifyViews() { - mapView.refreshDataFromModel(); + mapViewFrame.refreshDataFromModel(); } /** @@ -330,7 +330,7 @@ * @return the current view position */ public Point getViewPosition() { - return mapView.getViewPosition(); + return mapViewFrame.getViewPosition(); } /** @@ -437,7 +437,7 @@ } public void setMapFileName(final String fname) { - mapView.setTitle("Map [" + fname + "]"); + mapViewFrame.setTitle("Map [" + fname + "]"); mapModel.setFileName(fname); } @@ -465,7 +465,7 @@ assert mapFile != null; mainControl.encodeMapFile(mapFile, mapModel); mapModel.resetLevelChangedFlag(); - mapView.changedFlagNotify(); + mapViewFrame.changedFlagNotify(); } /** @@ -476,7 +476,7 @@ CMainStatusbar.getInstance().setText("Saving the map to a file..."); mainControl.encodeMapFile(file, mapModel); mapModel.resetLevelChangedFlag(); - mapView.changedFlagNotify(); + mapViewFrame.changedFlagNotify(); } public void setMapFile(final File file) { @@ -487,8 +487,8 @@ return mapModel; } - public MapViewIFrame getMapView() { - return mapView; + public MapViewIFrame getMapViewFrame() { + return mapViewFrame; } public MapArchObject getMapArch() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 16:01:10
|
Revision: 701 http://svn.sourceforge.net/gridarta/?rev=701&view=rev Author: akirschbaum Date: 2006-11-26 08:01:04 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify initialization code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/daimonin/src/daieditor/ReplaceDialog.java Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 15:27:51 UTC (rev 700) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 16:01:04 UTC (rev 701) @@ -72,15 +72,15 @@ private final CMainControl mainControl; - private boolean isBuilt; + private boolean isBuilt = false; private MapControl mapControl; - private GameObject replaceArch; // objects will be replaced by this arch + private GameObject replaceArch = null; // objects will be replaced by this arch private JLabel rfHeading; - private JLabel rfArchName; + private JLabel rfArchName = null; private JLabel iconLabel; @@ -105,9 +105,6 @@ dialog.setModal(false); dialog.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); this.mainControl = mainControl; - isBuilt = false; - rfArchName = null; - replaceArch = null; } /** @return true when this frame has been fully built */ Modified: trunk/daimonin/src/daieditor/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 15:27:51 UTC (rev 700) +++ trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 16:01:04 UTC (rev 701) @@ -73,11 +73,11 @@ private final CMainControl mainControl; - private boolean isBuilt; + private boolean isBuilt = false; private MapControl mapControl; - private GameObject replaceArch; // objects will be replaced by this arch + private GameObject replaceArch = null; // objects will be replaced by this arch private List<GameObject> replaceCopyBuffer; // objects in CopyBuffer @@ -85,7 +85,7 @@ private JLabel rfHeading; - private JLabel rfArchName; + private JLabel rfArchName = null; private JLabel iconLabel; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 15:27:52
|
Revision: 700 http://svn.sourceforge.net/gridarta/?rev=700&view=rev Author: akirschbaum Date: 2006-11-26 07:27:51 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Remove static import statements; fix comment typos. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/daimonin/src/daieditor/CArchPanelPan.java trunk/daimonin/src/daieditor/CAttribDialog.java trunk/daimonin/src/daieditor/CFArchType.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/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/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/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 trunk/src/app/net/sf/gridarta/gameobject/NamedObjects.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-26 15:27:51 UTC (rev 700) @@ -60,7 +60,6 @@ import net.sf.gridarta.gui.HideFileFilterProxy; import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.util.filter.file.EndingFileFilter; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -73,8 +72,8 @@ */ public final class CMainControl implements MainControl { - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("cfeditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); /** Logger. */ private static final Logger log = Logger.getLogger(CMainControl.class); Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 15:27:51 UTC (rev 700) @@ -46,7 +46,6 @@ import javax.swing.WindowConstants; import net.sf.gridarta.Size2D; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; /** * This dialog manages the replace action. @@ -57,8 +56,8 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("cfeditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); // matching criteria public static final int MATCH_ARCH_NAME = 0; Modified: trunk/daimonin/src/daieditor/CArchPanelPan.java =================================================================== --- trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-11-26 15:27:51 UTC (rev 700) @@ -46,7 +46,6 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -58,8 +57,8 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Controller of this subview. */ private final CMainControl mainControl; Modified: trunk/daimonin/src/daieditor/CAttribDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CAttribDialog.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CAttribDialog.java 2006-11-26 15:27:51 UTC (rev 700) @@ -97,7 +97,6 @@ import net.sf.gridarta.gameobject.NamedObjects; import net.sf.gridarta.help.Help; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import static net.sf.japi.util.Arrays2.linearSearch; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -116,7 +115,7 @@ private static final long serialVersionUID = 1L; /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.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 Modified: trunk/daimonin/src/daieditor/CFArchType.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchType.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CFArchType.java 2006-11-26 15:27:51 UTC (rev 700) @@ -29,7 +29,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import static net.sf.japi.swing.ActionFactory.getFactory; +import net.sf.japi.swing.ActionFactory; import net.sf.japi.xml.NodeListIterator; import static net.sf.japi.xml.NodeListIterator.getFirstChild; import org.apache.log4j.Logger; @@ -397,7 +397,7 @@ * @return the full html-text to be (parsed and) displayed */ public String createHtmlDocu() { - return getFactory("daieditor").format("arcDoc.htmlText", typeName, desc != null ? desc.trim() : "", use != null ? use.trim() : ""); + return ActionFactory.getFactory("daieditor").format("arcDoc.htmlText", typeName, desc != null ? desc.trim() : "", use != null ? use.trim() : ""); } public CFArchAttrib[] getAttr() { Modified: trunk/daimonin/src/daieditor/CFJavaEditor.java =================================================================== --- trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-11-26 15:27:51 UTC (rev 700) @@ -33,7 +33,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import static java.util.prefs.Preferences.userNodeForPackage; -import static net.sf.japi.swing.ActionFactory.getFactory; +import net.sf.japi.swing.ActionFactory; /** * Main class, launches the level editor application. @@ -64,7 +64,7 @@ Locale.setDefault(new Locale(locName)); } // Now add prefs to the ActionFactory. - getFactory("daieditor").addPref(CMainControl.class); + ActionFactory.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-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-11-26 15:27:51 UTC (rev 700) @@ -120,7 +120,6 @@ import net.sf.gridarta.map.MapType; import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.ActionMethod; import net.sf.japi.swing.TipOfTheDayManager; import net.sf.japi.swing.prefs.PreferencesGroup; @@ -141,8 +140,8 @@ */ public final class CMainControl implements ThrowableHandler, MapModelListener, MainControl { - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Logger. */ private static final Logger log = Logger.getLogger("daieditor"); Modified: trunk/daimonin/src/daieditor/CMainStatusbar.java =================================================================== --- trunk/daimonin/src/daieditor/CMainStatusbar.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CMainStatusbar.java 2006-11-26 15:27:51 UTC (rev 700) @@ -40,7 +40,6 @@ import net.sf.gridarta.gui.map.MapCursorEvent; import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; /** @@ -59,8 +58,8 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** The ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Controller of this statusbar view. */ private final CMainControl mainControl; Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-11-26 15:27:51 UTC (rev 700) @@ -61,7 +61,6 @@ import net.sf.gridarta.gui.GSplitPane; import net.sf.gridarta.help.Help; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.util.ThrowableHandler; import org.jetbrains.annotations.Nullable; @@ -76,7 +75,7 @@ public final class CMainView extends JFrame implements ErrorHandler, InternalFrameListener, ThrowableHandler, WindowListener { /** Action Factory to create Actions. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Serial Version UID. */ private static final long serialVersionUID = 1L; Modified: trunk/daimonin/src/daieditor/CMapArchPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CMapArchPanel.java 2006-11-26 15:27:51 UTC (rev 700) @@ -69,7 +69,6 @@ import javax.swing.text.StyleContext; import net.sf.gridarta.gui.GSplitPane; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.ActionMethod; /** @@ -84,8 +83,8 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** The ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); // constants for the 'task' parameter in editScriptWanted() public static final int SCRIPT_OPEN = 0; Modified: trunk/daimonin/src/daieditor/CMapTileList.java =================================================================== --- trunk/daimonin/src/daieditor/CMapTileList.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CMapTileList.java 2006-11-26 15:27:51 UTC (rev 700) @@ -55,7 +55,6 @@ import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.ActionMethod; import org.jetbrains.annotations.NotNull; @@ -71,8 +70,8 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Controller of this subview. */ private final CMainControl mainControl; Modified: trunk/daimonin/src/daieditor/CNewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-11-26 15:27:51 UTC (rev 700) @@ -51,7 +51,6 @@ import net.sf.gridarta.Size2D; import net.sf.gridarta.map.MapType; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; /** * Dialog used to ask the user the properties for the new level. Contains a @@ -66,8 +65,8 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** * Whether to use the default map size. Modified: trunk/daimonin/src/daieditor/CPickmapPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-11-26 15:27:51 UTC (rev 700) @@ -37,7 +37,6 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import org.apache.log4j.Logger; /** @@ -49,8 +48,8 @@ private static final Logger log = Logger.getLogger(CPickmapPanel.class); - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** static instance of this class */ private static CPickmapPanel instance; Modified: trunk/daimonin/src/daieditor/CPreview.java =================================================================== --- trunk/daimonin/src/daieditor/CPreview.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/CPreview.java 2006-11-26 15:27:51 UTC (rev 700) @@ -45,7 +45,6 @@ import javax.swing.JScrollPane; import static javax.swing.WindowConstants.DISPOSE_ON_CLOSE; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.ActionMethod; /** @@ -62,7 +61,7 @@ private static final long serialVersionUID = 1L; /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Original image. */ private final Image original; Modified: trunk/daimonin/src/daieditor/ProcessRunner.java =================================================================== --- trunk/daimonin/src/daieditor/ProcessRunner.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/ProcessRunner.java 2006-11-26 15:27:51 UTC (rev 700) @@ -45,7 +45,6 @@ import javax.swing.JToolBar; import javax.swing.SwingUtilities; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; /** * Class to run an external process. @@ -57,7 +56,7 @@ private static final long serialVersionUID = 1L; /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** * The Dialog. Modified: trunk/daimonin/src/daieditor/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 15:27:51 UTC (rev 700) @@ -46,7 +46,6 @@ import javax.swing.WindowConstants; import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; /** * This dialog manages the replace action. @@ -58,8 +57,8 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); // matching criteria public static final int MATCH_ARCH_NAME = 0; Modified: trunk/daimonin/src/daieditor/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/ScriptArchData.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/ScriptArchData.java 2006-11-26 15:27:51 UTC (rev 700) @@ -50,7 +50,6 @@ import static javax.swing.WindowConstants.HIDE_ON_CLOSE; import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.util.Arrays2; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -69,8 +68,8 @@ /** Serial Version. */ private static final long serialVersionUID = 1L; - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); // popup frame to edit script paths: private static JDialog pathFrame; Modified: trunk/daimonin/src/daieditor/Spells.java =================================================================== --- trunk/daimonin/src/daieditor/Spells.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/Spells.java 2006-11-26 15:27:51 UTC (rev 700) @@ -41,7 +41,6 @@ import javax.xml.parsers.DocumentBuilder; import net.sf.gridarta.io.IOUtils; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.util.filter.file.FilenameFileFilter; import net.sf.japi.xml.NodeListIterator; import org.w3c.dom.Document; @@ -55,8 +54,8 @@ */ public final class Spells { - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); private String[] spellNames; // array of spell names (these all begin with a ' ' space!) Modified: trunk/daimonin/src/daieditor/Updater.java =================================================================== --- trunk/daimonin/src/daieditor/Updater.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/Updater.java 2006-11-26 15:27:51 UTC (rev 700) @@ -46,7 +46,6 @@ import javax.swing.ProgressMonitor; import javax.swing.ProgressMonitorInputStream; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; /** * This class handles updating the map editor. @@ -57,8 +56,8 @@ */ public final class Updater implements Runnable { - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Logger. */ private static final Logger log = Logger.getLogger("daieditor"); Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2006-11-26 15:27:51 UTC (rev 700) @@ -53,7 +53,6 @@ import net.sf.gridarta.gameobject.anim.DuplicateAnimationException; import net.sf.gridarta.io.IOUtils; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.Progress; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; @@ -69,7 +68,7 @@ private static final Logger log = Logger.getLogger(ArchetypeSet.class); /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); private final CMainControl mainControl; Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2006-11-26 15:27:51 UTC (rev 700) @@ -42,7 +42,6 @@ import java.util.logging.Logger; import net.sf.gridarta.gameobject.face.AbstractFaceObjects; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.Progress; import org.jetbrains.annotations.NotNull; @@ -122,7 +121,7 @@ try { treeIn = new BufferedReader(new InputStreamReader(new FileInputStream(treeFile), "us-ascii")); } catch (final FileNotFoundException e) { - getFactory("daieditor").showMessageDialog(CMainControl.getInstance().getMainView(), "errCantLoadFaceTree"); + ActionFactory.getFactory("daieditor").showMessageDialog(CMainControl.getInstance().getMainView(), "errCantLoadFaceTree"); } final byte[] tag = "IMAGE ".getBytes(); // this is the starting string for a new png final StringBuilder faceB = new StringBuilder(); // face name of png Modified: trunk/daimonin/src/daieditor/gui/AboutDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/AboutDialog.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/AboutDialog.java 2006-11-26 15:27:51 UTC (rev 700) @@ -21,7 +21,6 @@ import javax.swing.JTabbedPane; import javax.swing.JTextArea; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; /** * TODO Refactor to use less memory @@ -32,7 +31,7 @@ public class AboutDialog extends JPanel { /** Action Factory to create Actions. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Create an AboutDialog. */ public AboutDialog() { Modified: trunk/daimonin/src/daieditor/gui/MapFileFilter.java =================================================================== --- trunk/daimonin/src/daieditor/gui/MapFileFilter.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/MapFileFilter.java 2006-11-26 15:27:51 UTC (rev 700) @@ -28,7 +28,7 @@ import java.util.Map; import java.util.WeakHashMap; import java.util.prefs.Preferences; -import static net.sf.japi.swing.ActionFactory.getFactory; +import net.sf.japi.swing.ActionFactory; import net.sf.japi.util.filter.file.EndingFileFilter; /** @@ -56,7 +56,7 @@ /** Create a MapFileFilter. */ private MapFileFilter() { - super(true, true, getFactory("daieditor").getString("fileDialog.filter.maps"), new String[]{".lua", ".py", ".txt", ".text"}); + super(true, true, ActionFactory.getFactory("daieditor").getString("fileDialog.filter.maps"), new String[]{".lua", ".py", ".txt", ".text"}); } /** Modified: trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java 2006-11-26 15:27:51 UTC (rev 700) @@ -50,7 +50,6 @@ import javax.swing.SwingConstants; import javax.swing.filechooser.FileView; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.ToggleAction; import org.jetbrains.annotations.Nullable; @@ -60,8 +59,8 @@ */ public class MapPreviewAccessory extends JComponent implements PropertyChangeListener { - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences prefs = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-11-26 15:27:51 UTC (rev 700) @@ -57,7 +57,6 @@ import net.sf.gridarta.Size2D; import net.sf.gridarta.help.Help; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.JFileChooserButton; /** @@ -71,8 +70,8 @@ /** Serial version UID. */ private static final long serialVersionUID = 1L; - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); private final CMainControl mainControl; Modified: trunk/daimonin/src/daieditor/gui/map/MapTilePane.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2006-11-26 15:27:51 UTC (rev 700) @@ -60,7 +60,6 @@ import net.sf.gridarta.Size2D; import net.sf.gridarta.io.IOUtils; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; /** @@ -75,8 +74,8 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - /** ActionFactory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** The mainControl to use. */ private final CMainControl mainControl; Modified: trunk/daimonin/src/daieditor/gui/prefs/AppPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/AppPrefs.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/prefs/AppPrefs.java 2006-11-26 15:27:51 UTC (rev 700) @@ -46,7 +46,6 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.JFileChooserButton; import net.sf.japi.swing.prefs.AbstractPrefs; @@ -57,8 +56,8 @@ */ public final class AppPrefs extends AbstractPrefs { - /** Action Facotry. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences PREFS = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java 2006-11-26 15:27:51 UTC (rev 700) @@ -36,7 +36,6 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.prefs.AbstractPrefs; /** @@ -46,8 +45,8 @@ */ public final class DevPrefs extends AbstractPrefs { - /** Action Facotry. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences PREFS = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java 2006-11-26 15:27:51 UTC (rev 700) @@ -43,7 +43,6 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.LocaleComparator; import net.sf.japi.swing.LocaleListCellRenderer; import net.sf.japi.swing.prefs.AbstractPrefs; @@ -55,8 +54,8 @@ */ public final class GUIPrefs extends AbstractPrefs { - /** Action Facotry. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences PREFS = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java 2006-11-26 15:27:51 UTC (rev 700) @@ -40,7 +40,6 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.prefs.AbstractPrefs; /** @@ -50,8 +49,8 @@ */ public final class MapValidatorPrefs extends AbstractPrefs { - /** Action Facotry. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences PREFS = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/gui/prefs/MiscPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/MiscPrefs.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/prefs/MiscPrefs.java 2006-11-26 15:27:51 UTC (rev 700) @@ -38,7 +38,6 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.prefs.AbstractPrefs; /** @@ -48,8 +47,8 @@ */ public final class MiscPrefs extends AbstractPrefs { - /** Action Facotry. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences PREFS = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java 2006-11-26 15:27:51 UTC (rev 700) @@ -43,7 +43,6 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.prefs.AbstractPrefs; /** @@ -62,8 +61,8 @@ /** The preferences key for the type. */ private static final String NET_PREFS_KEY_PORT = "daieditor.proxy.port"; - /** Action Facotry. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences PREFS = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java 2006-11-26 15:27:51 UTC (rev 700) @@ -43,7 +43,6 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.JFileChooserButton; import net.sf.japi.swing.prefs.AbstractPrefs; @@ -54,8 +53,8 @@ */ public final class ResPrefs extends AbstractPrefs { - /** Action Facotry. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences PREFS = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/gui/prefs/UpdatePrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/UpdatePrefs.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/gui/prefs/UpdatePrefs.java 2006-11-26 15:27:51 UTC (rev 700) @@ -36,7 +36,6 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.TitledBorder; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import net.sf.japi.swing.prefs.AbstractPrefs; /** @@ -46,8 +45,8 @@ */ public final class UpdatePrefs extends AbstractPrefs { - /** Action Facotry. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Preferences. */ private static final Preferences PREFS = userNodeForPackage(CMainControl.class); Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-11-26 15:27:51 UTC (rev 700) @@ -36,7 +36,6 @@ import net.sf.gridarta.map.AbstractMapModel; import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; /** @@ -56,7 +55,7 @@ public final class DefaultMapModel extends AbstractMapModel<GameObject, MapArchObject> implements MapModel { /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** * The CMainControl used for various operations. Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2006-11-26 15:27:51 UTC (rev 700) @@ -52,7 +52,6 @@ import net.sf.gridarta.map.MapModelListener; import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; /** @@ -88,9 +87,9 @@ private File mapFile; /** - * ActionFactory. + * Action Factory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** * Reference to SimpleLevelRenderer, which is only used to get images. Modified: trunk/daimonin/src/daieditor/map/validation/AbstractValidator.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/AbstractValidator.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/map/validation/AbstractValidator.java 2006-11-26 15:27:51 UTC (rev 700) @@ -24,7 +24,7 @@ import daieditor.CMainControl; import java.util.prefs.Preferences; import static java.util.prefs.Preferences.userNodeForPackage; -import static net.sf.japi.swing.ActionFactory.getFactory; +import net.sf.japi.swing.ActionFactory; /** * This is the base class for validators. @@ -57,7 +57,7 @@ } key = "Validator." + name.substring(0, name.indexOf("Checker")); enabled = prefs.getBoolean(key, false); - final String defaultEnabledString = getFactory("daieditor").getString(key + ".default"); + final String defaultEnabledString = ActionFactory.getFactory("daieditor").getString(key + ".default"); defaultEnabled = Boolean.parseBoolean(defaultEnabledString); } @@ -68,7 +68,7 @@ protected AbstractValidator(final String key) { this.key = key; enabled = prefs.getBoolean(key, false); - final String defaultEnabledString = getFactory("daieditor").getString(key + ".default"); + final String defaultEnabledString = ActionFactory.getFactory("daieditor").getString(key + ".default"); defaultEnabled = Boolean.parseBoolean(defaultEnabledString); } Modified: trunk/daimonin/src/daieditor/map/validation/ValidationError.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/ValidationError.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/daimonin/src/daieditor/map/validation/ValidationError.java 2006-11-26 15:27:51 UTC (rev 700) @@ -28,7 +28,6 @@ import net.sf.gridarta.map.MapModel; import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; /** @@ -39,7 +38,7 @@ public abstract class ValidationError { /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("daieditor"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Key. */ private final String key; Modified: trunk/src/app/net/sf/gridarta/gameobject/NamedObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/NamedObjects.java 2006-11-26 15:07:58 UTC (rev 699) +++ trunk/src/app/net/sf/gridarta/gameobject/NamedObjects.java 2006-11-26 15:27:51 UTC (rev 700) @@ -37,7 +37,6 @@ import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreePath; import net.sf.japi.swing.ActionFactory; -import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; @@ -50,7 +49,7 @@ public abstract class NamedObjects<T extends NamedObject> implements Iterable<T> { /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = getFactory("net.sf.gridarta"); + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.gridarta"); /** The localized name of the object type, e.g. used in dialogs. */ private final String name; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 15:07:59
|
Revision: 699 http://svn.sourceforge.net/gridarta/?rev=699&view=rev Author: akirschbaum Date: 2006-11-26 07:07:58 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Use ActionFactory to create GUI elements in ReplaceDialog. Modified Paths: -------------- trunk/crossfire/build.xml trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/crossfire/src/cfeditor/messages.properties Added Paths: ----------- trunk/crossfire/src/cfeditor/messages_de.properties trunk/crossfire/src/cfeditor/messages_fr.properties trunk/crossfire/src/cfeditor/messages_sv.properties Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2006-11-26 15:01:09 UTC (rev 698) +++ trunk/crossfire/build.xml 2006-11-26 15:07:58 UTC (rev 699) @@ -94,6 +94,7 @@ <unjar src="${lib.dir}/bsh-classgen.jar" dest="${build.dir}" /> <unjar src="${lib.dir}/bsh-util.jar" dest="${build.dir}" /> <unjar src="${lib.dir}/log4j.jar" dest="${build.dir}" /> + <unjar src="../lib/japi.jar" dest="${build.dir}" /> <delete dir="${build.dir}/META-INF" /> <!-- copy the resource files into the build dir --> Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 15:01:09 UTC (rev 698) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 15:07:58 UTC (rev 699) @@ -28,8 +28,6 @@ import cfeditor.map.MapControl; import java.awt.FlowLayout; import java.awt.Point; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.ArrayList; @@ -47,6 +45,8 @@ import javax.swing.JTextField; import javax.swing.WindowConstants; import net.sf.gridarta.Size2D; +import net.sf.japi.swing.ActionFactory; +import static net.sf.japi.swing.ActionFactory.getFactory; /** * This dialog manages the replace action. @@ -57,6 +57,9 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; + /** ActionFactory. */ + private static final ActionFactory ACTION_FACTORY = getFactory("cfeditor"); + // matching criteria public static final int MATCH_ARCH_NAME = 0; @@ -92,14 +95,14 @@ private JTextField replaceInput1; - private OkButtonAL okButtonListener; + private int lastSelectedIndex; /** * Construct instance. * @param mainControl MainControl */ private ReplaceDialog(final CMainControl mainControl) { - dialog = createDialog(mainControl.getMainView(), "Replace"); + dialog = createDialog(mainControl.getMainView(), ACTION_FACTORY.getString("replaceTitle")); dialog.setModal(false); dialog.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); this.mainControl = mainControl; @@ -135,10 +138,10 @@ // first line: heading final JPanel line1 = new JPanel(new FlowLayout(FlowLayout.LEFT)); - final JLabel labelon = new JLabel("On"); + final JLabel labelon = new JLabel(ACTION_FACTORY.getString("replaceOn")); line1.add(labelon); line1.add(Box.createVerticalStrut(3)); - replaceEntireBox = new JComboBox(new String[]{"entire map", "selected squares of"}); + replaceEntireBox = new JComboBox(new String[]{ACTION_FACTORY.getString("replaceOnMap"), ACTION_FACTORY.getString("replaceOnSelection")}); if (mapControl.getMapView().isHighlight()) { replaceEntireBox.setSelectedIndex(1); } else { @@ -152,7 +155,7 @@ // second line: replace what? final JPanel line2 = new JPanel(new FlowLayout(FlowLayout.LEFT)); - final JLabel label1 = new JLabel("delete objects with"); + final JLabel label1 = new JLabel(ACTION_FACTORY.getString("replaceDelete")); line2.add(label1); line2.add(Box.createVerticalStrut(5)); @@ -167,16 +170,18 @@ // third line: replace by? final JPanel line3 = new JPanel(new FlowLayout(FlowLayout.LEFT)); - final JLabel label2 = new JLabel("and replace by"); + final JLabel label2 = new JLabel(ACTION_FACTORY.getString("replaceBy")); line3.add(label2); line3.add(Box.createVerticalStrut(5)); - replaceWithBox = new JComboBox(new String[]{"object", "nothing"}); + replaceWithBox = new JComboBox(new String[]{ACTION_FACTORY.getString("replaceByObject"), + ACTION_FACTORY.getString("replaceByNothing")}); if (replaceArch == null) { replaceWithBox.setSelectedIndex(1); } else { replaceWithBox.setSelectedIndex(0); } replaceWithBox.addItemListener(new ReplaceWithBoxItemListener()); + lastSelectedIndex = replaceWithBox.getSelectedIndex(); line3.add(replaceWithBox); iconLabel = new JLabel(); @@ -194,18 +199,9 @@ line3.add(rfArchName); mainPanel.add(line3); - // button panel: - final JButton okButton = new JButton("OK"); - okButtonListener = new OkButtonAL(); - okButton.addActionListener(okButtonListener); + final JButton okButton = new JButton(ACTION_FACTORY.createAction(false, "replaceOk", this)); + final JButton cancelButton = new JButton(ACTION_FACTORY.createAction(false, "replaceCancel", this)); - final JButton cancelButton = new JButton("Cancel"); - cancelButton.addActionListener(new ActionListener() { - public void actionPerformed(final ActionEvent event) { - setVisible(false); - } - }); - setMessage(mainPanel); setOptions(new Object[]{okButton, cancelButton}); dialog.getRootPane().setDefaultButton(okButton); @@ -371,77 +367,76 @@ /** Item-listener for the "replace with"-selection box. */ private class ReplaceWithBoxItemListener implements ItemListener { - private int lastSelectedIndex; - - /** - * Constructor. - */ - ReplaceWithBoxItemListener() { - lastSelectedIndex = replaceWithBox.getSelectedIndex(); - } - - /** - * A (new) type has been selected in the box. - * @param event the occured <code>ItemEvent</code> (button pressed) - */ + /** {@inheritDoc} */ public void itemStateChanged(final ItemEvent event) { - if (event.getStateChange() == ItemEvent.SELECTED && lastSelectedIndex != replaceWithBox.getSelectedIndex()) { - if (replaceWithBox.getSelectedIndex() == 0) { + final int selectedIndex = replaceWithBox.getSelectedIndex(); + if (event.getStateChange() == ItemEvent.SELECTED && lastSelectedIndex != selectedIndex) { + switch (selectedIndex) { + case 0: // replace with arch replaceArch = mainControl.getArchPanelSelection(); // selected arch updateArchSelection(replaceArch, true); - } else if (replaceWithBox.getSelectedIndex() == 1) { + break; + + case 1: // replace with nothing iconLabel.setIcon(null); rfArchName.setText(""); colonLabel.setText(""); dialog.pack(); + break; } - lastSelectedIndex = replaceWithBox.getSelectedIndex(); + lastSelectedIndex = selectedIndex; } } } // class ReplaceWithBoxItemListener - /** Listener class for the ok-button of the replace dialog. */ - public final class OkButtonAL implements ActionListener { + /** + * Action method for Ok button. + * @used + */ + public void replaceOk() { + final String matchString = replaceInput1.getText().trim(); + final boolean deleteOnly = replaceWithBox.getSelectedIndex() == 1; + final boolean entireMap = replaceEntireBox.getSelectedIndex() == 0; - public void actionPerformed(final ActionEvent event) { - final String matchString = replaceInput1.getText().trim(); - final boolean deleteOnly = replaceWithBox.getSelectedIndex() == 1; - final boolean entireMap = replaceEntireBox.getSelectedIndex() == 0; - - if (mapControl == null || mapControl.isClosing()) { - setVisible(false); - mainControl.showMessage("Replace", "Map \"" + mapControl.getMapFileName() + "\" is no longer available.\n", JOptionPane.ERROR_MESSAGE); - } else if (!entireMap && !mapControl.getMapView().isHighlight()) { - // user selected "replace highlighted" but nothing is highlighted - mainControl.showMessage("Replace", "You chose to replace on selected squares of\n" + - "map \"" + mapControl.getMapFileName() + "\", but there is no selected area.", JOptionPane.ERROR_MESSAGE); + if (mapControl == null || mapControl.isClosing()) { + setVisible(false); + ACTION_FACTORY.showMessageDialog(this, "replaceMapGone", mapControl.getMapFileName()); + } else if (!entireMap && !mapControl.getMapView().isHighlight()) { + // user selected "replace highlighted" but nothing is highlighted + ACTION_FACTORY.showMessageDialog(this, "replaceMapNoSelection", mapControl.getMapFileName()); + } else { + final int matchCriteria; + if (replaceCriteria.getSelectedIndex() == 0) { + matchCriteria = MATCH_ARCH_NAME; + } else if (replaceCriteria.getSelectedIndex() == 1) { + matchCriteria = MATCH_OBJ_NAME; } else { - final int matchCriteria; - if (replaceCriteria.getSelectedIndex() == 0) { - matchCriteria = MATCH_ARCH_NAME; - } else if (replaceCriteria.getSelectedIndex() == 1) { - matchCriteria = MATCH_OBJ_NAME; - } else { - matchCriteria = 0; - } + matchCriteria = 0; + } - final int replaceCount = doReplace(matchCriteria, matchString, entireMap, deleteOnly); - if (replaceCount > 0) { - dialog.setVisible(false); - if (replaceCount == 1) { - mainControl.showMessage("Replace", "1 object has been replaced."); - } else { - mainControl.showMessage("Replace", replaceCount + " objects have been replaced."); - } + final int replaceCount = doReplace(matchCriteria, matchString, entireMap, deleteOnly); + if (replaceCount > 0) { + dialog.setVisible(false); + if (replaceCount == 1) { + ACTION_FACTORY.showMessageDialog(this, "replacedOne"); } else { - mainControl.showMessage("Replace", "No matching object found.", JOptionPane.ERROR_MESSAGE); + ACTION_FACTORY.showMessageDialog(this, "replacedMany", replaceCount); } + } else { + ACTION_FACTORY.showMessageDialog(this, "replacedZero"); } } + } - } // class OkButtonAL + /** + * Action method for Cancel button. + * @used + */ + public void replaceCancel() { + dialog.setVisible(false); + } } // class ReplaceDialog Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2006-11-26 15:01:09 UTC (rev 698) +++ trunk/crossfire/src/cfeditor/messages.properties 2006-11-26 15:07:58 UTC (rev 699) @@ -2,3 +2,27 @@ # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding fileDialog.filter.python=Python Scripts + +#replace +replaceTitle=Replace +replaceOn=On +replaceOnMap=entire map +replaceOnSelection=selected squares of +replaceDelete=delete objects with +replaceBy=and replace by +replaceByObject=object +replaceByNothing=nothing + +replaceMapGone.title=Error with Replace +replaceMapGone.message=Map {0} is no longer available.\n +replaceMapNoSelection.title=No selection +replaceMapNoSelection.message=You chose to replace on selected squares of\nmap "{0}", but there is no selected area. +replacedZero.title=Replace failed +replacedZero.message=No matching object found. +replacedOne.title=Replace successful +replacedOne.message=1 Object has been replaced. +replacedMany.title=Replace successful +replacedMany.message={0} Objects have been replaced. + +replaceOk.text=OK +replaceCancel.text=Cancel Added: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties (rev 0) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2006-11-26 15:07:58 UTC (rev 699) @@ -0,0 +1,21 @@ +# Warning: This file MUST be ISO-8859-1 +# See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding + +#replace +replaceTitle=Ersetze +replaceOn=In +replaceOnMap=der ganzen Karte +replaceOnSelection=der Auswahl auf +replaceDelete=l\xF6sche Objekte mit +replaceBy=und ersetze durch +replaceByObject=Objekt +replaceByNothing=nichts (=l\xF6schen) + +replaceMapGone=Karte {0} ist nicht mehr verf\xFCgbar.\n +replaceMapNoSelection=Ich kann ohne Selektion keine selektierten Felder\n auf der Karte "{0}" ersetzen. +replacedZero.title=Ersetzung fehlgeschlagen +replacedZero.message=Keine passenden Objekte gefunden. +replacedOne.title=Ersetzung erfolgreich +replacedOne.message=1 Objekt ersetzt. +replacedMany.title=Ersetzung erfolgreich +replacedMany.message={0} Objekte ersetzt. Property changes on: trunk/crossfire/src/cfeditor/messages_de.properties ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/crossfire/src/cfeditor/messages_fr.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_fr.properties (rev 0) +++ trunk/crossfire/src/cfeditor/messages_fr.properties 2006-11-26 15:07:58 UTC (rev 699) @@ -0,0 +1,19 @@ +# Warning: This file MUST be ISO-8859-1 +# See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding +# Translation done by Marmoth + +#replace +replaceTitle=Remplacer +replaceOn=Dans +replaceOnMap=toute la carte +replaceOnSelection=les cases s\xE9lectionn\xE9es +replaceDelete=delete objects with +replaceBy=et remplace par +replaceByObject=objet +replaceByNothing=rien + +replaceMapGone=La carte {0} n'est plus disponible.\n +replaceMapNoSelection=Vous avez choisi de remplacer les cases s\xE9lectionn\xE9es de la \ncarte \"{0}\", mais il n'y a pas de s\xE9lection. +replacedZero.message=Aucun objet correspondant trouv\xE9. +replacedOne.message=1 L'objet a \xE9t\xE9 remplac\xE9. +replacedMany.message={0} Les objets ont \xE9t\xE9 remplac\xE9s. Property changes on: trunk/crossfire/src/cfeditor/messages_fr.properties ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/crossfire/src/cfeditor/messages_sv.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_sv.properties (rev 0) +++ trunk/crossfire/src/cfeditor/messages_sv.properties 2006-11-26 15:07:58 UTC (rev 699) @@ -0,0 +1,26 @@ +# Warning: This file MUST be ISO-8859-1 +# See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding + +#replace +replaceTitle=Ers\xE4tt +replaceOn=P\xE5 +replaceOnMap=hela kartan +replaceOnSelection=markerade rutor p\xE5 +replaceDelete=radera objekt med +replaceBy=och ers\xE4tt med +replaceByObject=objekt +replaceByNothing=ingenting + +replaceMapGone.title=Fel under ers\xE4ttning +replaceMapGone.message=Kartan {0} is no longer available. +replaceMapNoSelection.title=Ingen markering +replaceMapNoSelection.message=Du valde att ers\xE4tta markerade rutor p\xE5 kartan \"{0}\",\n men det finns ingen markering. +replacedZero.title=Ers\xE4ttning misslyckades +replacedZero.message=Inga matchande objekt hittade. +replacedOne.title=Ers\xE4ttning lyckades +replacedOne.message=1 objekt har ersatts. +replacedMany.title=Ers\xE4ttning lyckades +replacedMany.message={0} objekt har ersatts. + +replaceOk.text=Ok +replaceCancel.text=Avbryt Property changes on: trunk/crossfire/src/cfeditor/messages_sv.properties ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 15:01:11
|
Revision: 698 http://svn.sourceforge.net/gridarta/?rev=698&view=rev Author: akirschbaum Date: 2006-11-26 07:01:09 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Use correct key names. Modified Paths: -------------- trunk/daimonin/src/daieditor/messages_de.properties trunk/daimonin/src/daieditor/messages_fr.properties Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2006-11-26 14:57:09 UTC (rev 697) +++ trunk/daimonin/src/daieditor/messages_de.properties 2006-11-26 15:01:09 UTC (rev 698) @@ -110,9 +110,12 @@ replaceMapGone=Karte {0} ist nicht mehr verf\xFCgbar.\n replaceMapNoSelection=Ich kann ohne Selektion keine selektierten Felder\n auf der Karte "{0}" ersetzen. -replacedZero=Keine passenden Objekte gefunden. -replacedOne=1 Objekt wurde ersetzt. -replacedMany={0} Objecte wurden ersetzt. +replacedZero.title=Ersetzung fehlgeschlagen +replacedZero.message=Keine passenden Objekte gefunden. +replacedOne.title=Ersetzung erfolgreich +replacedOne.message=1 Objekt ersetzt. +replacedMany.title=Ersetzung erfolgreich +replacedMany.message={0} Objekte ersetzt. # Options Modified: trunk/daimonin/src/daieditor/messages_fr.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_fr.properties 2006-11-26 14:57:09 UTC (rev 697) +++ trunk/daimonin/src/daieditor/messages_fr.properties 2006-11-26 15:01:09 UTC (rev 698) @@ -11,6 +11,7 @@ mapShrinkTitle=Confirm shrinking map mapShrinkText=Vous avez s\xE9lectionn\xE9 une carte de taille {0,number,integer} \xD7 {1,number,integer}. En modifiant la taille \nde la carte ainsi, certains objets seraient d\xE9truits.\\xCAtes-vous certain de le faire? +#replace replaceTitle=Remplacer replaceOn=Dans replaceOnMap=toute la carte @@ -22,9 +23,9 @@ replaceMapGone=La carte {0} n'est plus disponible.\n replaceMapNoSelection=Vous avez choisi de remplacer les cases s\xE9lectionn\xE9es de la \ncarte \"{0}\", mais il n'y a pas de s\xE9lection. -replacedZero=Aucun objet correspondant trouv\xE9. -replacedOne=1 L'objet a \xE9t\xE9 remplac\xE9. -replacedMany={0} Les objets ont \xE9t\xE9 remplac\xE9s. +replacedZero.message=Aucun objet correspondant trouv\xE9. +replacedOne.message=1 L'objet a \xE9t\xE9 remplac\xE9. +replacedMany.message={0} Les objets ont \xE9t\xE9 remplac\xE9s. arcDoc.htmlText=<html><head><meta name="CFJavaEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Fonctionalit\xE9s de {0}</h3><p>{1}</p><h3 style="colour:navy;">Notes d'utilisation:</h3><p>{2}</p></body></html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 14:57:09
|
Revision: 697 http://svn.sourceforge.net/gridarta/?rev=697&view=rev Author: akirschbaum Date: 2006-11-26 06:57:09 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Whitespace changes. Modified Paths: -------------- trunk/daimonin/src/daieditor/ReplaceDialog.java Modified: trunk/daimonin/src/daieditor/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 13:55:19 UTC (rev 696) +++ trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 14:57:09 UTC (rev 697) @@ -297,14 +297,18 @@ replaceList.add(replaceArch); } break; + case 1: replaceList = replaceCopyBuffer; break; + case 2: replaceList = replacePickmap; break; + default: replaceList = null; + break; } final MapViewIFrame mapViewIFrame = mapControl.getMapViewFrame(); assert mapViewIFrame != null; @@ -356,6 +360,7 @@ replaceArch = mainControl.getArchPanelHighlight(); // selected arch updateArchSelection(replaceArch, true); break; + case 1: // replace with CopyBuffer replaceCopyBuffer = CopyBuffer.getMapArchList(mainControl.getCopyMapCtrl(), 100); @@ -369,6 +374,7 @@ colonLabel.setText(":"); dialog.pack(); break; + case 2: // replace with pickmap replacePickmap = mainControl.getArchPanelSelection(); // selected arches @@ -382,6 +388,7 @@ colonLabel.setText(":"); dialog.pack(); break; + case 3: // replace with nothing iconLabel.setIcon(null); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 13:55:19
|
Revision: 696 http://svn.sourceforge.net/gridarta/?rev=696&view=rev Author: akirschbaum Date: 2006-11-26 05:55:19 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unification: use JOptionPane instead of JDialog. Modified Paths: -------------- trunk/crossfire/src/cfeditor/ReplaceDialog.java Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 13:53:31 UTC (rev 695) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 13:55:19 UTC (rev 696) @@ -26,7 +26,6 @@ import cfeditor.gameobject.GameObject; import cfeditor.map.MapControl; -import java.awt.Color; import java.awt.FlowLayout; import java.awt.Point; import java.awt.event.ActionEvent; @@ -46,13 +45,14 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; +import javax.swing.WindowConstants; import net.sf.gridarta.Size2D; /** * This dialog manages the replace action. * @author <a href="mailto:and...@gm...">Andreas Vogl</a> */ -public final class ReplaceDialog extends JDialog { +public final class ReplaceDialog extends JOptionPane { /** Serial Version UID. */ private static final long serialVersionUID = 1L; @@ -65,6 +65,9 @@ /** Singleton Instance. */ private static ReplaceDialog instance = null; + /** Dialog. */ + private JDialog dialog; + private final CMainControl mainControl; private boolean isBuilt; @@ -96,8 +99,9 @@ * @param mainControl MainControl */ private ReplaceDialog(final CMainControl mainControl) { - super(mainControl.getMainView(), "Replace", false); - setDefaultCloseOperation(HIDE_ON_CLOSE); + dialog = createDialog(mainControl.getMainView(), "Replace"); + dialog.setModal(false); + dialog.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); this.mainControl = mainControl; isBuilt = false; rfArchName = null; @@ -132,11 +136,9 @@ // first line: heading final JPanel line1 = new JPanel(new FlowLayout(FlowLayout.LEFT)); final JLabel labelon = new JLabel("On"); - labelon.setForeground(Color.black); line1.add(labelon); line1.add(Box.createVerticalStrut(3)); replaceEntireBox = new JComboBox(new String[]{"entire map", "selected squares of"}); - replaceEntireBox.setBackground(Color.white); if (mapControl.getMapView().isHighlight()) { replaceEntireBox.setSelectedIndex(1); } else { @@ -145,7 +147,6 @@ line1.add(replaceEntireBox); line1.add(Box.createVerticalStrut(3)); rfHeading = new JLabel("\"" + mapControl.getMapFileName() + "\":"); - rfHeading.setForeground(Color.black); line1.add(rfHeading); mainPanel.add(line1); @@ -157,7 +158,6 @@ replaceCriteria = new JComboBox(new String[]{"default arch", "name"}); replaceCriteria.setSelectedIndex(0); - replaceCriteria.setBackground(Color.white); line2.add(replaceCriteria); line2.add(Box.createVerticalStrut(5)); @@ -176,7 +176,6 @@ } else { replaceWithBox.setSelectedIndex(0); } - replaceWithBox.setBackground(Color.white); replaceWithBox.addItemListener(new ReplaceWithBoxItemListener()); line3.add(replaceWithBox); @@ -191,33 +190,28 @@ } line3.add(colonLabel); line3.add(Box.createVerticalStrut(5)); - rfArchName.setForeground(Color.black); line3.add(iconLabel); line3.add(rfArchName); mainPanel.add(line3); // button panel: - mainPanel.add(Box.createVerticalStrut(10)); - final JPanel line4 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); final JButton okButton = new JButton("OK"); okButtonListener = new OkButtonAL(); okButton.addActionListener(okButtonListener); - line4.add(okButton); - final JButton cancelButton = new JButton("Cancel"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent event) { setVisible(false); } }); - line4.add(cancelButton); - mainPanel.add(line4); - getContentPane().add(mainPanel); - pack(); - setLocationRelativeTo(mainControl.getMainView()); - setVisible(true); + setMessage(mainPanel); + setOptions(new Object[]{okButton, cancelButton}); + dialog.getRootPane().setDefaultButton(okButton); + dialog.pack(); + dialog.setLocationRelativeTo(mainControl.getMainView()); + dialog.setVisible(true); isBuilt = true; } else { // just set fields and show @@ -243,9 +237,9 @@ replaceEntireBox.setSelectedIndex(0); // entire map } - pack(); - toFront(); - setVisible(true); + dialog.pack(); + dialog.toFront(); + dialog.setVisible(true); } } @@ -268,7 +262,7 @@ // pack frame only if height of icon changed if (alwaysPack || (oldIcon == null && iconLabel.getIcon() != null) || (oldIcon != null && iconLabel.getIcon() == null) || (oldIcon != iconLabel.getIcon() && oldIcon != null && oldIcon.getIconHeight() != iconLabel.getIcon().getIconHeight())) { - pack(); + dialog.pack(); } } else { replaceWithBox.setSelectedIndex(1); @@ -401,7 +395,7 @@ iconLabel.setIcon(null); rfArchName.setText(""); colonLabel.setText(""); - pack(); + dialog.pack(); } lastSelectedIndex = replaceWithBox.getSelectedIndex(); } @@ -436,7 +430,7 @@ final int replaceCount = doReplace(matchCriteria, matchString, entireMap, deleteOnly); if (replaceCount > 0) { - setVisible(false); + dialog.setVisible(false); if (replaceCount == 1) { mainControl.showMessage("Replace", "1 object has been replaced."); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 13:53:32
|
Revision: 695 http://svn.sourceforge.net/gridarta/?rev=695&view=rev Author: akirschbaum Date: 2006-11-26 05:53:31 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Remove use of static import. Modified Paths: -------------- trunk/daimonin/src/daieditor/ReplaceDialog.java Modified: trunk/daimonin/src/daieditor/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 13:30:26 UTC (rev 694) +++ trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 13:53:31 UTC (rev 695) @@ -43,7 +43,7 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; -import static javax.swing.WindowConstants.HIDE_ON_CLOSE; +import javax.swing.WindowConstants; import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; @@ -109,7 +109,7 @@ private ReplaceDialog(final CMainControl mainControl) { dialog = createDialog(mainControl.getMainView(), ACTION_FACTORY.getString("replaceTitle")); dialog.setModal(false); - dialog.setDefaultCloseOperation(HIDE_ON_CLOSE); + dialog.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE); this.mainControl = mainControl; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 13:30:26
|
Revision: 694 http://svn.sourceforge.net/gridarta/?rev=694&view=rev Author: akirschbaum Date: 2006-11-26 05:30:26 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Whitespace changes. Modified Paths: -------------- trunk/crossfire/src/cfeditor/ReplaceDialog.java Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 13:27:16 UTC (rev 693) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 13:30:26 UTC (rev 694) @@ -327,11 +327,7 @@ // find objects to replace objectsToReplace.clear(); for (final GameObject node : mapControl.getMapModel().getMapSquare(pos)) { - if (node.isHead() && - ((matchCriteria == MATCH_ARCH_NAME && node.getArchetypeName() != null && - node.getArchetypeName().equalsIgnoreCase(matchString)) || - (matchCriteria == MATCH_OBJ_NAME && - node.getBestName().equalsIgnoreCase(matchString)))) { + if (node.isHead() && ((matchCriteria == MATCH_ARCH_NAME && node.getArchetypeName() != null && node.getArchetypeName().equalsIgnoreCase(matchString)) || (matchCriteria == MATCH_OBJ_NAME && node.getBestName().equalsIgnoreCase(matchString)))) { objectsToReplace.add(node); } } @@ -395,8 +391,7 @@ * @param event the occured <code>ItemEvent</code> (button pressed) */ public void itemStateChanged(final ItemEvent event) { - if (event.getStateChange() == ItemEvent.SELECTED && - lastSelectedIndex != replaceWithBox.getSelectedIndex()) { + if (event.getStateChange() == ItemEvent.SELECTED && lastSelectedIndex != replaceWithBox.getSelectedIndex()) { if (replaceWithBox.getSelectedIndex() == 0) { // replace with arch replaceArch = mainControl.getArchPanelSelection(); // selected arch This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 13:27:18
|
Revision: 693 http://svn.sourceforge.net/gridarta/?rev=693&view=rev Author: akirschbaum Date: 2006-11-26 05:27:16 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Do not expose ItemListener interface to clients of ReplaceDialog. Modified Paths: -------------- trunk/daimonin/src/daieditor/ReplaceDialog.java Modified: trunk/daimonin/src/daieditor/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 13:25:41 UTC (rev 692) +++ trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 13:27:16 UTC (rev 693) @@ -53,7 +53,7 @@ * @author <a href="mailto:and...@gm...">Andreas Vogl</a> * @author <a href="mailto:ch...@ri...">Christian.Hujer</a> */ -public final class ReplaceDialog extends JOptionPane implements ItemListener { +public final class ReplaceDialog extends JOptionPane { /** Serial Version UID. */ private static final long serialVersionUID = 1L; @@ -187,7 +187,7 @@ } else { replaceWithBox.setSelectedIndex(0); } - replaceWithBox.addItemListener(this); + replaceWithBox.addItemListener(new ReplaceWithBoxItemListener()); lastSelectedIndex = replaceWithBox.getSelectedIndex(); line3.add(replaceWithBox); @@ -342,55 +342,60 @@ return replaceCount; } - /** {@inheritDoc} */ - public void itemStateChanged(final ItemEvent event) { - final int selectedIndex = replaceWithBox.getSelectedIndex(); - if (event.getStateChange() == ItemEvent.SELECTED && lastSelectedIndex != selectedIndex) { - final int size; - switch (selectedIndex) { - case 0: - // replace with arch - replaceArch = mainControl.getArchPanelHighlight(); // selected arch - updateArchSelection(replaceArch, true); - break; - case 1: - // replace with CopyBuffer - replaceCopyBuffer = CopyBuffer.getMapArchList(mainControl.getCopyMapCtrl(), 100); - iconLabel.setIcon(null); - if (replaceCopyBuffer == null) { - size = 0; - } else { - size = replaceCopyBuffer.size(); + /** Item-listener for the "replace with"-selection box. */ + private class ReplaceWithBoxItemListener implements ItemListener { + + /** {@inheritDoc} */ + public void itemStateChanged(final ItemEvent event) { + final int selectedIndex = replaceWithBox.getSelectedIndex(); + if (event.getStateChange() == ItemEvent.SELECTED && lastSelectedIndex != selectedIndex) { + final int size; + switch (selectedIndex) { + case 0: + // replace with arch + replaceArch = mainControl.getArchPanelHighlight(); // selected arch + updateArchSelection(replaceArch, true); + break; + case 1: + // replace with CopyBuffer + replaceCopyBuffer = CopyBuffer.getMapArchList(mainControl.getCopyMapCtrl(), 100); + iconLabel.setIcon(null); + if (replaceCopyBuffer == null) { + size = 0; + } else { + size = replaceCopyBuffer.size(); + } + rfArchName.setText(String.valueOf(size)); + colonLabel.setText(":"); + dialog.pack(); + break; + case 2: + // replace with pickmap + replacePickmap = mainControl.getArchPanelSelection(); // selected arches + iconLabel.setIcon(null); + if (replacePickmap == null) { + size = 0; + } else { + size = replacePickmap.size(); + } + rfArchName.setText(String.valueOf(size)); + colonLabel.setText(":"); + dialog.pack(); + break; + case 3: + // replace with nothing + iconLabel.setIcon(null); + rfArchName.setText(""); + colonLabel.setText(""); + dialog.pack(); + break; } - rfArchName.setText(String.valueOf(size)); - colonLabel.setText(":"); - dialog.pack(); - break; - case 2: - // replace with pickmap - replacePickmap = mainControl.getArchPanelSelection(); // selected arches - iconLabel.setIcon(null); - if (replacePickmap == null) { - size = 0; - } else { - size = replacePickmap.size(); - } - rfArchName.setText(String.valueOf(size)); - colonLabel.setText(":"); - dialog.pack(); - break; - case 3: - // replace with nothing - iconLabel.setIcon(null); - rfArchName.setText(""); - colonLabel.setText(""); - dialog.pack(); - break; + lastSelectedIndex = selectedIndex; } - lastSelectedIndex = selectedIndex; } - } + } // class ReplaceWithBoxItemListener + /** * Action method for Ok button. * @used This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 13:25:41
|
Revision: 692 http://svn.sourceforge.net/gridarta/?rev=692&view=rev Author: akirschbaum Date: 2006-11-26 05:25:41 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Rename class name. Modified Paths: -------------- trunk/crossfire/src/cfeditor/ReplaceDialog.java Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 11:26:20 UTC (rev 691) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 13:25:41 UTC (rev 692) @@ -177,7 +177,7 @@ replaceWithBox.setSelectedIndex(0); } replaceWithBox.setBackground(Color.white); - replaceWithBox.addItemListener(new ReplaceWithBoxAL()); + replaceWithBox.addItemListener(new ReplaceWithBoxItemListener()); line3.add(replaceWithBox); iconLabel = new JLabel(); @@ -379,14 +379,14 @@ } /** Item-listener for the "replace with"-selection box. */ - private class ReplaceWithBoxAL implements ItemListener { + private class ReplaceWithBoxItemListener implements ItemListener { private int lastSelectedIndex; /** * Constructor. */ - ReplaceWithBoxAL() { + ReplaceWithBoxItemListener() { lastSelectedIndex = replaceWithBox.getSelectedIndex(); } @@ -412,7 +412,7 @@ } } - } // class ReplaceWithBoxAL + } // class ReplaceWithBoxItemListener /** Listener class for the ok-button of the replace dialog. */ public final class OkButtonAL implements ActionListener { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 11:26:19
|
Revision: 691 http://svn.sourceforge.net/gridarta/?rev=691&view=rev Author: akirschbaum Date: 2006-11-26 03:26:20 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify expression. Modified Paths: -------------- trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/daimonin/src/daieditor/ReplaceDialog.java Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 11:13:51 UTC (rev 690) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 11:26:20 UTC (rev 691) @@ -267,8 +267,7 @@ colonLabel.setText(":"); // pack frame only if height of icon changed - if (alwaysPack || (oldIcon == null && iconLabel.getIcon() != null) || (oldIcon != null && iconLabel.getIcon() == null) || - (oldIcon != iconLabel.getIcon() && oldIcon.getIconHeight() != iconLabel.getIcon().getIconHeight())) { + if (alwaysPack || (oldIcon == null && iconLabel.getIcon() != null) || (oldIcon != null && iconLabel.getIcon() == null) || (oldIcon != iconLabel.getIcon() && oldIcon != null && oldIcon.getIconHeight() != iconLabel.getIcon().getIconHeight())) { pack(); } } else { Modified: trunk/daimonin/src/daieditor/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 11:13:51 UTC (rev 690) +++ trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 11:26:20 UTC (rev 691) @@ -264,8 +264,7 @@ colonLabel.setText(":"); // pack frame only if height of icon changed - if (alwaysPack || oldIcon == null && iconLabel.getIcon() != null || oldIcon != null && iconLabel.getIcon() == null || oldIcon != iconLabel.getIcon() && oldIcon != null && oldIcon.getIconHeight() != iconLabel.getIcon().getIconHeight()) - { + if (alwaysPack || (oldIcon == null && iconLabel.getIcon() != null) || (oldIcon != null && iconLabel.getIcon() == null) || (oldIcon != iconLabel.getIcon() && oldIcon != null && oldIcon.getIconHeight() != iconLabel.getIcon().getIconHeight())) { dialog.pack(); } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 11:13:52
|
Revision: 690 http://svn.sourceforge.net/gridarta/?rev=690&view=rev Author: akirschbaum Date: 2006-11-26 03:13:51 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Remove redundant qualifying class name. Modified Paths: -------------- trunk/crossfire/src/cfeditor/ReplaceDialog.java Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 11:11:34 UTC (rev 689) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 11:13:51 UTC (rev 690) @@ -433,9 +433,9 @@ } else { final int matchCriteria; if (replaceCriteria.getSelectedIndex() == 0) { - matchCriteria = ReplaceDialog.MATCH_ARCH_NAME; + matchCriteria = MATCH_ARCH_NAME; } else if (replaceCriteria.getSelectedIndex() == 1) { - matchCriteria = ReplaceDialog.MATCH_OBJ_NAME; + matchCriteria = MATCH_OBJ_NAME; } else { matchCriteria = 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 11:11:34
|
Revision: 689 http://svn.sourceforge.net/gridarta/?rev=689&view=rev Author: akirschbaum Date: 2006-11-26 03:11:34 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify ReplaceDialog calling code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainMenu.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/daimonin/src/daieditor/CMainControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-26 11:04:23 UTC (rev 688) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-11-26 11:11:34 UTC (rev 689) @@ -1541,12 +1541,12 @@ } /** "Replace" was selected from the Edit menu. */ - public void replaceWanted() { + public void replace() { if (currentMap == null || currentMap.getMapView() == null) { return; // this should never be possible, but I just wanna make sure... } - copybuffer.replace(currentMap); + ReplaceDialog.getInstance().display(currentMap); } /** Modified: trunk/crossfire/src/cfeditor/CMainMenu.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainMenu.java 2006-11-26 11:04:23 UTC (rev 688) +++ trunk/crossfire/src/cfeditor/CMainMenu.java 2006-11-26 11:11:34 UTC (rev 689) @@ -424,7 +424,7 @@ m_replace.addActionListener( new ActionListener() { public void actionPerformed(final ActionEvent event) { - mainControl.replaceWanted(); + mainControl.replace(); } }); menuManager.addMenuEntry("main.edit", m_replace); Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-11-26 11:04:23 UTC (rev 688) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-11-26 11:11:34 UTC (rev 689) @@ -367,14 +367,6 @@ } /** - * Replace objects on the map. - * @param mapControl MapControl of the active map where the action was invoked - */ - public void replace(final MapControl mapControl) { - ReplaceDialog.getInstance().display(mapControl); - } - - /** * Add an archetype to the destination map. Inserts a new object instance * for default archetypes, and a clone for non-default archetypes. */ Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-11-26 11:04:23 UTC (rev 688) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-11-26 11:11:34 UTC (rev 689) @@ -1871,11 +1871,12 @@ } } - /** "Replace" was selected from the Edit menu */ + /** "Replace" was selected from the Edit menu. */ public void replace() { if (currentMap == null || currentMap.getMapViewFrame() == null) { return; // this should never be possible, but I just wanna make sure... } + ReplaceDialog.getInstance().display(currentMap); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 11:04:23
|
Revision: 688 http://svn.sourceforge.net/gridarta/?rev=688&view=rev Author: akirschbaum Date: 2006-11-26 03:04:23 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify variable names. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CArchQuickView.java Modified: trunk/crossfire/src/cfeditor/CArchQuickView.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchQuickView.java 2006-11-26 10:59:23 UTC (rev 687) +++ trunk/crossfire/src/cfeditor/CArchQuickView.java 2006-11-26 11:04:23 UTC (rev 688) @@ -109,11 +109,11 @@ /** * Show quick info for an object. * - * @param gameObjectPart the object to show; this may be any part of a multi-part + * @param gameObject the object to show; this may be any part of a multi-part * object */ - void showArchPanelQuickObject(final GameObject gameObjectPart) { - if (gameObjectPart == null) { + void showArchPanelQuickObject(final GameObject gameObject) { + if (gameObject == null) { archArchNameText.setText("<html><font color=black>Arch:</font></html>"); archObjNameText.setText("<html><font color=black>Name:</font></html>"); archTypeText.setText("<html><font color=black>Type:</font></html>"); @@ -121,11 +121,11 @@ return; } - final GameObject gameObject = gameObjectPart.getHead(); - archArchNameText.setText("<html><font color=black>Arch: " + gameObject.getArchetypeName() + "</font></html>"); - if (gameObject.getObjName() == null || gameObject.getObjName().length() <= 0) { - final Archetype<GameObject> archetype = gameObject.getArchetype(); - if (archetype == null || archetype == gameObject) { + final GameObject headObject = gameObject.getHead(); + archArchNameText.setText("<html><font color=black>Arch: " + headObject.getArchetypeName() + "</font></html>"); + if (headObject.getObjName() == null || headObject.getObjName().length() <= 0) { + final Archetype<GameObject> archetype = headObject.getArchetype(); + if (archetype == null || archetype == headObject) { archObjNameText.setText("<html><font color=black>Name: -none- </font></html>"); } else if (archetype.getObjName() != null && archetype.getObjName().length() > 0) { archObjNameText.setText("<html><font color=black>Name: " + archetype.getObjName() + "</font></html>"); @@ -135,20 +135,20 @@ archObjNameText.setText("<html><font color=black>Name: -none- </font></html>"); } } else { - archObjNameText.setText("<html><font color=black>Name: " + gameObject.getObjName() + "</font></html>"); + archObjNameText.setText("<html><font color=black>Name: " + headObject.getObjName() + "</font></html>"); } - archTypeText.setText("<html><font color=black>Type: " + mainControl.getArchetypeParser().getArchTypeName(gameObject.getArchTypNr()) + " (" + gameObject.getArchTypNr() + ") </font></html>"); + archTypeText.setText("<html><font color=black>Type: " + mainControl.getArchetypeParser().getArchTypeName(headObject.getArchTypNr()) + " (" + headObject.getArchTypNr() + ") </font></html>"); - if (gameObject.isMulti()) { - archTileText.setText("<html><font color=black>Tile: </font><font color=green> multi</font><font color=black> (" + gameObject.getMultiRefCount() + " parts) (" + gameObject.getSizeX() + "," + gameObject.getSizeY() + ")</font></html>"); + if (headObject.isMulti()) { + archTileText.setText("<html><font color=black>Tile: </font><font color=green> multi</font><font color=black> (" + headObject.getMultiRefCount() + " parts) (" + headObject.getSizeX() + "," + headObject.getSizeY() + ")</font></html>"); } else { archTileText.setText("<html><font color=black>Tile: single" + "</font></html>"); } // notify ReplaceDialog if (ReplaceDialog.isBuilt() && ReplaceDialog.getInstance().isShowing()) { - ReplaceDialog.getInstance().updateArchSelection(gameObject, false); + ReplaceDialog.getInstance().updateArchSelection(headObject, false); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 10:59:23
|
Revision: 687 http://svn.sourceforge.net/gridarta/?rev=687&view=rev Author: akirschbaum Date: 2006-11-26 02:59:23 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify handling of MapControl instance. Modified Paths: -------------- trunk/crossfire/src/cfeditor/ReplaceDialog.java Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 10:48:33 UTC (rev 686) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 10:59:23 UTC (rev 687) @@ -69,6 +69,8 @@ private boolean isBuilt; + private MapControl mapControl; + private GameObject replaceArch; // objects will be replaced by this arch private JLabel rfHeading; @@ -122,6 +124,7 @@ replaceArch = mainControl.getArchPanelSelection(); // selected arch if (!isBuilt) { + this.mapControl = mapControl; final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS)); mainPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 2, 5)); @@ -197,7 +200,7 @@ mainPanel.add(Box.createVerticalStrut(10)); final JPanel line4 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); final JButton okButton = new JButton("OK"); - okButtonListener = new OkButtonAL(mapControl); + okButtonListener = new OkButtonAL(); okButton.addActionListener(okButtonListener); line4.add(okButton); @@ -221,7 +224,7 @@ rfHeading.setText("\"" + mapControl.getMapFileName() + "\":"); replaceInput1.setText(""); - okButtonListener.setMapControl(mapControl); + this.mapControl = mapControl; if (replaceArch == null) { replaceWithBox.setSelectedIndex(1); iconLabel.setIcon(null); @@ -279,7 +282,6 @@ /** * This method performs the actual replace action on a map. - * @param mapControl MapControl of the map where the action was invoked * @param matchCriteria matching criteria for replace * @param matchString this is what to search for * @param entireMap if true, the entire map is affected - if false, @@ -288,7 +290,7 @@ * replaced * @return number of arches that have been replaced */ - private int doReplace(final MapControl mapControl, final int matchCriteria, final String matchString, final boolean entireMap, final boolean deleteOnly) { + private int doReplace(final int matchCriteria, final String matchString, final boolean entireMap, final boolean deleteOnly) { if (mapControl == null) { return 0; @@ -416,16 +418,6 @@ /** Listener class for the ok-button of the replace dialog. */ public final class OkButtonAL implements ActionListener { - private MapControl mapControl; // map control - - public OkButtonAL(final MapControl mapControl) { - this.mapControl = mapControl; - } - - public void setMapControl(final MapControl mapControl) { - this.mapControl = mapControl; - } - public void actionPerformed(final ActionEvent event) { final String matchString = replaceInput1.getText().trim(); final boolean deleteOnly = replaceWithBox.getSelectedIndex() == 1; @@ -448,7 +440,7 @@ matchCriteria = 0; } - final int replaceCount = doReplace(mapControl, matchCriteria, matchString, entireMap, deleteOnly); + final int replaceCount = doReplace(matchCriteria, matchString, entireMap, deleteOnly); if (replaceCount > 0) { setVisible(false); if (replaceCount == 1) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 10:48:34
|
Revision: 686 http://svn.sourceforge.net/gridarta/?rev=686&view=rev Author: akirschbaum Date: 2006-11-26 02:48:33 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Unify ReplaceDialog initialization. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/ReplaceDialog.java Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-11-26 10:42:23 UTC (rev 685) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-11-26 10:48:33 UTC (rev 686) @@ -197,8 +197,6 @@ menu = new CMainMenu(mainControl); setJMenuBar(menu); - ReplaceDialog.init(mainControl); // initialize replace dialog - // initialize pickmap panel pickmapPanel = new JTabbedPane(JTabbedPane.TOP); pickmapPanel.setBorder(BorderFactory.createEmptyBorder(IGUIConstants.SPACE_PICKARCH_TOP, 0, 0, 0)); Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 10:42:23 UTC (rev 685) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-11-26 10:48:33 UTC (rev 686) @@ -102,18 +102,15 @@ replaceArch = null; } - public static void init(final CMainControl mainControl) { - if (instance == null) { - instance = new ReplaceDialog(mainControl); - } - } - /** @return true when this frame has been fully built */ public static boolean isBuilt() { return instance != null && instance.isBuilt; } public static ReplaceDialog getInstance() { + if (instance == null) { + instance = new ReplaceDialog(CMainControl.getInstance()); + } return instance; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-11-26 10:42:23
|
Revision: 685 http://svn.sourceforge.net/gridarta/?rev=685&view=rev Author: akirschbaum Date: 2006-11-26 02:42:23 -0800 (Sun, 26 Nov 2006) Log Message: ----------- Add explicit field initialization. Modified Paths: -------------- trunk/daimonin/src/daieditor/ReplaceDialog.java Modified: trunk/daimonin/src/daieditor/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-24 19:51:55 UTC (rev 684) +++ trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-11-26 10:42:23 UTC (rev 685) @@ -67,7 +67,7 @@ public static final int MATCH_OBJ_NAME = 1; /** Singleton Instance. */ - private static ReplaceDialog instance; + private static ReplaceDialog instance = null; /** Dialog. */ private JDialog dialog; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |