You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(103) |
Jun
(121) |
Jul
(16) |
Aug
(67) |
Sep
(126) |
Oct
(161) |
Nov
(164) |
Dec
(588) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(394) |
Feb
(181) |
Mar
(131) |
Apr
(180) |
May
(255) |
Jun
(11) |
Jul
(79) |
Aug
(70) |
Sep
(274) |
Oct
(138) |
Nov
(195) |
Dec
(8) |
2008 |
Jan
(3) |
Feb
(142) |
Mar
(162) |
Apr
(124) |
May
(148) |
Jun
(157) |
Jul
(425) |
Aug
(373) |
Sep
(264) |
Oct
(315) |
Nov
(225) |
Dec
(6) |
2009 |
Jan
(67) |
Feb
(78) |
Mar
(279) |
Apr
(294) |
May
(92) |
Jun
(65) |
Jul
(134) |
Aug
(41) |
Sep
(138) |
Oct
(125) |
Nov
(126) |
Dec
(122) |
2010 |
Jan
(15) |
Feb
(48) |
Mar
(9) |
Apr
(195) |
May
(373) |
Jun
(507) |
Jul
(42) |
Aug
(16) |
Sep
(38) |
Oct
(81) |
Nov
(64) |
Dec
(18) |
2011 |
Jan
(13) |
Feb
(12) |
Mar
(39) |
Apr
(1) |
May
(2) |
Jun
(27) |
Jul
(27) |
Aug
(31) |
Sep
(14) |
Oct
(102) |
Nov
(20) |
Dec
(37) |
2012 |
Jan
(22) |
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(2) |
Jun
(18) |
Jul
(6) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(47) |
Jun
(7) |
Jul
(107) |
Aug
|
Sep
|
Oct
(112) |
Nov
(31) |
Dec
(17) |
2014 |
Jan
(29) |
Feb
(111) |
Mar
(34) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(18) |
Dec
(10) |
From: <chr...@us...> - 2006-06-25 21:44:09
|
Revision: 209 Author: christianhujer Date: 2006-06-25 14:42:47 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=209&view=rev Log Message: ----------- Sorted imports. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CArchPanel.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapFileDecode.java trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java trunk/crossfire/src/cfeditor/CMapTileList.java trunk/crossfire/src/cfeditor/CPickmapPanel.java trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/crossfire/src/cfeditor/map/MapModel.java trunk/crossfire/src/cfeditor/parameter/MapParameter.java trunk/crossfire/src/cfeditor/parameter/MapParameterView.java trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditMenuBar.java trunk/daimonin/src/daieditor/CArchPanelPan.java trunk/daimonin/src/daieditor/CFTreasureListTree.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMapFileDecode.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/CopyBuffer.java trunk/daimonin/src/daieditor/ProcessRunner.java trunk/daimonin/src/daieditor/ScriptArchData.java trunk/daimonin/src/daieditor/Spells.java trunk/daimonin/src/daieditor/Updater.java trunk/daimonin/src/daieditor/arch/NamedObjects.java trunk/daimonin/src/daieditor/gui/AboutDialog.java trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.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/map/event/MapViewSettingsEvent.java trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsListener.java trunk/daimonin/src/daieditor/gui/map/tools/Tool.java trunk/daimonin/src/daieditor/gui/map/tools/ToolSelector.java trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.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/UpdatePrefs.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/MapControl.java trunk/daimonin/src/daieditor/map/validation/ValidationError.java trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditMenuBar.java trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java trunk/src/app/net/sf/gridarta/gui/HideFileFilterProxy.java trunk/src/app/net/sf/gridarta/help/HtmlPane.java trunk/src/test/net/sf/gridarta/gui/HideFileFilterProxyTest.java Modified: trunk/crossfire/src/cfeditor/CArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanel.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/crossfire/src/cfeditor/CArchPanel.java 2006-06-25 21:42:47 UTC (rev 209) @@ -36,8 +36,8 @@ import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import net.sf.gridarta.gui.GSplitPane; import org.jetbrains.annotations.Nullable; -import net.sf.gridarta.gui.GSplitPane; /** * The <code>CArchPanel</code> holds the tile palette. Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-06-25 21:42:47 UTC (rev 209) @@ -24,7 +24,6 @@ package cfeditor; -import static net.sf.japi.swing.ActionFactory.getFactory; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectParser; import cfeditor.arch.ArchObjectStack; @@ -51,12 +50,13 @@ import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.filechooser.FileFilter; +import net.sf.gridarta.GridderException; +import net.sf.gridarta.Size2D; +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.Nullable; -import net.sf.gridarta.Size2D; -import net.sf.japi.util.filter.file.EndingFileFilter; -import net.sf.japi.swing.ActionFactory; -import net.sf.gridarta.GridderException; /** * The main controller of the level editor. Basically the main application. Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-06-25 21:42:47 UTC (rev 209) @@ -26,8 +26,6 @@ import cfeditor.arch.ArchObject; import cfeditor.map.MapControl; -import net.sf.gridarta.help.Help; -import net.sf.gridarta.GridderException; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; @@ -48,6 +46,8 @@ import javax.swing.UIManager; import javax.swing.event.InternalFrameEvent; import javax.swing.event.InternalFrameListener; +import net.sf.gridarta.GridderException; +import net.sf.gridarta.help.Help; import org.jetbrains.annotations.Nullable; /** Modified: trunk/crossfire/src/cfeditor/CMapFileDecode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-06-25 21:42:47 UTC (rev 209) @@ -30,9 +30,9 @@ import java.io.File; import java.io.FileReader; import java.io.IOException; +import net.sf.gridarta.GridderException; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; -import net.sf.gridarta.GridderException; /** * This class handles the reading of a mapfile and parsing the data Modified: trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-06-25 21:42:47 UTC (rev 209) @@ -53,8 +53,8 @@ import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; import net.sf.gridarta.GridderException; +import net.sf.gridarta.Size2D; import net.sf.gridarta.help.Help; -import net.sf.gridarta.Size2D; /** * Dialog used to ask the user the properties for the new level. Modified: trunk/crossfire/src/cfeditor/CMapTileList.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapTileList.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/crossfire/src/cfeditor/CMapTileList.java 2006-06-25 21:42:47 UTC (rev 209) @@ -31,8 +31,8 @@ import java.awt.Color; import java.awt.Component; import java.awt.GridLayout; +import java.awt.Point; import java.awt.Rectangle; -import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; Modified: trunk/crossfire/src/cfeditor/CPickmapPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-06-25 21:42:47 UTC (rev 209) @@ -28,17 +28,17 @@ import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; import java.io.File; -import java.util.Map; +import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; -import java.util.Arrays; +import java.util.Map; import javax.swing.JOptionPane; import javax.swing.JTabbedPane; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import net.sf.gridarta.GridderException; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; -import net.sf.gridarta.GridderException; /** * The <code>CPickmapPanel</code> manages the pickmap panel Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectIteratorDeleteMapArch.java 2006-06-25 21:42:47 UTC (rev 209) @@ -3,8 +3,8 @@ package cfeditor.arch; import cfeditor.map.MapModel; +import java.awt.Point; import java.util.Iterator; -import java.awt.Point; /** * The class ArchObjectIterator implements an {@link ArchObjectIterator} that Modified: trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java =================================================================== --- trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/crossfire/src/cfeditor/arch/ArchObjectStack.java 2006-06-25 21:42:47 UTC (rev 209) @@ -46,10 +46,10 @@ import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; +import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.Map; -import java.util.Arrays; import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.JDialog; Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-06-25 21:42:47 UTC (rev 209) @@ -24,17 +24,17 @@ package cfeditor.map; +import cfeditor.CMainControl; +import cfeditor.ExitTypes; +import cfeditor.IGUIConstants; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectIterator; import cfeditor.arch.ArchObjectIteratorDeleteArchMapObject; import cfeditor.arch.ArchObjectIteratorDeleteMapArch; -import cfeditor.CMainControl; -import cfeditor.ExitTypes; import cfeditor.filter.Filter; import cfeditor.filter.FilterConfig; import cfeditor.filter.NamedFilterConfig; import cfeditor.filter.NamedFilterList; -import cfeditor.IGUIConstants; import java.awt.Point; import java.util.Iterator; import net.sf.gridarta.Size2D; Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2006-06-25 21:42:47 UTC (rev 209) @@ -24,15 +24,15 @@ package cfeditor.map; -import cfeditor.arch.ArchObject; -import cfeditor.arch.ArchObjectIterator; -import cfeditor.arch.ArchObjectIteratorDeleteMapArch; import cfeditor.CMainControl; import cfeditor.CMainStatusbar; import cfeditor.CMapViewBasic; import cfeditor.CMapViewIFrame; import cfeditor.CUndoStack; import cfeditor.IGUIConstants; +import cfeditor.arch.ArchObject; +import cfeditor.arch.ArchObjectIterator; +import cfeditor.arch.ArchObjectIteratorDeleteMapArch; import java.awt.Point; import java.io.File; import java.util.Iterator; Modified: trunk/crossfire/src/cfeditor/map/MapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapModel.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/crossfire/src/cfeditor/map/MapModel.java 2006-06-25 21:42:47 UTC (rev 209) @@ -2,10 +2,8 @@ import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectIterator; -import cfeditor.arch.ArchObjectIteratorDeleteArchMapObject; import cfeditor.arch.ArchObjectIteratorDeleteMapArch; import java.awt.Point; -import java.util.Iterator; import net.sf.gridarta.Size2D; import org.jetbrains.annotations.Nullable; Modified: trunk/crossfire/src/cfeditor/parameter/MapParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/MapParameter.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/crossfire/src/cfeditor/parameter/MapParameter.java 2006-06-25 21:42:47 UTC (rev 209) @@ -8,9 +8,9 @@ package cfeditor.parameter; import cfeditor.CMainControl; -import cfeditor.map.MapControl; import cfeditor.PluginParameter; import cfeditor.PluginParameterView; +import cfeditor.map.MapControl; import org.jdom.Element; /** Modified: trunk/crossfire/src/cfeditor/parameter/MapParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/MapParameterView.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/crossfire/src/cfeditor/parameter/MapParameterView.java 2006-06-25 21:42:47 UTC (rev 209) @@ -8,9 +8,9 @@ package cfeditor.parameter; import cfeditor.CMainControl; -import cfeditor.map.MapControl; import cfeditor.PluginParameter; import cfeditor.PluginParameterView; +import cfeditor.map.MapControl; import java.awt.Component; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; Modified: trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditMenuBar.java =================================================================== --- trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditMenuBar.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/crossfire/src/cfeditor/textedit/scripteditor/ScriptEditMenuBar.java 2006-06-25 21:42:47 UTC (rev 209) @@ -25,10 +25,10 @@ import cfeditor.textedit.textarea.InputHandler; import cfeditor.textedit.textarea.JEditTextArea; +import java.awt.Event; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; -import java.awt.Event; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; Modified: trunk/daimonin/src/daieditor/CArchPanelPan.java =================================================================== --- trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/CArchPanelPan.java 2006-06-25 21:42:47 UTC (rev 209) @@ -24,7 +24,6 @@ package daieditor; -import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.arch.ArchObject; import daieditor.arch.ArchObjectStack; import java.awt.BorderLayout; @@ -47,6 +46,7 @@ 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.jetbrains.annotations.Nullable; Modified: trunk/daimonin/src/daieditor/CFTreasureListTree.java =================================================================== --- trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-06-25 21:42:47 UTC (rev 209) @@ -26,8 +26,6 @@ import static daieditor.CGUIUtils.getSysIcon; import daieditor.arch.ArchObject; -import net.sf.gridarta.help.Help; -import net.sf.gridarta.GridderException; import java.awt.BorderLayout; import static java.awt.Color.gray; import java.awt.Component; @@ -41,13 +39,13 @@ import java.io.IOException; import static java.lang.String.CASE_INSENSITIVE_ORDER; import java.util.ArrayList; +import java.util.Arrays; import static java.util.Collections.sort; import java.util.Comparator; import java.util.Enumeration; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Arrays; import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.JButton; @@ -65,6 +63,8 @@ import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreePath; +import net.sf.gridarta.GridderException; +import net.sf.gridarta.help.Help; import net.sf.japi.util.EnumerationIterator; import org.jetbrains.annotations.Nullable; Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-06-25 21:42:47 UTC (rev 209) @@ -82,12 +82,12 @@ import java.io.IOException; import static java.lang.System.currentTimeMillis; import java.util.ArrayList; +import java.util.Arrays; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.ListIterator; import java.util.Random; -import java.util.Arrays; import java.util.logging.Level; import java.util.logging.Logger; import java.util.prefs.Preferences; Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-06-25 21:42:47 UTC (rev 209) @@ -34,8 +34,8 @@ import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; +import net.sf.gridarta.GridderException; import org.jetbrains.annotations.Nullable; -import net.sf.gridarta.GridderException; /** * This class handles the reading of a mapfile and parsing the data Modified: trunk/daimonin/src/daieditor/CMapTileList.java =================================================================== --- trunk/daimonin/src/daieditor/CMapTileList.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/CMapTileList.java 2006-06-25 21:42:47 UTC (rev 209) @@ -32,8 +32,8 @@ import java.awt.Color; import java.awt.Component; import java.awt.GridLayout; +import java.awt.Insets; import java.awt.Rectangle; -import java.awt.Insets; import static java.awt.event.InputEvent.SHIFT_MASK; import java.awt.event.MouseEvent; import static java.awt.event.MouseEvent.BUTTON1; @@ -55,8 +55,8 @@ 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 net.sf.japi.swing.ActionMethod; -import static net.sf.japi.swing.ActionFactory.getFactory; /** * The panel that displays the arches of the currently selected map square. Modified: trunk/daimonin/src/daieditor/CNewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-06-25 21:42:47 UTC (rev 209) @@ -25,7 +25,6 @@ package daieditor; -import static net.sf.japi.swing.ActionFactory.getFactory; import static daieditor.CMainControl.PREFS_USERNAME; import static daieditor.CMainControl.PREFS_USERNAME_DEFAULT; import daieditor.map.MapArchObject; @@ -48,8 +47,9 @@ import javax.swing.border.CompoundBorder; import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; +import net.sf.gridarta.Size2D; import net.sf.japi.swing.ActionFactory; -import net.sf.gridarta.Size2D; +import static net.sf.japi.swing.ActionFactory.getFactory; /** * Dialog used to ask the user the properties for the new level. Contains a Modified: trunk/daimonin/src/daieditor/CPickmapPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-06-25 21:42:47 UTC (rev 209) @@ -24,7 +24,6 @@ package daieditor; -import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.arch.ArchObject; import daieditor.arch.ArchObjectParser; import daieditor.map.MapArchObject; @@ -33,13 +32,14 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.Arrays; import javax.swing.JTabbedPane; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import net.sf.gridarta.GridderException; import net.sf.japi.swing.ActionFactory; -import net.sf.gridarta.GridderException; +import static net.sf.japi.swing.ActionFactory.getFactory; /** * The <code>CPickmapPanel</code> manages the pickmap panel Modified: trunk/daimonin/src/daieditor/CPreview.java =================================================================== --- trunk/daimonin/src/daieditor/CPreview.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/CPreview.java 2006-06-25 21:42:47 UTC (rev 209) @@ -26,7 +26,6 @@ package daieditor; -import static net.sf.japi.swing.ActionFactory.getFactory; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; @@ -46,6 +45,7 @@ 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; /** * The map preview of the level editor. Modified: trunk/daimonin/src/daieditor/CopyBuffer.java =================================================================== --- trunk/daimonin/src/daieditor/CopyBuffer.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/CopyBuffer.java 2006-06-25 21:42:47 UTC (rev 209) @@ -34,8 +34,8 @@ import java.awt.Rectangle; import java.util.ArrayList; import java.util.List; +import net.sf.gridarta.Size2D; import org.jetbrains.annotations.Nullable; -import net.sf.gridarta.Size2D; /** * This class manages the cut/copy/paste actions in maps. The data is stored in Modified: trunk/daimonin/src/daieditor/ProcessRunner.java =================================================================== --- trunk/daimonin/src/daieditor/ProcessRunner.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/ProcessRunner.java 2006-06-25 21:42:47 UTC (rev 209) @@ -23,7 +23,6 @@ package daieditor; -import static net.sf.japi.swing.ActionFactory.getFactory; import java.awt.BorderLayout; import static java.awt.BorderLayout.CENTER; import static java.awt.BorderLayout.SOUTH; @@ -46,6 +45,7 @@ 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. Modified: trunk/daimonin/src/daieditor/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/ScriptArchData.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/ScriptArchData.java 2006-06-25 21:42:47 UTC (rev 209) @@ -24,7 +24,6 @@ package daieditor; -import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.arch.ArchObject; import daieditor.textedit.scripteditor.ScriptEditControl; import java.awt.Color; @@ -49,6 +48,7 @@ import javax.swing.JTextField; import static javax.swing.WindowConstants.HIDE_ON_CLOSE; import net.sf.japi.swing.ActionFactory; +import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; /** Modified: trunk/daimonin/src/daieditor/Spells.java =================================================================== --- trunk/daimonin/src/daieditor/Spells.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/Spells.java 2006-06-25 21:42:47 UTC (rev 209) @@ -21,7 +21,6 @@ package daieditor; -import static net.sf.japi.swing.ActionFactory.getFactory; import java.io.BufferedReader; import java.io.EOFException; import java.io.File; @@ -41,6 +40,7 @@ import javax.swing.filechooser.FileFilter; import javax.xml.parsers.DocumentBuilder; 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; Modified: trunk/daimonin/src/daieditor/Updater.java =================================================================== --- trunk/daimonin/src/daieditor/Updater.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/Updater.java 2006-06-25 21:42:47 UTC (rev 209) @@ -21,7 +21,6 @@ package daieditor; -import static net.sf.japi.swing.ActionFactory.getFactory; import java.awt.Component; import java.io.File; import java.io.FileOutputStream; @@ -37,8 +36,8 @@ import java.util.MissingResourceException; import java.util.PropertyResourceBundle; import java.util.ResourceBundle; +import java.util.logging.Level; import java.util.logging.Logger; -import java.util.logging.Level; import java.util.prefs.Preferences; import static java.util.prefs.Preferences.userNodeForPackage; import static javax.swing.JOptionPane.QUESTION_MESSAGE; @@ -47,6 +46,7 @@ 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. Modified: trunk/daimonin/src/daieditor/arch/NamedObjects.java =================================================================== --- trunk/daimonin/src/daieditor/arch/NamedObjects.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/arch/NamedObjects.java 2006-06-25 21:42:47 UTC (rev 209) @@ -21,7 +21,6 @@ package daieditor.arch; -import static net.sf.japi.swing.ActionFactory.getFactory; import java.awt.Component; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -38,6 +37,7 @@ 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; Modified: trunk/daimonin/src/daieditor/gui/AboutDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/AboutDialog.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/gui/AboutDialog.java 2006-06-25 21:42:47 UTC (rev 209) @@ -1,6 +1,5 @@ package daieditor.gui; -import static net.sf.japi.swing.ActionFactory.getFactory; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Font; @@ -22,6 +21,7 @@ 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 Modified: trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2006-06-25 21:42:47 UTC (rev 209) @@ -44,10 +44,10 @@ import java.awt.image.BufferedImage; import java.util.Map; import javax.swing.ImageIcon; +import net.sf.gridarta.Size2D; import net.sf.gridarta.gui.map.MapGrid; import net.sf.gridarta.gui.map.MapGridEvent; import net.sf.gridarta.gui.map.MapGridListener; -import net.sf.gridarta.Size2D; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Modified: trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java 2006-06-25 21:42:47 UTC (rev 209) @@ -21,7 +21,6 @@ package daieditor.gui.map; -import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.CMainControl; import daieditor.gui.MapFileFilter; import daieditor.map.MapControl; @@ -51,6 +50,7 @@ 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; Modified: trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-06-25 21:42:47 UTC (rev 209) @@ -25,12 +25,9 @@ package daieditor.gui.map; -import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.CMainControl; import daieditor.CMainView; import daieditor.IGUIConstants; -import net.sf.gridarta.help.Help; -import net.sf.gridarta.Size2D; import daieditor.map.MapArchObject; import daieditor.map.MapControl; import java.awt.BorderLayout; @@ -57,7 +54,10 @@ import static javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER; import javax.swing.border.Border; import javax.swing.border.EmptyBorder; +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; /** Modified: trunk/daimonin/src/daieditor/gui/map/MapTilePane.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2006-06-25 21:42:47 UTC (rev 209) @@ -23,7 +23,6 @@ package daieditor.gui.map; -import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.CMainControl; import daieditor.IGUIConstants; import daieditor.PathManager; @@ -58,8 +57,9 @@ import javax.swing.border.TitledBorder; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import net.sf.gridarta.Size2D; import net.sf.japi.swing.ActionFactory; -import net.sf.gridarta.Size2D; +import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; /** Modified: trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsEvent.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsEvent.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsEvent.java 2006-06-25 21:42:47 UTC (rev 209) @@ -21,8 +21,8 @@ package daieditor.gui.map.event; +import daieditor.gui.map.MapViewSettings; import java.util.EventObject; -import daieditor.gui.map.MapViewSettings; /** * Event Object encapsulating events on MapViewSettings. Modified: trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsListener.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsListener.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsListener.java 2006-06-25 21:42:47 UTC (rev 209) @@ -22,7 +22,6 @@ package daieditor.gui.map.event; import java.util.EventListener; -import daieditor.gui.map.event.MapViewSettingsEvent; /** * Interface for event listeners that are interested in changes on {@link daieditor.gui.map.MapViewSettings}. Modified: trunk/daimonin/src/daieditor/gui/map/tools/Tool.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/Tool.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/gui/map/tools/Tool.java 2006-06-25 21:42:47 UTC (rev 209) @@ -1,10 +1,8 @@ package daieditor.gui.map.tools; -import javax.swing.Action; +import daieditor.gui.map.event.MouseOpListener; import java.awt.Component; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import daieditor.gui.map.event.MouseOpListener; /** * Interface for tools that are used to manipulate maps. Modified: trunk/daimonin/src/daieditor/gui/map/tools/ToolSelector.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/ToolSelector.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/gui/map/tools/ToolSelector.java 2006-06-25 21:42:47 UTC (rev 209) @@ -13,9 +13,9 @@ import javax.swing.ButtonGroup; import javax.swing.JPanel; import javax.swing.JToggleButton; +import net.sf.japi.swing.ActionFactory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import net.sf.japi.swing.ActionFactory; /** * User interface for selecting a tool and displaying its options. Modified: trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java 2006-06-25 21:42:47 UTC (rev 209) @@ -3,11 +3,11 @@ import daieditor.gui.map.event.MouseOpEvent; import java.awt.BorderLayout; import java.awt.event.MouseEvent; +import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTabbedPane; -import javax.swing.JLabel; +import net.sf.japi.swing.ActionFactory; import org.jetbrains.annotations.Nullable; -import net.sf.japi.swing.ActionFactory; /** * Pane for controlling which mouse to select and configure tools for. Modified: trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/gui/prefs/DevPrefs.java 2006-06-25 21:42:47 UTC (rev 209) @@ -21,7 +21,6 @@ package daieditor.gui.prefs; -import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.CMainControl; import static daieditor.CMainControl.PREFS_SYSTEM_EXIT; import static daieditor.CMainControl.PREFS_SYSTEM_EXIT_DEFAULT; @@ -37,6 +36,7 @@ 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; /** Modified: trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java 2006-06-25 21:42:47 UTC (rev 209) @@ -21,7 +21,6 @@ package daieditor.gui.prefs; -import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.CMainControl; import static daieditor.CMainControl.PREFS_LANGUAGE; import static daieditor.CMainView.MAP_TILE_LIST_BOTTOM_DEFAULT; @@ -44,6 +43,7 @@ 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; Modified: trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java 2006-06-25 21:42:47 UTC (rev 209) @@ -21,7 +21,6 @@ package daieditor.gui.prefs; -import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.CMainControl; import static daieditor.CMainControl.PREFS_VALIDATOR_AUTO; import static daieditor.CMainControl.PREFS_VALIDATOR_AUTO_DEFAULT; @@ -41,6 +40,7 @@ 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; /** Modified: trunk/daimonin/src/daieditor/gui/prefs/MiscPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/MiscPrefs.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/gui/prefs/MiscPrefs.java 2006-06-25 21:42:47 UTC (rev 209) @@ -21,7 +21,6 @@ package daieditor.gui.prefs; -import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.CMainControl; import static daieditor.CMainControl.PREFS_USERNAME; import static daieditor.CMainControl.PREFS_USERNAME_DEFAULT; @@ -39,6 +38,7 @@ 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; /** Modified: trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java 2006-06-25 21:42:47 UTC (rev 209) @@ -21,7 +21,6 @@ package daieditor.gui.prefs; -import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.CMainControl; import static daieditor.IGUIConstants.DIALOG_BORDER; import java.awt.Component; @@ -44,6 +43,7 @@ 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; /** Modified: trunk/daimonin/src/daieditor/gui/prefs/UpdatePrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/UpdatePrefs.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/gui/prefs/UpdatePrefs.java 2006-06-25 21:42:47 UTC (rev 209) @@ -21,7 +21,6 @@ package daieditor.gui.prefs; -import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.CMainControl; import static daieditor.IGUIConstants.DIALOG_BORDER; import daieditor.Updater; @@ -37,6 +36,7 @@ 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; /** Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-06-25 21:42:47 UTC (rev 209) @@ -25,7 +25,6 @@ package daieditor.map; -import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.CFArchTypeList; import daieditor.CMainControl; import daieditor.IGUIConstants; @@ -38,8 +37,9 @@ import java.util.List; import java.util.NoSuchElementException; import javax.swing.event.EventListenerList; -import net.sf.japi.swing.ActionFactory; import net.sf.gridarta.Size2D; +import net.sf.japi.swing.ActionFactory; +import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; /** @@ -166,15 +166,12 @@ /** * Place the loaded arches from the list onto the map * @param objects <code>ArchObject</code> list or <code>null</code> for empty map - * @todo this method should somehow be changed; first, arch.getContainer() might eventually return non-null in future even for map * arches; second, the temp list should be removed and will be removed. */ private void addArchListToMap(final List<ArchObject> objects) { - // arch objects if (objects == null) { return; } - for (final ArchObject arch : objects) { if (!arch.isInContainer()) { // only map arches.... addArchObjectToMap(arch, false); Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2006-06-25 21:42:47 UTC (rev 209) @@ -46,9 +46,9 @@ import java.util.List; import javax.imageio.ImageIO; import javax.swing.ImageIcon; +import net.sf.gridarta.Size2D; import net.sf.gridarta.gui.map.MapCursor; import net.sf.gridarta.gui.map.MapGrid; -import net.sf.gridarta.Size2D; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; Modified: trunk/daimonin/src/daieditor/map/validation/ValidationError.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/ValidationError.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/map/validation/ValidationError.java 2006-06-25 21:42:47 UTC (rev 209) @@ -24,11 +24,11 @@ package daieditor.map.validation; -import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.arch.ArchObject; import daieditor.map.MapModel; import daieditor.map.MapSquare; import net.sf.japi.swing.ActionFactory; +import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; /** Modified: trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditMenuBar.java =================================================================== --- trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditMenuBar.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/daieditor/textedit/scripteditor/ScriptEditMenuBar.java 2006-06-25 21:42:47 UTC (rev 209) @@ -26,10 +26,10 @@ import daieditor.IGUIConstants; import daieditor.textedit.textarea.InputHandler; import daieditor.textedit.textarea.JEditTextArea; +import java.awt.Event; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; -import java.awt.Event; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; Modified: trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java =================================================================== --- trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java 2006-06-25 21:42:47 UTC (rev 209) @@ -24,11 +24,11 @@ import java.awt.Dimension; import java.awt.Point; import junit.framework.JUnit4TestAdapter; +import net.sf.gridarta.Size2D; import net.sf.gridarta.gui.map.MapCursor; import net.sf.gridarta.gui.map.MapCursorEvent; import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.gridarta.gui.map.MapGrid; -import net.sf.gridarta.Size2D; import org.junit.AfterClass; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; Modified: trunk/src/app/net/sf/gridarta/gui/HideFileFilterProxy.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/HideFileFilterProxy.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/src/app/net/sf/gridarta/gui/HideFileFilterProxy.java 2006-06-25 21:42:47 UTC (rev 209) @@ -24,9 +24,9 @@ import java.io.File; import java.io.FileFilter; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; -import java.util.Arrays; -import java.util.ArrayList; import net.sf.japi.util.filter.file.AbstractFileFilter; /** Modified: trunk/src/app/net/sf/gridarta/help/HtmlPane.java =================================================================== --- trunk/src/app/net/sf/gridarta/help/HtmlPane.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/src/app/net/sf/gridarta/help/HtmlPane.java 2006-06-25 21:42:47 UTC (rev 209) @@ -30,8 +30,8 @@ import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; +import java.util.logging.Level; import java.util.logging.Logger; -import java.util.logging.Level; import javax.swing.JEditorPane; import javax.swing.JScrollPane; import javax.swing.JViewport; Modified: trunk/src/test/net/sf/gridarta/gui/HideFileFilterProxyTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/gui/HideFileFilterProxyTest.java 2006-06-25 20:49:21 UTC (rev 208) +++ trunk/src/test/net/sf/gridarta/gui/HideFileFilterProxyTest.java 2006-06-25 21:42:47 UTC (rev 209) @@ -1,9 +1,9 @@ package test.net.sf.gridarta.gui; +import java.io.File; +import junit.framework.TestCase; import net.sf.gridarta.gui.HideFileFilterProxy; import net.sf.japi.util.filter.file.AbstractFileFilter; -import junit.framework.TestCase; -import java.io.File; /** * Test for {@link HideFileFilterProxy}. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-06-25 20:49:27
|
Revision: 208 Author: akirschbaum Date: 2006-06-25 13:49:21 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=208&view=rev Log Message: ----------- Fix typo in comment. Modified Paths: -------------- trunk/daimonin/src/daieditor/map/MapArchObject.java Modified: trunk/daimonin/src/daieditor/map/MapArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-06-25 20:45:11 UTC (rev 207) +++ trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-06-25 20:49:21 UTC (rev 208) @@ -54,7 +54,7 @@ /** * Map size. - * @fixme theis is redundant with {@link DefaultMapModel}. + * @fixme this is redundant with {@link DefaultMapModel}. */ private Size2D mapSize = new Size2D(1, 1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-06-25 20:45:15
|
Revision: 207 Author: akirschbaum Date: 2006-06-25 13:45:11 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=207&view=rev Log Message: ----------- Convert if statement into guard. Modified Paths: -------------- trunk/daimonin/src/daieditor/map/DefaultMapModel.java Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-06-25 20:37:49 UTC (rev 206) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-06-25 20:45:11 UTC (rev 207) @@ -171,11 +171,13 @@ */ private void addArchListToMap(final List<ArchObject> objects) { // arch objects - if (objects != null) { - for (final ArchObject arch : objects) { - if (!arch.isInContainer()) { // only map arches.... - addArchObjectToMap(arch, false); - } + if (objects == null) { + return; + } + + for (final ArchObject arch : objects) { + if (!arch.isInContainer()) { // only map arches.... + addArchObjectToMap(arch, false); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-06-25 20:37:59
|
Revision: 206 Author: akirschbaum Date: 2006-06-25 13:37:49 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=206&view=rev Log Message: ----------- Remove duplicate initialization. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapFileDecode.java trunk/daimonin/src/daieditor/CMapFileDecode.java Modified: trunk/crossfire/src/cfeditor/CMapFileDecode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-06-25 20:33:34 UTC (rev 205) +++ trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-06-25 20:37:49 UTC (rev 206) @@ -81,7 +81,6 @@ maxxlen = maxylen = 0; start = previous = null; //firstArch = null; - maparch = null; // first of all we read the map arch (if that fails we throw an exception) maparch = new MapArchObject(); Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-06-25 20:33:34 UTC (rev 205) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-06-25 20:37:49 UTC (rev 206) @@ -82,7 +82,6 @@ maxylen = 0; objects = new ArrayList<ArchObject>(); //firstArch = null; - maparch = null; // first of all we read the map arch (if that fails we throw an exception) maparch = new MapArchObject(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-06-25 20:33:43
|
Revision: 205 Author: akirschbaum Date: 2006-06-25 13:33:34 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=205&view=rev Log Message: ----------- Remove unused import statements. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-06-25 20:24:09 UTC (rev 204) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-06-25 20:33:34 UTC (rev 205) @@ -27,7 +27,6 @@ import cfeditor.arch.ArchObject; import cfeditor.map.MapArchObject; import cfeditor.map.MapModel; -import java.awt.Dimension; import java.awt.Point; import java.io.BufferedReader; import java.io.BufferedWriter; Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-06-25 20:24:09 UTC (rev 204) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-06-25 20:33:34 UTC (rev 205) @@ -27,7 +27,6 @@ import cfeditor.arch.ArchObject; import cfeditor.map.MapControl; import java.awt.Color; -import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Point; import java.awt.event.ActionEvent; Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-06-25 20:24:09 UTC (rev 204) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-06-25 20:33:34 UTC (rev 205) @@ -31,7 +31,6 @@ import daieditor.IGUIConstants; import daieditor.arch.ArchObject; import daieditor.arch.ArchObjectParser; -import java.awt.Dimension; import java.awt.Point; import java.awt.Toolkit; import java.util.ArrayList; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-06-25 20:24:18
|
Revision: 204 Author: akirschbaum Date: 2006-06-25 13:24:09 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=204&view=rev Log Message: ----------- Ignore inwvalid width/height fields when loading a map file. Modified Paths: -------------- trunk/crossfire/src/cfeditor/map/MapArchObject.java trunk/daimonin/src/daieditor/map/MapArchObject.java Modified: trunk/crossfire/src/cfeditor/map/MapArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-06-25 20:23:04 UTC (rev 203) +++ trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-06-25 20:24:09 UTC (rev 204) @@ -779,7 +779,7 @@ return false; } - mapSize = new Size2D(width, height); + mapSize = new Size2D(Math.max(1, width), Math.max(1, height)); return archflag; } Modified: trunk/daimonin/src/daieditor/map/MapArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-06-25 20:23:04 UTC (rev 203) +++ trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-06-25 20:24:09 UTC (rev 204) @@ -560,7 +560,7 @@ return false; } - mapSize = new Size2D(width, height); + mapSize = new Size2D(Math.max(1, width), Math.max(1, height)); return archflag; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-06-25 20:23:08
|
Revision: 203 Author: akirschbaum Date: 2006-06-25 13:23:04 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=203&view=rev Log Message: ----------- Display an error message for invalid map size instead of crashing. Modified Paths: -------------- trunk/daimonin/src/daieditor/CNewMapDialog.java Modified: trunk/daimonin/src/daieditor/CNewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-06-25 20:20:04 UTC (rev 202) +++ trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-06-25 20:23:04 UTC (rev 203) @@ -211,6 +211,11 @@ mapWidthField.requestFocus(); return false; } + if (width < 1) { + ACTION_FACTORY.showMessageDialog(this, "newMapDimensionOutOfRange"); + mapWidthField.requestFocus(); + return false; + } // Get and validate the height final int height; @@ -222,6 +227,11 @@ mapHeightField.requestFocus(); return false; } + if (height < 1) { + ACTION_FACTORY.showMessageDialog(this, "newMapDimensionOutOfRange"); + mapHeightField.requestFocus(); + return false; + } maparch.setMapSize(new Size2D(width, height)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-06-25 20:20:22
|
Revision: 202 Author: akirschbaum Date: 2006-06-25 13:20:04 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=202&view=rev Log Message: ----------- Make the crossfire editor compilable. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CNewMapDialog.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/MapArchObject.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/crossfire/src/cfeditor/map/MapModel.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor; -import app.net.sf.gridarta.Size2D; import static net.sf.japi.swing.ActionFactory.getFactory; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectParser; @@ -54,6 +53,7 @@ import javax.swing.filechooser.FileFilter; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; +import net.sf.gridarta.Size2D; import net.sf.japi.util.filter.file.EndingFileFilter; import net.sf.japi.swing.ActionFactory; import net.sf.gridarta.GridderException; Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor; -import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.map.MapArchObject; import cfeditor.map.MapModel; @@ -41,6 +40,7 @@ import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; +import net.sf.gridarta.Size2D; import org.apache.log4j.Logger; /** Modified: trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor; -import app.net.sf.gridarta.Size2D; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; import java.awt.BorderLayout; @@ -55,6 +54,7 @@ import javax.swing.border.TitledBorder; import net.sf.gridarta.GridderException; import net.sf.gridarta.help.Help; +import net.sf.gridarta.Size2D; /** * Dialog used to ask the user the properties for the new level. Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor; -import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectStack; import cfeditor.filter.AttributeFilter; @@ -53,6 +52,7 @@ import javax.swing.JComponent; import javax.swing.JScrollPane; import javax.swing.JViewport; +import net.sf.gridarta.Size2D; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; Modified: trunk/crossfire/src/cfeditor/CNewMapDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor; -import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObjectStack; import cfeditor.map.MapArchObject; import java.awt.BorderLayout; @@ -45,6 +44,7 @@ import javax.swing.border.EmptyBorder; import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; +import net.sf.gridarta.Size2D; /** * Dialog used to ask the user the properties for the new level. Contains a Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor; -import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.map.DefaultMapModel; import cfeditor.map.MapArchObject; @@ -32,6 +31,7 @@ import cfeditor.map.MapModel; import java.awt.Point; import java.util.Iterator; +import net.sf.gridarta.Size2D; import org.apache.log4j.Logger; /** Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor; -import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.map.MapControl; import java.awt.Color; @@ -47,6 +46,7 @@ import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; +import net.sf.gridarta.Size2D; /** * This dialog manages the replace action. Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor.map; -import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectIterator; import cfeditor.arch.ArchObjectIteratorDeleteArchMapObject; @@ -38,6 +37,7 @@ import cfeditor.IGUIConstants; import java.awt.Point; import java.util.Iterator; +import net.sf.gridarta.Size2D; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; Modified: trunk/crossfire/src/cfeditor/map/MapArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,11 +24,11 @@ package cfeditor.map; -import app.net.sf.gridarta.Size2D; import cfeditor.IGUIConstants; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; +import net.sf.gridarta.Size2D; /** * MapArchObject contains the specific meta data about a map that is stored in Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2006-06-25 20:20:04 UTC (rev 202) @@ -24,7 +24,6 @@ package cfeditor.map; -import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectIterator; import cfeditor.arch.ArchObjectIteratorDeleteMapArch; @@ -38,6 +37,7 @@ import java.io.File; import java.util.Iterator; import net.sf.gridarta.GridderException; +import net.sf.gridarta.Size2D; /** * The <code>MapControl</code> Modified: trunk/crossfire/src/cfeditor/map/MapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapModel.java 2006-06-25 19:18:44 UTC (rev 201) +++ trunk/crossfire/src/cfeditor/map/MapModel.java 2006-06-25 20:20:04 UTC (rev 202) @@ -1,12 +1,12 @@ package cfeditor.map; -import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectIterator; import cfeditor.arch.ArchObjectIteratorDeleteArchMapObject; import cfeditor.arch.ArchObjectIteratorDeleteMapArch; import java.awt.Point; import java.util.Iterator; +import net.sf.gridarta.Size2D; import org.jetbrains.annotations.Nullable; /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-25 19:18:49
|
Revision: 201 Author: christianhujer Date: 2006-06-25 12:18:44 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=201&view=rev Log Message: ----------- Made buttons for moving arches inside the map tile list smaller. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMapTileList.java Modified: trunk/daimonin/src/daieditor/CMapTileList.java =================================================================== --- trunk/daimonin/src/daieditor/CMapTileList.java 2006-06-25 19:11:09 UTC (rev 200) +++ trunk/daimonin/src/daieditor/CMapTileList.java 2006-06-25 19:18:44 UTC (rev 201) @@ -33,6 +33,7 @@ import java.awt.Component; import java.awt.GridLayout; import java.awt.Rectangle; +import java.awt.Insets; import static java.awt.event.InputEvent.SHIFT_MASK; import java.awt.event.MouseEvent; import static java.awt.event.MouseEvent.BUTTON1; @@ -109,11 +110,11 @@ } else { add(arrows, BorderLayout.SOUTH); // put up/down buttons south } - arrows.add(new JButton(ACTION_FACTORY.createAction(true, "moveTileTop", this))); - arrows.add(new JButton(ACTION_FACTORY.createAction(true, "moveTileUp", this))); - arrows.add(new JButton(ACTION_FACTORY.createAction(true, "moveTileDown", this))); - arrows.add(new JButton(ACTION_FACTORY.createAction(true, "moveTileBottom", this))); - + for (final String keyPostfix : new String[] { "Top", "Up", "Down", "Bottom" }) { + final JButton button = new JButton(ACTION_FACTORY.createAction(true, "moveTile" + keyPostfix, this)); + arrows.add(button); + button.setMargin(new Insets(0, 0, 0, 0)); + } final JPanel compass = new JPanel(); compass.add(new JLabel(CGUIUtils.getSysIcon(IGUIConstants.TILE_NORTH))); add(compass, BorderLayout.NORTH); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-25 19:11:16
|
Revision: 200 Author: christianhujer Date: 2006-06-25 12:11:09 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=200&view=rev Log Message: ----------- Released new update version, committing next build number. Modified Paths: -------------- trunk/daimonin/nextBuildNumber.properties Modified: trunk/daimonin/nextBuildNumber.properties =================================================================== --- trunk/daimonin/nextBuildNumber.properties 2006-06-25 19:04:54 UTC (rev 199) +++ trunk/daimonin/nextBuildNumber.properties 2006-06-25 19:11:09 UTC (rev 200) @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sun Jun 25 18:25:54 CEST 2006 -build.number=2923 +#Sun Jun 25 21:11:03 CEST 2006 +build.number=2924 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-25 19:05:05
|
Revision: 199 Author: christianhujer Date: 2006-06-25 12:04:54 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=199&view=rev Log Message: ----------- Integrated tool icons. Modified Paths: -------------- trunk/daimonin/src/daieditor/gui/map/tools/BasicAbstractTool.java trunk/daimonin/src/daieditor/gui/map/tools/Tool.java trunk/daimonin/src/daieditor/gui/map/tools/ToolSelector.java trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java trunk/daimonin/src/daieditor/gui/map/tools/action.properties Modified: trunk/daimonin/src/daieditor/gui/map/tools/BasicAbstractTool.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/BasicAbstractTool.java 2006-06-25 19:03:19 UTC (rev 198) +++ trunk/daimonin/src/daieditor/gui/map/tools/BasicAbstractTool.java 2006-06-25 19:04:54 UTC (rev 199) @@ -1,11 +1,8 @@ package daieditor.gui.map.tools; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NonNls; -import javax.swing.Action; import java.awt.Component; -import net.sf.japi.swing.ActionFactory; +import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.Nullable; /** * Base class for the default provided tools. @@ -13,31 +10,19 @@ */ class BasicAbstractTool extends AbstractTool { - /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor.gui.map.tools"); - /** The ID of this tool. */ @SuppressWarnings({"InstanceVariableNamingConvention"}) @NonNls private final String id; - /** The Action for choosing this tool. */ - private final Action chooseAction; - /** * Create a BasicAbstractTool. * @param id ID (used for {@link #getId()} as well as for the ActionFactory) */ protected BasicAbstractTool(final String id) { this.id = id; - chooseAction = ACTION_FACTORY.createAction(false, id); } /** {@inheritDoc} */ - @NotNull public Action getChooseAction() { - return chooseAction; - } - - /** {@inheritDoc} */ @Nullable public Component createOptionsView() { return null; } Modified: trunk/daimonin/src/daieditor/gui/map/tools/Tool.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/Tool.java 2006-06-25 19:03:19 UTC (rev 198) +++ trunk/daimonin/src/daieditor/gui/map/tools/Tool.java 2006-06-25 19:04:54 UTC (rev 199) @@ -13,12 +13,6 @@ public interface Tool extends MouseOpListener { /** - * Get the action for choosing this tool. - * @return action for choosing this tool or <code>null</code> if this tool cannot be chosen - */ - @NotNull Action getChooseAction(); - - /** * Create a view for changing the options of this tool * @return view for changing the options of this tool or <code>null</code> if this tool hasn't any options */ Modified: trunk/daimonin/src/daieditor/gui/map/tools/ToolSelector.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/ToolSelector.java 2006-06-25 19:03:19 UTC (rev 198) +++ trunk/daimonin/src/daieditor/gui/map/tools/ToolSelector.java 2006-06-25 19:04:54 UTC (rev 199) @@ -4,6 +4,7 @@ import java.awt.CardLayout; import java.awt.Component; import java.awt.FlowLayout; +import java.awt.Insets; import java.awt.event.ActionEvent; import java.util.HashMap; import java.util.Map; @@ -14,6 +15,7 @@ import javax.swing.JToggleButton; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import net.sf.japi.swing.ActionFactory; /** * User interface for selecting a tool and displaying its options. @@ -21,6 +23,9 @@ */ public final class ToolSelector extends JPanel { + /** The Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor.gui.map.tools"); + /** The pane with the selections. */ @NotNull private final JPanel selectionPane = new JPanel(new FlowLayout()); @@ -39,13 +44,16 @@ /** The tools. */ @NotNull private final Map<String, Tool> tools = new HashMap<String, Tool>(); + /** Empty margin. */ + private static final Insets EMPTY_MARGIN = new Insets(0, 0, 0, 0); + /** * Create a ToolSelector component. * @param defaultTool name of the tool that should be selected by default */ public ToolSelector(@NotNull final String defaultTool) { createUI(); - for (final Tool toolToAdd : new Tool[] { new VoidTool(), new SelectionTool(), new InsertionTool(), new DeletionTool() }) { + for (final Tool toolToAdd : new Tool[] { new VoidTool(), new SelectionTool(), new DeletionTool(), new InsertionTool() }) { add(toolToAdd, toolToAdd.getId().equals(defaultTool)); } } @@ -74,6 +82,7 @@ private void add(@NotNull final Tool tool, final boolean selected) { @NotNull final Action selectionAction = new SelectionAction(tool); @NotNull final JToggleButton toggleButton = new JToggleButton(selectionAction); + toggleButton.setMargin(EMPTY_MARGIN); @NotNull final Component optionsView = createOptionsView(tool); selectionButtonGroup.add(toggleButton); selectionPane.add(toggleButton); @@ -142,8 +151,7 @@ */ SelectionAction(@NotNull final Tool tool) { this.tool = tool; - @NotNull final Action chooseAction = tool.getChooseAction(); - putValue(NAME, chooseAction.getValue(NAME)); + ACTION_FACTORY.initAction(false, this, tool.getId()); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java 2006-06-25 19:03:19 UTC (rev 198) +++ trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java 2006-06-25 19:04:54 UTC (rev 199) @@ -19,6 +19,9 @@ /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor.gui.map.tools"); + /** The JTabbedPane for the three tabs, one for each mousebutton. */ + private final JTabbedPane mouseTabs = new JTabbedPane(); + /** The ToolSelector for lmb. */ private ToolSelector lmbSelector = new ToolSelector("selection"); @@ -32,7 +35,6 @@ public ToolSelectorPane() { super(new BorderLayout()); add(new JLabel(ACTION_FACTORY.getString("mouse")), BorderLayout.NORTH); - final JTabbedPane mouseTabs = new JTabbedPane(); mouseTabs.add(ACTION_FACTORY.getString("left"), lmbSelector); mouseTabs.add(ACTION_FACTORY.getString("middle"), mmbSelector); mouseTabs.add(ACTION_FACTORY.getString("right"), rmbSelector); Modified: trunk/daimonin/src/daieditor/gui/map/tools/action.properties =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/action.properties 2006-06-25 19:03:19 UTC (rev 198) +++ trunk/daimonin/src/daieditor/gui/map/tools/action.properties 2006-06-25 19:04:54 UTC (rev 199) @@ -1,7 +1,11 @@ -selection.text=SEL -deletion.text=DEL -insertion.text=INS -void.text=VOID +selection.icon=misc/Select16 +selection.shortdescription=Select regions of the map. +deletion.icon=misc/Delete16 +deletion.shortdescription=Delete topmost or bottommost objects. +insertion.icon=misc/Insert16 +insertion.shortdescription=Insert topmost objects. +void.icon=misc/Void16 +void.shortdescription=Do nothing (makes selected mouse button inactive). deleteBelow.text=Delete below left=left middle=middle This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-25 19:03:30
|
Revision: 198 Author: christianhujer Date: 2006-06-25 12:03:19 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=198&view=rev Log Message: ----------- Added icons for tools. Added Paths: ----------- trunk/daimonin/resource/toolbarButtonGraphics/misc/ trunk/daimonin/resource/toolbarButtonGraphics/misc/Delete16.gif trunk/daimonin/resource/toolbarButtonGraphics/misc/Insert16.gif trunk/daimonin/resource/toolbarButtonGraphics/misc/Select16.gif trunk/daimonin/resource/toolbarButtonGraphics/misc/Void16.gif Added: trunk/daimonin/resource/toolbarButtonGraphics/misc/Delete16.gif =================================================================== (Binary files differ) Property changes on: trunk/daimonin/resource/toolbarButtonGraphics/misc/Delete16.gif ___________________________________________________________________ Name: svn:mime-type + image/gif Added: trunk/daimonin/resource/toolbarButtonGraphics/misc/Insert16.gif =================================================================== (Binary files differ) Property changes on: trunk/daimonin/resource/toolbarButtonGraphics/misc/Insert16.gif ___________________________________________________________________ Name: svn:mime-type + image/gif Added: trunk/daimonin/resource/toolbarButtonGraphics/misc/Select16.gif =================================================================== (Binary files differ) Property changes on: trunk/daimonin/resource/toolbarButtonGraphics/misc/Select16.gif ___________________________________________________________________ Name: svn:mime-type + image/gif Added: trunk/daimonin/resource/toolbarButtonGraphics/misc/Void16.gif =================================================================== (Binary files differ) Property changes on: trunk/daimonin/resource/toolbarButtonGraphics/misc/Void16.gif ___________________________________________________________________ Name: svn:mime-type + image/gif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-25 16:26:03
|
Revision: 197 Author: christianhujer Date: 2006-06-25 09:25:57 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=197&view=rev Log Message: ----------- Released new update version, committing next build number. Modified Paths: -------------- trunk/daimonin/nextBuildNumber.properties Modified: trunk/daimonin/nextBuildNumber.properties =================================================================== --- trunk/daimonin/nextBuildNumber.properties 2006-06-25 16:24:48 UTC (rev 196) +++ trunk/daimonin/nextBuildNumber.properties 2006-06-25 16:25:57 UTC (rev 197) @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sun Jun 25 18:22:14 CEST 2006 -build.number=2922 +#Sun Jun 25 18:25:54 CEST 2006 +build.number=2923 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-25 16:24:53
|
Revision: 196 Author: christianhujer Date: 2006-06-25 09:24:48 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=196&view=rev Log Message: ----------- Fixed but which would omit additional toolbar button graphics. Modified Paths: -------------- trunk/daimonin/build.xml Modified: trunk/daimonin/build.xml =================================================================== --- trunk/daimonin/build.xml 2006-06-25 16:22:16 UTC (rev 195) +++ trunk/daimonin/build.xml 2006-06-25 16:24:48 UTC (rev 196) @@ -97,6 +97,7 @@ <copy todir="${build.dir}"> <fileset dir="${resource.dir}"> <include name="icons/**/*.*"/> + <include name="toolbarButtonGraphics/**/*.*"/> <include name="system/**/*.*"/> <exclude name="**/.xvpics/**"/> </fileset> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-25 16:22:21
|
Revision: 195 Author: christianhujer Date: 2006-06-25 09:22:16 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=195&view=rev Log Message: ----------- Released new update version, committing next build number. Modified Paths: -------------- trunk/daimonin/nextBuildNumber.properties Modified: trunk/daimonin/nextBuildNumber.properties =================================================================== --- trunk/daimonin/nextBuildNumber.properties 2006-06-25 16:16:39 UTC (rev 194) +++ trunk/daimonin/nextBuildNumber.properties 2006-06-25 16:22:16 UTC (rev 195) @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sun Jun 25 17:28:06 CEST 2006 -build.number=2921 +#Sun Jun 25 18:22:14 CEST 2006 +build.number=2922 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-25 16:16:53
|
Revision: 194 Author: christianhujer Date: 2006-06-25 09:16:39 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=194&view=rev Log Message: ----------- Fixed wrong tool assignment. Added feature to move arches within their square top or bottom. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMapTileList.java trunk/daimonin/src/daieditor/action.properties trunk/daimonin/src/daieditor/arch/ArchObject.java trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java Modified: trunk/daimonin/src/daieditor/CMapTileList.java =================================================================== --- trunk/daimonin/src/daieditor/CMapTileList.java 2006-06-25 16:10:56 UTC (rev 193) +++ trunk/daimonin/src/daieditor/CMapTileList.java 2006-06-25 16:16:39 UTC (rev 194) @@ -54,6 +54,7 @@ import net.sf.gridarta.gui.map.MapCursorEvent; import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.japi.swing.ActionFactory; +import net.sf.japi.swing.ActionMethod; import static net.sf.japi.swing.ActionFactory.getFactory; /** @@ -103,13 +104,15 @@ final JPanel arrows = new JPanel(); if (mainView.isMapTileListBottom()) { - arrows.setLayout(new GridLayout(2, 1)); + arrows.setLayout(new GridLayout(4, 1)); add(arrows, BorderLayout.WEST); // put up/down buttons west } else { add(arrows, BorderLayout.SOUTH); // put up/down buttons south } + arrows.add(new JButton(ACTION_FACTORY.createAction(true, "moveTileTop", this))); arrows.add(new JButton(ACTION_FACTORY.createAction(true, "moveTileUp", this))); arrows.add(new JButton(ACTION_FACTORY.createAction(true, "moveTileDown", this))); + arrows.add(new JButton(ACTION_FACTORY.createAction(true, "moveTileBottom", this))); final JPanel compass = new JPanel(); compass.add(new JLabel(CGUIUtils.getSysIcon(IGUIConstants.TILE_NORTH))); @@ -125,10 +128,22 @@ } /** + * Action method for moving an arch topmost within its tile. + * @used + */ + @ActionMethod public void moveTileTop() { + final ArchObject arch = getMapTileSelection(); + if (arch != null) { + arch.moveTop(); + } + refresh(); + } + + /** * Action method for moving an arch up within its tile. * @used */ - public void moveTileUp() { + @ActionMethod public void moveTileUp() { final ArchObject arch = getMapTileSelection(); if (arch != null) { arch.moveUp(); @@ -140,7 +155,7 @@ * Action method for moving an arch down within its tile. * @used */ - public void moveTileDown() { + @ActionMethod public void moveTileDown() { final ArchObject arch = getMapTileSelection(); if (arch != null) { arch.moveDown(); @@ -148,6 +163,18 @@ refresh(); } + /** + * Action method for moving an arch topmost within its tile. + * @used + */ + @ActionMethod public void moveTileBottom() { + final ArchObject arch = getMapTileSelection(); + if (arch != null) { + arch.moveBottom(); + } + refresh(); + } + public void selectArchBelow() { list.setSelectedIndex(list.getSelectedIndex() + 1); } Modified: trunk/daimonin/src/daieditor/action.properties =================================================================== --- trunk/daimonin/src/daieditor/action.properties 2006-06-25 16:10:56 UTC (rev 193) +++ trunk/daimonin/src/daieditor/action.properties 2006-06-25 16:16:39 UTC (rev 194) @@ -162,8 +162,10 @@ direction7.icon=Dir7 direction8.icon=Dir8 +moveTileTop.icon=navigation/Top16 moveTileUp.icon=navigation/Up16 moveTileDown.icon=navigation/Down16 +moveTileBottom.icon=navigation/Bottom16 prefsApp.icon=development/Application24 Modified: trunk/daimonin/src/daieditor/arch/ArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-06-25 16:10:56 UTC (rev 193) +++ trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-06-25 16:16:39 UTC (rev 194) @@ -567,6 +567,11 @@ return artifact; } + /** Move this ArchObject top. */ + public void moveTop() { + container.moveTop(this); + } + /** Move this ArchObject up. */ public void moveUp() { container.moveUp(this); @@ -577,6 +582,11 @@ container.moveDown(this); } + /** Move this ArchObject bottom. */ + public void moveBottom() { + container.moveBottom(this); + } + /** * Remove this ArchObject from its container. * This method also takes perfectly well care of multihead arches. Modified: trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java 2006-06-25 16:10:56 UTC (rev 193) +++ trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java 2006-06-25 16:16:39 UTC (rev 194) @@ -164,7 +164,7 @@ */ public final void moveTop(final ArchObject arch) { getMapSquare().getModel().beginTransaction(); - while (first != arch) { + while (last != arch) { swap(arch, arch.getNext()); } getMapSquare().getModel().endTransaction(); @@ -187,13 +187,13 @@ } /** - * Move an item to top. - * @param arch item to move to top + * Move an item to bottom. + * @param arch item to move to bottom */ public final void moveBottom(final ArchObject arch) { getMapSquare().getModel().beginTransaction(); - while (last != arch) { - swap(arch, arch.getPrev()); + while (first != arch) { + swap(arch.getPrev(), arch); } getMapSquare().getModel().endTransaction(); } Modified: trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java 2006-06-25 16:10:56 UTC (rev 193) +++ trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java 2006-06-25 16:16:39 UTC (rev 194) @@ -23,10 +23,10 @@ private ToolSelector lmbSelector = new ToolSelector("selection"); /** The ToolSelector for mmb. */ - private ToolSelector mmbSelector = new ToolSelector("insertion"); + private ToolSelector mmbSelector = new ToolSelector("deletion"); /** The ToolSelector for rmb. */ - private ToolSelector rmbSelector = new ToolSelector("deletion"); + private ToolSelector rmbSelector = new ToolSelector("insertion"); /** Create a ToolSelectorPane. */ public ToolSelectorPane() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-25 16:11:05
|
Revision: 193 Author: christianhujer Date: 2006-06-25 09:10:56 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=193&view=rev Log Message: ----------- Adding graphics for move to top / bottom. Added Paths: ----------- trunk/daimonin/resource/toolbarButtonGraphics/ trunk/daimonin/resource/toolbarButtonGraphics/navigation/ trunk/daimonin/resource/toolbarButtonGraphics/navigation/Bottom16.gif trunk/daimonin/resource/toolbarButtonGraphics/navigation/Top16.gif Added: trunk/daimonin/resource/toolbarButtonGraphics/navigation/Bottom16.gif =================================================================== (Binary files differ) Property changes on: trunk/daimonin/resource/toolbarButtonGraphics/navigation/Bottom16.gif ___________________________________________________________________ Name: svn:mime-type + image/gif Added: trunk/daimonin/resource/toolbarButtonGraphics/navigation/Top16.gif =================================================================== (Binary files differ) Property changes on: trunk/daimonin/resource/toolbarButtonGraphics/navigation/Top16.gif ___________________________________________________________________ Name: svn:mime-type + image/gif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-25 15:28:19
|
Revision: 192 Author: christianhujer Date: 2006-06-25 08:28:11 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=192&view=rev Log Message: ----------- Released new update version, committing next build number. Modified Paths: -------------- trunk/daimonin/nextBuildNumber.properties Modified: trunk/daimonin/nextBuildNumber.properties =================================================================== --- trunk/daimonin/nextBuildNumber.properties 2006-06-25 15:23:50 UTC (rev 191) +++ trunk/daimonin/nextBuildNumber.properties 2006-06-25 15:28:11 UTC (rev 192) @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sun Jun 25 17:23:48 CEST 2006 -build.number=2920 +#Sun Jun 25 17:28:06 CEST 2006 +build.number=2921 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-25 15:23:56
|
Revision: 191 Author: christianhujer Date: 2006-06-25 08:23:50 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=191&view=rev Log Message: ----------- Released new update version, committing next build number. Modified Paths: -------------- trunk/daimonin/nextBuildNumber.properties Modified: trunk/daimonin/nextBuildNumber.properties =================================================================== --- trunk/daimonin/nextBuildNumber.properties 2006-06-25 15:18:05 UTC (rev 190) +++ trunk/daimonin/nextBuildNumber.properties 2006-06-25 15:23:50 UTC (rev 191) @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sun May 28 23:56:17 CEST 2006 -build.number=2919 +#Sun Jun 25 17:23:48 CEST 2006 +build.number=2920 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-25 15:18:22
|
Revision: 190 Author: christianhujer Date: 2006-06-25 08:18:05 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=190&view=rev Log Message: ----------- Changed tool selection and configuration. Modified Paths: -------------- trunk/daimonin/src/daieditor/CArchPanel.java trunk/daimonin/src/daieditor/gui/map/MapUserListener.java trunk/daimonin/src/daieditor/gui/map/tools/DeletionTool.java trunk/daimonin/src/daieditor/gui/map/tools/InsertionTool.java trunk/daimonin/src/daieditor/gui/map/tools/SelectionTool.java trunk/daimonin/src/daieditor/gui/map/tools/Tool.java trunk/daimonin/src/daieditor/gui/map/tools/ToolSelector.java trunk/daimonin/src/daieditor/gui/map/tools/action.properties Added Paths: ----------- trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java Modified: trunk/daimonin/src/daieditor/CArchPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CArchPanel.java 2006-06-25 14:13:17 UTC (rev 189) +++ trunk/daimonin/src/daieditor/CArchPanel.java 2006-06-25 15:18:05 UTC (rev 190) @@ -25,13 +25,8 @@ package daieditor; import daieditor.arch.ArchObject; -import daieditor.gui.map.tools.DeletionTool; -import daieditor.gui.map.tools.InsertionTool; -import daieditor.gui.map.tools.SelectionTool; -import daieditor.gui.map.tools.ToolSelector; +import daieditor.gui.map.tools.ToolSelectorPane; import java.awt.BorderLayout; -import static java.awt.event.MouseEvent.BUTTON2; -import static java.awt.event.MouseEvent.BUTTON3; import java.util.ArrayList; import java.util.List; import javax.swing.BorderFactory; @@ -57,7 +52,7 @@ private final transient CMainControl mainControl; /** ToolSelector of this subview. */ - private final ToolSelector toolSelector = new ToolSelector(); + private final ToolSelectorPane toolSelectorPane = new ToolSelectorPane(); /** * Name of the selected arch. @@ -106,12 +101,7 @@ // TODO: introduce a tool registry - toolSelector.add(SelectionTool.instance); - toolSelector.add(InsertionTool.instance); - toolSelector.setDefault(BUTTON3, InsertionTool.instance); - toolSelector.add(DeletionTool.instance); - toolSelector.setDefault(BUTTON2, DeletionTool.instance); - add(toolSelector, BorderLayout.NORTH); + add(toolSelectorPane, BorderLayout.NORTH); add(archAndPickPane, BorderLayout.CENTER); add(archQuickPanel, BorderLayout.SOUTH); @@ -204,9 +194,9 @@ this.selectedArch = selectedArch; } - /** Getter of <code>toolSelector</code>. */ - public ToolSelector getToolSelector() { - return toolSelector; + /** Getter of <code>toolSelectorPane</code>. */ + public ToolSelectorPane getToolSelectorPane() { + return toolSelectorPane; } public static final class PanelNode { Modified: trunk/daimonin/src/daieditor/gui/map/MapUserListener.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapUserListener.java 2006-06-25 14:13:17 UTC (rev 189) +++ trunk/daimonin/src/daieditor/gui/map/MapUserListener.java 2006-06-25 15:18:05 UTC (rev 190) @@ -25,7 +25,7 @@ import daieditor.CMapViewBasic; import daieditor.gui.map.event.MouseOpEvent; import daieditor.gui.map.event.MouseOpListener; -import daieditor.gui.map.tools.ToolSelector; +import daieditor.gui.map.tools.ToolSelectorPane; import daieditor.map.MapControl; import java.awt.Point; import java.awt.event.MouseEvent; @@ -36,7 +36,7 @@ public final class MapUserListener implements MouseListener, MouseMotionListener { /** ToolSelector of ArchPanel. */ - private final ToolSelector toolSelector; + private final ToolSelectorPane toolSelectorPane; private MapCursor mapCursor; private DefaultLevelRenderer renderer; @@ -52,7 +52,7 @@ public MapUserListener(final CMainControl mainControl, final MapControl mapControl, final CMapViewBasic mapView) { this.mainControl = mainControl; this.mapControl = mapControl; - toolSelector = mainControl.getMainView().archPanel.getToolSelector(); + toolSelectorPane = mainControl.getMainView().archPanel.getToolSelectorPane(); mapCursor = mapView.getMapCursor(); renderer = mapView.getRenderer(); } @@ -131,7 +131,7 @@ */ @Nullable private MouseOpListener getMouseOperation(final MouseEvent event) { initEvent(event); - return toolSelector.getMouseOpListener(mouseOpEvent); + return toolSelectorPane.getTool(mouseOpEvent); } /** Modified: trunk/daimonin/src/daieditor/gui/map/tools/DeletionTool.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/DeletionTool.java 2006-06-25 14:13:17 UTC (rev 189) +++ trunk/daimonin/src/daieditor/gui/map/tools/DeletionTool.java 2006-06-25 15:18:05 UTC (rev 190) @@ -26,8 +26,6 @@ /** The position for deletion. */ private boolean deleteBelow; - public static final DeletionTool instance = new DeletionTool(); - /** Create a DeletionTool. */ public DeletionTool() { super("deletion"); Modified: trunk/daimonin/src/daieditor/gui/map/tools/InsertionTool.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/InsertionTool.java 2006-06-25 14:13:17 UTC (rev 189) +++ trunk/daimonin/src/daieditor/gui/map/tools/InsertionTool.java 2006-06-25 15:18:05 UTC (rev 190) @@ -27,8 +27,6 @@ /** The position for deletion. */ private boolean deleteBelow; - public static final InsertionTool instance = new InsertionTool(); - /** * Create a BasicAbstractTool. */ Modified: trunk/daimonin/src/daieditor/gui/map/tools/SelectionTool.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/SelectionTool.java 2006-06-25 14:13:17 UTC (rev 189) +++ trunk/daimonin/src/daieditor/gui/map/tools/SelectionTool.java 2006-06-25 15:18:05 UTC (rev 190) @@ -11,8 +11,6 @@ /** MouseOpListener for selection */ public class SelectionTool extends BasicAbstractTool { - public static final SelectionTool instance = new SelectionTool(); - /** * Create a BasicAbstractTool. */ Modified: trunk/daimonin/src/daieditor/gui/map/tools/Tool.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/Tool.java 2006-06-25 14:13:17 UTC (rev 189) +++ trunk/daimonin/src/daieditor/gui/map/tools/Tool.java 2006-06-25 15:18:05 UTC (rev 190) @@ -4,12 +4,13 @@ import java.awt.Component; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import daieditor.gui.map.event.MouseOpListener; /** * Interface for tools that are used to manipulate maps. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public interface Tool { +public interface Tool extends MouseOpListener { /** * Get the action for choosing this tool. Modified: trunk/daimonin/src/daieditor/gui/map/tools/ToolSelector.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/ToolSelector.java 2006-06-25 14:13:17 UTC (rev 189) +++ trunk/daimonin/src/daieditor/gui/map/tools/ToolSelector.java 2006-06-25 15:18:05 UTC (rev 190) @@ -1,24 +1,15 @@ package daieditor.gui.map.tools; -import daieditor.gui.map.event.MouseOpEvent; -import daieditor.gui.map.event.MouseOpListener; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; import java.awt.FlowLayout; import java.awt.event.ActionEvent; -import java.awt.event.MouseEvent; -import static java.awt.event.InputEvent.BUTTON2_DOWN_MASK; -import static java.awt.event.InputEvent.BUTTON3_DOWN_MASK; -import static java.awt.event.MouseEvent.BUTTON1; -import static java.awt.event.MouseEvent.BUTTON2; -import static java.awt.event.MouseEvent.BUTTON3; import java.util.HashMap; import java.util.Map; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.ButtonGroup; -import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JToggleButton; import org.jetbrains.annotations.NotNull; @@ -49,18 +40,14 @@ @NotNull private final Map<String, Tool> tools = new HashMap<String, Tool>(); /** - * Default mapping of mouse button to Tool. - * The key is the mouse button ({@link MouseEvent#getButton()}). + * Create a ToolSelector component. + * @param defaultTool name of the tool that should be selected by default */ - @NotNull private final Map<Integer, MouseOpListener> defaultMouseOpListeners = new HashMap<Integer, MouseOpListener>(); - - /** Create a ToolSelector component. */ - public ToolSelector() { + public ToolSelector(@NotNull final String defaultTool) { createUI(); - @NotNull final Tool voidTool = new VoidTool(); - selectedTool = voidTool; - add(voidTool, true); - setSelectedTool(voidTool); + for (final Tool toolToAdd : new Tool[] { new VoidTool(), new SelectionTool(), new InsertionTool(), new DeletionTool() }) { + add(toolToAdd, toolToAdd.getId().equals(defaultTool)); + } } /** Create the user interface elements of the ToolSelector. */ @@ -84,7 +71,7 @@ * @param tool Tool to add * @param selected <code>true</code> if the tool should be made the selected tool, otherwise <code>false</code> */ - private void add(final Tool tool, final boolean selected) { + private void add(@NotNull final Tool tool, final boolean selected) { @NotNull final Action selectionAction = new SelectionAction(tool); @NotNull final JToggleButton toggleButton = new JToggleButton(selectionAction); @NotNull final Component optionsView = createOptionsView(tool); @@ -93,6 +80,10 @@ optionsPane.add(optionsView, tool.getId()); toggleButton.setSelected(selected); tools.put(tool.getId(), tool); + if (selected) { + selectedTool = tool; + optionCards.show(optionsPane, tool.getId()); + } } /** @@ -138,42 +129,6 @@ } /** - * Returns <code>MouseOpListener</code> depending on the <code>event</code> - * and the default settings. - * @param event This event's button and modifiers are needed - * @return Default <code>MouseOpListener</code> or <code>null</code> if mouse button is not bound to a tool. - */ - @Nullable public MouseOpListener getMouseOpListener(final MouseOpEvent event) { - final int button = event.getButton(); - if (button != BUTTON1) { - @Nullable final MouseOpListener mouseOpListener = defaultMouseOpListeners.get(button); - if (mouseOpListener != null) { - return mouseOpListener; - } - } - final int modifiers = event.getModifiers(); - if ((modifiers & BUTTON2_DOWN_MASK) != 0) { - return defaultMouseOpListeners.get(BUTTON2); - } - if ((modifiers & BUTTON3_DOWN_MASK) != 0) { - return defaultMouseOpListeners.get(BUTTON3); - } - if (selectedTool instanceof MouseOpListener) { - return (MouseOpListener) selectedTool; - } - return null; - } - - /** - * Set a default <code>MouseOpListener</code> for a mouse button. - * @param button Button number - * @param mouseOpListener This will become the default Listener for the mouse button. - */ - public void setDefault(final int button, @Nullable final MouseOpListener mouseOpListener) { - defaultMouseOpListeners.put(button, mouseOpListener); - } - - /** * Action for selecting a tool. */ private final class SelectionAction extends AbstractAction { @@ -198,15 +153,4 @@ } // class SelectionAction - public static void main(final String[] args) { - final JFrame frame = new JFrame(); - final ToolSelector selector = new ToolSelector(); - selector.add(new DeletionTool()); - selector.add(new InsertionTool()); - selector.add(new SelectionTool()); - frame.add(selector, BorderLayout.EAST); - frame.setVisible(true); - frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - } - } // class ToolSelector Added: trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java (rev 0) +++ trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java 2006-06-25 15:18:05 UTC (rev 190) @@ -0,0 +1,76 @@ +package daieditor.gui.map.tools; + +import daieditor.gui.map.event.MouseOpEvent; +import java.awt.BorderLayout; +import java.awt.event.MouseEvent; +import javax.swing.JPanel; +import javax.swing.JTabbedPane; +import javax.swing.JLabel; +import org.jetbrains.annotations.Nullable; +import net.sf.japi.swing.ActionFactory; + +/** + * Pane for controlling which mouse to select and configure tools for. + * Also serves as a proxy for querying which tool is bound to which mouse button. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class ToolSelectorPane extends JPanel { + + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor.gui.map.tools"); + + /** The ToolSelector for lmb. */ + private ToolSelector lmbSelector = new ToolSelector("selection"); + + /** The ToolSelector for mmb. */ + private ToolSelector mmbSelector = new ToolSelector("insertion"); + + /** The ToolSelector for rmb. */ + private ToolSelector rmbSelector = new ToolSelector("deletion"); + + /** Create a ToolSelectorPane. */ + public ToolSelectorPane() { + super(new BorderLayout()); + add(new JLabel(ACTION_FACTORY.getString("mouse")), BorderLayout.NORTH); + final JTabbedPane mouseTabs = new JTabbedPane(); + mouseTabs.add(ACTION_FACTORY.getString("left"), lmbSelector); + mouseTabs.add(ACTION_FACTORY.getString("middle"), mmbSelector); + mouseTabs.add(ACTION_FACTORY.getString("right"), rmbSelector); + add(mouseTabs); + } + + /** + * Returns <code>MouseOpListener</code> depending on the <code>event</code> + * and the default settings. + * @param event This event's button and modifiers are needed + * @return Default <code>MouseOpListener</code> or <code>null</code> if mouse button is not bound to a tool. + */ + @Nullable public Tool getTool(final MouseOpEvent event) { + final int button = event.getButton(); + final ToolSelector toolSelector; + switch (button) { + case MouseEvent.BUTTON1: + toolSelector = lmbSelector; + break; + case MouseEvent.BUTTON2: + toolSelector = mmbSelector; + break; + case MouseEvent.BUTTON3: + toolSelector = rmbSelector; + break; + default: + final int mask = event.getModifiers(); + if ((mask & MouseEvent.BUTTON1_DOWN_MASK) == MouseEvent.BUTTON1_DOWN_MASK) { + toolSelector = lmbSelector; + } else if ((mask & MouseEvent.BUTTON2_DOWN_MASK) == MouseEvent.BUTTON2_DOWN_MASK) { + toolSelector = mmbSelector; + } else if ((mask & MouseEvent.BUTTON3_DOWN_MASK) == MouseEvent.BUTTON3_DOWN_MASK) { + toolSelector = rmbSelector; + } else { + return null; + } + } + return toolSelector.getSelectedTool(); + } + +} // class ToolSelectorPane Property changes on: trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/daimonin/src/daieditor/gui/map/tools/action.properties =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/action.properties 2006-06-25 14:13:17 UTC (rev 189) +++ trunk/daimonin/src/daieditor/gui/map/tools/action.properties 2006-06-25 15:18:05 UTC (rev 190) @@ -2,4 +2,8 @@ deletion.text=DEL insertion.text=INS void.text=VOID -deleteBelow.text=Delete below \ No newline at end of file +deleteBelow.text=Delete below +left=left +middle=middle +right=right +mouse=Mousebutton \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-25 14:13:29
|
Revision: 189 Author: christianhujer Date: 2006-06-25 07:13:17 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=189&view=rev Log Message: ----------- Fixed eol-style. Property Changed: ---------------- trunk/src/app/net/sf/gridarta/Size2D.java Property changes on: trunk/src/app/net/sf/gridarta/Size2D.java ___________________________________________________________________ Name: svn:eol-style - native + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-25 14:10:59
|
Revision: 188 Author: christianhujer Date: 2006-06-25 07:10:25 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=188&view=rev Log Message: ----------- Fixed bug in Size2D (package and documentation). Changed MapCursorTest for Size2D. Changed transaction system for MapSquare changes. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMapFileEncode.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/CNewMapDialog.java trunk/daimonin/src/daieditor/CopyBuffer.java trunk/daimonin/src/daieditor/arch/ArchObject.java trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java trunk/daimonin/src/daieditor/gui/map/MapTilePane.java trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/MapArchObject.java trunk/daimonin/src/daieditor/map/MapControl.java trunk/daimonin/src/daieditor/map/MapModel.java trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java trunk/src/app/net/sf/gridarta/Size2D.java trunk/src/app/net/sf/gridarta/gui/map/MapGrid.java Modified: trunk/daimonin/src/daieditor/CMapFileEncode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-06-25 13:25:39 UTC (rev 187) +++ trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-06-25 14:10:25 UTC (rev 188) @@ -24,7 +24,6 @@ package daieditor; -import app.net.sf.gridarta.Size2D; import daieditor.arch.ArchObject; import daieditor.map.MapArchObject; import daieditor.map.MapModel; @@ -36,6 +35,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; +import net.sf.gridarta.Size2D; /** * The <code>CMapFileEncode</code> Modified: trunk/daimonin/src/daieditor/CMapViewBasic.java =================================================================== --- trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-06-25 13:25:39 UTC (rev 187) +++ trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-06-25 14:10:25 UTC (rev 188) @@ -24,7 +24,6 @@ package daieditor; -import app.net.sf.gridarta.Size2D; import daieditor.arch.ArchObject; import daieditor.gui.map.DefaultLevelRenderer; import daieditor.gui.map.MapUserListener; @@ -50,6 +49,7 @@ import javax.imageio.ImageIO; import javax.swing.JScrollPane; import javax.swing.JViewport; +import net.sf.gridarta.Size2D; import net.sf.gridarta.gui.map.MapCursor; import net.sf.gridarta.gui.map.MapCursorEvent; import net.sf.gridarta.gui.map.MapCursorListener; Modified: trunk/daimonin/src/daieditor/CNewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-06-25 13:25:39 UTC (rev 187) +++ trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-06-25 14:10:25 UTC (rev 188) @@ -25,7 +25,6 @@ package daieditor; -import app.net.sf.gridarta.Size2D; import static net.sf.japi.swing.ActionFactory.getFactory; import static daieditor.CMainControl.PREFS_USERNAME; import static daieditor.CMainControl.PREFS_USERNAME_DEFAULT; @@ -50,6 +49,7 @@ import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; import net.sf.japi.swing.ActionFactory; +import net.sf.gridarta.Size2D; /** * Dialog used to ask the user the properties for the new level. Contains a Modified: trunk/daimonin/src/daieditor/CopyBuffer.java =================================================================== --- trunk/daimonin/src/daieditor/CopyBuffer.java 2006-06-25 13:25:39 UTC (rev 187) +++ trunk/daimonin/src/daieditor/CopyBuffer.java 2006-06-25 14:10:25 UTC (rev 188) @@ -24,7 +24,6 @@ package daieditor; -import app.net.sf.gridarta.Size2D; import static daieditor.CMainControl.rnd; import daieditor.arch.ArchObject; import daieditor.map.MapArchObject; @@ -36,6 +35,7 @@ import java.util.ArrayList; import java.util.List; import org.jetbrains.annotations.Nullable; +import net.sf.gridarta.Size2D; /** * This class manages the cut/copy/paste actions in maps. The data is stored in @@ -148,7 +148,7 @@ } final Point offset = selRec.getLocation(); - mapControl.getMapModel().setAutoCommitSquareChanges(false); + mapControl.getMapModel().beginTransaction(); for (final MapSquare square : mapControl.getMapViewFrame().view.getSelectedSquares()) { final int posx = square.getMapX(); final int posy = square.getMapY(); @@ -178,7 +178,7 @@ } } } - mapControl.getMapModel().setAutoCommitSquareChanges(true); + mapControl.getMapModel().endTransaction(); // finally redraw the map if (mode != Mode.DO_COPY) { mainControl.refreshCurrentMap(); @@ -195,7 +195,7 @@ assert startp != null; // cycle through all tile coordinates which are highlighted: - mapControl.getMapModel().setAutoCommitSquareChanges(false); + mapControl.getMapModel().beginTransaction(); final Point pos = new Point(); assert copyMap != null; ArchObject clone; @@ -240,7 +240,7 @@ } } } - mapControl.getMapModel().setAutoCommitSquareChanges(true); + mapControl.getMapModel().endTransaction(); // now the map and toolbars must be redrawn mapControl.repaint(); @@ -282,7 +282,7 @@ assert p != null; floodfill(mapControl, p.x, p.y, archList); // floodfill } else { - mapControl.getMapModel().setAutoCommitSquareChanges(false); + mapControl.getMapModel().beginTransaction(); for (final Point p : mapControl.getMapViewFrame().view.getSelection()) { if (rand != -1 && rand != 100 && rand < rnd.nextInt(100) + 1) { continue; @@ -296,7 +296,7 @@ mapControl.addArchObjectToMap(arch.createClone(p.x, p.y), fillBelow); } } - mapControl.getMapModel().setAutoCommitSquareChanges(true); + mapControl.getMapModel().endTransaction(); } // now the map and toolbars must be redrawn @@ -420,7 +420,7 @@ final byte[][] area = new byte[mapSize.getWidth()][mapSize.getHeight()]; area[startX][startY] = BORDER; //int iter = 0; - mapControl.getMapModel().setAutoCommitSquareChanges(false); + mapControl.getMapModel().beginTransaction(); int border = 1; while (border > 0) { //iter++; @@ -469,7 +469,7 @@ } } } - mapControl.getMapModel().setAutoCommitSquareChanges(true); + mapControl.getMapModel().endTransaction(); //mainControl.setStatusText("Flood fill took " + (System.currentTimeMillis() - start) + " milliseconds in " + iter + " iterations."); } Modified: trunk/daimonin/src/daieditor/arch/ArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-06-25 13:25:39 UTC (rev 187) +++ trunk/daimonin/src/daieditor/arch/ArchObject.java 2006-06-25 14:10:25 UTC (rev 188) @@ -271,6 +271,7 @@ * determined by the various attributes of the arch (->archText). * @param checkType bitmask containing the edit type(s) to be calculated * @return new editType for this arch + * @todo use arch object matchers, eventually deprecated this method and remove it */ public int calculateEditType(final int checkType) { /* if one of the types in checkType already is in editType, Modified: trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java =================================================================== --- trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java 2006-06-25 13:25:39 UTC (rev 187) +++ trunk/daimonin/src/daieditor/arch/ArchObjectContainer.java 2006-06-25 14:10:25 UTC (rev 188) @@ -159,6 +159,18 @@ } /** + * Move an item to top. + * @param arch item to move to top + */ + public final void moveTop(final ArchObject arch) { + getMapSquare().getModel().beginTransaction(); + while (first != arch) { + swap(arch, arch.getNext()); + } + getMapSquare().getModel().endTransaction(); + } + + /** * Move an item up. * @param arch item to move up */ @@ -175,6 +187,18 @@ } /** + * Move an item to top. + * @param arch item to move to top + */ + public final void moveBottom(final ArchObject arch) { + getMapSquare().getModel().beginTransaction(); + while (last != arch) { + swap(arch, arch.getPrev()); + } + getMapSquare().getModel().endTransaction(); + } + + /** * Swap to ArchObjects, exchanging them with each other. * If at least one of <var>a1</var> and <var>a2</var> is <code>null</code>, this method simply does nothing. * @param a1 first ArchObject, maybe <code>null</code> Modified: trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2006-06-25 13:25:39 UTC (rev 187) +++ trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2006-06-25 14:10:25 UTC (rev 188) @@ -25,7 +25,6 @@ package daieditor.gui.map; -import app.net.sf.gridarta.Size2D; import daieditor.CMainControl; import daieditor.IGUIConstants; import daieditor.MultiPositionData; @@ -48,6 +47,7 @@ import net.sf.gridarta.gui.map.MapGrid; import net.sf.gridarta.gui.map.MapGridEvent; import net.sf.gridarta.gui.map.MapGridListener; +import net.sf.gridarta.Size2D; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; Modified: trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-06-25 13:25:39 UTC (rev 187) +++ trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java 2006-06-25 14:10:25 UTC (rev 188) @@ -25,12 +25,12 @@ package daieditor.gui.map; -import app.net.sf.gridarta.Size2D; import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.CMainControl; import daieditor.CMainView; import daieditor.IGUIConstants; import net.sf.gridarta.help.Help; +import net.sf.gridarta.Size2D; import daieditor.map.MapArchObject; import daieditor.map.MapControl; import java.awt.BorderLayout; Modified: trunk/daimonin/src/daieditor/gui/map/MapTilePane.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2006-06-25 13:25:39 UTC (rev 187) +++ trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2006-06-25 14:10:25 UTC (rev 188) @@ -23,7 +23,6 @@ package daieditor.gui.map; -import app.net.sf.gridarta.Size2D; import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.CMainControl; import daieditor.IGUIConstants; @@ -60,6 +59,7 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import net.sf.japi.swing.ActionFactory; +import net.sf.gridarta.Size2D; import org.jetbrains.annotations.Nullable; /** Modified: trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java 2006-06-25 13:25:39 UTC (rev 187) +++ trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java 2006-06-25 14:10:25 UTC (rev 188) @@ -25,7 +25,6 @@ package daieditor.gui.map; -import app.net.sf.gridarta.Size2D; import daieditor.CMainControl; import daieditor.IGUIConstants; import daieditor.MultiPositionData; @@ -39,6 +38,7 @@ import java.awt.Rectangle; import java.awt.image.BufferedImage; import javax.swing.ImageIcon; +import net.sf.gridarta.Size2D; /** * The SimpleLevelRenderer renders maps without MapGrid or validation errors. Modified: trunk/daimonin/src/daieditor/map/DefaultMapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-06-25 13:25:39 UTC (rev 187) +++ trunk/daimonin/src/daieditor/map/DefaultMapModel.java 2006-06-25 14:10:25 UTC (rev 188) @@ -25,7 +25,6 @@ package daieditor.map; -import app.net.sf.gridarta.Size2D; import static net.sf.japi.swing.ActionFactory.getFactory; import daieditor.CFArchTypeList; import daieditor.CMainControl; @@ -41,6 +40,7 @@ import java.util.NoSuchElementException; import javax.swing.event.EventListenerList; import net.sf.japi.swing.ActionFactory; +import net.sf.gridarta.Size2D; import org.jetbrains.annotations.Nullable; /** @@ -86,9 +86,12 @@ /** CMainControl. */ private final CMainControl mainControl; - /** MapControl. */ + /** The MapControl that controls this MapModel. */ private final MapControl mapControl; + /** The transaction depth. */ + private int transactionDepth; + /** * Constructs a level model. * @param mainControl main controller @@ -178,7 +181,10 @@ } } - /** Reset the level changed flag to false. */ + /** + * Reset the level changed flag to false. + * @todo it's not a good idea to use the mapViewFrame here + */ public void resetLevelChangedFlag() { if (!levelChanged) { return; @@ -191,7 +197,10 @@ } } - /** Set the level changed flag to true. */ + /** + * Set the level changed flag to true. + * @todo it's not a good idea to use the mapViewFrame here + */ public void setLevelChangedFlag() { if (levelChanged) { return; @@ -575,22 +584,17 @@ fireMapSizeChanged(); } + /** {@inheritDoc} */ public MapControl getMapControl() { return mapControl; } - /** - * Register a map listener. - * @param listener MapListener to register - */ + /** {@inheritDoc} */ public void addMapModelListener(final MapModelListener listener) { listenerList.add(MapModelListener.class, listener); } - /** - * Unregister a map listener. - * @param listener MapListener to unregsiter - */ + /** {@inheritDoc} */ public void removeMapModelListener(final MapModelListener listener) { listenerList.remove(MapModelListener.class, listener); } @@ -609,55 +613,44 @@ /** The ArrayList with changed squares. */ private final List<MapSquare> changedSquares = new ArrayList<MapSquare>(); - /** Wether in autocommit mode. */ - private boolean autoCommitSquareChanges = true; + /** {@inheritDoc} */ + public void squareChanged(final MapSquare square) { + if (transactionDepth == 0) { + fireMapSquaresChangedEvent(square); + } else { + synchronized (changedSquares) { + changedSquares.add(square); + } + } + } - /** - * Set the autocommit mode for square changes. - * Invoking this method also fires any pending events, independently of the argument. - * @param autoCommitSquareChanges <code>true</code> if every single square change should fire an event, <code>false</code> for bulk changes - * @see #isAutoCommitSquareChanges() - */ - public void setAutoCommitSquareChanges(final boolean autoCommitSquareChanges) { - this.autoCommitSquareChanges = autoCommitSquareChanges; - commitSquareChanges(); + /** {@inheritDoc} */ + public void beginTransaction() { + transactionDepth++; } - /** - * Get the autocommit mode for square changes. - * @return autocommit mode for square changes - * @see #setAutoCommitSquareChanges(boolean) - */ - public boolean isAutoCommitSquareChanges() { - return autoCommitSquareChanges; + /** {@inheritDoc} */ + public void endTransaction() { + transactionDepth--; + assert transactionDepth >= 0; + if (transactionDepth == 0 && !changedSquares.isEmpty()) { + fireMapSquaresChangedEvent(changedSquares.toArray(new MapSquare[changedSquares.size()])); + } } - /** - * Commits all squareChanges. - * If there are no changed squares, this method does nothing. - * Listeners are not notified with an empty list of squares. - */ - public void commitSquareChanges() { - synchronized (changedSquares) { + /** {@inheritDoc} */ + public void endAllTransactions() { + if (transactionDepth > 0) { + transactionDepth = 0; if (!changedSquares.isEmpty()) { fireMapSquaresChangedEvent(changedSquares.toArray(new MapSquare[changedSquares.size()])); } } } - /** - * Method to notify the model that a map square was changed. - * The model then notifies the registered listeners of the changes. - * @param square MapSquare that has changed - */ - public void squareChanged(final MapSquare square) { - if (autoCommitSquareChanges) { - fireMapSquaresChangedEvent(square); - } else { - synchronized (changedSquares) { - changedSquares.add(square); - } - } + /** {@inheritDoc} */ + public int getTransactionDepth() { + return transactionDepth; } /** Modified: trunk/daimonin/src/daieditor/map/MapArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-06-25 13:25:39 UTC (rev 187) +++ trunk/daimonin/src/daieditor/map/MapArchObject.java 2006-06-25 14:10:25 UTC (rev 188) @@ -24,11 +24,11 @@ package daieditor.map; -import app.net.sf.gridarta.Size2D; import static daieditor.IGUIConstants.DEF_MAPFNAME; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; +import net.sf.gridarta.Size2D; /** * MapArchObject contains the specific meta data about a map that is stored in Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2006-06-25 13:25:39 UTC (rev 187) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2006-06-25 14:10:25 UTC (rev 188) @@ -24,7 +24,6 @@ package daieditor.map; -import app.net.sf.gridarta.Size2D; import daieditor.CMainControl; import daieditor.CMapViewIFrame; import daieditor.CPickmapPanel; @@ -49,6 +48,7 @@ import javax.swing.ImageIcon; import net.sf.gridarta.gui.map.MapCursor; import net.sf.gridarta.gui.map.MapGrid; +import net.sf.gridarta.Size2D; import net.sf.japi.swing.ActionFactory; import static net.sf.japi.swing.ActionFactory.getFactory; import org.jetbrains.annotations.Nullable; @@ -478,11 +478,11 @@ if (!mainControl.getMainView().isPickmapActive() || isPickmap() || newarch != null && newarch.isDefaultArch()) { // insert default arch from archlist: - mapModel.setAutoCommitSquareChanges(false); + mapModel.beginTransaction(); if (!addArchToMap(mainControl.getPanelArchName(), p, allowMany)) { // todo } - mapModel.setAutoCommitSquareChanges(true); + mapModel.endTransaction(); } else { // insert custom arch from the pickmap: if (newarch != null) { Modified: trunk/daimonin/src/daieditor/map/MapModel.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapModel.java 2006-06-25 13:25:39 UTC (rev 187) +++ trunk/daimonin/src/daieditor/map/MapModel.java 2006-06-25 14:10:25 UTC (rev 188) @@ -1,10 +1,9 @@ package daieditor.map; -import app.net.sf.gridarta.Size2D; import daieditor.arch.ArchObject; -import java.awt.Dimension; import java.awt.Point; import java.util.Iterator; +import net.sf.gridarta.Size2D; import org.jetbrains.annotations.Nullable; /** @@ -96,18 +95,70 @@ void resizeMap(Size2D newSize); + /** + * Returns the MapControl that controls this MapModel. + * @return the MapControl that controls this MapModel + */ MapControl getMapControl(); + /** + * Register a map listener. + * @param listener MapListener to register + */ void addMapModelListener(MapModelListener listener); + /** + * Unregister a map listener. + * @param listener MapListener to unregsiter + */ void removeMapModelListener(MapModelListener listener); - void setAutoCommitSquareChanges(boolean autoCommitSquareChanges); + /** + * Method to notify the model that a map square was changed. + * A change to a square is atomic if {@link #getTransactionDepth()} returns 0, otherwise it is transactional. + * The model then notifies the registered listeners of the changes. + * @param square MapSquare that has changed + */ + void squareChanged(MapSquare square); - boolean isAutoCommitSquareChanges(); + /** + * Start a new transaction. + * Transactions may be nested. + * Transactions serve the purpose of firing events to the views when more changes are known to come before the view is really required to update. + * Each invocation of {@link #beginTransaction()} requires its own invocation of {@link #endTransaction()}. + * @see #endTransaction() + * @see #getTransactionDepth() + * @see #endAllTransactions() + */ + void beginTransaction(); - void commitSquareChanges(); + /** + * End a transaction. + * Invoking this method will reduce the transaction depth by only 1. + * @see #beginTransaction() + * @see #getTransactionDepth() + * @see #endAllTransactions() + */ + void endTransaction(); - void squareChanged(MapSquare square); + /** + * Ends all transaction. + * Invoking this method will reduce set the transaction depth to 0. + * You shouldn't invoke this method regularly. + * It is meant as a fallback in high level methods / exception handlers to prevent errors from causing unclosed transactions. + * @see #beginTransaction() + * @see #getTransactionDepth() + */ + void endAllTransactions(); + /** + * Get the transaction depth, which is the number of {@link #beginTransaction()} invocations without matching {@link #endTransaction()} invocations. + * A transaction depth of 0 means there is no ongoing transaction. + * @return transaction depth + * @see #beginTransaction() + * @see #endTransaction() + * @see #endAllTransactions() + */ + int getTransactionDepth(); + } // interface MapModel Modified: trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java =================================================================== --- trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java 2006-06-25 13:25:39 UTC (rev 187) +++ trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java 2006-06-25 14:10:25 UTC (rev 188) @@ -28,6 +28,7 @@ import net.sf.gridarta.gui.map.MapCursorEvent; import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.gridarta.gui.map.MapGrid; +import net.sf.gridarta.Size2D; import org.junit.AfterClass; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -41,7 +42,7 @@ /** This class is testing #MapCursor. */ public class MapCursorTest implements MapCursorListener { private static MapCursor cursor; - private static final Dimension gridSize = new Dimension(6, 7); + private static final Size2D gridSize = new Size2D(6, 7); private static final MapGrid grid = new MapGrid(gridSize); private static int changedPosCounter = 0; private static int changedModeCounter = 0; @@ -62,7 +63,7 @@ @Test public void setOutside() { final Point p = new Point(); - for (int i = -2; i < gridSize.width + 2; i++) { + for (int i = -2; i < gridSize.getWidth() + 2; i++) { p.setLocation(i, -1); assertFalse("setLocation(" + p + ") should return false", cursor.setLocation(p)); testEvents(0, 0); @@ -70,7 +71,7 @@ testEvents(0, 0); assertNull("getLocation() should return null after setLocation(" + p + ")", cursor.getLocation()); testEvents(0, 0); - p.setLocation(i, gridSize.height); + p.setLocation(i, gridSize.getHeight()); assertFalse("setLocation(" + p + ") should return false", cursor.setLocation(p)); testEvents(0, 0); assertFalse("MapCursor should be disabled after setLocation(" + p + ")", cursor.isActive()); @@ -78,7 +79,7 @@ assertNull("getLocation() should return null after setLocation(" + p + ")", cursor.getLocation()); testEvents(0, 0); } - for (int i = -2; i < gridSize.height + 2; i++) { + for (int i = -2; i < gridSize.getHeight() + 2; i++) { p.setLocation(-1, i); assertFalse("setLocation(" + p + ") should return false", cursor.setLocation(p)); testEvents(0, 0); @@ -86,7 +87,7 @@ testEvents(0, 0); assertNull("getLocation() should return null after setLocation(" + p + ")", cursor.getLocation()); testEvents(0, 0); - p.setLocation(gridSize.width, i); + p.setLocation(gridSize.getWidth(), i); assertFalse("setLocation(" + p + ") should return false", cursor.setLocation(p)); testEvents(0, 0); assertFalse("MapCursor should be disabled after setLocation(" + p + ")", cursor.isActive()); @@ -99,8 +100,8 @@ @Test public void setInside() { boolean first = true; final Point p = new Point(); - for (int j = 0; j < gridSize.height; j++) { - for (int i = 0; i < gridSize.width; i++) { + for (int j = 0; j < gridSize.getHeight(); j++) { + for (int i = 0; i < gridSize.getWidth(); i++) { p.setLocation(i, j); assertTrue("setLocation(" + p + ") should return true", cursor.setLocation(p)); if (first) { @@ -177,10 +178,10 @@ @Test public void isOnGrid() { final Point p = new Point(); - for (int j = -2; j < gridSize.height + 2; j++) { - for (int i = -2; i < gridSize.width + 2; i++) { + for (int j = -2; j < gridSize.getHeight() + 2; j++) { + for (int i = -2; i < gridSize.getWidth() + 2; i++) { p.setLocation(i, j); - if (i >= 0 && i < gridSize.width && j >= 0 && j < gridSize.height) { + if (i >= 0 && i < gridSize.getWidth() && j >= 0 && j < gridSize.getHeight()) { assertTrue(p + " should be on the grid.", cursor.isOnGrid(p)); } else { assertFalse(p + " should not be on the grid.", cursor.isOnGrid(p)); @@ -273,8 +274,8 @@ minY = end.y; maxY = start.y; } - for (int j = 0; j < gridSize.height; j++) { - for (int i = 0; i < gridSize.width; i++) { + for (int j = 0; j < gridSize.getHeight(); j++) { + for (int i = 0; i < gridSize.getWidth(); i++) { if (i < minX || i > maxX || j < minY || j > maxY) { //Not preselected assertFalse("Preselection", (grid.getFlags(i, j) & MapGrid.GRID_FLAG_SELECTING) > 0); @@ -314,7 +315,7 @@ @Test public void selecting() { final Point start = new Point(2, 3); final Point end = new Point(4, 5); - final Point gridMaxIndex = new Point(gridSize.width - 1 , gridSize.height - 1); + final Point gridMaxIndex = new Point(gridSize.getWidth() - 1 , gridSize.getHeight() - 1); cursor.dragRelease(); testEvents(0, 0); cursor.setLocation(start); Modified: trunk/src/app/net/sf/gridarta/Size2D.java =================================================================== --- trunk/src/app/net/sf/gridarta/Size2D.java 2006-06-25 13:25:39 UTC (rev 187) +++ trunk/src/app/net/sf/gridarta/Size2D.java 2006-06-25 14:10:25 UTC (rev 188) @@ -18,43 +18,56 @@ * 02111-1307, USA. */ -package app.net.sf.gridarta; +package net.sf.gridarta; /** * The class Size2D represents a 2d rectangular area. */ -public final class Size2D -{ +public final class Size2D { - /** The width of the area. It is always positive. */ + /** + * The width of the area. + * It is always greater than zero. + */ private final int width; - /** The height of the area. It is always positive. */ + /** + * The height of the area. + * It is always greater than zero. + */ private final int height; /** - * Create a new instance. - * @param width the width of the area; must be positive - * @param height the height of the area; must be positive + * Create a new Size2D. + * @param width the width of the area; must be greater than zero + * @param height the height of the area; must be greater than zero */ public Size2D(final int width, final int height) { if (width < 1) { - throw new IllegalArgumentException("Width must be positive"); + throw new IllegalArgumentException("Width must be > 0"); } if (height < 1) { - throw new IllegalArgumentException("Height must be positive"); + throw new IllegalArgumentException("Height must be > 0"); } this.width = width; this.height = height; } - /** Return the width of this area. It is always positive. */ + /** + * Returns the width of the area. + * It is always greater than zero. + * @return the width of the area + */ public int getWidth() { return width; } - /** Return the height of this area. It is always positive. */ + /** + * Returns the height of the area. + * It is always greater than zero. + * @return the height of the area + */ public int getHeight() { return height; } Modified: trunk/src/app/net/sf/gridarta/gui/map/MapGrid.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/MapGrid.java 2006-06-25 13:25:39 UTC (rev 187) +++ trunk/src/app/net/sf/gridarta/gui/map/MapGrid.java 2006-06-25 14:10:25 UTC (rev 188) @@ -21,12 +21,11 @@ package net.sf.gridarta.gui.map; - -import app.net.sf.gridarta.Size2D; import java.awt.Point; import java.awt.Rectangle; import static java.lang.Math.min; import javax.swing.event.EventListenerList; +import net.sf.gridarta.Size2D; import org.jetbrains.annotations.Nullable; /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-06-25 13:26:27
|
Revision: 187 Author: akirschbaum Date: 2006-06-25 06:25:39 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=187&view=rev Log Message: ----------- Store map size in a Size2D instance; remove deprecated functions; unify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMapFileDecode.java trunk/crossfire/src/cfeditor/CMapFileEncode.java trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CNewMapDialog.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/MapArchObject.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/crossfire/src/cfeditor/map/MapModel.java trunk/daimonin/src/daieditor/CMapFileDecode.java trunk/daimonin/src/daieditor/CMapFileEncode.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/CNewMapDialog.java trunk/daimonin/src/daieditor/CopyBuffer.java trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java trunk/daimonin/src/daieditor/gui/map/MapPropertiesDialog.java trunk/daimonin/src/daieditor/gui/map/MapTilePane.java trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java trunk/daimonin/src/daieditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/map/MapArchObject.java trunk/daimonin/src/daieditor/map/MapControl.java trunk/daimonin/src/daieditor/map/MapModel.java trunk/src/app/net/sf/gridarta/gui/map/MapGrid.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/Size2D.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-06-25 12:30:38 UTC (rev 186) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-06-25 13:25:39 UTC (rev 187) @@ -24,6 +24,7 @@ package cfeditor; +import app.net.sf.gridarta.Size2D; import static net.sf.japi.swing.ActionFactory.getFactory; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectParser; @@ -37,7 +38,6 @@ import java.awt.Point; import java.awt.Rectangle; import java.awt.Toolkit; -import java.awt.Dimension; import java.io.File; import java.io.IOException; import java.util.Enumeration; @@ -1306,7 +1306,7 @@ * @param strMapTitle map name * @param mapSize size of map */ - void setLevelProperties(final MapControl level, final String archText, final String loreText, final String strMapTitle, final Dimension mapSize) { + void setLevelProperties(final MapControl level, final String archText, final String loreText, final String strMapTitle, final Size2D mapSize) { if (level != null) { level.setProperties(archText, loreText, strMapTitle, mapSize); refreshMenusAndToolbars(); Modified: trunk/crossfire/src/cfeditor/CMapFileDecode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-06-25 12:30:38 UTC (rev 186) +++ trunk/crossfire/src/cfeditor/CMapFileDecode.java 2006-06-25 13:25:39 UTC (rev 187) @@ -115,12 +115,7 @@ // finally... here we go // last action: if the map is bigger than the specified size in // the maparch, we set the true size: the maxxlen/maxylen counters. - if (maparch.getWidth() < maxxlen + 1) { - maparch.setWidth(maxxlen + 1); - } - if (maparch.getHeight() < maxylen + 1) { - maparch.setHeight(maxylen + 1); - } + maparch.ensureMapSize(maxxlen + 1, maxylen + 1); return start; // return first arch of the list } Modified: trunk/crossfire/src/cfeditor/CMapFileEncode.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-06-25 12:30:38 UTC (rev 186) +++ trunk/crossfire/src/cfeditor/CMapFileEncode.java 2006-06-25 13:25:39 UTC (rev 187) @@ -24,6 +24,7 @@ package cfeditor; +import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.map.MapArchObject; import cfeditor.map.MapModel; @@ -87,10 +88,10 @@ map.writeMapArch(bufferedWriter); // first, write all one tile parts - final Dimension size = map.getMapSize(); + final Size2D mapSize = map.getMapSize(); final Point pos = new Point(); - for (pos.x = 0; pos.x < size.width; pos.x++) { - for (pos.y = 0; pos.y < size.height; pos.y++) { + for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { + for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { final Iterator it = mapModel.getArchObjects(pos); while (it.hasNext()) { final ArchObject node = (ArchObject) it.next(); @@ -105,8 +106,8 @@ } // x // second, we drop the multi part suckers out - for (pos.x = 0; pos.x < size.width; pos.x++) { - for (pos.y = 0; pos.y < size.height; pos.y++) { + for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { + for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { final Iterator it = mapModel.getArchObjects(pos); while (it.hasNext()) { final ArchObject node = (ArchObject) it.next(); Modified: trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-06-25 12:30:38 UTC (rev 186) +++ trunk/crossfire/src/cfeditor/CMapPropertiesDialog.java 2006-06-25 13:25:39 UTC (rev 187) @@ -24,6 +24,7 @@ package cfeditor; +import app.net.sf.gridarta.Size2D; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; import java.awt.BorderLayout; @@ -187,9 +188,9 @@ createPanelLine(mapPanel, m_nameField, 16, m_level.getMapName(), "Name: "); createPanelLine(mapPanel, m_regionField, 16, map.getMapRegion(), "Region: "); - final Dimension mapSize = m_level.getMapSize(); - createPanelLine(mapPanel, m_levelWidthField, 10, String.valueOf(mapSize.width), "Width: "); - createPanelLine(mapPanel, m_levelHeightField, 10, String.valueOf(mapSize.height), "Height: "); + final Size2D mapSize = m_level.getMapSize(); + createPanelLine(mapPanel, m_levelWidthField, 10, String.valueOf(mapSize.getWidth()), "Width: "); + createPanelLine(mapPanel, m_levelHeightField, 10, String.valueOf(mapSize.getHeight()), "Height: "); createPanelCBox(mapPanel, m_unique, map.isUnique(), " Unique Map"); createPanelCBox(mapPanel, m_outdoor, map.isOutdoor(), " Outdoor Map"); createPanelCBox(mapPanel, m_fixedReset, map.isFixedReset(), " Fixed Reset"); @@ -452,7 +453,7 @@ boolean modifyTilepaths = false; // true when map tile-paths were modified // tmp variables for parsing - final Dimension size = new Dimension(); + final int width, height; final int t_enter_x, t_enter_y; final int t_reset_timeout, t_swap_time; final int t_difficulty, t_darkness; @@ -466,8 +467,8 @@ // first check if the entries are all okay try { // try to parse everything - size.width = parseProperty(m_levelWidthField.getText(), "Width"); - size.height = parseProperty(m_levelHeightField.getText(), "Height"); + width = parseProperty(m_levelWidthField.getText(), "Width"); + height = parseProperty(m_levelHeightField.getText(), "Height"); t_enter_x = parseProperty(m_enterX.getText(), "Enter X"); t_enter_y = parseProperty(m_enterY.getText(), "Enter Y"); t_swap_time = parseProperty(m_swapTime.getText(), "Swap Time"); @@ -503,7 +504,7 @@ } // Now do some sanity checks: - if (size.width < 1 || size.height < 1) { + if (width < 1 || height < 1) { mainControl.showMessage( "Illegal Value", "Level dimensions must be greater than zero."); @@ -527,10 +528,11 @@ } // if the mapsize has been modified, see if we should ask for a confirm + Size2D size = new Size2D(width, height); if (m_level.checkResizeMap(size)) { if (!askConfirmResize(size)) { // resizing has been cancelled - size.setSize(m_level.getMapSize()); + size = m_level.getMapSize(); } } @@ -666,9 +668,9 @@ m_loreArea.setText(m_level.getMapLore()); m_nameField.setText(m_level.getMapName()); m_regionField.setText("" + map.getMapRegion()); - final Dimension mapSize = map.getMapSize(); - m_levelWidthField.setText(String.valueOf(mapSize.width)); - m_levelHeightField.setText(String.valueOf(mapSize.height)); + final Size2D mapSize = map.getMapSize(); + m_levelWidthField.setText(String.valueOf(mapSize.getWidth())); + m_levelHeightField.setText(String.valueOf(mapSize.getHeight())); m_enterX.setText("" + map.getEnterX()); m_enterY.setText("" + map.getEnterY()); m_swapTime.setText("" + map.getSwapTime()); @@ -715,9 +717,9 @@ * popup dialog disables all other windows (and threads). * @return true if user confirmed, false if user cancelled resize */ - private boolean askConfirmResize(final Dimension size) { + private boolean askConfirmResize(final Size2D size) { return JOptionPane.showConfirmDialog(this, - "You selected a new map size of " + size.width + "x" + size.height + ". If the map was\n" + + "You selected a new map size of " + size.getWidth() + "x" + size.getHeight() + ". If the map was\n" + "resized in this way, some objects would get cut off and deleted.\n" + "Are you really sure you want this?", "Confirm", Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-06-25 12:30:38 UTC (rev 186) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-06-25 13:25:39 UTC (rev 187) @@ -24,6 +24,7 @@ package cfeditor; +import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectStack; import cfeditor.filter.AttributeFilter; @@ -88,7 +89,7 @@ private final CMainControl mainControl; /** Size of the map. */ - private final Dimension mapSize = new Dimension(); + private Size2D mapSize = new Size2D(1, 1); /** The tile palette renderer. */ private final CLevelRenderer renderer; @@ -369,16 +370,16 @@ void refreshDataFromModel() { final Dimension forcedSize; - mapSize.setSize(mapControl.getMapSize()); + mapSize = mapControl.getMapSize(); log.debug("refreshDataFromModel"); // define how much drawing space we need for the map if (IGUIConstants.isoView) { forcedSize = new Dimension( - (isPickmap() ? 3 + 2 * IGUIConstants.TILE_ISO_YLEN : mapSize.height * IGUIConstants.TILE_ISO_YLEN) + mapSize.width * IGUIConstants.TILE_ISO_YLEN + IGUIConstants.TILE_ISO_XLEN, - ((isPickmap() ? Math.max(mapSize.height - 2, 0) : mapSize.height) * IGUIConstants.TILE_ISO_YLEN + (mapSize.width - mapSize.height) * IGUIConstants.TILE_ISO_YLEN2) + 1 + IGUIConstants.TILE_ISO_XLEN); + (isPickmap() ? 3 + 2 * IGUIConstants.TILE_ISO_YLEN : mapSize.getHeight() * IGUIConstants.TILE_ISO_YLEN) + mapSize.getWidth() * IGUIConstants.TILE_ISO_YLEN + IGUIConstants.TILE_ISO_XLEN, + ((isPickmap() ? Math.max(mapSize.getHeight() - 2, 0) : mapSize.getHeight()) * IGUIConstants.TILE_ISO_YLEN + (mapSize.getWidth() - mapSize.getHeight()) * IGUIConstants.TILE_ISO_YLEN2) + 1 + IGUIConstants.TILE_ISO_XLEN); } else { - forcedSize = new Dimension(mapSize.width * 32 + (isPickmap() ? 0 : 64), mapSize.height * 32 + (isPickmap() ? 0 : 64)); + forcedSize = new Dimension(mapSize.getWidth() * 32 + (isPickmap() ? 0 : 64), mapSize.getHeight() * 32 + (isPickmap() ? 0 : 64)); } ((JComponent) renderer).setPreferredSize(forcedSize); ((JComponent) renderer).setMinimumSize(forcedSize); @@ -678,8 +679,9 @@ public Image getFullImage() { final int storeOffset; // tmp. storage to save map offset - final int mapWidth = 32 * getMapControl().getMapWidth(); // map width for standard view - final int mapHeight = 32 * getMapControl().getMapHeight(); // map height for standard view + final Size2D mapSize = getMapControl().getMapSize(); + final int mapWidth = 32 * mapSize.getWidth(); + final int mapHeight = 32 * mapSize.getHeight(); // first create a storing place for the image final Image bufImage = new BufferedImage(mapWidth, mapHeight, BufferedImage.TYPE_INT_ARGB); @@ -741,8 +743,8 @@ // this vector contains all heads of multi-tiles with oversized images final Vector oversizedMultiHeads = new Vector(); final CFilterControl filter = mainControl.getFilterControl(); - for (int y = 0; y < mapSize.height; y++) { - for (int x = 0; x < mapSize.width; x++) { + for (int y = 0; y < mapSize.getHeight(); y++) { + for (int x = 0; x < mapSize.getWidth(); x++) { filter.newSquare(); if (!_model.containsArchObject(x, y)) { // empty square @@ -800,18 +802,18 @@ // grid lines if (showMapGrid && !isSnapshot) { - for (int x = 0; x <= mapSize.width; x++) { + for (int x = 0; x <= mapSize.getWidth(); x++) { grfx.drawLine( x * 32 + bOffset, 0 + bOffset, x * 32 + bOffset, - mapSize.height * 32 + bOffset); + mapSize.getHeight() * 32 + bOffset); } - for (int y = 0; y <= mapSize.height; y++) { + for (int y = 0; y <= mapSize.getHeight(); y++) { grfx.drawLine( 0 + bOffset, y * 32 + bOffset, - mapSize.width * 32 + bOffset, + mapSize.getWidth() * 32 + bOffset, y * 32 + bOffset); } } @@ -1019,7 +1021,7 @@ final Point mpoint = new Point(); mpoint.x = mapMousePos.x; mpoint.y = mapMousePos.y; - if (point.x >= 0 && point.x < mapSize.width * 32 && point.y >= 0 && point.y < mapSize.height * 32) { + if (point.x >= 0 && point.x < mapSize.getWidth() * 32 && point.y >= 0 && point.y < mapSize.getHeight() * 32) { mapMousePos.x = point.x / 32; mapMousePos.y = point.y / 32; @@ -1037,9 +1039,8 @@ return false; } - final Dimension size = new Dimension(getMapControl().getMapSize()); - size.width *= 32; - size.height *= 32; + final Size2D mapSize = getMapControl().getMapSize(); + final Dimension size = new Dimension(mapSize.getWidth() * 32, mapSize.getHeight() * 32); if (bufferedSize.equals(size)) { return true; } @@ -1154,10 +1155,11 @@ public Image getFullImage() { final int storeOffset; // tmp. storage to save map offset - final int mapWidth = getMapControl().getMapHeight() * IGUIConstants.TILE_ISO_YLEN - + getMapControl().getMapWidth() * IGUIConstants.TILE_ISO_YLEN + IGUIConstants.TILE_ISO_XLEN; - final int mapHeight = (getMapControl().getMapHeight() * IGUIConstants.TILE_ISO_YLEN + (getMapControl().getMapWidth() - - getMapControl().getMapHeight()) * IGUIConstants.TILE_ISO_YLEN2) + 1 + IGUIConstants.TILE_ISO_XLEN; + final Size2D mapSize = getMapControl().getMapSize(); + final int mapWidth = mapSize.getHeight() * IGUIConstants.TILE_ISO_YLEN + + mapSize.getWidth() * IGUIConstants.TILE_ISO_YLEN + IGUIConstants.TILE_ISO_XLEN; + final int mapHeight = (mapSize.getHeight() * IGUIConstants.TILE_ISO_YLEN + (mapSize.getWidth() + - mapSize.getHeight()) * IGUIConstants.TILE_ISO_YLEN2) + 1 + IGUIConstants.TILE_ISO_XLEN; // first create a storing place for the image final Image bufImage = new BufferedImage(mapWidth, mapHeight, BufferedImage.TYPE_INT_ARGB); @@ -1171,7 +1173,7 @@ bOffset = 0; paintComponent(bufGrfx, true); bOffset = storeOffset; - //return bufImage.getScaledInstance(16*getMapControl().getMapWidth(), 16*getMapControl().getMapHeight(), Image.SCALE_SMOOTH); + //return bufImage.getScaledInstance(16 * mapSize.getWidth(), 16 * mapSize.getHeight(), Image.SCALE_SMOOTH); return bufImage; } @@ -1197,14 +1199,14 @@ } // ---------- draw iso map -------------- - for (int y = 0; y < mapSize.height; y++) { + for (int y = 0; y < mapSize.getHeight(); y++) { if (!isPickmap) { - xstart = (mapSize.height) * IGUIConstants.TILE_ISO_YLEN - y * IGUIConstants.TILE_ISO_XLEN2; + xstart = (mapSize.getHeight()) * IGUIConstants.TILE_ISO_YLEN - y * IGUIConstants.TILE_ISO_XLEN2; } else { xstart = 3 + 2 * IGUIConstants.TILE_ISO_YLEN - y * IGUIConstants.TILE_ISO_XLEN2; } ystart = y * IGUIConstants.TILE_ISO_YLEN2 + (isPickmap ? 0 : IGUIConstants.TILE_ISO_YLEN); - for (int x = 0; x < mapSize.width; x++) { + for (int x = 0; x < mapSize.getWidth(); x++) { if (!mapModel.containsArchObject(x, y)) { // empty square if (!isPickmap) { @@ -1264,23 +1266,23 @@ // draw iso grid grfx.setColor(Color.black); - for (int x = 0; x <= mapSize.width; x++) { - grfx.drawLine((mapSize.height) * IGUIConstants.TILE_ISO_YLEN + (x + 1) * IGUIConstants.TILE_ISO_XLEN2 - 1, + for (int x = 0; x <= mapSize.getWidth(); x++) { + grfx.drawLine((mapSize.getHeight()) * IGUIConstants.TILE_ISO_YLEN + (x + 1) * IGUIConstants.TILE_ISO_XLEN2 - 1, IGUIConstants.TILE_ISO_YLEN + x * IGUIConstants.TILE_ISO_YLEN2 - 1, - (mapSize.height) * IGUIConstants.TILE_ISO_YLEN - (mapSize.height) * IGUIConstants.TILE_ISO_XLEN2 + (mapSize.getHeight()) * IGUIConstants.TILE_ISO_YLEN - (mapSize.getHeight()) * IGUIConstants.TILE_ISO_XLEN2 + (x + 1) * IGUIConstants.TILE_ISO_XLEN2, - (mapSize.height) * IGUIConstants.TILE_ISO_YLEN2 + IGUIConstants.TILE_ISO_YLEN + (mapSize.getHeight()) * IGUIConstants.TILE_ISO_YLEN2 + IGUIConstants.TILE_ISO_YLEN + x * IGUIConstants.TILE_ISO_YLEN2 - 1); } - for (int y = 0; y <= mapSize.height; y++) { - grfx.drawLine((mapSize.height) * IGUIConstants.TILE_ISO_YLEN - y * IGUIConstants.TILE_ISO_XLEN2 + for (int y = 0; y <= mapSize.getHeight(); y++) { + grfx.drawLine((mapSize.getHeight()) * IGUIConstants.TILE_ISO_YLEN - y * IGUIConstants.TILE_ISO_XLEN2 + IGUIConstants.TILE_ISO_XLEN2 - 1, y * IGUIConstants.TILE_ISO_YLEN2 + IGUIConstants.TILE_ISO_YLEN - 1, - (mapSize.height) * IGUIConstants.TILE_ISO_YLEN - y * IGUIConstants.TILE_ISO_XLEN2 - + (mapSize.width + 1) * IGUIConstants.TILE_ISO_XLEN2, + (mapSize.getHeight()) * IGUIConstants.TILE_ISO_YLEN - y * IGUIConstants.TILE_ISO_XLEN2 + + (mapSize.getWidth() + 1) * IGUIConstants.TILE_ISO_XLEN2, y * IGUIConstants.TILE_ISO_YLEN2 + IGUIConstants.TILE_ISO_YLEN - + (mapSize.width) * IGUIConstants.TILE_ISO_YLEN2 - 1); + + (mapSize.getWidth()) * IGUIConstants.TILE_ISO_YLEN2 - 1); } } if (highlightOn && mapMouseRightPos.y != -1 && mapMouseRightPos.x != -1) { @@ -1377,7 +1379,7 @@ // in Iso-View mainControl.getMapSelIconF().paintIcon(this, grfx, (isPickmap ? 3 + 2 * IGUIConstants.TILE_ISO_YLEN - posy * IGUIConstants.TILE_ISO_XLEN2 - : (mapSize.height) * IGUIConstants.TILE_ISO_YLEN - posy * IGUIConstants.TILE_ISO_XLEN2) + : (mapSize.getHeight()) * IGUIConstants.TILE_ISO_YLEN - posy * IGUIConstants.TILE_ISO_XLEN2) + posx * IGUIConstants.TILE_ISO_XLEN2, posy * IGUIConstants.TILE_ISO_YLEN2 + (isPickmap ? 0 : IGUIConstants.TILE_ISO_YLEN) + posx * IGUIConstants.TILE_ISO_YLEN2); @@ -1417,14 +1419,14 @@ // most lame way to find the map point // but i can't remember the algorithm way for iso on the fly // i had done it before, but i forget - for (int y = 0; y < mapSize.height; y++) { + for (int y = 0; y < mapSize.getHeight(); y++) { if (!isPickmap) { - xstart = (mapSize.height) * IGUIConstants.TILE_ISO_YLEN - y * IGUIConstants.TILE_ISO_XLEN2; + xstart = (mapSize.getHeight()) * IGUIConstants.TILE_ISO_YLEN - y * IGUIConstants.TILE_ISO_XLEN2; } else { xstart = 3 + 2 * IGUIConstants.TILE_ISO_YLEN - y * IGUIConstants.TILE_ISO_XLEN2; } ystart = y * IGUIConstants.TILE_ISO_YLEN2 + (isPickmap ? 0 : IGUIConstants.TILE_ISO_YLEN); - for (int x = 0; x < mapSize.width; x++) { + for (int x = 0; x < mapSize.getWidth(); x++) { if (point.x >= xstart && point.x < xstart + IGUIConstants.TILE_ISO_XLEN && point.y >= ystart && point.y < ystart + IGUIConstants.TILE_ISO_YLEN) { // get the offsets in the rectangle @@ -1438,8 +1440,8 @@ mapMousePos.y = y + gridMapOffset[temp][1]; // ok, now check map borders and set to -1/-1 when not in map - if (mapMousePos.x < 0 || mapMousePos.x >= mapSize.width - || mapMousePos.y < 0 || mapMousePos.y >= mapSize.height) { + if (mapMousePos.x < 0 || mapMousePos.x >= mapSize.getWidth() + || mapMousePos.y < 0 || mapMousePos.y >= mapSize.getHeight()) { mapMousePos.x = -1; mapMousePos.y = -1; mapMousePosOff.x = -1; Modified: trunk/crossfire/src/cfeditor/CNewMapDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-06-25 12:30:38 UTC (rev 186) +++ trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-06-25 13:25:39 UTC (rev 187) @@ -24,6 +24,7 @@ package cfeditor; +import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObjectStack; import cfeditor.map.MapArchObject; import java.awt.BorderLayout; @@ -219,29 +220,26 @@ // Create a new level from scratch final MapArchObject maparch = new MapArchObject(); - final Dimension mapSize = new Dimension(IGUIConstants.DEF_MAPSIZE, IGUIConstants.DEF_MAPSIZE); - maparch.setMapSize(mapSize); // Get and validate the level size + final int width, height; try { // get size - mapSize.width = Integer.parseInt(mapWidthField.getText()); - mapSize.height = Integer.parseInt(mapHeightField.getText()); - maparch.setMapSize(mapSize); - - if (mapSize.width < 1 || mapSize.height < 1) { - mainControl.showMessage("Illegal Value", - "Map dimensions must be in range [1, " + - Integer.MAX_VALUE + "]."); - return false; - } + width = Integer.parseInt(mapWidthField.getText()); + height = Integer.parseInt(mapHeightField.getText()); } catch (final NumberFormatException illegalNumbers) { mainControl.showMessage( "Illegal Value", "Map dimensions must be numerical integer values!"); return false; } + if (width < 1 || height < 1) { + mainControl.showMessage("Illegal Value", "Map dimensions must be in range [1, " + Integer.MAX_VALUE + "]."); + return false; + } + maparch.setMapSize(new Size2D(width, height)); + // the mapmaker must enter a mapname to create a new map if (mapType == TYPE_CFMAP && (mapNameField.getText() == null || mapNameField.getText().length() <= 0)) { mainControl.showMessage("Map Name is Missing", @@ -261,8 +259,8 @@ if (mapType == TYPE_CFMAP) { final CSettings settings = CSettings.getInstance(IGUIConstants.APP_NAME); - settings.setProperty(DEFAULT_LEVEL_WIDTH_KEY, String.valueOf(mapSize.width)); - settings.setProperty(DEFAULT_LEVEL_HEIGHT_KEY, String.valueOf(mapSize.height)); + settings.setProperty(DEFAULT_LEVEL_WIDTH_KEY, String.valueOf(width)); + settings.setProperty(DEFAULT_LEVEL_HEIGHT_KEY, String.valueOf(height)); } // set file name Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-06-25 12:30:38 UTC (rev 186) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-06-25 13:25:39 UTC (rev 187) @@ -24,6 +24,7 @@ package cfeditor; +import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.map.DefaultMapModel; import cfeditor.map.MapArchObject; @@ -75,10 +76,9 @@ this.mainControl = mainControl; // link main control in mapArch = new MapArchObject(); - bufWidth = 0; - bufHeight = 0; - mapArch.setWidth(bufWidth); - mapArch.setHeight(bufHeight); + bufWidth = 1; + bufHeight = 1; + mapArch.setMapSize(new Size2D(bufWidth, bufHeight)); mapArch.setFileName("cb"); mapArch.setMapName("cb"); @@ -153,8 +153,7 @@ mapData.freeMapArchObject(); // free old map (/buffer) object bufWidth = Math.abs(offset.x) + 1; // new width bufHeight = Math.abs(offset.y) + 1; // new height - mapArch.setWidth(bufWidth); - mapArch.setHeight(bufHeight); + mapArch.setMapSize(new Size2D(bufWidth, bufHeight)); mapData = null; // free objects (at least that is the plan and theory) buffCtrl = null; mapData = new DefaultMapModel(mainControl, buffCtrl, mapArch); // new MapModel Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-06-25 12:30:38 UTC (rev 186) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-06-25 13:25:39 UTC (rev 187) @@ -24,6 +24,7 @@ package cfeditor; +import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.map.MapControl; import java.awt.Color; @@ -302,8 +303,8 @@ final Point offset; if (entireMap) { startp = new Point(0, 0); - final Dimension mapSize = mapControl.getMapSize(); - offset = new Point(mapSize.width - 1, mapSize.height - 1); + 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 Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-06-25 12:30:38 UTC (rev 186) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2006-06-25 13:25:39 UTC (rev 187) @@ -24,6 +24,7 @@ package cfeditor.map; +import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectIterator; import cfeditor.arch.ArchObjectIteratorDeleteArchMapObject; @@ -36,7 +37,6 @@ import cfeditor.filter.NamedFilterList; import cfeditor.IGUIConstants; import java.awt.Point; -import java.awt.Dimension; import java.util.Iterator; import org.apache.log4j.Logger; import org.jetbrains.annotations.Nullable; @@ -60,7 +60,7 @@ private ArchObject[][] mapGrid; /** Size of this map. */ - private final Dimension mapSize = new Dimension(); + private Size2D mapSize; /** Flag that indicates if the level has been changed since last save. */ private boolean levelChanged = false; @@ -81,11 +81,9 @@ this.mapArch = mapArch; this.mainControl = mainControl; mapControl = control; - mapSize.setSize(mapArch.getMapSize()); + mapSize = mapArch.getMapSize(); mapGrid = initMap(); - - mapArch.setMapSize(mapSize); } /** @@ -175,33 +173,19 @@ } /** - * Return whether the level has changed since it was last saved. - * @return true=level has changed + * Return whether the level has changed since it was last saved or not. + * @return <code>true</code> if level has changed, <code>false</code> if + * not. */ public boolean isLevelChanged() { return levelChanged; } /** - * Return the width of the level. - * @return the width of the level - */ - @Deprecated public int getMapWidth() { - return mapSize.width; - } - - /** - * Returns the height of the level. - * @return the height of the level - */ - @Deprecated public int getMapHeight() { - return mapSize.height; - } - - /** Return the map size of this level. + * Return the map size of this level. * @return map size of this level */ - public Dimension getMapSize() { + public Size2D getMapSize() { return mapSize; } @@ -305,9 +289,9 @@ * @return the empty map grid */ private ArchObject[][] initMap() { - final ArchObject[][] map = new ArchObject[mapSize.width][mapSize.height]; - for (int y = 0; y < mapSize.height; y++) { - for (int x = 0; x < mapSize.width; x++) { + final ArchObject[][] map = new ArchObject[mapSize.getWidth()][mapSize.getHeight()]; + for (int y = 0; y < mapSize.getHeight(); y++) { + for (int x = 0; x < mapSize.getWidth(); x++) { map[x][y] = null; } } @@ -329,7 +313,7 @@ for (int c = 0; c <= count; c++) { final int mapx = xx + mainControl.getArchObjectStack().getArch(archnr + c).getRefX(); final int mapy = yy + mainControl.getArchObjectStack().getArch(archnr + c).getRefY(); - if (mapx < 0 || mapy < 0 || mapx >= mapSize.width|| mapy >= mapSize.height) { + if (mapx < 0 || mapy < 0 || mapx >= mapSize.getWidth()|| mapy >= mapSize.getHeight()) { // outside map return false; } @@ -456,7 +440,7 @@ ArchObject newarch, oldarch, startarch; // our new suckers (copys, not ref ptrs) if (archnr < 0 || archnr >= mainControl.getArchObjectStack().getArchCount() - || pos.x == -1 || pos.y == -1 || pos.x >= mapSize.width|| pos.y >= mapSize.height) { + || pos.x == -1 || pos.y == -1 || pos.x >= mapSize.getWidth() || pos.y >= mapSize.getHeight()) { // invalid parameter return false; } @@ -702,7 +686,7 @@ @Nullable public ArchObject getMapArch(final int id, final Point pos) { ArchObject node; - if (mapGrid == null || pos.x < 0 || pos.x >= mapSize.width || pos.y < 0 || pos.y >= mapSize.height) { + if (mapGrid == null || pos.x < 0 || pos.x >= mapSize.getWidth() || pos.y < 0 || pos.y >= mapSize.getHeight()) { return null; } @@ -882,8 +866,8 @@ * every single ArchObject of the map... */ public void freeMapArchObject() { - for (int x = 0; x < mapSize.width; x++) { - for (int y = 0; y < mapSize.height; y++) { + for (int x = 0; x < mapSize.getWidth(); x++) { + for (int y = 0; y < mapSize.getHeight(); y++) { while (mapGrid[x][y] != null) { deleteArchMapObject(mapGrid[x][y]); } @@ -946,7 +930,7 @@ * @return true=the given coordinates are within map bounds */ public boolean pointValid(final Point pos) { - return pos.x >= 0 && pos.x < mapSize.width && pos.y >= 0 && pos.y < mapSize.height; + return pos.x >= 0 && pos.x < mapSize.getWidth() && pos.y >= 0 && pos.y < mapSize.getHeight(); } /** @@ -986,20 +970,16 @@ return exit; } - @Deprecated public boolean checkResizeMap(final int newWidth, final int newHeight) { - return checkResizeMap(new Dimension(newWidth, newHeight)); - } - /** * Check if objects get cut off if the map was resized to the given bounds. * @param newSize the new level size * @return true if objects would be cut off */ - public boolean checkResizeMap(final Dimension newSize) { - if (mapSize.width > newSize.width) { + public boolean checkResizeMap(final Size2D newSize) { + if (mapSize.getWidth() > newSize.getWidth()) { // search the right stripe (as far as being cut off) - for (int x = newSize.width; x < mapSize.width; x++) { - for (int y = 0; y < mapSize.height; y++) { + for (int x = newSize.getWidth(); x < mapSize.getWidth(); x++) { + for (int y = 0; y < mapSize.getHeight(); y++) { if (mapGrid[x][y] != null) { return true; } @@ -1007,10 +987,10 @@ } } - if (mapSize.height > newSize.height) { + if (mapSize.getHeight() > newSize.getHeight()) { // search the bottom stripe (as far as being cut off) - for (int y = newSize.height; y < mapSize.height; y++) { - for (int x = 0; x < mapSize.width; x++) { + for (int y = newSize.getHeight(); y < mapSize.getHeight(); y++) { + for (int x = 0; x < mapSize.getWidth(); x++) { if (mapGrid[x][y] != null) { return true; } @@ -1021,34 +1001,25 @@ return false; } - @Deprecated public void resizeMap(final int newWidth, final int newHeight) { - resizeMap(new Dimension(newWidth, newHeight)); - } - /** * Resize this map to the new size. If any bounds are smaller than before, * the map gets cut on the right and bottom side. Accordingly, new space is * attached to right and bottom. * @param newSize new map size */ - public void resizeMap(final Dimension newSize) { - // don't allow negative values - if (newSize.width < 0) { - newSize.width = 0; + public void resizeMap(final Size2D newSize) { + if (newSize.equals(mapSize)) { + return; } - if (newSize.height < 0) { - newSize.height = 0; - } - // no other thread may access this mapmodel while resizing synchronized (this) { // first delete all arches in the area that will get cut off // (this is especially important to remove all multipart-objects // reaching into that area) - if (mapSize.width > newSize.width) { + if (mapSize.getWidth() > newSize.getWidth()) { // clear out the right stripe (as far as being cut off) - for (int x = newSize.width; x < mapSize.width; x++) { - for (int y = 0; y < mapSize.height; y++) { + for (int x = newSize.getWidth(); x < mapSize.getWidth(); x++) { + for (int y = 0; y < mapSize.getHeight(); y++) { // for every map square: delete all arches on it final Iterator it = getArchObjectsDeleteMapArch(x, y, false, false); while (it.hasNext()) { @@ -1059,12 +1030,12 @@ } } - if (mapSize.height > newSize.height) { + if (mapSize.getHeight() > newSize.getHeight()) { // clear out the bottom stripe (as far as being cut off) // (and yes, there is an area getting sweeped twice - and yes it could // be optimized you smartass - but I don't care!) - for (int y = newSize.height; y < mapSize.height; y++) { - for (int x = 0; x < mapSize.width; x++) { + for (int y = newSize.getHeight(); y < mapSize.getHeight(); y++) { + for (int x = 0; x < mapSize.getWidth(); x++) { // for every map square: delete all arches on it final Iterator it = getArchObjectsDeleteMapArch(x, y, false, false); while (it.hasNext()) { @@ -1077,17 +1048,17 @@ // Now the critical step: create an ArchObject array of new dimension, // copy all objects and set it to replace the current one. - final ArchObject[][] newGrid = new ArchObject[newSize.width][newSize.height]; + final ArchObject[][] newGrid = new ArchObject[newSize.getWidth()][newSize.getHeight()]; // fill it with nulls - for (int x = 0; x < newSize.width; x++) { - for (int y = 0; y < newSize.height; y++) { + for (int x = 0; x < newSize.getWidth(); x++) { + for (int y = 0; y < newSize.getHeight(); y++) { newGrid[x][y] = null; } } // relink all arches to the new grid - for (int x = 0; x < Math.min(newSize.width, mapSize.width); x++) { - for (int y = 0; y < Math.min(newSize.height, mapSize.height); y++) { + for (int x = 0; x < Math.min(newSize.getWidth(), mapSize.getWidth()); x++) { + for (int y = 0; y < Math.min(newSize.getHeight(), mapSize.getHeight()); y++) { newGrid[x][y] = mapGrid[x][y]; } } @@ -1096,7 +1067,7 @@ mapGrid = newGrid; // adjust the map and model attributes - mapSize.setSize(newSize.width, newSize.height); + mapSize = newSize; mapArch.setMapSize(newSize); // an important last point: if there is a highlighted area in a region @@ -1135,7 +1106,7 @@ * @return whether a match was found */ public boolean filterSquare(final Filter filter, final FilterConfig config, final int x, final int y) { - if (x < 0 || y < 0 || x >= mapSize.width || y >= mapSize.height) { + if (x < 0 || y < 0 || x >= mapSize.getWidth() || y >= mapSize.getHeight()) { return false; } Modified: trunk/crossfire/src/cfeditor/map/MapArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-06-25 12:30:38 UTC (rev 186) +++ trunk/crossfire/src/cfeditor/map/MapArchObject.java 2006-06-25 13:25:39 UTC (rev 187) @@ -24,11 +24,11 @@ package cfeditor.map; +import app.net.sf.gridarta.Size2D; import cfeditor.IGUIConstants; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; -import java.awt.Dimension; /** * MapArchObject contains the specific meta data about a map that is stored in @@ -70,8 +70,10 @@ private final StringBuffer loreText = new StringBuffer(""); // lore text buffer - /** Size of this map. */ - private Dimension mapSize = new Dimension(); + /** + * Map size. + */ + private Size2D mapSize = new Size2D(1, 1); /** Default enter coordinates (usage not recommended). */ private int enterX, enterY; @@ -239,46 +241,27 @@ } /** - * Get the map width. - * @return map width + * Set map size. + * @param mapSize new map size */ - @Deprecated public int getWidth() { - return mapSize.width; - } + public void setMapSize(final Size2D mapSize) { + if (mapSize == null) { + throw new IllegalArgumentException("No map size set"); + } - /** - * Set the map width. - * @param x new map width - */ - @Deprecated public void setWidth(final int x) { - mapSize.width = x; + this.mapSize = mapSize; } /** - * Get the map height. - * @return map height + * Ensure that the map size is at least the given size. + * @param width the new minimum map width + * @param height the new minimum map height */ - @Deprecated public int getHeight() { - return mapSize.height; + public void ensureMapSize(final int width, final int height) { + mapSize = new Size2D(Math.max(mapSize.getWidth(), width), Math.max(mapSize.getHeight(), height)); } - /** - * Set the map height. - * @param y new map height - */ - @Deprecated public void setHeight(final int y) { - mapSize.height = y; - } - - /** - * Set map size. - * @param mapSize new map size - */ - public void setMapSize(final Dimension mapSize) { - this.mapSize.setSize(mapSize); - } - - public Dimension getMapSize() { + public Size2D getMapSize() { return mapSize; } @@ -619,11 +602,6 @@ return loreText.toString(); } - /** @return true if the mapsize is zero */ - public boolean sizeNull() { - return mapSize.width <= 0 && mapSize.height <= 0; - } - /** * Parsing the MapArchObject. This special object has it's own parser now * because it must be easily expandable for possible features. Who knows @@ -638,6 +616,9 @@ String line2; // input line, includes leading and trailing white space boolean loreflag = false; // flag for lore-text boolean archflag = false; // flag for arch<->end + int width = 0; + int height = 0; + try { boolean msgflag = false; // flag for map-message // read lines @@ -681,9 +662,9 @@ } else if (line.startsWith("region")) { region = line.substring(line.indexOf(" ") + 1).trim(); } else if (line.startsWith("width") || line.startsWith("x ")) { - mapSize.width = getLineValue(line); + width = getLineValue(line); } else if (line.startsWith("height") || line.startsWith("y ")) { - mapSize.height = getLineValue(line); + height = getLineValue(line); } else if (line.startsWith("enter_x") || line.startsWith("hp")) { enterX = getLineValue(line); } else if (line.startsWith("enter_y") || line.startsWith("sp")) { @@ -797,6 +778,9 @@ // if we reach eof here, the mapfile is corrupt return false; } + + mapSize = new Size2D(width, height); + return archflag; } @@ -874,12 +858,8 @@ if (darkness > 0) { stream.append("darkness " + darkness + "\n"); } - if (mapSize.width > 0) { - stream.append("width " + mapSize.width + "\n"); - } - if (mapSize.height > 0) { - stream.append("height " + mapSize.height + "\n"); - } + stream.append("width " + mapSize.getWidth() + "\n"); + stream.append("height " + mapSize.getHeight() + "\n"); if (enterX > 0) { stream.append("enter_x " + enterX + "\n"); } Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2006-06-25 12:30:38 UTC (rev 186) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2006-06-25 13:25:39 UTC (rev 187) @@ -24,6 +24,7 @@ package cfeditor.map; +import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectIterator; import cfeditor.arch.ArchObjectIteratorDeleteMapArch; @@ -33,7 +34,6 @@ import cfeditor.CMapViewIFrame; import cfeditor.CUndoStack; import cfeditor.IGUIConstants; -import java.awt.Dimension; import java.awt.Point; import java.io.File; import java.util.Iterator; @@ -174,11 +174,11 @@ */ public void addEditType(final int newType) { // calculate only if needed - final Dimension size = mapModel.getMapSize(); + final Size2D mapSize = mapModel.getMapSize(); final Point pos = new Point(); if (!hasEditType(newType)) { - for (pos.x = 0; pos.x < size.width; pos.x++) { - for (pos.y = 0; pos.y < size.height; pos.y++) { + for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { + for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { final Iterator<ArchObject> it = mapModel.getArchObjects(pos); while (it.hasNext()) { final ArchObject arch = it.next(); @@ -355,7 +355,7 @@ * @param strMapTitle map name * @param newSize size of map */ - public void setProperties(final String archText, final String loreText, String strMapTitle, final Dimension newSize) { + public void setProperties(final String archText, final String loreText, String strMapTitle, final Size2D newSize) { // resize this map if (!newSize.equals(getMapSize())) { resizeMap(newSize); @@ -437,29 +437,11 @@ * Return the size of the level. * @return the map size */ - public Dimension getMapSize() { + public Size2D getMapSize() { return mapModel.getMapSize(); } /** - * Return the width of the level. - * @return the map width - * @deprecated use {@link #getMapSize()} instead. - */ - @Deprecated public int getMapWidth() { - return getMapSize().width; - } - - /** - * Return the height of the level. - * @return the map height - * @deprecated use {@link #getMapSize()} instead. - */ - @Deprecated public int getMapHeight() { - return getMapSize().height; - } - - /** * Return the current view position. * @return the current view position */ @@ -474,9 +456,9 @@ // TODO implement this int getDisplayMapWidth() { if (showTiles) { - return mapModel.getMapSize().width + eastWidth + westWidth; + return mapModel.getMapSize().getWidth() + eastWidth + westWidth; } else { - return mapModel.getMapSize().width; + return mapModel.getMapSize().getWidth(); } } @@ -486,9 +468,9 @@ */ int getDisplayMapHeight() { if (showTiles) { - return mapModel.getMapSize().height + northHeight + southHeight; + return mapModel.getMapSize().getHeight() + northHeight + southHeight; } else { - return mapModel.getMapSize().height; + return mapModel.getMapSize().getHeight(); } } @@ -536,7 +518,7 @@ return mapModel.pointValid(pos); } - public boolean checkResizeMap(final Dimension dim) { + public boolean checkResizeMap(final Size2D dim) { return mapModel.checkResizeMap(dim); } @@ -544,7 +526,7 @@ * Resize the map. * @param size the new level size */ - void resizeMap(final Dimension size) { + void resizeMap(final Size2D size) { mapModel.resizeMap(size); } Modified: trunk/crossfire/src/cfeditor/map/MapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapModel.java 2006-06-25 12:30:38 UTC (rev 186) +++ trunk/crossfire/src/cfeditor/map/MapModel.java 2006-06-25 13:25:39 UTC (rev 187) @@ -1,10 +1,10 @@ package cfeditor.map; +import app.net.sf.gridarta.Size2D; import cfeditor.arch.ArchObject; import cfeditor.arch.ArchObjectIterator; import cfeditor.arch.ArchObjectIteratorDeleteArchMapObject; import cfeditor.arch.ArchObjectIteratorDeleteMapArch; -import java.awt.Dimension; import java.awt.Point; import java.util.Iterator; import org.jetbrains.annotations.Nullable; @@ -46,7 +46,7 @@ boolean isLevelChanged(); - Dimension getMapSize(); + Size2D getMapSize(); @Deprecated boolean addArchToMap(int archnr, int xx, int yy, int intern, boolean join, boolean insertBelow); boolean addArchToMap(int archnr, Point pos, int intern, boolean join, boolean insertBelow); @@ -67,10 +67,9 @@ @Nullable ArchObject getExit(); - @Deprecated boolean checkResizeMap(int newWidth, int newHeight); - boolean checkResizeMap(Dimension newSize); + boolean checkResizeMap(Size2D newSize); - void resizeMap(Dimension newSize); + void resizeMap(Size2D newSize); void moveTileUp(ArchObject prev, boolean refresh); Modified: trunk/daimonin/src/daieditor/CMapFileDecode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-06-25 12:30:38 UTC (rev 186) +++ trunk/daimonin/src/daieditor/CMapFileDecode.java 2006-06-25 13:25:39 UTC (rev 187) @@ -114,12 +114,7 @@ // finally... here we go // last action: if the map is bigger than the specified size in // the maparch, we set the true size: the maxxlen/maxylen counters. - if (maparch.getWidth() < maxxlen + 1) { - maparch.setWidth(maxxlen + 1); - } - if (maparch.getHeight() < maxylen + 1) { - maparch.setHeight(maxylen + 1); - } + maparch.ensureMapSize(maxxlen + 1, maxylen + 1); return objects; // return first arch of the list } Modified: trunk/daimonin/src/daieditor/CMapFileEncode.java =================================================================== --- trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-06-25 12:30:38 UTC (rev 186) +++ trunk/daimonin/src/daieditor/CMapFileEncode.java 2006-06-25 13:25:39 UTC (rev 187) @@ -24,11 +24,11 @@ package daieditor; +import app.net.sf.gridarta.Size2D; import daieditor.arch.ArchObject; import daieditor.map.MapArchObject; import daieditor.map.MapModel; import daieditor.map.MapSquare; -import java.awt.Dimension; import java.awt.Point; import java.io.BufferedWriter; import java.io.File; @@ -72,10 +72,10 @@ mapArch.writeMapArch(writer); // FIXME: It doesn't look like a good idea to mix Push and Pull // first, write all one tile parts - final Dimension mapSize = mapModel.getMapSize(); + final Size2D mapSize = mapModel.getMapSize(); final Point pos = new Point(); - for (pos.x = 0; pos.x < mapSize.width; pos.x++) { - for (pos.y = 0; pos.y < mapSize.height; pos.y++) { + for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { + for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { for (ArchObject node : mapModel.getMapSquare(pos)) { // only non muli suckers if (node.getMapMultiHead() == null && node.getMultiRefCount() == 0) { Modified: trunk/daimonin/src/daieditor/CMapViewBasic.java =================================================================== --- trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-06-25 12:30:38 UTC (rev 186) +++ trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-06-25 13:25:39 UTC (rev 187) @@ -24,6 +24,7 @@ package daieditor; +import app.net.sf.gridarta.Size2D; import daieditor.arch.ArchObject; import daieditor.gui.map.DefaultLevelRenderer; import daieditor.gui.map.MapUserListener; @@ -286,10 +287,10 @@ */ public Point[] getSelection() { final List<Point> selection = new ArrayList<Point>(); - final Dimension mapSize = mapModel.getMapSize(); + final Size2D mapSize = mapModel.getMapSize(); final Point pos = new Point(); - for (pos.x = 0; pos.x < mapSize.width; pos.x++) { - for (pos.y = 0; pos.y < mapSize.height; pos.y++) { + for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { + for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { if ((mapGrid.getFlags(pos) & MapGrid.GRID_FLAG_SELECTION) > 0) { selection.add((Point) pos.clone()); } @@ -304,10 +305,10 @@ */ public List<MapSquare> getSelectedSquares() { final List<MapSquare> selection = new ArrayList<MapSquare>(); - final Dimension mapSize = mapModel.getMapSize(); + final Size2D mapSize = mapModel.getMapSize(); final Point pos = new Point(); - for (pos.x = 0; pos.x < mapSize.width; pos.x++) { - for (pos.y = 0; pos.y < mapSize.height; pos.y++) { + for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { + for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { if ((mapGrid.getFlags(pos) & MapGrid.GRID_FLAG_SELECTION) > 0) { selection.add(mapModel.getMapSquare(pos)); } @@ -346,15 +347,15 @@ /** Refreshes the data in the view from the model. */ private void refreshDataFromModel() { - final Dimension mapSize = mapModel.getMapSize(); + final Size2D mapSize = mapModel.getMapSize(); // define how much drawing space we need for the map final Point offset = renderer.getBorderOffset(); - final int sum = mapSize.width + mapSize.height; + final int sum = mapSize.getWidth() + mapSize.getHeight(); final Dimension forcedSize; if (isPickmap()) { forcedSize = new Dimension( - 2 * offset.x + (min(mapSize.height, 4) + min(mapSize.width, 7)) * IGUIConstants.TILE_ISO_XLEN2, + 2 * offset.x + (min(mapSize.getHeight(), 4) + min(mapSize.getWidth(), 7)) * IGUIConstants.TILE_ISO_XLEN2, 2 * offset.y + sum * IGUIConstants.TILE_ISO_YLEN2 ); } else { @@ -378,8 +379,7 @@ /** {@inheritDoc} */ public void mapSizeChanged(final MapModelEvent e) { - final Dimension size = e.getMap().getMapSize(); - mapGrid.resize(size); + mapGrid.resize(e.getMap().getMapSize()); // This will validate the map if necessary mainControl.mapSizeChanged(e.getMap()); refreshDataFromModel(); Modified: trunk/daimonin/src/daieditor/CNewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-06-25 12:30:38 UTC (rev 186) +++ trunk/daimonin/src/daieditor/CNewMapDialog.java 2006-06-25 13:25:39 UTC (rev 187) @@ -25,6 +25,7 @@ package daieditor; +import app.net.sf.gridarta.Size2D; import static net.sf.japi.swing.ActionFactory.getFactory; import static daieditor.CMainControl.PREFS_USERNAME; import static daieditor.CMainControl.PREFS_USERNAME_DEFAULT; @@ -201,8 +202,9 @@ //maparch.setHeight(IGUIConstants.DEF_MAPSIZE); // Get and validate the width + final int width; try { - maparch.setWidth((Integer) mapWidthField.getValue()); + width = (Integer) mapWidthField.getValue(); } catch (final IllegalArgumentException e) { final String key = e instanceof NumberFormatException ? "newMapDimensionNotANumber" : "newMapDimensionOutOfRange"; ACTION_FACTORY.showMessageDialog(this, key); @@ -211,8 +213,9 @@ } // Get and validate the height + final int height; try { - maparch.setHeight((Integer) mapHeightField.getValue()); + height = (Integer) mapHeightField.getValue(); } catch (final IllegalArgumentException e) { final String key = e instanceof NumberFormatException ? "newMapDimensionNotANumber" : "newMapDimensionOutOfRange"; ACTION_FACTORY.showMessageDialog(this, key); @@ -220,6 +223,8 @@ return false; } + maparch.setMapSize(new Size2D(width, height)); + // the mapmaker must enter a mapname to create a new map final String mapName = mapNameField.getText(); if (mapType == MapType.GAMEMAP && (mapName == null || mapName.length() <= 0)) { @@ -229,8 +234,8 @@ } if (mapType == MapType.GAMEMAP) { - prefs.putInt(DEFAULT_LEVEL_WIDTH_KEY, maparch.getWidth()); - prefs.putInt(DEFAULT_LEVEL_HEIGHT_KEY, maparch.getHeight()); + prefs.putInt(DEFAULT_LEVEL_WIDTH_KEY, width); + prefs.putInt(DEFAULT_LEVEL_HEIGHT_KEY, height); } // set file name Modified: trunk/daimonin/src/daieditor/CopyBuffer.java =================================================================== --- trunk/daimonin/src/daieditor/CopyBuffer.java 2006-06-25 12:30:38 UTC (rev 186) +++ trunk/daimonin/src/daieditor/CopyBuffer.java 2006-06-25 13:25:39 UTC (rev 187) @@ -24,13 +24,13 @@ package daieditor; +import app.net.sf.gridarta.Size2D; import static daieditor.CMainControl.rnd; import daieditor.arch.ArchObject; import daieditor.map.MapArchObject; import daieditor.map.MapControl; import daieditor.map.MapModel; import daieditor.map.MapSquare; -import java.awt.Dimension; import java.awt.Point; import java.awt.Rectangle; import java.util.ArrayList; @@ -139,8 +139,7 @@ wasEmpty = true; } - maparch.setWidth(selRec.width + 1); - maparch.setHeight(selRec.height + 1); + maparch.setMapSize(new Size2D(selRec.width + 1, selRec.height + 1)); copyMapCtrl = new MapControl(mainControl, null, maparch, false, false); // new MapControl copyMap = copyMapCtrl.getMapModel(); if (wasEmpty) { @@ -313,10 +312,10 @@ private static int countMapArches(final MapControl mapControl) { final MapModel map = mapControl.getMapModel(); int count = 0; - final Dimension mapSize = map.getMapSize(); + final Size2D mapSize = map.getMapSize(); final Point pos = new Point(); - for (pos.x = 0; pos.x < mapSize.width; pos.x++) { - for (pos.y = 0; pos.y < mapSize.height; pos.y++) { + for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { + for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { for (ArchObject node : map.getMapSquare(pos)) { ... [truncated message content] |
From: <chr...@us...> - 2006-06-25 12:30:43
|
Revision: 186 Author: christianhujer Date: 2006-06-25 05:30:38 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=186&view=rev Log Message: ----------- Removed empty unused swing package. Removed Paths: ------------- trunk/daimonin/src/daieditor/swing/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-06-25 12:27:29
|
Revision: 185 Author: christianhujer Date: 2006-06-25 05:27:19 -0700 (Sun, 25 Jun 2006) ViewCVS: http://svn.sourceforge.net/gridarta/?rev=185&view=rev Log Message: ----------- Added freshmeat link. Modified Paths: -------------- trunk/src/doc/transform.xslt Modified: trunk/src/doc/transform.xslt =================================================================== --- trunk/src/doc/transform.xslt 2006-06-25 12:22:10 UTC (rev 184) +++ trunk/src/doc/transform.xslt 2006-06-25 12:27:19 UTC (rev 185) @@ -10,13 +10,13 @@ > <xsl:output + cdata-section-elements="html:script html:style" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" encoding="utf-8" indent="no" method="xml" omit-xml-declaration="no" - cdata-section-elements="html:script html:style" /> <xsl:strip-space @@ -61,6 +61,7 @@ <address> <a href="http://sourceforge.net/"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=166996&type=1" alt="SourceForge.net Logo" width="88" height="31" class="now" /></a> <a href="http://sourceforge.net/donate/index.php?group_id=166996"><img src="http://sourceforge.net/images/project-support.jpg" width="88" height="32" alt="Support This Project" class="now" /></a> + <a href="http://freshmeat.net/projects/gridarta/"><img src="http://images.freshmeat.net/img/link_button_4.gif" width="88" height="31" alt="freshmeat.net" class="now" /></a> <a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml11" alt="Valid XHTML 1.1" height="31" width="88" class="now" /></a> <a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="http://jigsaw.w3.org/css-validator/images/vcss" width="88" height="31" alt="Valid CSS!" class="now" /></a> <!--<a href="http://www.jetbrains.com/idea/"><img src="http://www.jetbrains.com/idea/opensource/img/banners/idea88x31_blue.gif" alt="The best Java IDE" width="88" height="31" /></a>--> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |