From: <aki...@us...> - 2007-01-08 23:04:32
|
Revision: 1519 http://svn.sourceforge.net/gridarta/?rev=1519&view=rev Author: akirschbaum Date: 2007-01-08 15:04:32 -0800 (Mon, 08 Jan 2007) Log Message: ----------- Move code related to pickmap panel into PickmapChooserView. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2007-01-08 22:24:56 UTC (rev 1518) +++ trunk/crossfire/src/cfeditor/CMainView.java 2007-01-08 23:04:32 UTC (rev 1519) @@ -45,7 +45,6 @@ import java.util.List; import javax.swing.AbstractAction; import javax.swing.Action; -import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.JCheckBoxMenuItem; import javax.swing.JDesktopPane; @@ -53,7 +52,6 @@ import javax.swing.JOptionPane; import javax.swing.JSplitPane; import javax.swing.JTabbedPane; -import javax.swing.SwingConstants; import javax.swing.UIManager; import javax.swing.event.InternalFrameEvent; import net.sf.gridarta.gui.GSplitPane; @@ -146,9 +144,6 @@ /** Attributes panel (bottom). */ private GameObjectAttributesPanel mapArchPanel; - /** Panel with pickmaps. */ - private JTabbedPane pickmapPanel; - /** <code>true</code> when pickmap is active, <code>false</code> when * archlist is active. */ private boolean pickmapActive = false; @@ -210,11 +205,7 @@ // Add all the subviews getContentPane().setLayout(new BorderLayout()); - // initialize pickmap panel - pickmapPanel = new JTabbedPane(SwingConstants.TOP); - // initialize pickmap panel (needed early during the loading process) - pickmapChooserControl = new PickmapChooserControl(pickmapPanel); - pickmapPanel.setBorder(BorderFactory.createEmptyBorder(IGUIConstants.SPACE_PICKARCH_TOP, 0, 0, 0)); + pickmapChooserControl = new PickmapChooserControl(); statusBar = new StatusBar(mainControl); getContentPane().add(statusBar, BorderLayout.SOUTH); @@ -365,7 +356,7 @@ * @return the JTabbedPane with all pickmaps */ public JTabbedPane getPickmapPanel() { - return pickmapPanel; + return pickmapChooserControl.getPickmapPanel(); } // show a arch in the arch map panel Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-08 22:24:56 UTC (rev 1518) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-08 23:04:32 UTC (rev 1519) @@ -74,14 +74,13 @@ /** * Create a PickmapChooserControl. - * @param tabpane Tabbed pane to create view on. */ - public PickmapChooserControl(final JTabbedPane tabpane) { + public PickmapChooserControl() { mainControl = CMainControl.getInstance(); - view = new PickmapChooserView(tabpane); actions = new Actions(this); + view = new PickmapChooserView(); actions.init(); - tabpane.addChangeListener(new PickmapSelectionListener(this)); + view.addChangeListener(new PickmapSelectionListener(this)); } /** @@ -397,4 +396,12 @@ mainControl.getMainView().update(mainControl.getMainView().getGraphics()); } + /** + * Returns the JTabbedPane with all pickmaps. + * @return the JTabbedPane with all pickmaps + */ + public JTabbedPane getPickmapPanel() { + return view.getPickmapPanel(); + } + } // class PickmapChooserControl Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java 2007-01-08 22:24:56 UTC (rev 1518) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserView.java 2007-01-08 23:04:32 UTC (rev 1519) @@ -22,10 +22,15 @@ package cfeditor.gui.pickmapchooser; +import cfeditor.IGUIConstants; import java.awt.Component; +import javax.swing.BorderFactory; import javax.swing.JTabbedPane; +import javax.swing.SwingConstants; +import javax.swing.event.ChangeListener; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; /** * A View for choosing pickmaps. @@ -38,31 +43,43 @@ /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); - private final JTabbedPane tabpane; // tab pane with pickmaps + /** Panel with pickmaps. */ + private final JTabbedPane pickmapPanel = new JTabbedPane(SwingConstants.TOP); - public PickmapChooserView(final JTabbedPane tabpane) { - // the main-panel for pickmaps: - this.tabpane = tabpane; + public PickmapChooserView() { + pickmapPanel.setBorder(BorderFactory.createEmptyBorder(IGUIConstants.SPACE_PICKARCH_TOP, 0, 0, 0)); } + void addChangeListener(@NotNull final ChangeListener changeListener) { + pickmapPanel.addChangeListener(changeListener); + } + void addPanel(final String name, final Component mapView) { int i; - for (i = 0; i < tabpane.getTabCount() && name.compareToIgnoreCase(tabpane.getTitleAt(i)) < 0; i++) { + for (i = 0; i < pickmapPanel.getTabCount() && name.compareToIgnoreCase(pickmapPanel.getTitleAt(i)) < 0; i++) { ; } - tabpane.insertTab(name, null, mapView, null, i); + pickmapPanel.insertTab(name, null, mapView, null, i); } void removePanel(final Component mapView) { - tabpane.remove(mapView); + pickmapPanel.remove(mapView); } void selectPanel(final Component mapView) { - tabpane.setSelectedComponent(mapView); + pickmapPanel.setSelectedComponent(mapView); } String getSelectedPanelTitle() { - return tabpane.getTitleAt(tabpane.getSelectedIndex()); + return pickmapPanel.getTitleAt(pickmapPanel.getSelectedIndex()); } + /** + * Returns the JTabbedPane with all pickmaps. + * @return the JTabbedPane with all pickmaps + */ + public JTabbedPane getPickmapPanel() { + return pickmapPanel; + } + } // class PickmapChooserView Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2007-01-08 22:24:56 UTC (rev 1518) +++ trunk/daimonin/src/daieditor/CMainView.java 2007-01-08 23:04:32 UTC (rev 1519) @@ -46,7 +46,6 @@ import java.util.prefs.Preferences; import static java.util.prefs.Preferences.userNodeForPackage; import javax.swing.Action; -import javax.swing.BorderFactory; import javax.swing.ImageIcon; import javax.swing.JDesktopPane; import javax.swing.JMenu; @@ -56,7 +55,6 @@ import static javax.swing.JSplitPane.HORIZONTAL_SPLIT; import static javax.swing.JSplitPane.VERTICAL_SPLIT; import javax.swing.JTabbedPane; -import javax.swing.SwingConstants; import javax.swing.event.InternalFrameEvent; import net.sf.gridarta.gui.GSplitPane; import net.sf.gridarta.gui.MainView; @@ -150,9 +148,6 @@ /** Attributes panel (bottom). */ private GameObjectAttributesPanel mapArchPanel; - /** Panel with pickmaps. */ - private JTabbedPane pickmapPanel; - /** <code>true</code> when pickmap is active, <code>false</code> when * archlist is active. */ private boolean pickmapActive = false; @@ -219,11 +214,7 @@ final int divLocationDown = prefs.getInt(DIVIDER_LOCATION_KEY2, (int) (defheight * 0.76)); final int divLocation = prefs.getInt(DIVIDER_LOCATION_KEY, (int) (defwidth * 0.17)); - pickmapPanel = new JTabbedPane(SwingConstants.TOP); - // initialize pickmap panel (needed early during the loading process) - pickmapChooserControl = new PickmapChooserControl(pickmapPanel); - pickmapPanel.setComponentPopupMenu(ACTION_FACTORY.createPopupMenu(true, "pickmaps")); - pickmapPanel.setBorder(BorderFactory.createEmptyBorder(IGUIConstants.SPACE_PICKARCH_TOP, 0, 0, 0)); + pickmapChooserControl = new PickmapChooserControl(); statusBar = new StatusBar(mainControl); archPanel = new InsertionObjectChooser(mainControl); @@ -360,7 +351,7 @@ * @return the JTabbedPane with all pickmaps */ public JTabbedPane getPickmapPanel() { - return pickmapPanel; + return pickmapChooserControl.getPickmapPanel(); } // show a arch in the arch map panel Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-08 22:24:56 UTC (rev 1518) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-08 23:04:32 UTC (rev 1519) @@ -72,14 +72,13 @@ /** * Create a PickmapChooserControl. - * @param tabpane Tabbed pane to create view on. */ - public PickmapChooserControl(final JTabbedPane tabpane) { + public PickmapChooserControl() { mainControl = CMainControl.getInstance(); - view = new PickmapChooserView(tabpane); actions = new Actions(this); + view = new PickmapChooserView(); actions.init(); - tabpane.addChangeListener(new PickmapSelectionListener(this, mainControl)); + view.addChangeListener(new PickmapSelectionListener(this, mainControl)); } /** @@ -438,4 +437,12 @@ mainControl.getMainView().update(mainControl.getMainView().getGraphics()); } + /** + * Returns the JTabbedPane with all pickmaps. + * @return the JTabbedPane with all pickmaps + */ + public JTabbedPane getPickmapPanel() { + return view.getPickmapPanel(); + } + } // class PickmapChooserControl Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java 2007-01-08 22:24:56 UTC (rev 1518) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java 2007-01-08 23:04:32 UTC (rev 1519) @@ -22,10 +22,15 @@ package daieditor.gui.pickmapchooser; +import daieditor.IGUIConstants; import java.awt.Component; +import javax.swing.BorderFactory; import javax.swing.JTabbedPane; +import javax.swing.SwingConstants; +import javax.swing.event.ChangeListener; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; /** * A View for choosing pickmaps. @@ -38,35 +43,48 @@ /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); - private final JTabbedPane tabpane; // tab pane with pickmaps + /** Panel with pickmaps. */ + private JTabbedPane pickmapPanel = new JTabbedPane(SwingConstants.TOP); - public PickmapChooserView(final JTabbedPane tabpane) { - // the main-panel for pickmaps: - this.tabpane = tabpane; + public PickmapChooserView() { + pickmapPanel.setComponentPopupMenu(ACTION_FACTORY.createPopupMenu(true, "pickmaps")); + pickmapPanel.setBorder(BorderFactory.createEmptyBorder(IGUIConstants.SPACE_PICKARCH_TOP, 0, 0, 0)); } + void addChangeListener(@NotNull final ChangeListener changeListener) { + pickmapPanel.addChangeListener(changeListener); + } + int addPanel(final String name, final Component mapView, final int index) { - if (index < 0 || index >= tabpane.getTabCount()) { - tabpane.addTab(name, mapView); - return tabpane.getTabCount() - 1; + if (index < 0 || index >= pickmapPanel.getTabCount()) { + pickmapPanel.addTab(name, mapView); + return pickmapPanel.getTabCount() - 1; } else { - tabpane.insertTab(name, null, mapView, null, index); + pickmapPanel.insertTab(name, null, mapView, null, index); return index; } } void removePanel(final int index) { - tabpane.remove(index); + pickmapPanel.remove(index); } void selectPanel(final int index) { - if (index >= 0 && index < tabpane.getTabCount()) { - tabpane.setSelectedIndex(index); + if (index >= 0 && index < pickmapPanel.getTabCount()) { + pickmapPanel.setSelectedIndex(index); } } String getSelectedPanelTitle() { - return tabpane.getTitleAt(tabpane.getSelectedIndex()); + return pickmapPanel.getTitleAt(pickmapPanel.getSelectedIndex()); } + /** + * Returns the JTabbedPane with all pickmaps. + * @return the JTabbedPane with all pickmaps + */ + public JTabbedPane getPickmapPanel() { + return pickmapPanel; + } + } // class PickmapChooserView This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-09 21:36:43
|
Revision: 1522 http://svn.sourceforge.net/gridarta/?rev=1522&view=rev Author: akirschbaum Date: 2007-01-09 13:36:37 -0800 (Tue, 09 Jan 2007) Log Message: ----------- Unify pickmap chooser implementation; sort pickmaps in daieditor. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java trunk/daimonin/src/daieditor/map/MapControl.java Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-09 08:04:17 UTC (rev 1521) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-09 21:36:37 UTC (rev 1522) @@ -136,34 +136,27 @@ */ public boolean openPickmap(final File mapFile) { // open the pickmaps - final CMapViewBasic bmapview; - final MapArchObject maparch; try { final CMapReader decoder = new CMapReader(mapFile); - final List<GameObject> objects = decoder.decodeMapFile(); // parse mapfile - maparch = decoder.getMapArch(); // get map arch + try { + final List<GameObject> objects = decoder.decodeMapFile(); + final MapArchObject maparch = decoder.getMapArch(); - if (objects == null) { - // The map is totally empty - newPickmap(null, maparch, mapFile); // init the map - } else { // go to ArchetypeParser and add the default arch list information to them - if (!mainControl.collectTempList(objects, mapFile)) { // get face names, face id, etc. + if (!mainControl.collectTempList(objects, mapFile)) { return false; } - mainControl.getArchetypeParser().sortTempList(objects); // sort the list (put multiparts at the end) - newPickmap(objects, maparch, mapFile); // init the map + mainControl.getArchetypeParser().sortTempList(objects); + newPickmap(objects, maparch, mapFile); // init the map + return true; + } finally { + decoder.close(); } } catch (final IOException e) { - // loading failed - could be a system file in that directory, - // or something else. Doesn't deserve more attention than a printout. - if (!mapFile.getName().startsWith(".")) { - log.warn("Couldn't load pickmap", e); - } + log.warn("Couldn't load pickmap", e); } - - return true; + return false; } /** @@ -192,7 +185,7 @@ * Add a new pickmap. * @param objects list of objects or <code>null</code> for empty * @param maparch the maparch of the pickmap - * @param mapFile The map file that's stored in the MapControl. + * @param mapFile the file name of the pickmap */ private void newPickmap(final List<GameObject> objects, final MapArchObject maparch, final File mapFile) { final MapControl mapControl = new MapControl(mainControl, objects, maparch, true, null); Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-09 08:04:17 UTC (rev 1521) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-09 21:36:37 UTC (rev 1522) @@ -61,7 +61,10 @@ private final CMainControl mainControl; // main control reference - /** All open pickmaps (the map controllers get stored in the vector). */ + /** + * All open pickmaps. The sort order matches {@link + * PickmapChooserView#pickmapPanel}. + */ private final List<MapControl> pickmaps = new ArrayList<MapControl>(); /** The view for this control. */ @@ -127,17 +130,12 @@ updateActivePickmap(); // make sure we know which one is on top } - public boolean openPickmap(final File mapFile) { - return openPickmap(mapFile, -1); - } - /** * Open and load a pickmap from the given file. * @param mapFile the map file - * @param index the tab index where this pickmap should be inserted * @return true when pickmap was opened successfully */ - public boolean openPickmap(final File mapFile, final int index) { + public boolean openPickmap(final File mapFile) { // open the pickmaps try { @@ -146,17 +144,10 @@ try { final List<GameObject> objects = decoder.decodeMapFile(); final MapArchObject maparch = decoder.getMapArch(); - final CMapViewBasic bmapview; // go to ArchetypeParser and add the default arch list information to them - bmapview = newPickmap(objects, maparch, mapFile, index); // init the map - - // looks like it worked, so we add a panel and display this pickmap - if (bmapview != null) { - view.addPanel(mapFile.getName(), bmapview, index); - bmapview.getMapControl().setPickmap(true); - return true; - } + newPickmap(objects, maparch, mapFile); // init the map + return true; } finally { decoder.close(); } @@ -183,13 +174,7 @@ mapFile.getParentFile().mkdirs(); } - final CMapViewBasic bmapview = newPickmap(null, maparch, mapFile, -1); - if (bmapview == null) { - return false; - } - - bmapview.getLevel().save(); - setActivePickmap(view.addPanel(mapFile.getName(), bmapview, -1)); + newPickmap(null, maparch, mapFile); actions.setLoadComplete(true); return true; } @@ -198,25 +183,20 @@ * Add a new pickmap. * @param objects list of objects or <code>null</code> for empty * @param maparch the maparch of the pickmap - * @param mapFile File to load the pickmap from. - * @param index tab index to insert, -1 means add to the end - * @return basic mapview + * @param mapFile the file name of the pickmap */ - private CMapViewBasic newPickmap(final List<GameObject> objects, final MapArchObject maparch, final File mapFile, final int index) { + private void newPickmap(final List<GameObject> objects, final MapArchObject maparch, final File mapFile) { final MapControl mapControl = new MapControl(mainControl, objects, maparch, true, true); mapControl.getMapViewFrame().setAutoscrolls(true); mapControl.setMapFile(mapFile); - - // add pickmap to vector - if (index < 0 || index >= pickmaps.size()) { - pickmaps.add(mapControl); - } else { - pickmaps.add(index, mapControl); - } mapControl.resetModified(); - actions.setCurrentPickmap(mapControl); - return mapControl.getMapViewFrame().getBasicView(); + final int index = getIndex(mapFile); + pickmaps.add(index, mapControl); + view.addPanel(mapFile.getName(), mapControl.getMapViewFrame().getBasicView(), index); + + setActivePickmap(index); + actions.setCurrentPickmap(mapControl); } /** @@ -225,63 +205,34 @@ * @return true when closing successful */ public boolean closePickmap(final MapControl mapControl) { - boolean mapClosed = false; - for (int i = 0; !mapClosed && i < pickmaps.size(); i++) { - final MapControl tmpMap = pickmaps.get(i); - if (tmpMap == mapControl) { - pickmaps.remove(i); - view.removePanel(i); - mapClosed = true; - } + final int index = pickmaps.indexOf(mapControl); + if (index == -1) { + return false; } - if (mapClosed) { - updateActivePickmap(); - } - - return mapClosed; + pickmaps.remove(index); + view.removePanel(index); + updateActivePickmap(); + return true; } /** - * Get tab index of a pickmap in the JTabbedPane. - * @param mapControl control - * @return tab index of pickmap, or -1 if it doesn't exist + * Close a pickmap: Remove it from the panel and the data vector. + * @param file the map file name to remove + * @return true when closing successful */ - public int getPickmapTabIndex(final MapControl mapControl) { - for (int i = 0; i < pickmaps.size(); i++) { - if (pickmaps.get(i) == mapControl) { - return i; + public boolean closePickmap(final File file) { + for (final MapControl pickmap : pickmaps) { + if (pickmap.getMapFile().equals(file)) { + return closePickmap(pickmap); } } - return -1; + return false; } /** - * Get tab index of a pickmap in the JTabbedPane by absolut file filename. - * @param filename Filename of the pickmap. - * @return tab index of pickmap, or -1 if it doesn't exist - */ - public int getPickmapTabIndexByName(final String filename) { - for (int i = 0; i < pickmaps.size(); i++) { - if (pickmaps.get(i).getMapFileName().equals(filename)) { - return i; - } - } - return -1; - } - - /** - * Get a pickmap in the JTabbedPane by the index. - * @param index index number - * @return the map - */ - public MapControl getPickmapByIndex(final int index) { - return pickmaps.get(index); - } - - /** * Set pickmap with given tab index to be the active one (ontop). - * @param index tab index + * @param index the index into <code>pickmaps</code> */ public void setActivePickmap(final int index) { view.selectPanel(index); @@ -294,30 +245,13 @@ return; } - boolean foundMap = false; - - final String selectedName = view.getSelectedPanelTitle(); - - // Fix for Mantis #0000541: pickmap selection doesn't work on windows - // This has to be a '/' always, even on Windows, because the pickmap filename is a URI. - final String newName = '/' + selectedName; - - for (MapControl tmp : pickmaps) { - if (tmp != null && tmp.getMapFileName().endsWith(newName)) { - // this is the new active pickmap - actions.setCurrentPickmap(tmp); - foundMap = true; - if (log.isDebugEnabled()) { - log.debug("new pickmap: " + newName); - } - break; - } + final int index = view.getSelectedPanel(); + if (index == -1) { + actions.setCurrentPickmap(null); + return; } - if (!foundMap && isPickmapActive() && isLoadComplete()) { - // error: the new selected pickmap couldn't be found - log.error("Bad Error in PickmapChooserControl.updateActivePickmap: Selected pickmap couldn't be found!"); - } + actions.setCurrentPickmap(pickmaps.get(index)); } /** @@ -424,14 +358,8 @@ return; } - final int tabIndex = getPickmapTabIndex(pickmap); - if (tabIndex < 0) { - return; - } - mainControl.closeLevel(pickmap, true); // close the old map - openPickmap(mfile, tabIndex); // open the new map - setActivePickmap(tabIndex); + openPickmap(mfile); // open the new map // Update the main view so the new map instantly pops up. mainControl.getMainView().update(mainControl.getMainView().getGraphics()); @@ -445,4 +373,19 @@ return view.getPickmapPanel(); } + /** + * Determine where to insert a new pickmap into {@link #pickmaps}. + * + * @param file the file of the pickmap to insert + * + * @return the insertion index + */ + private int getIndex(final File file) { + int i; + for (i = 0; i < view.getPickmapPanel().getTabCount() && file.getName().compareToIgnoreCase(view.getPickmapPanel().getTitleAt(i)) > 0; i++) { + ; + } + return i; + } + } // class PickmapChooserControl Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java 2007-01-09 08:04:17 UTC (rev 1521) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserView.java 2007-01-09 21:36:37 UTC (rev 1522) @@ -44,7 +44,7 @@ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** Panel with pickmaps. */ - private JTabbedPane pickmapPanel = new JTabbedPane(SwingConstants.TOP); + private final JTabbedPane pickmapPanel = new JTabbedPane(SwingConstants.TOP); public PickmapChooserView() { pickmapPanel.setComponentPopupMenu(ACTION_FACTORY.createPopupMenu(true, "pickmaps")); @@ -55,14 +55,8 @@ pickmapPanel.addChangeListener(changeListener); } - int addPanel(final String name, final Component mapView, final int index) { - if (index < 0 || index >= pickmapPanel.getTabCount()) { - pickmapPanel.addTab(name, mapView); - return pickmapPanel.getTabCount() - 1; - } else { - pickmapPanel.insertTab(name, null, mapView, null, index); - return index; - } + void addPanel(final String name, final Component mapView, final int index) { + pickmapPanel.insertTab(name, null, mapView, null, index); } void removePanel(final int index) { @@ -70,13 +64,11 @@ } void selectPanel(final int index) { - if (index >= 0 && index < pickmapPanel.getTabCount()) { - pickmapPanel.setSelectedIndex(index); - } + pickmapPanel.setSelectedIndex(index); } - String getSelectedPanelTitle() { - return pickmapPanel.getTitleAt(pickmapPanel.getSelectedIndex()); + int getSelectedPanel() { + return pickmapPanel.getSelectedIndex(); } /** Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-09 08:04:17 UTC (rev 1521) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-09 21:36:37 UTC (rev 1522) @@ -293,19 +293,8 @@ // TODO } } else { - final int i = mainControl.getMainView().getPickmapChooserControl().getPickmapTabIndexByName(getMapFileName()); - - // -1: this map is not a pickmap - every other value is the tab index - if (i != -1) { - mainControl.getMainView().getPickmapChooserControl().closePickmap(mainControl.getMainView().getPickmapChooserControl().getPickmapByIndex(i)); - mainControl.getMainView().getPickmapChooserControl().openPickmap(mapFile, -1); // open the new map - mainControl.getMainView().getPickmapChooserControl().setActivePickmap(mainControl.getMainView().getPickmapChooserControl().getPickmapTabIndexByName(getMapFileName())); - if (mapViewFrame != null) { - // Update the main view so the new map instantly pops up. - final Graphics g = mapViewFrame.getGraphics(); - assert mapViewFrame != null; - mapViewFrame.update(g); - } + if (mainControl.getMainView().getPickmapChooserControl().closePickmap(mapFile)) { + mainControl.getMainView().getPickmapChooserControl().openPickmap(mapFile); } } if (!isPickmap) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-09 22:14:17
|
Revision: 1525 http://svn.sourceforge.net/gridarta/?rev=1525&view=rev Author: akirschbaum Date: 2007-01-09 14:14:15 -0800 (Tue, 09 Jan 2007) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFilterControl.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/filter/NamedFilterList.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java trunk/crossfire/src/cfeditor/gui/ScriptEditor.java trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java Modified: trunk/crossfire/src/cfeditor/CFilterControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CFilterControl.java 2007-01-09 21:50:08 UTC (rev 1524) +++ trunk/crossfire/src/cfeditor/CFilterControl.java 2007-01-09 22:14:15 UTC (rev 1525) @@ -65,7 +65,6 @@ * @param mapControl MapControl to create FilterControl for. */ public CFilterControl(@Nullable final MapControl mapControl) { - final boolean[] highLight = new boolean[]{false, false, false,}; filterOutConfig = (NamedFilterConfig) filterList.createConfig(); highLightConfig = new NamedFilterConfig[]{ (NamedFilterConfig) filterList.createConfig(), Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2007-01-09 21:50:08 UTC (rev 1524) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2007-01-09 22:14:15 UTC (rev 1525) @@ -452,7 +452,6 @@ // delete the topmost arch (matching the view settings) // on that square and redraw the map GameObject tmpArch = null; - final Iterator<GameObject> it = mapControl.getMapModel().getMapSquare(temp).reverse().iterator(); for (final GameObject gameObject : mapControl.getMapModel().getMapSquare(temp).reverse()) { tmpArch = gameObject; @@ -487,23 +486,6 @@ } else { // insert on normal map mapControl.insertSelArchToMap(mapLoc, true); - - // get name of inserted arch (this is display in status bar while dragging) - @Nullable final GameObject insArch = mainControl.getArchPanelHighlight(); - final String insertArchName; - if (insArch != null) { - if (insArch.getObjName() != null && insArch.getObjName().length() > 0) { - insertArchName = insArch.getObjName(); - } else if (insArch.getArchetypeName() != null && insArch.getArchetypeName().length() > 0) { - insertArchName = insArch.getArchetypeName(); - } else if (insArch.getArchetype() != null) { - insertArchName = insArch.getArchetype().getArchetypeName(); - } else { - insertArchName = "unknown"; - } - } else { - insertArchName = "nothing"; - } } mapControl.getMapModel().endTransaction(); } @@ -514,7 +496,6 @@ // delete the topmost arch (matching the view settings) on that square // and redraw the map GameObject tmpArch = null; - final Iterator<GameObject> it = mapControl.getMapModel().getMapSquare(mapLoc).reverse().iterator(); for (final GameObject gameObject : mapControl.getMapModel().getMapSquare(mapLoc).reverse()) { tmpArch = gameObject; if (mainControl.isTileEdit(tmpArch)) { Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-01-09 21:50:08 UTC (rev 1524) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-01-09 22:14:15 UTC (rev 1525) @@ -230,9 +230,6 @@ return; // should actually never happen } - final Rectangle selRec = mapControl.getMapGrid().getSelectedRec();; - final Point cursor = mapControl.getMapViewFrame().getView().getCursorPosition(); - if (mainControl.getArchPanelHighlight() == null) { // no selected arch to fill with return; } Modified: trunk/crossfire/src/cfeditor/filter/NamedFilterList.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/NamedFilterList.java 2007-01-09 21:50:08 UTC (rev 1524) +++ trunk/crossfire/src/cfeditor/filter/NamedFilterList.java 2007-01-09 22:14:15 UTC (rev 1525) @@ -53,7 +53,6 @@ /** Create a new NameFilterList. */ public NamedFilterList() { - final boolean inverted = false; subFilters = new LinkedHashMap<String, Filter>(); AttributeFilter f; f = new AttributeFilter(); Modified: trunk/crossfire/src/cfeditor/gui/ArchComboBox.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2007-01-09 21:50:08 UTC (rev 1524) +++ trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2007-01-09 22:14:15 UTC (rev 1525) @@ -94,7 +94,6 @@ boolean locked = false; public ArchComboBoxEditor() { - final ArchComboBoxModel archModel = new ArchComboBoxModel(); } public synchronized void lockEditor() { Modified: trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java 2007-01-09 21:50:08 UTC (rev 1524) +++ trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java 2007-01-09 22:14:15 UTC (rev 1525) @@ -153,8 +153,6 @@ * @return true if the settings were applied, false if error occurred */ @Override protected boolean applySettings2() { - final String oldArchText = gameObject.getObjectText(); // the old ArchText - final String oldMsg = gameObject.getMsgText(); // old gameObject msg final CFArchType typeStruct = archTypeList.getTypeOfArch(gameObject); // the type structure for this gameObject String newArchText = ""; Modified: trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java 2007-01-09 21:50:08 UTC (rev 1524) +++ trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java 2007-01-09 22:14:15 UTC (rev 1525) @@ -318,9 +318,6 @@ assert mapSquare != null; mapSquare.getModel().beginTransaction("Change object attributes"); - final String oldArchText = gameObject.getObjectText(); - final String oldMsg = gameObject.getMsgText(); - // We update all panels: name, face, msg and archText (more to come...) // the obj name: if (isNonwhitespaceText(archNameField.getText())) { // there is something in Modified: trunk/crossfire/src/cfeditor/gui/ScriptEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2007-01-09 21:50:08 UTC (rev 1524) +++ trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2007-01-09 22:14:15 UTC (rev 1525) @@ -263,7 +263,6 @@ final GridBagConstraints gbc = l.getConstraints(c); if (gbc != null) { selectedRow = gbc.gridy - 1; - final int selectedCol = gbc.gridx; } } Modified: trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java 2007-01-09 21:50:08 UTC (rev 1524) +++ trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java 2007-01-09 22:14:15 UTC (rev 1525) @@ -378,8 +378,6 @@ * <code>false</code> if the parameters were wrong. */ private boolean modifyMapProperties() { - boolean modifyTilepaths = false; // true when map tile-paths were modified - // first check if the entries are all okay final int darkness; final int difficulty; @@ -482,9 +480,6 @@ // update tilepaths for (int i = 0; i < IGUIConstants.DIRECTIONS; i++) { - if ((map.getTilePath(i) == null && (fieldTilePath[i].getText() == null || fieldTilePath[i].getText().length() == 0)) || (map.getTilePath(i) != null && !map.getTilePath(i).equals(fieldTilePath[i].getText()))) { - modifyTilepaths = true; - } map.setTilePath(i, fieldTilePath[i].getText()); } Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java 2007-01-09 21:50:08 UTC (rev 1524) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java 2007-01-09 22:14:15 UTC (rev 1525) @@ -231,7 +231,6 @@ * Update the actions' states. */ private void refresh() { - final boolean pickmapActive = control.isPickmapActive(); aAddNewPickmap.setEnabled(isAddNewPickmapEnabled()); aOpenPickmapMap.setEnabled(getOpenPickmapMap() != null); aClosePickmap.setEnabled(getClosePickmap() != null); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-01-09 21:50:08 UTC (rev 1524) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-01-09 22:14:15 UTC (rev 1525) @@ -1745,7 +1745,6 @@ * access. */ private static void loadDefTiles() { - final ImageIcon mapGridIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_IGRID_TILE); mapPreSelIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_IPRESEL_TILE); mapSelIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_ISEL_TILE); mapCursorIcon = CGUIUtils.getSysIcon(IGUIConstants.TILE_ICURSOR); Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java 2007-01-09 21:50:08 UTC (rev 1524) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java 2007-01-09 22:14:15 UTC (rev 1525) @@ -241,7 +241,6 @@ * Update the actions' states. */ private void refresh() { - final boolean pickmapActive = control.isPickmapActive(); aAddNewPickmap.setEnabled(isAddNewPickmapEnabled()); aOpenPickmapMap.setEnabled(getOpenPickmapMap() != null); aClosePickmap.setEnabled(getClosePickmap() != null); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-09 22:53:20
|
Revision: 1526 http://svn.sourceforge.net/gridarta/?rev=1526&view=rev Author: akirschbaum Date: 2007-01-09 14:53:11 -0800 (Tue, 09 Jan 2007) Log Message: ----------- Add final modifier. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CSettings.java trunk/crossfire/src/cfeditor/MapViewIFrame.java trunk/crossfire/src/cfeditor/filter/SimpleFilterConfig.java trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/MapViewIFrame.java trunk/daimonin/src/daieditor/ProcessRunner.java trunk/daimonin/src/daieditor/gameobject/match/AndGameObjectMatcher.java trunk/daimonin/src/daieditor/gameobject/match/MutableOrGameObjectMatcher.java trunk/daimonin/src/daieditor/gameobject/match/OrGameObjectMatcher.java trunk/daimonin/src/daieditor/gameobject/match/ViewGameObjectMatcherManager.java trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java trunk/daimonin/src/daieditor/gui/InsertionObjectChooser.java trunk/daimonin/src/daieditor/gui/ReplaceDialog.java trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java trunk/daimonin/src/daieditor/gui/map/tools/DeletionTool.java trunk/daimonin/src/daieditor/gui/map/tools/ToolPalette.java trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java trunk/daimonin/src/daieditor/map/validation/DefaultErrorCollector.java trunk/src/app/net/sf/gridarta/gameobject/Collector.java trunk/src/app/net/sf/gridarta/gameobject/NotInsideContainerException.java trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java trunk/src/app/net/sf/gridarta/gui/map/MapCursor.java trunk/src/app/net/sf/gridarta/gui/map/MapGrid.java trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java trunk/src/app/net/sf/gridarta/map/AbstractMapModel.java trunk/src/app/net/sf/gridarta/map/MapModelEvent.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -197,7 +197,7 @@ private final MapCursorControl mapCursorControl; /** The MainControlListeners to inform of changes. */ - private EventListenerList listenerList = new EventListenerList(); + private final EventListenerList listenerList = new EventListenerList(); /** Actions used by this instance. */ private final MainActions mainActions = new MainActions(this); Modified: trunk/crossfire/src/cfeditor/CSettings.java =================================================================== --- trunk/crossfire/src/cfeditor/CSettings.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/crossfire/src/cfeditor/CSettings.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -52,7 +52,7 @@ private final Properties properties = new Properties(); /** The file that is used to store the settings or null if none specified. */ - private String strFile; + private final String strFile; /** The shared hashtable that maps filenames to settings instances. */ private static final Map<String, CSettings> hashFromNameToInstance = new HashMap<String, CSettings>(); Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -219,7 +219,7 @@ } /** The Action to select this Window. */ - private WindowAction windowAction = new WindowAction(); + private final WindowAction windowAction = new WindowAction(); public void modelChanged() { view.modelChanged(); Modified: trunk/crossfire/src/cfeditor/filter/SimpleFilterConfig.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/SimpleFilterConfig.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/crossfire/src/cfeditor/filter/SimpleFilterConfig.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -16,7 +16,7 @@ */ public class SimpleFilterConfig extends BasicFilterConfig { - private Map<String, Object> properties = new HashMap<String, Object>(); + private final Map<String, Object> properties = new HashMap<String, Object>(); public void setProperty(final String name, final Object value) { properties.put(name, value); Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -60,7 +60,7 @@ private String pluginName; // name of plugin ("Python" expected) - private String eventType; // name of event type (e.g. "say", "death", "attack"...) + private final String eventType; // name of event type (e.g. "say", "death", "attack"...) private String options; // plugin options Modified: trunk/crossfire/src/cfeditor/gui/ArchComboBox.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -275,7 +275,7 @@ private Object value = null; - private GameObject[] archList; /*the current list*/ + private final GameObject[] archList; /*the current list*/ private String currentFilter = ""; Modified: trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/crossfire/src/cfeditor/gui/CloseableTabbedPane.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -128,7 +128,7 @@ //--- Data field(s) --- - private Icon icon; + private final Icon icon; @SuppressWarnings({"InstanceVariableNamingConvention"}) private int x = 0; Modified: trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -71,7 +71,7 @@ private static ReplaceDialog instance = null; /** Dialog. */ - private JDialog dialog; + private final JDialog dialog; private final CMainControl mainControl; Modified: trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/crossfire/src/cfeditor/gui/prefs/GUIPrefs.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -69,7 +69,7 @@ private Locale[] locales; /** LocaleComparator. */ - private LocaleComparator comp = new LocaleComparator(); + private final LocaleComparator comp = new LocaleComparator(); /** * Create a GUIPrefs pane. Modified: trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/crossfire/src/cfeditor/parameter/DoubleParameterView.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -26,11 +26,11 @@ private static final Logger log = Logger.getLogger(DoubleParameterView.class); - private JSpinner value; + private final JSpinner value; - private JButton config; + private final JButton config; - private DoubleParameter parameter; + private final DoubleParameter parameter; public JComponent getConfigComponent(final Object config, final PluginParameter parameter) { return this.config; Modified: trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/crossfire/src/cfeditor/parameter/IntegerParameterView.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -26,11 +26,11 @@ private static final Logger log = Logger.getLogger(IntegerParameterView.class); - private JSpinner value; + private final JSpinner value; - private JButton config; + private final JButton config; - private IntegerParameter parameter; + private final IntegerParameter parameter; public JComponent getConfigComponent(final Object config, final PluginParameter parameter) { return this.config; Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -288,10 +288,10 @@ public static final boolean PREFS_VALIDATOR_AUTO_DEFAULT = false; /** The GameObjectMatcher for show only. */ - private MutableOrGameObjectMatcher moaomShow = new MutableOrGameObjectMatcher(true); + private final MutableOrGameObjectMatcher moaomShow = new MutableOrGameObjectMatcher(true); /** The GameObjectMatcher for alpha. */ - private MutableOrGameObjectMatcher moaomAlpha = new MutableOrGameObjectMatcher(false); + private final MutableOrGameObjectMatcher moaomAlpha = new MutableOrGameObjectMatcher(false); /** The ViewGameObjectMatcherManager for show only. */ private final ViewGameObjectMatcherManager vaommShow = new ViewGameObjectMatcherManager(moaomShow); @@ -304,7 +304,7 @@ private final MapCursorControl mapCursorControl; /** The MainControlListeners to inform of changes. */ - private EventListenerList listenerList = new EventListenerList(); + private final EventListenerList listenerList = new EventListenerList(); /** Actions used by this instance. */ private final MainActions mainActions = new MainActions(this); @@ -997,7 +997,7 @@ private JFileChooser fileChooser; /** MapPreviewAccessory. */ - private MapPreviewAccessory mapPreviewAccessory = new MapPreviewAccessory(); + private final MapPreviewAccessory mapPreviewAccessory = new MapPreviewAccessory(); /** Create the JFileChooser for opening a file. */ private void createFileChooser() { @@ -1799,7 +1799,7 @@ } /** List with recents. */ - private LinkedList<Recent> recents = new LinkedList<Recent>(); + private final LinkedList<Recent> recents = new LinkedList<Recent>(); /** * Adds a file to the recent files. @@ -1934,7 +1934,7 @@ public final class Recent extends AbstractAction { /** Title = map name. */ - private String title; + private final String title; /** Filename = map filename (openable path, usually absolute, canonical or relative to user.dir). */ private final String filename; Modified: trunk/daimonin/src/daieditor/CMapViewBasic.java =================================================================== --- trunk/daimonin/src/daieditor/CMapViewBasic.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/CMapViewBasic.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -108,10 +108,10 @@ @NotNull private final MapGrid mapGrid; /** The MapSquares that are known to contain errors. */ - private Map<MapSquare<? extends net.sf.gridarta.gameobject.GameObject, ? extends net.sf.gridarta.map.MapArchObject>, ValidationError> erraneousMapSquares = new HashMap<MapSquare<? extends net.sf.gridarta.gameobject.GameObject, ? extends net.sf.gridarta.map.MapArchObject>, ValidationError>(); + private final Map<MapSquare<? extends net.sf.gridarta.gameobject.GameObject, ? extends net.sf.gridarta.map.MapArchObject>, ValidationError> erraneousMapSquares = new HashMap<MapSquare<? extends net.sf.gridarta.gameobject.GameObject, ? extends net.sf.gridarta.map.MapArchObject>, ValidationError>(); /** The ArchObjects that are known to contain errors. */ - private Map<net.sf.gridarta.gameobject.GameObject,ValidationError> erraneousArchObjects = new HashMap<net.sf.gridarta.gameobject.GameObject,ValidationError>(); + private final Map<net.sf.gridarta.gameobject.GameObject,ValidationError> erraneousArchObjects = new HashMap<net.sf.gridarta.gameobject.GameObject,ValidationError>(); /** * Constructs a level view. Modified: trunk/daimonin/src/daieditor/MapViewIFrame.java =================================================================== --- trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -204,7 +204,7 @@ } /** The Action to select this Window. */ - private WindowAction windowAction = new WindowAction(); + private final WindowAction windowAction = new WindowAction(); /** {@inheritDoc} */ @Override public void setFrameIcon(final Icon icon) { Modified: trunk/daimonin/src/daieditor/ProcessRunner.java =================================================================== --- trunk/daimonin/src/daieditor/ProcessRunner.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/ProcessRunner.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -68,7 +68,7 @@ * The i18n key. * @serial include */ - private String key; + private final String key; /** * The command. @@ -107,19 +107,19 @@ * Action for start. * @serial include */ - private Action controlStart = ACTION_FACTORY.createAction(false, "controlStart", this); + private final Action controlStart = ACTION_FACTORY.createAction(false, "controlStart", this); /** * Action for stop. * @serial include */ - private Action controlStop = ACTION_FACTORY.createAction(false, "controlStop", this); + private final Action controlStop = ACTION_FACTORY.createAction(false, "controlStop", this); /** * Action for clearing the log. * @serial include */ - private Action controlClear = ACTION_FACTORY.createAction(false, "controlClear", this); + private final Action controlClear = ACTION_FACTORY.createAction(false, "controlClear", this); /** The lock object for thread synchronization. */ private final Object lock = new Object(); @@ -285,7 +285,7 @@ private final Appender appender; /** Title. */ - private String title; + private final String title; /** * Create a CopyOutput. @@ -346,7 +346,7 @@ private static class Appender implements Runnable { /** Strings to append. */ - private Queue<String> texts = new ConcurrentLinkedQueue<String>(); + private final Queue<String> texts = new ConcurrentLinkedQueue<String>(); /** JTextArea to append to. */ private final JTextArea textArea; Modified: trunk/daimonin/src/daieditor/gameobject/match/AndGameObjectMatcher.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/match/AndGameObjectMatcher.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/gameobject/match/AndGameObjectMatcher.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -33,7 +33,7 @@ public class AndGameObjectMatcher implements GameObjectMatcher { /** List of Matchers to And. */ - private List<GameObjectMatcher> matchers = new ArrayList<GameObjectMatcher>(); + private final List<GameObjectMatcher> matchers = new ArrayList<GameObjectMatcher>(); /** * Create an AndGameObjectMatcher. Modified: trunk/daimonin/src/daieditor/gameobject/match/MutableOrGameObjectMatcher.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/match/MutableOrGameObjectMatcher.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/gameobject/match/MutableOrGameObjectMatcher.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -38,7 +38,7 @@ private final boolean defaultState; /** The GameObjectMatchers to OR. */ - private List<GameObjectMatcher> gameObjectMatchers = new ArrayList<GameObjectMatcher>(); + private final List<GameObjectMatcher> gameObjectMatchers = new ArrayList<GameObjectMatcher>(); /** * Create a MMutableOrGameObjectMatcher. Modified: trunk/daimonin/src/daieditor/gameobject/match/OrGameObjectMatcher.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/match/OrGameObjectMatcher.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/gameobject/match/OrGameObjectMatcher.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -33,7 +33,7 @@ public class OrGameObjectMatcher implements GameObjectMatcher { /** List of Matchers to Or. */ - private List<GameObjectMatcher> matchers = new ArrayList<GameObjectMatcher>(); + private final List<GameObjectMatcher> matchers = new ArrayList<GameObjectMatcher>(); /** * Create an OrGameObjectMatcher. Modified: trunk/daimonin/src/daieditor/gameobject/match/ViewGameObjectMatcherManager.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/match/ViewGameObjectMatcherManager.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/gameobject/match/ViewGameObjectMatcherManager.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -41,7 +41,7 @@ private final List<GameObjectMatcherToggleAction> actions = new ArrayList<GameObjectMatcherToggleAction>(); /** The Reset Action. */ - private Action resetAction = new ResetAction(Collections.unmodifiableList(actions)); + private final Action resetAction = new ResetAction(Collections.unmodifiableList(actions)); /** * Create a ViewArchObjectMatcher. Modified: trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java =================================================================== --- trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/gui/GameObjectAttributesPanel.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -130,13 +130,13 @@ /** The buttons for the direction panel. * @see #directionButtonGroup */ - private JToggleButton[] directionButtons = new JToggleButton[9]; + private final JToggleButton[] directionButtons = new JToggleButton[9]; /** * The ButtonGroup for the direction buttons. * @see #directionButtons */ - private ButtonGroup directionButtonGroup = new ButtonGroup(); + private final ButtonGroup directionButtonGroup = new ButtonGroup(); private final GSplitPane splitPane; Modified: trunk/daimonin/src/daieditor/gui/InsertionObjectChooser.java =================================================================== --- trunk/daimonin/src/daieditor/gui/InsertionObjectChooser.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/gui/InsertionObjectChooser.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -265,13 +265,13 @@ /** The buttons for the direction panel. * @see #directionButtonGroup */ - private JToggleButton[] directionButtons = new JToggleButton[9]; + private final JToggleButton[] directionButtons = new JToggleButton[9]; /** * The ButtonGroup for the direction buttons. * @see #directionButtons */ - private ButtonGroup directionButtonGroup = new ButtonGroup(); + private final ButtonGroup directionButtonGroup = new ButtonGroup(); private final InsertionObjectChooser ioc; Modified: trunk/daimonin/src/daieditor/gui/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/ReplaceDialog.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/gui/ReplaceDialog.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -74,7 +74,7 @@ private static ReplaceDialog instance = null; /** Dialog. */ - private JDialog dialog; + private final JDialog dialog; private final CMainControl mainControl; Modified: trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/gui/map/MapPreviewAccessory.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -69,19 +69,19 @@ private static final String PREFS_AUTOGEN_PREVIEW = "autogenPreviews"; /** Cache with icons. */ - private Map<File, WeakReference<ImageIcon>> icons = new WeakHashMap<File, WeakReference<ImageIcon>>(); + private final Map<File, WeakReference<ImageIcon>> icons = new WeakHashMap<File, WeakReference<ImageIcon>>(); /** Cache with previews. */ - private Map<File, WeakReference<ImageIcon>> previews = new WeakHashMap<File, WeakReference<ImageIcon>>(); + private final Map<File, WeakReference<ImageIcon>> previews = new WeakHashMap<File, WeakReference<ImageIcon>>(); /** The preview label. */ - private JLabel preview = new JLabel(); + private final JLabel preview = new JLabel(); /** ToggleAction for autogen preview. */ - private ToggleAction autogenPreview = (ToggleAction) ACTION_FACTORY.createToggle(false, "autogenPreviews", this); + private final ToggleAction autogenPreview = (ToggleAction) ACTION_FACTORY.createToggle(false, "autogenPreviews", this); /** Action for generating preview. */ - private Action genPreview = ACTION_FACTORY.createAction(false, "genPreview", this); + private final Action genPreview = ACTION_FACTORY.createAction(false, "genPreview", this); /** Wether to auto generate previews. */ private boolean autogenPreviews; Modified: trunk/daimonin/src/daieditor/gui/map/tools/DeletionTool.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/DeletionTool.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/gui/map/tools/DeletionTool.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -25,7 +25,7 @@ @NotNull private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor.gui.map.tools"); /** The ToggleAction for toggling the deleteBelow status. */ - private ToggleAction deleteBelowAction = (ToggleAction) ACTION_FACTORY.createToggle(true, "deleteBelow", this); + private final ToggleAction deleteBelowAction = (ToggleAction) ACTION_FACTORY.createToggle(true, "deleteBelow", this); /** The position for deletion. */ private boolean deleteBelow; Modified: trunk/daimonin/src/daieditor/gui/map/tools/ToolPalette.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/ToolPalette.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/gui/map/tools/ToolPalette.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -24,13 +24,13 @@ private final JTabbedPane mouseTabs = new JTabbedPane(); /** The ToolSelector for lmb. */ - private ToolSelector lmbSelector = new ToolSelector("selection"); + private final ToolSelector lmbSelector = new ToolSelector("selection"); /** The ToolSelector for mmb. */ - private ToolSelector mmbSelector = new ToolSelector("deletion"); + private final ToolSelector mmbSelector = new ToolSelector("deletion"); /** The ToolSelector for rmb. */ - private ToolSelector rmbSelector = new ToolSelector("insertion"); + private final ToolSelector rmbSelector = new ToolSelector("insertion"); /** Create a ToolPalette. */ public ToolPalette() { Modified: trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/gui/prefs/GUIPrefs.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -70,7 +70,7 @@ private Locale[] locales; /** LocaleComparator. */ - private LocaleComparator comp = new LocaleComparator(); + private final LocaleComparator comp = new LocaleComparator(); /** * Create a GUIPrefs pane. Modified: trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/gui/prefs/MapValidatorPrefs.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -59,7 +59,7 @@ private final DelegatingMapValidator validators; /** Checkboxes to enabled the individual validator checks. */ - private Map<Validator, JCheckBox> checkBoxes = new HashMap<Validator, JCheckBox>(); + private final Map<Validator, JCheckBox> checkBoxes = new HashMap<Validator, JCheckBox>(); /** Check box to set whether map files should be really checked. */ private JCheckBox autoValidate; Modified: trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/gui/prefs/NetPrefs.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -68,13 +68,13 @@ private static final Preferences PREFS = userNodeForPackage(CMainControl.class); /** JComboBox for selecting the proxy type. */ - private JComboBox proxyType = createProxyType(); + private final JComboBox proxyType = createProxyType(); /** TextField for server executable. */ - private JTextField proxyHost = new JTextField(PREFS.get(NET_PREFS_KEY_HOST, "")); + private final JTextField proxyHost = new JTextField(PREFS.get(NET_PREFS_KEY_HOST, "")); /** TextField for client executable. */ - private JSpinner proxyPort = new JSpinner(new SpinnerNumberModel(PREFS.getInt(NET_PREFS_KEY_PORT, 3128), 1, 65535, 1)); + private final JSpinner proxyPort = new JSpinner(new SpinnerNumberModel(PREFS.getInt(NET_PREFS_KEY_PORT, 3128), 1, 65535, 1)); /** Create a NetPrefs pane. */ public NetPrefs() { Modified: trunk/daimonin/src/daieditor/map/validation/DefaultErrorCollector.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/DefaultErrorCollector.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/daimonin/src/daieditor/map/validation/DefaultErrorCollector.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -32,7 +32,7 @@ public class DefaultErrorCollector implements ErrorCollector, Iterable<ValidationError> { /** Errors. */ - private List<ValidationError> errors = new ArrayList<ValidationError>(); + private final List<ValidationError> errors = new ArrayList<ValidationError>(); /** Create a DefaultErrorCollector. */ public DefaultErrorCollector() { Modified: trunk/src/app/net/sf/gridarta/gameobject/Collector.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Collector.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/src/app/net/sf/gridarta/gameobject/Collector.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -20,7 +20,7 @@ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.gridarta"); /** The Collectables. */ - private List<Collectable> collectables = new ArrayList<Collectable>(); + private final List<Collectable> collectables = new ArrayList<Collectable>(); /** The Component to show the progress dialog on. */ private JFrame parent; Modified: trunk/src/app/net/sf/gridarta/gameobject/NotInsideContainerException.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/NotInsideContainerException.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/src/app/net/sf/gridarta/gameobject/NotInsideContainerException.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -12,7 +12,7 @@ /** * The expected container if != null or null if expected to be in any container. */ - @Nullable private GameObjectContainer container; + @Nullable private final GameObjectContainer container; /** * The GameObject that was not inside a / the Container but should have been. Modified: trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -103,7 +103,7 @@ /** Reference to MainControl. */ protected final MainControl mainControl; - protected List<DialogAttrib<?>> dialogAttribs = new ArrayList<DialogAttrib<?>>(); + protected final List<DialogAttrib<?>> dialogAttribs = new ArrayList<DialogAttrib<?>>(); private JComboBox typesel; // selection box for type @@ -123,10 +123,10 @@ private final CardLayout cardLayout = new CardLayout(); /** The Action for switching to the summary. */ - private Action summaryAction = ACTION_FACTORY.createAction(false, "attribSummary", this); + private final Action summaryAction = ACTION_FACTORY.createAction(false, "attribSummary", this); /** The Action for switching to the edit. */ - private Action editAction = ACTION_FACTORY.createAction(false, "attribEdit", this); + private final Action editAction = ACTION_FACTORY.createAction(false, "attribEdit", this); /** The Button for toggling the summary. */ private JButton summaryEditButton; Modified: trunk/src/app/net/sf/gridarta/gui/map/MapCursor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/MapCursor.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/src/app/net/sf/gridarta/gui/map/MapCursor.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -60,7 +60,7 @@ private boolean dragging; /** Grid where cursor is bound to. */ - private MapGrid mapGrid; + private final MapGrid mapGrid; /** Used to test if coordinates are on the map. Created by MapGrid. */ private final Rectangle mapRec; Modified: trunk/src/app/net/sf/gridarta/gui/map/MapGrid.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/MapGrid.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/src/app/net/sf/gridarta/gui/map/MapGrid.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -45,10 +45,10 @@ private int[][] gridFlags; /** Left upper coordinates of rectangle that is beeing processed. */ - private Point cornerMin = new Point(); + private final Point cornerMin = new Point(); /** Right lower coordinates of rectangle that is beeing processed. */ - private Point cornerMax = new Point(); + private final Point cornerMax = new Point(); /** Size of <code>gridFlags[][]</code>. */ private Size2D gridSize; @@ -84,7 +84,7 @@ public static final int GRID_FLAG_CURSOR = 1 << 7; /** The MapGridListeners to inform of changes. */ - private EventListenerList listenerList = new EventListenerList(); + private final EventListenerList listenerList = new EventListenerList(); /** Set to size of grid size. Used to test if coordinates are on the map. */ private final Rectangle mapRec = new Rectangle(); Modified: trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -77,7 +77,7 @@ private int darkness; /** The registered event listeners. */ - private EventListenerList listenerList = new EventListenerList(); + private final EventListenerList listenerList = new EventListenerList(); /** * The transaction depth. Modified: trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -37,7 +37,7 @@ private static final Logger log = Logger.getLogger(AbstractMapControl.class); /** The registered event listeners. */ - private EventListenerList listenerList = new EventListenerList(); + private final EventListenerList listenerList = new EventListenerList(); /** * Set if the map has changed since last save. Modified: trunk/src/app/net/sf/gridarta/map/AbstractMapModel.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/AbstractMapModel.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/src/app/net/sf/gridarta/map/AbstractMapModel.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -43,7 +43,7 @@ protected MapSquare<G, A>[][] mapGrid; /** The registered event listeners. */ - private EventListenerList listenerList = new EventListenerList(); + private final EventListenerList listenerList = new EventListenerList(); /** * The transaction depth. Modified: trunk/src/app/net/sf/gridarta/map/MapModelEvent.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapModelEvent.java 2007-01-09 22:14:15 UTC (rev 1525) +++ trunk/src/app/net/sf/gridarta/map/MapModelEvent.java 2007-01-09 22:53:11 UTC (rev 1526) @@ -50,7 +50,7 @@ @Nullable private final G[] gameObjects; /** The type of this event. */ - @NotNull private Type type; + @NotNull private final Type type; /** * Create a MapModelEvent. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-10 21:35:17
|
Revision: 1544 http://svn.sourceforge.net/gridarta/?rev=1544&view=rev Author: akirschbaum Date: 2007-01-10 13:35:17 -0800 (Wed, 10 Jan 2007) Log Message: ----------- Fix #1556003 (Crossfire script editor doesn't support new plugin system); Add support for "Event" game objects (type 116). Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/resource/conf/types.xml trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java trunk/crossfire/src/cfeditor/io/CMapReader.java trunk/crossfire/src/cfeditor/io/CMapWriter.java trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java Added Paths: ----------- trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeException.java trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeNameException.java trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeTypeException.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2007-01-10 21:09:38 UTC (rev 1543) +++ trunk/crossfire/ChangeLog 2007-01-10 21:35:17 UTC (rev 1544) @@ -1,3 +1,11 @@ +2007-01-10 Andreas Kirschbaum + + * Add support for "Event" game objects (type 116). + + * Fix #1556003 (Crossfire script editor doesn't support new plugin + system). Drop support for old plugin system via event_xxx + attributes. + 2007-01-09 Andreas Kirschbaum * Make pickmap panel work for pickmaps with spaces in the name Modified: trunk/crossfire/resource/conf/types.xml =================================================================== --- trunk/crossfire/resource/conf/types.xml 2007-01-10 21:09:38 UTC (rev 1543) +++ trunk/crossfire/resource/conf/types.xml 2007-01-10 21:35:17 UTC (rev 1544) @@ -428,6 +428,12 @@ <attribute arch="identified" /> </ignore_list> +<!-- This ignorelist is for event objects. --> +<ignore_list name="event_object"> + <attribute arch="name" /> + <attribute arch="face" /> +</ignore_list> + <!--####################################################################--> <type number="0" name="Misc"> <required> @@ -1661,6 +1667,33 @@ </type> <!--####################################################################--> +<type number="116" name="Event"> + <ignore> + <ignore_list name="system_object" /> + <ignore_list name="event_object" /> + </ignore> + <description><![CDATA[ + Scripts are to be put in object's inventory. They execute an external + script file when the trigger condition is met.]]> + </description> + <attribute arch="subtype" editor="event type" type="int"> + The event type determines the trigger condition. + </attribute> + <attribute arch="title" editor="plugin name" type="string"> + The plugin name specifies the plugin that should execute the script file. + Almost all plugins use the plugin 'Python'. + </attribute> + <attribute arch="slaying" editor="script file" type="string"> + Specifies the script file name that should be executed. Relative file names + are relative to the path name of the map file this even is in. Absolute + file names are looked up in the maps base directory. + </attribute> + <attribute arch="name" editor="script options" type="string"> + If set, this field contains options passed to the script. + </attribute> +</type> + +<!--####################################################################--> <type number="66" name="Exit"> <ignore> <ignore_list name="non_pickable" /> Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2007-01-10 21:09:38 UTC (rev 1543) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2007-01-10 21:35:17 UTC (rev 1544) @@ -60,7 +60,6 @@ /** * Data for scripted events. - * Stays null if no events defined. */ private ScriptArchData script; @@ -85,8 +84,6 @@ /** Create an GameObject. */ public GameObject() { - script = null; // this object stays 'null' unless there are events defined - animText = loreText = null; archTextCount = 0; // lines inserted in objectText @@ -99,6 +96,7 @@ editflag = false; join = null; // no autojoin list per default archType = TYPE_UNSET; // type must be set + script = new ScriptArchData(this); } /** @@ -505,10 +503,6 @@ clone.multiX = multiX; clone.multiY = multiY; - if (script != null) { - clone.script = script.getClone(); - } - clone.setArchetype(getArchetype()); // default arch clone.noface = noface; // if true, arch has no face as default @@ -518,6 +512,7 @@ clone.archType = archType; // type attribute of the arch + clone.script = new ScriptArchData(clone); // set coords: clone.setMapX(posx); clone.setMapY(posy); @@ -543,37 +538,12 @@ return multi != null; } - public void addEventPlugin(final String eventType, final String pluginName) { - if (script == null) { - script = new ScriptArchData(); - } - script.addEventData(eventType, pluginName, ScriptArchData.EDATA_PLUGIN_NAME); - } - - public void addEventOptions(final String eventType, final String eventOptions) { - if (script == null) { - script = new ScriptArchData(); - } - script.addEventData(eventType, eventOptions, ScriptArchData.EDATA_EVENT_OPTIONS); - } - - public void addEventScript(final String eventType, final String filePath) { - if (script == null) { - script = new ScriptArchData(); - } - script.addEventData(eventType, filePath, ScriptArchData.EDATA_FILE_PATH); - } - /** * Check whether all events have enough data to be valid. Invalid or * insufficient ScriptedEvent objects get removed. */ public void validateAllEvents() { - if (script != null) { - if (!script.validateAllEvents()) { - script = null; // remove empty script object - } - } + script.validateAllEvents(); } /** @@ -581,19 +551,12 @@ * @return <code>true</code> if this GameObject has one or more scripted events, otherwise <code>false</code> */ public boolean isScripted() { - return script != null; - } - - /** - * This method is called from CMapFileEncode.writeMapArch() - * @return text for all scripted events, how it is written in a mapfile - */ - public String getMapArchEventData() { - if (script != null) { - return script.getMapArchEventData(); + for (final GameObject tmp : this) { + if (tmp.archType == 116) { + return true; + } } - - return ""; // this case should actually never happen + return false; } /** @@ -601,9 +564,7 @@ * @param list the JList which displays all events for this arch */ public void addEventsToJList(final JList list) { - if (script != null) { - script.addEventsToJList(list); - } + script.addEventsToJList(list); } /** @@ -616,14 +577,11 @@ * @param mapanel the MapArchPanel * @xxx this method knows things it should never know, it is evil! */ - public void modifyEventScript(final String eventType, final int task, final JList eventList, final GameObjectAttributesPanel mapanel) { - if (script != null) { - script.modifyEventScript(eventType, task, eventList); + public void modifyEventScript(final int eventType, final int task, final JList eventList, final GameObjectAttributesPanel mapanel) { + script.modifyEventScript(eventType, task, eventList); - if (script.isEmpty()) { - script = null; // delete ScriptArchData object if empty - mapanel.setScriptPanelButtonState(true, false, false, false); - } + if (script.isEmpty()) { + mapanel.setScriptPanelButtonState(true, false, false, false); } } @@ -635,17 +593,13 @@ * @param mapanel the MapArchPanel */ public void addEventScript(final JList eventList, final GameObjectAttributesPanel mapanel) { - if (script == null) { - script = new ScriptArchData(); - } script.addEventScript(eventList, this); - if (script.isEmpty()) { - script = null; // delete ScriptArchData object if empty - mapanel.setScriptPanelButtonState(true, false, false, false); - } else { + if (!script.isEmpty()) { mapanel.setScriptPanelButtonState(true, true, true, true); script.addEventsToJList(eventList); + } else { + mapanel.setScriptPanelButtonState(true, false, false, false); } } Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java 2007-01-10 21:09:38 UTC (rev 1543) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java 2007-01-10 21:35:17 UTC (rev 1544) @@ -36,7 +36,9 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; +import java.util.Vector; import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; @@ -67,13 +69,6 @@ /** Logger. */ private static final Logger log = Logger.getLogger(ScriptArchData.class); - // constants for addEventData() parameters - public static final int EDATA_PLUGIN_NAME = 0; - - public static final int EDATA_FILE_PATH = 1; - - public static final int EDATA_EVENT_OPTIONS = 2; - /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); @@ -93,17 +88,18 @@ private static JTextField inputOptions; // FIXME: This should NOT BE HERE. Instead, it should be read from types.xml. - private static final String[] allEventTypes = new String[]{" apply", " attack", " close", " death", " drop", " pickup", " say", " stop", " time", " throw", " trigger"}; + private static final String[] allEventTypes = new String[]{"apply", "attack", "death", "drop", "pickup", "say", "stop", "time", "throw", "trigger", "close", "timer", "destroy"}; - private final List<ScriptedEvent> eventList; // contains list of ScriptedEvents + private final GameObject owner; private boolean changed; /** * Create a ScriptArchData. + * @param owner owner of this ScriptArchData */ - public ScriptArchData() { - eventList = new ArrayList<ScriptedEvent>(); + public ScriptArchData(final GameObject owner) { + this.owner = owner; if (eventTypeBox == null) { initEventTypeBoxes(); } @@ -115,125 +111,61 @@ pluginNameBox.setSelectedIndex(0); eventTypeBox = new JComboBox(allEventTypes); - eventTypeBox.setSelectedIndex(Arrays2.linearEqualitySearch(" say", allEventTypes)); + eventTypeBox.setSelectedIndex(Arrays2.linearEqualitySearch("say", allEventTypes)); } /** - * Add given data to a ScriptedEvent. If no event of given type exists, a - * new one is created. - * @param eventType event type ("say", "attack", "death", ...) - * @param eventData new data about the ScriptedEvent, kind of data is - * defined by 'dataType' - * @param dataType 0: pluginData = "plugin name" - * 1: pluginData = "file path" - */ - public synchronized void addEventData(final String eventType, final String eventData, final int dataType) { - // first try to find an existing event - final ScriptedEvent event; - final int index = getScriptedEvent(eventType); - - // if none exists yet, create new - else take the existing one - if (index == -1) { - event = new ScriptedEvent(eventType); - } else { - event = eventList.get(index); - } - - // set new event data: - if (dataType == EDATA_PLUGIN_NAME) { - event.setPluginName(eventData.trim()); // set plugin name - } else if (dataType == EDATA_FILE_PATH) { - event.setScriptPath(eventData.trim()); // set plugin name - } else if (dataType == EDATA_EVENT_OPTIONS) { - event.setOptions(eventData.trim()); // set event options - } - - // save changes: - if (index == -1) { - eventList.add(event); - } else { - eventList.set(index, event); - } - } - - /** - * Search 'eventList' for an existing ScriptedEvent of the specified event + * Search the owner game object for an event object of the specified event * type. * @param eventType look for a ScriptedEvent of this type - * @return index of ScriptedEvent in 'eventList' if found, -1 if not found + * @return the event game object, or <code>null</code> if no event of this + * type exists */ - private int getScriptedEvent(final String eventType) { - if (eventList != null && !eventList.isEmpty()) { - for (int i = 0; i < eventList.size(); i++) { - final ScriptedEvent se = eventList.get(i); - if (se.getEventType().equalsIgnoreCase(eventType)) { - // we found a matching ScriptedEvent! - return i; - } + @Nullable private GameObject getScriptedEvent(final int eventType) { + for (final GameObject tmp : owner) { + if (tmp.getArchTypNr() == 116 && tmp.getAttributeInt("subtype") == eventType) { + return tmp; } } - - return -1; // didn't find a matching event + return null; } /** * This method is called for each arch after loading a map. It checks * whether all events have enough data to be valid. Invalid or insufficient * ScriptedEvent objects get removed. - * @return true when at least one valid event remains, false when all - * events were invalid (and deleted) */ - public boolean validateAllEvents() { - if (eventList != null && !eventList.isEmpty()) { - int numEvents = eventList.size(); - - for (int i = 0; i < numEvents; i++) { - final ScriptedEvent se = eventList.get(i); + public void validateAllEvents() { + final Iterator<GameObject> it = owner.iterator(); + while (it.hasNext()) { + final GameObject tmp = it.next(); + if (tmp.getArchTypNr() == 116) { + final ScriptedEvent se = new ScriptedEvent(tmp); // validate this event if (!se.isValid()) { // this event is invalid if (log.isInfoEnabled()) { log.info("-> Deleting invalid event..."); } - eventList.remove(i); - numEvents--; // adjust indices for removed element - i--; + it.remove(); } } - - if (!eventList.isEmpty()) { - return true; // there is at least one remaining valid event - } } - return false; } /** - * This method is called from CMapFileEncode.writeMapArch(). - * @return text for all scripted events, how it is written in a mapfile - * (the String is expected to end with '\n', unless empty) - */ - public String getMapArchEventData() { - final StringBuilder buff = new StringBuilder(); - - if (eventList != null && !eventList.isEmpty()) { - for (final ScriptedEvent se : eventList) { - buff.append(se.getMapArchText()); - } - } - - return buff.toString(); - } - - /** * Set all ScriptedEvents to appear in the given JList This method should * be fast because it may be executed when user clicks on map objects. * @param list JList */ public void addEventsToJList(final JList list) { - final String[] content = new String[eventList.size()]; - for (int i = 0; i < eventList.size(); i++) { - content[i] = " " + eventList.get(i).getEventType(); + //cher: JList expects Vector, so we MUST use an obsolete concrete collection. + //noinspection CollectionDeclaredAsConcreteClass,UseOfObsoleteCollectionType + final Vector<String> content = new Vector<String>(); + for (final GameObject tmp : owner) { + if (tmp.getArchTypNr() == 116) { + content.add(" " + typeName(tmp.getAttributeInt("subtype"))); + } } list.setListData(content); @@ -241,53 +173,45 @@ } /** - * Create a new ScriptArchData instance, identical to this one. - * @return a cloned instance of this ScriptArchData object - */ - @Nullable public ScriptArchData getClone() { - if (eventList != null && !eventList.isEmpty()) { - final ScriptArchData clone = new ScriptArchData(); // new instance - - for (int i = 0; i < eventList.size(); i++) { - // clone every ScriptedEvent in the event list - clone.eventList.add(eventList.get(i).getClone()); - } - - return clone; - } else { - return null; - } - } - - /** * If there is a scripted event of the specified type, the script pad is * opened and the appropriate script displayed. - * @param eventType type of event + * @param eventIndex index of event in the owner's inventory * @param task ID number for task (open script/ edit path/ remove) * @param panelList JList from the MapArchPanel (script tab) which * displays the events */ - public void modifyEventScript(final String eventType, final int task, final JList panelList) { - final int index = getScriptedEvent(eventType); + public void modifyEventScript(int eventIndex, final int task, final JList panelList) { + GameObject oldEvent = null; - if (index >= 0) { - final ScriptedEvent event = eventList.get(index); + /* Find the event object */ + for (final GameObject tmp : owner) { + if (tmp.getArchTypNr() == 116) { + if (eventIndex == 0) { + oldEvent = tmp; + break; + } else { + eventIndex--; + } + } + } + + if (oldEvent != null) { + final ScriptedEvent event = new ScriptedEvent(oldEvent); // now decide what to do: if (task == GameObjectAttributesPanel.SCRIPT_OPEN) { event.openScript(); } else if (task == GameObjectAttributesPanel.SCRIPT_EDIT_PATH) { event.editParameters(); - eventList.set(index, event); // save changes } else if (task == GameObjectAttributesPanel.SCRIPT_REMOVE) { // first ask for confirmation - if (JOptionPane.showConfirmDialog(panelList, "Are you sure you want to remove this \"" + eventType + "\" event which is\n" + "linked to the script: '" + event.getScriptPath() + "'?\n" + "(The script file itself is not going to be deleted)", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) { + if (JOptionPane.showConfirmDialog(panelList, "Are you sure you want to remove this \"" + typeName(event.getEventType()) + "\" event which is\n" + "linked to the script: '" + event.getScriptPath() + "'?\n" + "(The script file itself is not going to be deleted)", "Confirm", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) { // remove this event from the GameObject - eventList.remove(index); + oldEvent.remove(); addEventsToJList(panelList); // update panel JList } } } else { - log.error("Error in modifyEventScript(): No event for '" + eventType + "'"); + log.error("Error in modifyEventScript(): No event selected?"); } } @@ -362,7 +286,7 @@ * A popup is opened and the user can create a new scripting event * which gets attached to this gameObject. * @param panelList JList from the MapArchPanel (script tab) which displays the events - * @param gameObject GameObject that's name should be used for creating a reasonable default script name + * @param gameObject GameObject to add event to */ public void addEventScript(final JList panelList, final GameObject gameObject) { final String archName = gameObject.getBestName(); @@ -487,7 +411,7 @@ final CMainControl mainControl = CMainControl.getInstance(); // main control String scriptPath = inputScriptPath.getText().trim(); final String options = inputOptions.getText().trim(); - final String eventType = ((String) eventTypeBox.getSelectedItem()).trim(); + final int eventType = eventTypeBox.getSelectedIndex() + 1; final String pluginName = ((String) pluginNameBox.getSelectedItem()).trim(); final File localMapDir = getLocalMapDir(); @@ -495,10 +419,10 @@ changed = false; // first check if that event type is not already in use - final int replaceIndex = getScriptedEvent(eventType); - if (replaceIndex != -1) { + final GameObject replaceObject = getScriptedEvent(eventType); + if (replaceObject != null) { // collision with existing event -> ask user: replace? - if (JOptionPane.showConfirmDialog(frame, "An event of type \"" + eventType + "\" already exists for this object.\n" + "Do you want to replace the existing event?", "Event exists", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.NO_OPTION) { + if (JOptionPane.showConfirmDialog(frame, "An event of type \"" + typeName(eventType) + "\" already exists for this object.\n" + "Do you want to replace the existing event?", "Event exists", JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE) == JOptionPane.NO_OPTION) { // bail out return false; } @@ -510,13 +434,13 @@ if (scriptPath.startsWith("/")) { // script path is absolute final File mapDir = new File(mainControl.getMapDefaultFolder()); // global map directory - if (mapDir.exists()) { - absScriptPath = mapDir.getAbsolutePath() + scriptPath; - } else { + if (!mapDir.exists()) { // if map dir doesn't exist, this is not going to work frame.setVisible(false); ACTION_FACTORY.showMessageDialog(frame, "mapDirDoesntExist", mapDir); return false; + } else { + absScriptPath = mapDir.getAbsolutePath() + scriptPath; } } else { // script path is relative @@ -534,12 +458,17 @@ if (newScriptFile.exists()) { if (newScriptFile.isFile()) { // file exists -> link it to the event - final ScriptedEvent event = new ScriptedEvent(eventType, pluginName, scriptPath, options); - if (replaceIndex == -1) { - eventList.add(event); - } else { - eventList.set(replaceIndex, event); + final ScriptedEvent event; + try { + event = new ScriptedEvent(eventType, pluginName, scriptPath, options); + } catch (final UndefinedEventArchetypeException ex) { + JOptionPane.showMessageDialog(frame, "Cannot create event of type " + eventType + ":\n" + ex.getMessage() + ".", "Cannot create event", JOptionPane.ERROR_MESSAGE); + return false; } + if (replaceObject != null) { + replaceObject.remove(); + } + owner.addLast(event.getEventArch()); frame.setVisible(false); // close dialog } } else { @@ -564,13 +493,18 @@ JOptionPane.showMessageDialog(frame, "File '" + newScriptFile.getName() + "' could not be created.\n" + "Please check your path and write premissions.", "Cannot create file", JOptionPane.ERROR_MESSAGE); } else { // file has been created, now link it to the event - final ScriptedEvent event = new ScriptedEvent(eventType, pluginName, scriptPath, options); - changed = true; - if (replaceIndex != -1) { - eventList.set(replaceIndex, event); - } else { - eventList.add(event); + final ScriptedEvent event; + try { + event = new ScriptedEvent(eventType, pluginName, scriptPath, options); + } catch (final UndefinedEventArchetypeException ex) { + JOptionPane.showMessageDialog(frame, "Cannot create event of type " + eventType + ":\n" + ex.getMessage() + ".", "Cannot create event", JOptionPane.ERROR_MESSAGE); + return false; } + if (replaceObject != null) { + replaceObject.remove(); + } + changed = true; + owner.addLast(event.getEventArch()); frame.setVisible(false); // close dialog // open new script file @@ -587,10 +521,46 @@ * @return <code>true</code> if this ScriptArchData contains no events, otherwise <code>false</code> */ public boolean isEmpty() { - return eventList == null || eventList.isEmpty(); + for (final GameObject tmp : owner) { + if (tmp.getArchTypNr() == 116) { + return false; + } + } + return true; } /** + * Return a human readable name for an event type. + * + * @param eventType the event type + * + * @return the event type name + */ + public static String typeName(final int eventType) { + if (eventType > 0 && eventType <= allEventTypes.length) { + return allEventTypes[eventType - 1]; + } else { + return "<invalid type>"; + } + } + + /** + * Return the archetype for an event type. + * + * @param eventType the event type + * + * @return the archetype name, or <code>null</code> if the event type is + * invalid + */ + public static String typeArchName(final int eventType) { + if (eventType > 0 && eventType <= allEventTypes.length) { + return "event_" + allEventTypes[eventType - 1]; + } else { + return null; + } + } + + /** * Return a guess for the directory to use. * * @return the directory to use Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-10 21:09:38 UTC (rev 1543) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-10 21:35:17 UTC (rev 1544) @@ -21,6 +21,7 @@ package cfeditor.gameobject.scripts; import cfeditor.CMainControl; +import cfeditor.gameobject.GameObject; import java.io.File; import java.awt.FlowLayout; import javax.swing.BorderFactory; @@ -35,6 +36,7 @@ import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; /** * Class which stores information about one scripted event. @@ -48,6 +50,9 @@ /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); + /** The underlying game object that represents the event. */ + private final GameObject event; + private static JTextField inputScriptPath; private static JTextField inputPluginName; @@ -58,25 +63,15 @@ private static PathButtonListener okListener; - private String pluginName; // name of plugin ("Python" expected) - - private String eventType; // name of event type (e.g. "say", "death", "attack"...) - - private String options; // plugin options - - private String scriptPath; // path to scriptfile (can be a relative or absolute path) - // popup frame to edit script paths: private static JDialog pathFrame; /** * Create a ScriptedEvent of given type (This is used for map-loading). - * @param eventType Type of the event. + * @param event GameObject that describes the event. */ - ScriptedEvent(final String eventType) { - this.eventType = eventType; - pluginName = null; - scriptPath = null; + ScriptedEvent(final GameObject event) { + this.event = event; } /** @@ -86,11 +81,9 @@ * @param scriptPath path to the file for this event * @param options options for this event */ - ScriptedEvent(final String eventType, final String pluginName, final String scriptPath, final String options) { - this.eventType = eventType; - this.pluginName = pluginName; - this.scriptPath = scriptPath; - this.options = options; + ScriptedEvent(final int eventType, final String pluginName, final String scriptPath, final String options) throws UndefinedEventArchetypeException { + event = newEventGameObject(eventType); + setEventData(pluginName, scriptPath, options); } /** @@ -98,51 +91,33 @@ * @return true if this object is valid, otherwise false */ public boolean isValid() { + final String options = getOptions(); + String scriptPath = getScriptPath(); + String pluginName = getPluginName(); + final int eventType = getEventType(); + if (scriptPath == null || scriptPath.length() <= 0) { - log.error("Map Error: Found event_" + eventType + " without file name!"); + log.error("Map Error: Found " + ScriptArchData.typeName(eventType) + " event without file name!"); return false; } if (pluginName == null || pluginName.length() <= 0) { pluginName = "Python"; if (log.isInfoEnabled()) { - log.info("Found event_" + eventType + " without plugin name. Setting to \"Python\"."); + log.info("Found " + ScriptArchData.typeName(eventType) + " without plugin name. Setting to \"Python\"."); } } scriptPath = scriptPath.replace('\\', '/'); // just make sure there are only slashes: '/' + setEventData(pluginName, scriptPath, options); return true; } - /** - * Returns the text that has to be written to a map file for this ScriptedEvent. - * @return Event text for the map file. - */ - public String getMapArchText() { - final StringBuilder buff = new StringBuilder(""); - buff.append("event_").append(eventType).append("_plugin ").append(pluginName).append("\n"); - buff.append("event_").append(eventType).append(" ").append(scriptPath).append("\n"); - if (options != null && options.trim().length() > 0) { - buff.append("event_").append(eventType).append("_options ").append(options).append("\n"); - } - return buff.toString(); - } - - /** - * Creates a clone of this object. - * @return Clone of this object. - * @todo instead override {@link Object#clone()}. - */ - public ScriptedEvent getClone() { - final ScriptedEvent clone = new ScriptedEvent(eventType); - setEventData(getEventType(), getPluginName(), getScriptPath(), getOptions()); - return clone; - } - /** Opens the script pad to display the script for this event. */ public void openScript() { final CMainControl mainControl = CMainControl.getInstance(); // reference to main control + final String scriptPath = getScriptPath(); // trying to get the absolute path to scriptfile: String path; @@ -194,7 +169,7 @@ // input line: plugin options final JPanel line2 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - final JLabel text2 = new JLabel("Event options:"); + final JLabel text2 = new JLabel("Script options:"); line2.add(text2); inputOptions = new JTextField(getOptions(), 20); line2.add(inputOptions); @@ -208,6 +183,7 @@ inputPluginName = new JTextField(getPluginName(), 20); line3.add(inputPluginName); mainPanel.add(line3); + mainPanel.add(Box.createVerticalStrut(5)); // button panel: final JPanel line4 = new JPanel(new FlowLayout(FlowLayout.RIGHT)); @@ -259,39 +235,85 @@ } // GET/SET methods - public String getEventType() { - return eventType; + /** + * Return the underlying event game object. + * + * @return the underlynig event game object + */ + public GameObject getEventArch() { + return event; } + public int getEventType() { + return event.getAttributeInt("subtype"); + } + public String getPluginName() { - return pluginName; + return event.getAttributeString("title"); } public String getScriptPath() { - return scriptPath; + return event.getAttributeString("slaying"); } public String getOptions() { - return options; + final String options = event.getObjName(); + return options == null ? "" : options; } public void setPluginName(final String pluginName) { - setEventData(getEventType(), pluginName, getScriptPath(), getOptions()); + setEventData(pluginName, getScriptPath(), getOptions()); } public void setScriptPath(final String scriptPath) { - setEventData(getEventType(), getPluginName(), scriptPath, getOptions()); + setEventData(getPluginName(), scriptPath, getOptions()); } public void setOptions(final String options) { - setEventData(getEventType(), getPluginName(), getScriptPath(), options); + setEventData(getPluginName(), getScriptPath(), options); } - private void setEventData(final String eventType, final String pluginName, final String scriptPath, final String options) { - this.eventType = eventType; - this.pluginName = pluginName; - this.scriptPath = scriptPath; - this.options = options; + private void setEventData(@NotNull final String pluginName, @NotNull final String scriptPath, @NotNull final String options) { + final int eventType = getEventType(); + event.resetObjectText(); + if (eventType != event.getArchetype().getAttributeInt("subtype")) { + event.addObjectText("subtype " + eventType); + } + if (!pluginName.equals(event.getArchetype().getAttributeString("title"))) { + event.addObjectText("title " + pluginName); + } + if (!scriptPath.equals(event.getArchetype().getAttributeString("slaying"))) { + event.addObjectText("slaying " + scriptPath); + } + final String tmp = event.getObjName(); + final String defaultEventOptions = tmp == null ? "" : tmp; + if (!options.equals(defaultEventOptions)) { + event.setObjName(options.length() > 0 ? options : null); + } } + /** + * Return a new event game object for a given event type. + * + * @param eventType the event type + * + * @return the new event game object + * + * @throws UndefinedEventArchetypeException if the event game object cannot + * be created + */ + private static GameObject newEventGameObject(final int eventType) throws UndefinedEventArchetypeException { + final String typeArchName = ScriptArchData.typeArchName(eventType); + if (typeArchName == null) { + throw new UndefinedEventArchetypeTypeException(eventType); + } + final GameObject eventArch = CMainControl.getInstance().getArchetypeSet().getArchetype(typeArchName); + if (eventArch == null) { + throw new UndefinedEventArchetypeNameException(typeArchName); + } + final GameObject event = eventArch.createArch(); + CMainControl.getInstance().getArchetypeParser().postParseGameObject(event, 0); + return event; + } + } // class ScriptedEvent Added: trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeException.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeException.java (rev 0) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeException.java 2007-01-10 21:35:17 UTC (rev 1544) @@ -0,0 +1,45 @@ +/* + * Gridarta Map Editor. + * Copyright (C) 2007 The Gridarta Developers + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +package cfeditor.gameobject.scripts; + +import org.jetbrains.annotations.NotNull; + +/** + * The class <code>UndefinedEventArchetypeException</code> is thrown when an + * event game object cannot be created. + * + * @author Andreas Kirschbaum + */ +public abstract class UndefinedEventArchetypeException extends Exception { + + /** Serial Version UID. */ + private static final long serialVersionUID = 1L; + + /** + * Create a new instance. + * + * @param msg the exception message + */ + public UndefinedEventArchetypeException(@NotNull final String msg) { + super(msg); + } + +} // class UndefinedEventArchetypeException Property changes on: trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeException.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeNameException.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeNameException.java (rev 0) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeNameException.java 2007-01-10 21:35:17 UTC (rev 1544) @@ -0,0 +1,60 @@ +/* + * Gridarta Map Editor. + * Copyright (C) 2007 The Gridarta Developers + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +package cfeditor.gameobject.scripts; + +import org.jetbrains.annotations.NotNull; + +/** + * This class implements an {@link UndefinedEventArchetypeException} that + * describes a missing archetype. + * + * @author Andreas Kirschbaum + */ +public class UndefinedEventArchetypeNameException extends UndefinedEventArchetypeException { + + /** Serial Version UID. */ + private static final long serialVersionUID = 1L; + + /** + * The archetype that could not be found. + */ + @NotNull private final String archName; + + /** + * Create a new instance. + * + * @param archName the archetype that could not be found + */ + public UndefinedEventArchetypeNameException(@NotNull final String archName) { + super("undefined archetype " + archName); + this.archName = archName; + } + + /** + * Return the archetype that could not be found. + * + * @return the archetype that could not be found + */ + @NotNull public String getArchName() { + return archName; + } + +} // class UndefinedEventArchetypeNameException Property changes on: trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeNameException.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Added: trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeTypeException.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeTypeException.java (rev 0) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeTypeException.java 2007-01-10 21:35:17 UTC (rev 1544) @@ -0,0 +1,58 @@ +/* + * Gridarta Map Editor. + * Copyright (C) 2007 The Gridarta Developers + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +package cfeditor.gameobject.scripts; + +/** + * This class implements an {@link UndefinedEventArchetypeException} that + * describes an invalid event type. + * + * @author Andreas Kirschbaum + */ +public class UndefinedEventArchetypeTypeException extends UndefinedEventArchetypeException { + + /** Serial Version UID. */ + private static final long serialVersionUID = 1L; + + /** + * The event type that could not be found. + */ + private final int eventType; + + /** + * Create a new instance. + * + * @param eventType the event type that could not be found + */ + public UndefinedEventArchetypeTypeException(final int eventType) { + super("invalid event type " + eventType); + this.eventType = eventType; + } + + /** + * Return the event type that could not be found. + * + * @return the event type that could not be found + */ + public int getEventType() { + return eventType; + } + +} // class UndefinedEventArchetypeTypeException Property changes on: trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeTypeException.java ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:eol-style + LF Modified: trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java 2007-01-10 21:09:38 UTC (rev 1543) +++ trunk/crossfire/src/cfeditor/gui/GameObjectAttributesDialog.java 2007-01-10 21:35:17 UTC (rev 1544) @@ -254,7 +254,11 @@ if (inline != null) { if (attr.ref.getNameOld().equalsIgnoreCase("name")) { // special case #1: "name"-textfield - if (archetype.getObjName() != null && archetype.getObjName().length() > 0) { + if (typeStruct.getTypeNr() == 116) { + // events are special: they do not inherit the + // archeptype name for empty names + newName = inline; + } else if (archetype.getObjName() != null && archetype.getObjName().length() > 0) { if (!inline.equals(archetype.getObjName())) { newName = inline; } else { @@ -458,4 +462,9 @@ return true; // apply succeeded } + /** {@inheritDoc} */ + protected boolean isSpecialNameHandling() { + return type.getTypeNr() != 116; + } + } // class GameObjectAttributesDialog Modified: trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java 2007-01-10 21:09:38 UTC (rev 1543) +++ trunk/crossfire/src/cfeditor/gui/GameObjectAttributesPanel.java 2007-01-10 21:35:17 UTC (rev 1544) @@ -871,13 +871,12 @@ // check for a valid selection in the event list if (eventList.getModel() != null && eventList.getModel().getSize() > 0 && eventList.getSelectedIndex() >= 0) { // there - String eventType = (String) eventList.getSelectedValue(); - if (eventType != null && eventType.length() > 0) { - eventType = eventType.trim(); + final int index = eventList.getSelectedIndex(); + if (index >= 0) { final MapSquare mapSquare = gameObject.getMapSquare(); assert mapSquare != null; mapSquare.getModel().beginTransaction("Modify event script"); - gameObject.getHead().modifyEventScript(eventType, task, eventList, this); + gameObject.getHead().modifyEventScript(index, task, eventList, this); mapSquare.getModel().endTransaction(); } } Modified: trunk/crossfire/src/cfeditor/io/CMapReader.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapReader.java 2007-01-10 21:09:38 UTC (rev 1543) +++ trunk/crossfire/src/cfeditor/io/CMapReader.java 2007-01-10 21:35:17 UTC (rev 1544) @@ -141,32 +141,6 @@ } else if (thisLine.startsWith("msg")) { gameObject.addMsgText(""); msgflag = true; - } else if (thisLine.startsWith("event_")) { - // here's something about a scripted event - final int i = thisLine.indexOf("_plugin"); - final int k = thisLine.indexOf("_options"); - final int space = thisLine.indexOf(" "); - if (space > 0) { - if (i > 0) { - // expecting: "event_type_plugin Name" - final String type = thisLine.substring(6, i); - final String plname = thisLine.substring(space + 1).trim(); - gameObject.addEventPlugin(type, plname); - } else if (k > 0) { - // expecting: "event_type_options Name" - final String type = thisLine.substring(6, k); - final String eventopt = thisLine.substring(space + 1).trim(); - gameObject.addEventOptions(type, eventopt); - } else { - // expecting: "event_type filepath" - final String type = thisLine.substring(6, space); - final String path = thisLine.substring(space + 1).trim(); - gameObject.addEventScript(type, path); - } - } else { - log.warn("Arch " + gameObject.getArchetypeName() + " has incorrect event code '" + thisLine + "'"); - gameObject.addObjectText(thisLine); // keep line, it might have a meaning after all - } } else if (thisLine.startsWith("x ")) { gameObject.setMapX(Integer.parseInt(thisLine.substring(2))); } else if (thisLine.startsWith("y ")) { Modified: trunk/crossfire/src/cfeditor/io/CMapWriter.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapWriter.java 2007-01-10 21:09:38 UTC (rev 1543) +++ trunk/crossfire/src/cfeditor/io/CMapWriter.java 2007-01-10 21:35:17 UTC (rev 1544) @@ -85,21 +85,6 @@ fields.put("face", face); } - if (gameObject.isScripted()) { - final String events = gameObject.getMapArchEventData(); - if (events.length() != 0) { - final String[] tmp = events.split("\n"); - for (final String aTmp : tmp) { - final String[] line = aTmp.split(" +", 2); - if (line.length != 2) { - log.warn("writeMapArch: ignoring invalid event line: " + aTmp); - } else { - fields.put(line[0], line[1]); - } - } - } - } - final String msgText = gameObject.getMsgText(); if (msgText != null && !msgText.trim().equals((archetype == null || archetype.getMsgText() == null) ? "" : archetype.getMsgText().trim())) { fields.put("msg", String.format("%s%sendmsg", msgText, msgText.endsWith("\n") ? "" : "\n")); Modified: trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java 2007-01-10 21:09:38 UTC (rev 1543) +++ trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java 2007-01-10 21:35:17 UTC (rev 1544) @@ -562,8 +562,10 @@ case ANIMNAME: { final String dtxt; if (nameOld.equalsIgnoreCase("name")) { - if (gameObject.getObjName() != null && gameObject.getObjName().length() > 0) { + if (!isSpecialNameHandling()) { dtxt = gameObject.getObjName(); + } else if (gameObject.getObjName() != null && gameObject.getObjName().length() > 0) { + dtxt = gameObject.getObjName(); } else if (archetype.getObjName() != null && archetype.getObjName().length() > 0) { dtxt = archetype.getObjName(); } else { @@ -743,6 +745,18 @@ } /** + * Determine if the "name" attribute should inherit its default value from + * the archetype name. + * + * @return <code>true</code> if the archetype name should be used for an + * empty "name" attribute, or <code>false</code> if an empty name should be + * used + */ + protected boolean isSpecialNameHandling() { + return true; + } + + /** * Looks up the section name from the ID. * @param secId ID of the section * @return name of that section This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-10 22:04:35
|
Revision: 1548 http://svn.sourceforge.net/gridarta/?rev=1548&view=rev Author: akirschbaum Date: 2007-01-10 14:03:19 -0800 (Wed, 10 Jan 2007) Log Message: ----------- Unify code to create event game objects. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gameobject/scripts/ trunk/src/app/net/sf/gridarta/gameobject/scripts/UndefinedEventArchetypeException.java trunk/src/app/net/sf/gridarta/gameobject/scripts/UndefinedEventArchetypeNameException.java Removed Paths: ------------- trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeException.java trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeNameException.java Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-10 21:47:05 UTC (rev 1547) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-10 22:03:19 UTC (rev 1548) @@ -33,6 +33,8 @@ import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.WindowConstants; +import net.sf.gridarta.gameobject.scripts.UndefinedEventArchetypeException; +import net.sf.gridarta.gameobject.scripts.UndefinedEventArchetypeNameException; import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; Deleted: trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeException.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeException.java 2007-01-10 21:47:05 UTC (rev 1547) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeException.java 2007-01-10 22:03:19 UTC (rev 1548) @@ -1,45 +0,0 @@ -/* - * Gridarta Map Editor. - * Copyright (C) 2007 The Gridarta Developers - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -package cfeditor.gameobject.scripts; - -import org.jetbrains.annotations.NotNull; - -/** - * The class <code>UndefinedEventArchetypeException</code> is thrown when an - * event game object cannot be created. - * - * @author Andreas Kirschbaum - */ -public abstract class UndefinedEventArchetypeException extends Exception { - - /** Serial Version UID. */ - private static final long serialVersionUID = 1L; - - /** - * Create a new instance. - * - * @param msg the exception message - */ - public UndefinedEventArchetypeException(@NotNull final String msg) { - super(msg); - } - -} // class UndefinedEventArchetypeException Deleted: trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeNameException.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeNameException.java 2007-01-10 21:47:05 UTC (rev 1547) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeNameException.java 2007-01-10 22:03:19 UTC (rev 1548) @@ -1,60 +0,0 @@ -/* - * Gridarta Map Editor. - * Copyright (C) 2007 The Gridarta Developers - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - * 02111-1307, USA. - */ - -package cfeditor.gameobject.scripts; - -import org.jetbrains.annotations.NotNull; - -/** - * This class implements an {@link UndefinedEventArchetypeException} that - * describes a missing archetype. - * - * @author Andreas Kirschbaum - */ -public class UndefinedEventArchetypeNameException extends UndefinedEventArchetypeException { - - /** Serial Version UID. */ - private static final long serialVersionUID = 1L; - - /** - * The archetype that could not be found. - */ - @NotNull private final String archName; - - /** - * Create a new instance. - * - * @param archName the archetype that could not be found - */ - public UndefinedEventArchetypeNameException(@NotNull final String archName) { - super("undefined archetype " + archName); - this.archName = archName; - } - - /** - * Return the archetype that could not be found. - * - * @return the archetype that could not be found - */ - @NotNull public String getArchName() { - return archName; - } - -} // class UndefinedEventArchetypeNameException Modified: trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java 2007-01-10 21:47:05 UTC (rev 1547) +++ trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java 2007-01-10 22:03:19 UTC (rev 1548) @@ -52,6 +52,7 @@ import javax.swing.JTextField; import javax.swing.WindowConstants; import net.sf.gridarta.io.PathManager; +import net.sf.gridarta.gameobject.scripts.UndefinedEventArchetypeException; import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.swing.ActionFactory; import net.sf.japi.util.Arrays2; @@ -485,7 +486,13 @@ if (newScriptFile.exists()) { if (newScriptFile.isFile()) { // file exists -> link it to the event - final ScriptedEvent event = new ScriptedEvent(eventType, pluginName, scriptPath, options); + final ScriptedEvent event; + try { + event = new ScriptedEvent(eventType, pluginName, scriptPath, options); + } catch (final UndefinedEventArchetypeException ex) { + JOptionPane.showMessageDialog(frame, "Cannot create event of type " + eventType + ":\n" + ex.getMessage() + ".", "Cannot create event", JOptionPane.ERROR_MESSAGE); + return false; + } if (replaceObject != null) { replaceObject.remove(); } @@ -514,7 +521,13 @@ JOptionPane.showMessageDialog(frame, "File '" + newScriptFile.getName() + "' could not be created.\n" + "Please check your path and write premissions.", "Cannot create file", JOptionPane.ERROR_MESSAGE); } else { // file has been created, now link it to the event - final ScriptedEvent event = new ScriptedEvent(eventType, pluginName, scriptPath, options); + final ScriptedEvent event; + try { + event = new ScriptedEvent(eventType, pluginName, scriptPath, options); + } catch (final UndefinedEventArchetypeException ex) { + JOptionPane.showMessageDialog(frame, "Cannot create event of type " + eventType + ":\n" + ex.getMessage() + ".", "Cannot create event", JOptionPane.ERROR_MESSAGE); + return false; + } if (replaceObject != null) { replaceObject.remove(); } Modified: trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java 2007-01-10 21:47:05 UTC (rev 1547) +++ trunk/daimonin/src/daieditor/gameobject/scripts/ScriptedEvent.java 2007-01-10 22:03:19 UTC (rev 1548) @@ -33,6 +33,8 @@ import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.WindowConstants; +import net.sf.gridarta.gameobject.scripts.UndefinedEventArchetypeException; +import net.sf.gridarta.gameobject.scripts.UndefinedEventArchetypeNameException; import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; @@ -79,13 +81,9 @@ * @param scriptPath path to the file for this event * @param options options for this event */ - ScriptedEvent(final int eventType, final String pluginName, final String scriptPath, final String options) { - event = new GameObject(); // FIXME: This arch has no default arch - event.setArchTypNr(118); - event.setArchetypeName("event_obj"); - event.setArchetype(CMainControl.getInstance().getArchetypeSet().getArchetype("event_obj")); - event.setObjectFace(); - setEventData(eventType, pluginName, scriptPath, options); + ScriptedEvent(final int eventType, final String pluginName, final String scriptPath, final String options) throws UndefinedEventArchetypeException { + event = newEventGameObject(eventType); + setEventData(pluginName, scriptPath, options); } /** @@ -112,7 +110,7 @@ scriptPath = scriptPath.replace('\\', '/'); // just make sure there are only slashes: '/' - setEventData(eventType, pluginName, scriptPath, options); + setEventData(pluginName, scriptPath, options); return true; } @@ -261,18 +259,18 @@ } public void setPluginName(final String pluginName) { - setEventData(getEventType(), pluginName, getScriptPath(), getOptions()); + setEventData(pluginName, getScriptPath(), getOptions()); } public void setScriptPath(final String scriptPath) { - setEventData(getEventType(), getPluginName(), scriptPath, getOptions()); + setEventData(getPluginName(), scriptPath, getOptions()); } public void setOptions(final String options) { - setEventData(getEventType(), getPluginName(), getScriptPath(), options); + setEventData(getPluginName(), getScriptPath(), options); } - private void setEventData(final int eventType, final String pluginName, final String scriptPath, final String options) { + private void setEventData(final String pluginName, final String scriptPath, final String options) { event.resetObjectText(); if (pluginName != null && pluginName.length() > 0) { event.setObjName(pluginName); @@ -283,7 +281,28 @@ if (options != null && options.length() > 0) { event.addObjectText("slaying " + options); } + } + + /** + * Return a new event game object for a given event type. + * + * @param eventType the event type + * + * @return the new event game object + * + * @throws UndefinedEventArchetypeException if the event game object cannot + * be created + */ + private static GameObject newEventGameObject(final int eventType) throws UndefinedEventArchetypeException { + final String typeArchName = "event_obj"; + final GameObject eventArch = CMainControl.getInstance().getArchetypeSet().getArchetype(typeArchName); + if (eventArch == null) { + throw new UndefinedEventArchetypeNameException(typeArchName); + } + final GameObject event = eventArch.createArch(); event.addObjectText("sub_type " + eventType); + CMainControl.getInstance().getArchetypeParser().postParseGameObject(event, 0); + return event; } } // class ScriptedEvent Copied: trunk/src/app/net/sf/gridarta/gameobject/scripts/UndefinedEventArchetypeException.java (from rev 1544, trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeException.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/scripts/UndefinedEventArchetypeException.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/scripts/UndefinedEventArchetypeException.java 2007-01-10 22:03:19 UTC (rev 1548) @@ -0,0 +1,45 @@ +/* + * Gridarta Map Editor. + * Copyright (C) 2007 The Gridarta Developers + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +package net.sf.gridarta.gameobject.scripts; + +import org.jetbrains.annotations.NotNull; + +/** + * The class <code>UndefinedEventArchetypeException</code> is thrown when an + * event game object cannot be created. + * + * @author Andreas Kirschbaum + */ +public abstract class UndefinedEventArchetypeException extends Exception { + + /** Serial Version UID. */ + private static final long serialVersionUID = 1L; + + /** + * Create a new instance. + * + * @param msg the exception message + */ + public UndefinedEventArchetypeException(@NotNull final String msg) { + super(msg); + } + +} // class UndefinedEventArchetypeException Copied: trunk/src/app/net/sf/gridarta/gameobject/scripts/UndefinedEventArchetypeNameException.java (from rev 1544, trunk/crossfire/src/cfeditor/gameobject/scripts/UndefinedEventArchetypeNameException.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/scripts/UndefinedEventArchetypeNameException.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/scripts/UndefinedEventArchetypeNameException.java 2007-01-10 22:03:19 UTC (rev 1548) @@ -0,0 +1,60 @@ +/* + * Gridarta Map Editor. + * Copyright (C) 2007 The Gridarta Developers + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ + +package net.sf.gridarta.gameobject.scripts; + +import org.jetbrains.annotations.NotNull; + +/** + * This class implements an {@link UndefinedEventArchetypeException} that + * describes a missing archetype. + * + * @author Andreas Kirschbaum + */ +public class UndefinedEventArchetypeNameException extends UndefinedEventArchetypeException { + + /** Serial Version UID. */ + private static final long serialVersionUID = 1L; + + /** + * The archetype that could not be found. + */ + @NotNull private final String archName; + + /** + * Create a new instance. + * + * @param archName the archetype that could not be found + */ + public UndefinedEventArchetypeNameException(@NotNull final String archName) { + super("undefined archetype " + archName); + this.archName = archName; + } + + /** + * Return the archetype that could not be found. + * + * @return the archetype that could not be found + */ + @NotNull public String getArchName() { + return archName; + } + +} // class UndefinedEventArchetypeNameException This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-10 22:50:15
|
Revision: 1552 http://svn.sourceforge.net/gridarta/?rev=1552&view=rev Author: akirschbaum Date: 2007-01-10 14:50:15 -0800 (Wed, 10 Jan 2007) Log Message: ----------- Unify selected square control code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareControl.java trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareControl.java trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java Modified: trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareControl.java 2007-01-10 22:40:10 UTC (rev 1551) +++ trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareControl.java 2007-01-10 22:50:15 UTC (rev 1552) @@ -84,6 +84,7 @@ ListSelectionListener getListSelectionListener() { return new ListSelectionListener() { + /** {@inheritDoc} */ public void valueChanged(final ListSelectionEvent e) { mainView.setMapArchPanelObject(getMapTileSelection()); } @@ -92,31 +93,26 @@ MouseListener getMouseListener() { return new MouseAdapter() { - @Override public void mousePressed(final MouseEvent e) { - if ((e.getModifiers() & InputEvent.BUTTON1_MASK) != 0) { - // --- left mouse button: select arch --- - // first, check if this is a doubleclick - final long thisClick = (new Date()).getTime(); - if (thisClick - lastClick < IGUIConstants.DOUBLECLICK_MS && lastClickGameObject != null && lastClickGameObject == getMapTileSelection()) { - // doubleclick: open attribute window - mainControl.openAttrDialog(getMapTileSelection()); + /** {@inheritDoc} */ + @Override public void mousePressed(final MouseEvent e) { + if ((e.getModifiers() & InputEvent.BUTTON1_MASK) != 0) { + final long thisClick = (new Date()).getTime(); + if (thisClick - lastClick < IGUIConstants.DOUBLECLICK_MS && lastClickGameObject != null && lastClickGameObject == getMapTileSelection()) { + mainControl.openAttrDialog(getMapTileSelection()); + } else { + mainView.setMapArchPanelObject(getMapTileSelection()); + } + + // save values for next click + lastClick = thisClick; + lastClickGameObject = getMapTileSelection(); + } else if ((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0) { + insertGameObjectFromArchPanel(view.getListIndex(e)); } else { - // single click: now make this arch selected - mainView.setMapArchPanelObject(getMapTileSelection()); + deleteIndex(view.getListIndex(e)); } - - // save values for next click - lastClick = thisClick; - lastClickGameObject = getMapTileSelection(); - } else if ((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0) { - // --- right mouse button: insert arch --- - insertGameObjectFromArchPanel(view.getListIndex(e)); - } else { - // --- middle mouse button: delete arch --- - deleteIndex(view.getListIndex(e)); } - } - }; + }; } /** Modified: trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareControl.java =================================================================== --- trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareControl.java 2007-01-10 22:40:10 UTC (rev 1551) +++ trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareControl.java 2007-01-10 22:50:15 UTC (rev 1552) @@ -35,6 +35,7 @@ import daieditor.map.MapModel; import java.awt.Point; import static java.awt.event.InputEvent.SHIFT_MASK; +import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import static java.awt.event.MouseEvent.BUTTON1; import static java.awt.event.MouseEvent.BUTTON2; @@ -54,7 +55,7 @@ * @author <a href="mailto:ch...@ri...">Christian Hujer</a> * @todo turn this into a tree */ -public final class SelectedSquareControl implements MouseListener { +public final class SelectedSquareControl { /** Controller of this subview. */ private final CMainControl mainControl; @@ -78,15 +79,30 @@ ListSelectionListener getListSelectionListener() { return new ListSelectionListener() { + /** {@inheritDoc} */ public void valueChanged(final ListSelectionEvent e) { mainView.setMapArchPanelObject(getMapTileSelection()); } }; } - /** {@inheritDoc} */ - public void valueChanged(final ListSelectionEvent e) { - mainView.setMapArchPanelObject(getMapTileSelection()); + MouseListener getMouseListener() { + return new MouseAdapter() { + /** {@inheritDoc} */ + public void mousePressed(final MouseEvent e) { + if (e.getButton() == BUTTON1) { // LMB + if (e.getClickCount() > 1) { // LMB Double click + mainControl.openAttrDialog(getMapTileSelection()); + } else { + mainView.setMapArchPanelObject(getMapTileSelection()); + } + } else if (e.getButton() == BUTTON3 && (e.getModifiers() & SHIFT_MASK) != SHIFT_MASK) { // RMB + insertGameObjectFromArchPanel(view.getListIndex(e)); + } else if (e.getButton() == BUTTON2 || (e.getModifiers() & SHIFT_MASK) == SHIFT_MASK && e.getButton() == BUTTON3) { // MMB + deleteIndex(view.getListIndex(e)); + } + } + }; } /** @@ -153,42 +169,6 @@ view.setSelectedIndex(view.getSelectedIndex() - 1); } - /** {@inheritDoc} */ - public void mousePressed(final MouseEvent e) { - if (e.getButton() == BUTTON1) { // LMB - if (e.getClickCount() > 1) { // LMB Double click - mainControl.openAttrDialog(getMapTileSelection()); - } else { - mainView.setMapArchPanelObject(getMapTileSelection()); - } - } else if (e.getButton() == BUTTON3 && (e.getModifiers() & SHIFT_MASK) != SHIFT_MASK) { // RMB - insertGameObjectFromArchPanel(view.getListIndex(e)); - } else if (e.getButton() == BUTTON2 || (e.getModifiers() & SHIFT_MASK) == SHIFT_MASK && e.getButton() == BUTTON3) { // MMB - // --- middle mouse button: delete arch --- - deleteIndex(view.getListIndex(e)); - } - } - - /** {@inheritDoc} */ - public void mouseClicked(final MouseEvent e) { - /* ignore */ - } - - /** {@inheritDoc} */ - public void mouseEntered(final MouseEvent e) { - /* ignore */ - } - - /** {@inheritDoc} */ - public void mouseExited(final MouseEvent e) { - /* ignore */ - } - - /** {@inheritDoc} */ - public void mouseReleased(final MouseEvent e) { - /* ignore */ - } - /** * Return the currently selected GameObject within this list (currently selected MapSquare). * @return the currently selected GameObject Modified: trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java 2007-01-10 22:40:10 UTC (rev 1551) +++ trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java 2007-01-10 22:50:15 UTC (rev 1552) @@ -141,7 +141,7 @@ compass.add(new JLabel(CGUIUtils.getSysIcon(IGUIConstants.TILE_NORTH))); add(compass, BorderLayout.NORTH); list.addListSelectionListener(control.getListSelectionListener()); - list.addMouseListener(control); + list.addMouseListener(control.getMouseListener()); list.setFocusable(false); // XXX Workaround for Mantis #0000154 This is not clean and should be removed as soon as cut/copy/paste of arches is possible mainControl.addMainControlListener(this); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-11 18:55:15
|
Revision: 1563 http://svn.sourceforge.net/gridarta/?rev=1563&view=rev Author: akirschbaum Date: 2007-01-11 10:55:15 -0800 (Thu, 11 Jan 2007) Log Message: ----------- Use pickmap selection for insert, replace, fill, floodfill. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/crossfire/src/cfeditor/messages_de.properties trunk/daimonin/src/daieditor/messages.properties trunk/src/app/net/sf/gridarta/messages.properties Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2007-01-10 23:14:29 UTC (rev 1562) +++ trunk/crossfire/ChangeLog 2007-01-11 18:55:15 UTC (rev 1563) @@ -1,5 +1,7 @@ 2007-01-11 Andreas Kirschbaum + * Use pickmap selection for insert, replace, fill, floodfill. + * Add context menu to pickmap chooser. 2007-01-10 Andreas Kirschbaum Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-10 23:14:29 UTC (rev 1562) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-11 18:55:15 UTC (rev 1563) @@ -576,6 +576,11 @@ return mainView.isLockAllPickmaps(); } + // ask arch panel which arches are selectd + public List<GameObject> getArchPanelSelection() { + return mainView.getArchPanelSelection(); + } + // ask arch panel which arch is highlighted public GameObject getArchPanelHighlight() { return mainView.getArchPanelHighlight(); @@ -1865,7 +1870,7 @@ * @param fillBelow true if "Fill Below" was activated, false if "Fill Above" */ private void fillWanted(final boolean fillBelow) { - mainControl.getCopyBuffer().fill(mainControl.getCurrentMap(), fillBelow, -1); + mainControl.getCopyBuffer().fill(mainControl.getCurrentMap(), fillBelow, null, -1); } /** "Random fill above" was selected from the Edit menu. */ @@ -1888,10 +1893,31 @@ */ private void fillRandomWanted(final boolean fillBelow) { final MapControl currentMap = mainControl.getCurrentMap(); + final StringBuilder title = new StringBuilder(fillBelow ? "Random fill below " : "Random fill above "); + final GameObject arch = instance.getArchPanelHighlight(); + MapControl pmap = null; + /* if we have a single arch, use it as random seed. + * We can throw the arch with % chance over the selected area. + * If the arch is null, we look we have a selected pickmap. + * if so, use the pickmap as random arch seed for the filler. + */ + if (arch != null) { + title.append("with arch ").append(arch.getArchetypeName()); + } else { + pmap = mainControl.getMainView().getPickmapChooserControl().getCurrentPickmap(); + if (pmap != null) { + title.append("with pickmap ").append(pmap.getMapArchObject().getMapName()); + } else { // ok ,we have a problem here: arch == null, pmap == null... + // XXX but shouldn't be something told to the user? + // Not even a logging? + return; + } + } + String input = "100"; for (;;) { - input = (String) JOptionPane.showInputDialog(mainControl.getMainView(), "Enter a fill density between 1-100", fillBelow ? "Random fill below" : "Random fill above", JOptionPane.QUESTION_MESSAGE, null, null, input); + input = (String) JOptionPane.showInputDialog(mainControl.getMainView(), "Enter a fill density between 1-100", title.toString(), JOptionPane.QUESTION_MESSAGE, null, null, input); if (input == null) { break; } @@ -1905,7 +1931,7 @@ if (rand < 1 || rand > 100) { JOptionPane.showMessageDialog(mainControl.getMainView(), "The fill density must be between 1-100.", "Illegal Value.", JOptionPane.ERROR_MESSAGE); } else { - mainControl.getCopyBuffer().fill(currentMap, fillBelow, rand); + mainControl.getCopyBuffer().fill(currentMap, fillBelow, pmap, rand); break; } } Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2007-01-10 23:14:29 UTC (rev 1562) +++ trunk/crossfire/src/cfeditor/CMainView.java 2007-01-11 18:55:15 UTC (rev 1563) @@ -322,7 +322,7 @@ * must be generated before inserting such an arch to the map. * @return the active arch in the left-side panel */ - public GameObject getArchPanelHighlight() { + @Nullable public GameObject getArchPanelHighlight() { if ((isPickmapActive() || archPanel.getArchPanelSelection() == null) && pickmapChooserControl.isLoadComplete() && pickmapChooserControl.getCurrentPickmap() != null) { // get the active pickmap @@ -340,6 +340,7 @@ return arch.getHead(); } } + return null; } // return the arch from the archlist in any case the pickmap is @@ -347,6 +348,36 @@ return archPanel.getArchPanelSelection(); } + /** + * Returns the selected arches in the left-side panel. + * This can either be default arches, or + * custom arches from a pickmap. + * IMPORTANT: The returned GameObject list contains no clone. A copy + * must be generated before inserting such arches to the map. + * @return the selected arches in the left-side panel + */ + @Nullable public List<GameObject> getArchPanelSelection() { + + if ((isPickmapActive() || archPanel.getArchPanelSelection() == null) && pickmapChooserControl.isLoadComplete()) { + // get the active pickmap + final MapControl pmap = pickmapChooserControl.getCurrentPickmap(); + if (pmap != null) { + return CopyBuffer.getMapArchList(pmap, 100); + } + return null; + } + + // return the arch from the archlist in any case the pickmap is + // either not active or didn't work + final GameObject archObject = archPanel.getArchPanelSelection(); + if (archObject != null) { + final ArrayList<GameObject> archPanelList = new ArrayList<GameObject>(); + archPanelList.add(archObject); + return archPanelList; + } + return null; + } + public void showArchPanelQuickObject(final GameObject gameObject) { archPanel.showArchPanelQuickObject(gameObject); } Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-01-10 23:14:29 UTC (rev 1562) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-01-11 18:55:15 UTC (rev 1563) @@ -31,7 +31,9 @@ import cfeditor.map.MapModel; import java.awt.Point; import java.awt.Rectangle; +import java.util.ArrayList; import java.util.HashSet; +import java.util.List; import net.sf.gridarta.MainControl; import net.sf.gridarta.Size2D; import net.sf.gridarta.map.MapSquare; @@ -223,14 +225,29 @@ * @param mapControl MapControl of the active map we paste on * @param fillBelow if true, the filling content is placed *below* the * existing map + * @param seed MapControl of the random objects or <code>null</code> to use the currently selected Archetype. * @param density the fill density in percent; -1 to disable */ - public void fill(final MapControl mapControl, final boolean fillBelow, final int density) { + public void fill(final MapControl mapControl, final boolean fillBelow, final MapControl seed, final int density) { if (!mapControl.getMapViewFrame().isHighlight()) { return; // should actually never happen } - if (mainControl.getArchPanelHighlight() == null) { // no selected arch to fill with + final List<GameObject> archList; + if (seed == null) { + final List<GameObject> archPanelSelection = mainControl.getArchPanelSelection(); + if (archPanelSelection == null || archPanelSelection.isEmpty()) { + return; + } + archList = archPanelSelection; + } else { + final int seedSize = countMapArches(seed); + if (seedSize == 0) { + return; + } + archList = getMapArchList(seed, seedSize); + } + if (archList == null || archList.isEmpty()) { return; } @@ -239,13 +256,92 @@ if (density != -1 && density != 100 && density < MainControl.rnd.nextInt(100) + 1) { continue; } - final GameObject gameObject = mainControl.getArchPanelHighlight(); + final GameObject gameObject = archList.get(MainControl.rnd.nextInt(archList.size())); addArchToMap(mapControl, gameObject, p, false, fillBelow); } mapControl.getMapModel().endTransaction(); } /** + * Count the arches in a map. + * @param mapControl MapControl to count arches of + * @return arches in map of <var>mapControl</var> + */ + private static int countMapArches(final MapControl mapControl) { + final MapModel map = mapControl.getMapModel(); + int count = 0; + final Size2D mapSize = map.getMapSize(); + final Point pos = new Point(); + for (pos.x = 0; pos.x < mapSize.getWidth(); pos.x++) { + for (pos.y = 0; pos.y < mapSize.getHeight(); pos.y++) { + for (final GameObject node : map.getMapSquare(pos)) { + // only non multi suckers + if (!node.isTail()) { + count++; + } + } + } + } + return count; + } + + /** + * Get a random gameObject from a map. + * @param mapControl map to get random gameObject from + * @param max Initial size of Array in #getMapArchList + * @return random gameObject from <var>mapControl</var> + */ + @Nullable public static GameObject getRandomMapArch(final MapControl mapControl, final int max) { + final List<GameObject> objects = getMapArchList(mapControl, max); + if (objects == null) { + return null; + } + final int objectSize = objects.size(); + if (objectSize == 0) { + return null; + } + if (objectSize == 1) { + return objects.get(0); + } + return objects.get(CMainControl.rnd.nextInt(objects.size())); + } + + /** + * Returns a list of all ArchObjects on selected MapSquares. + * If no MapSquare is selected all ArchObjects are returned. + * Tail ArchObjects will not be in the list. + * @param mapControl Map to get ArchList from + * @param max Initial size of Array size + * @return Array of selected/all ArchObjects + */ + @Nullable public static List<GameObject> getMapArchList(final MapControl mapControl, final int max) { + if (mapControl == null) { + return null; + } + final MapViewIFrame mapViewIFrame = mapControl.getMapViewFrame(); + final Iterable<MapSquare<GameObject, MapArchObject>> mapSquares; + if (mapViewIFrame == null) { + mapSquares = mapControl.getAllSquares(); + } else { + final List<MapSquare<GameObject, MapArchObject>> selectedMapSquares = mapViewIFrame.getView().getSelectedSquares(); + if (selectedMapSquares.isEmpty()) { + mapSquares = mapControl.getAllSquares(); + } else { + mapSquares = selectedMapSquares; + } + } + final List<GameObject> objects = new ArrayList<GameObject>(max); + for (final MapSquare<GameObject, MapArchObject> mapSquare : mapSquares) { + for (final GameObject node : mapSquare) { + if (!node.isTail()) { + objects.add(node); + } + } + } + return objects.isEmpty() ? null : objects; + } + + /** * Floodfill the the map, starting at the cursor position. * * @param mapControl the map to fill @@ -260,13 +356,13 @@ return; } - final GameObject arch = mainControl.getArchPanelHighlight(); - if (arch == null) { + final List<GameObject> archList = mainControl.getArchPanelSelection(); + if (archList == null || archList.isEmpty()) { return; } mapControl.getMapModel().beginTransaction("Floodfill"); // TODO: I18N/L10N - floodfill(mapControl, cursor.x, cursor.y, arch); + floodfill(mapControl, cursor.x, cursor.y, archList); mapControl.getMapModel().endTransaction(); } @@ -280,21 +376,22 @@ * @param startY starting y-coord for floodfill * @param arch GameObject to fill with */ - private void floodfill(final MapControl mapControl, final int startX, final int startY, final GameObject arch) { - addArchToMap(mapControl, arch, new Point(startX, startY), false, false); + private void floodfill(final MapControl mapControl, final int startX, final int startY, final List<GameObject> archList) { + final GameObject gameObject = archList.get(MainControl.rnd.nextInt(archList.size())); + addArchToMap(mapControl, gameObject, new Point(startX, startY), false, false); // now go recursive into all four directions if (mapControl.isPointValid(new Point(startX - 1, startY)) && !mapControl.containsArchObject(new Point(startX - 1, startY))) { - floodfill(mapControl, startX - 1, startY, arch); + floodfill(mapControl, startX - 1, startY, archList); } if (mapControl.isPointValid(new Point(startX, startY - 1)) && !mapControl.containsArchObject(new Point(startX, startY - 1))) { - floodfill(mapControl, startX, startY - 1, arch); + floodfill(mapControl, startX, startY - 1, archList); } if (mapControl.isPointValid(new Point(startX + 1, startY)) && !mapControl.containsArchObject(new Point(startX + 1, startY))) { - floodfill(mapControl, startX + 1, startY, arch); + floodfill(mapControl, startX + 1, startY, archList); } if (mapControl.isPointValid(new Point(startX, startY + 1)) && !mapControl.containsArchObject(new Point(startX, startY + 1))) { - floodfill(mapControl, startX, startY + 1, arch); + floodfill(mapControl, startX, startY + 1, archList); } } Modified: trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java 2007-01-10 23:14:29 UTC (rev 1562) +++ trunk/crossfire/src/cfeditor/gui/ReplaceDialog.java 2007-01-11 18:55:15 UTC (rev 1563) @@ -35,6 +35,7 @@ import java.awt.event.ItemListener; import java.util.ArrayList; import java.util.Iterator; +import java.util.List; import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; @@ -81,6 +82,8 @@ private GameObject replaceArch = null; // objects will be replaced by this arch + private List<GameObject> replacePickmap; // selected objects in pickmap or all if none is selected + private JLabel rfHeading; private JLabel rfArchName = null; @@ -131,6 +134,7 @@ */ public void display(final MapControl mapControl) { replaceArch = mainControl.getArchPanelHighlight(); // highlighted arch + replacePickmap = mainControl.getArchPanelSelection(); // selected arches if (!isBuilt) { this.mapControl = mapControl; @@ -177,9 +181,10 @@ line3.add(label2); line3.add(Box.createVerticalStrut(5)); replaceWithBox = new JComboBox(new String[]{ACTION_FACTORY.getString("replaceByObject"), + ACTION_FACTORY.getString("replaceByPickmap"), ACTION_FACTORY.getString("replaceByNothing")}); if (replaceArch == null) { - replaceWithBox.setSelectedIndex(1); + replaceWithBox.setSelectedIndex(2); } else { replaceWithBox.setSelectedIndex(0); } @@ -288,11 +293,30 @@ return 0; } + final List<GameObject> replaceList; + switch (lastSelectedIndex) { + case 0: + if (replaceArch == null) { + replaceList = null; + } else { + replaceList = new ArrayList<GameObject>(1); + replaceList.add(replaceArch); + } + break; + case 1: + replaceList = replacePickmap; + break; + + default: + replaceList = null; + break; + } final MapViewIFrame mapViewIFrame = mapControl.getMapViewFrame(); assert mapViewIFrame != null; int replaceCount = 0; final ArrayList<GameObject> objectsToReplace = new ArrayList<GameObject>(); + final int replaceListSize = replaceList == null ? 0 : replaceList.size(); mapControl.getMapModel().beginTransaction("Replace"); // TODO: I18N/L10N for (final MapSquare<GameObject, MapArchObject> square : entireMap ? mapControl.getMapModel() : mapViewIFrame.getView().getSelectedSquares()) { // find objects to replace @@ -322,16 +346,25 @@ // first, delete the old arch node.remove(); - if (replaceArch != null && !deleteOnly) { + if (replaceListSize > 0 && !deleteOnly) { + GameObject randomArch; + if (replaceListSize == 1) { + randomArch = replaceList.get(0); + } else { + randomArch = replaceList.get(CMainControl.rnd.nextInt(replaceList.size())); + } + if (randomArch.isMulti()) { + // multi's cannot be inserted properly, so we just put them ontop + randomArch = randomArch.getHead(); + } // insert replacement object - if (replaceArch.isMulti()) { + if (randomArch.isMulti()) { // multi's cannot be inserted properly, so we just put them ontop - replaceArch = replaceArch.getHead(); - mapControl.addArchToMap(replaceArch.getArchetypeName(), new Point(square.getMapX(), square.getMapY()), false, false); + mapControl.addArchToMap(randomArch.getArchetypeName(), new Point(square.getMapX(), square.getMapY()), false, false); // TODO: if from pickmap it could have special attributes -> copy them } else { - mapControl.insertArchToMap(replaceArch, null, prevArch, new Point(square.getMapX(), square.getMapY()), false); + mapControl.insertArchToMap(randomArch, null, prevArch, new Point(square.getMapX(), square.getMapY()), false); } } replaceCount++; @@ -349,6 +382,7 @@ public void itemStateChanged(final ItemEvent e) { final int selectedIndex = replaceWithBox.getSelectedIndex(); if (e.getStateChange() == ItemEvent.SELECTED && lastSelectedIndex != selectedIndex) { + final int size; switch (selectedIndex) { case 0: // replace with arch @@ -357,6 +391,20 @@ break; case 1: + // replace with pickmap + replacePickmap = mainControl.getArchPanelSelection(); // selected arches + iconLabel.setIcon(null); + if (replacePickmap == null) { + size = 0; + } else { + size = replacePickmap.size(); + } + rfArchName.setText(String.valueOf(size)); + colonLabel.setText(":"); + dialog.pack(); + break; + + case 2: // replace with nothing iconLabel.setIcon(null); rfArchName.setText(""); @@ -375,7 +423,7 @@ */ public void replaceOk() { final String matchString = replaceInput1.getText().trim(); - final boolean deleteOnly = replaceWithBox.getSelectedIndex() == 1; + final boolean deleteOnly = replaceWithBox.getSelectedIndex() == 2; final boolean entireMap = replaceEntireBox.getSelectedIndex() == 0; final MapViewIFrame mapViewIFrame = mapControl.getMapViewFrame(); Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-10 23:14:29 UTC (rev 1562) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-11 18:55:15 UTC (rev 1563) @@ -25,6 +25,7 @@ package cfeditor.map; import cfeditor.CMainControl; +import cfeditor.CopyBuffer; import cfeditor.IGUIConstants; import cfeditor.MapViewIFrame; import cfeditor.gameobject.GameObject; @@ -39,6 +40,7 @@ import net.sf.gridarta.gui.map.MapGridListener; import net.sf.gridarta.map.AbstractMapControl; import net.sf.gridarta.map.MapModelListener; +import net.sf.gridarta.map.MapSquare; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -346,7 +348,7 @@ // this is the arch that would get inserted from pickmap, but it also could // be a default arch (when pickmap has no selection) - GameObject newarch = mainControl.getArchPanelHighlight(); + GameObject newarch = CopyBuffer.getRandomMapArch(mainControl.getMainView().getPickmapChooserControl().getCurrentPickmap(), 100); if (!mainControl.getMainView().isPickmapActive() || isPickmap() || (newarch != null && newarch.isArchetype())) { // insert default arch from archlist: @@ -505,6 +507,14 @@ } /** + * Get Iterable of all MapSquares. + * @return Iterable of all MapSquares + */ + public Iterable<MapSquare<GameObject, MapArchObject>> getAllSquares() { + return mapModel; + } + + /** * Determines if this map has an active selection. * * @return <code>true</code> if this map has an active selection, Modified: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties 2007-01-10 23:14:29 UTC (rev 1562) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2007-01-11 18:55:15 UTC (rev 1563) @@ -175,6 +175,7 @@ replaceDelete=l\xF6sche Objekte mit replaceBy=und ersetze durch replaceByObject=Objekt +replaceByPickmap=Pickmap replaceByNothing=nichts (=l\xF6schen) replaceMapGone.title=Karte nicht mehr verf\xFCgbar Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2007-01-10 23:14:29 UTC (rev 1562) +++ trunk/daimonin/src/daieditor/messages.properties 2007-01-11 18:55:15 UTC (rev 1563) @@ -154,7 +154,6 @@ mapTilePathMode.shortdescription=Switch between relative and absolute path replaceByCopyBuffer=clipboard -replaceByPickmap=pickmap arcDoc.htmlText=<html><head><meta name="CFJavaEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">{0}</h1><h3 style="colour:navy;">Functionality of {0}:</h3><p>{1}</p><h3 style="colour:navy;">Notes on Usage:</h3><p>{2}</p></body></html> Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2007-01-10 23:14:29 UTC (rev 1562) +++ trunk/src/app/net/sf/gridarta/messages.properties 2007-01-11 18:55:15 UTC (rev 1563) @@ -123,6 +123,7 @@ replaceDelete=delete objects with replaceBy=and replace by replaceByObject=object +replaceByPickmap=pickmap replaceByNothing=nothing replaceMapGone.title=Error with Replace This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-11 19:22:46
|
Revision: 1567 http://svn.sourceforge.net/gridarta/?rev=1567&view=rev Author: akirschbaum Date: 2007-01-11 11:22:43 -0800 (Thu, 11 Jan 2007) Log Message: ----------- Fix #1613731 (Arch list tabs sometimes blank). Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/src/app/net/sf/gridarta/gui/ArchetypeChooser.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2007-01-11 19:18:22 UTC (rev 1566) +++ trunk/crossfire/ChangeLog 2007-01-11 19:22:43 UTC (rev 1567) @@ -1,5 +1,7 @@ 2007-01-11 Andreas Kirschbaum + * Fix #1613731 (Arch list tabs sometimes blank). + * Use pickmap selection for insert, replace, fill, floodfill. * Add context menu to pickmap chooser. Modified: trunk/src/app/net/sf/gridarta/gui/ArchetypeChooser.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/ArchetypeChooser.java 2007-01-11 19:18:22 UTC (rev 1566) +++ trunk/src/app/net/sf/gridarta/gui/ArchetypeChooser.java 2007-01-11 19:22:43 UTC (rev 1567) @@ -153,24 +153,26 @@ } } - if (folders.size() <= 0) { - comboBox.addItem("show all"); - folders.add(null); // first entry is always empty - } + synchronized(comboBox.getTreeLock()) { + if (folders.size() <= 0) { + comboBox.addItem("show all"); + folders.add(null); // first entry is always empty + } - // insert new folder in alphabetical order - int i; - for (i = 1; i < folders.size(); i++) { - if (folderName.compareToIgnoreCase((String) comboBox.getItemAt(i)) <= 0) { - break; + // insert new folder in alphabetical order + int i; + for (i = 1; i < folders.size(); i++) { + if (folderName.compareToIgnoreCase((String) comboBox.getItemAt(i)) <= 0) { + break; + } } - } - final ArrayList<G> folder = new ArrayList<G>(); - comboBox.insertItemAt(folderName, i); - folders.add(i, folder); + final ArrayList<G> folder = new ArrayList<G>(); + comboBox.insertItemAt(folderName, i); + folders.add(i, folder); - return folder; + return folder; + } } /** @@ -191,12 +193,12 @@ } } - archList.setVisible(false); - model.removeAllElements(); - for (final GameObject arch : sortedArchetypes) { - model.addElement(arch); + synchronized(archList.getTreeLock()) { + model.removeAllElements(); + for (final GameObject arch : sortedArchetypes) { + model.addElement(arch); + } } - archList.setVisible(true); } protected abstract ListCellRenderer createRenderer(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-11 19:28:11
|
Revision: 1568 http://svn.sourceforge.net/gridarta/?rev=1568&view=rev Author: akirschbaum Date: 2007-01-11 11:28:11 -0800 (Thu, 11 Jan 2007) Log Message: ----------- Enable "save" after "save as". Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/map/MapControl.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2007-01-11 19:22:43 UTC (rev 1567) +++ trunk/crossfire/ChangeLog 2007-01-11 19:28:11 UTC (rev 1568) @@ -1,5 +1,7 @@ 2007-01-11 Andreas Kirschbaum + * Enable "save" after "save as". + * Fix #1613731 (Arch list tabs sometimes blank). * Use pickmap selection for insert, replace, fill, floodfill. Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-11 19:22:43 UTC (rev 1567) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-11 19:28:11 UTC (rev 1568) @@ -1067,9 +1067,6 @@ final File file = fileChooser.getSelectedFile(); if (!file.exists() || ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.WARNING_MESSAGE, JOptionPane.OK_CANCEL_OPTION, "overwriteOtherFile", file.getName()) == JOptionPane.OK_OPTION) { level.saveAs(file); - level.setMapFileName(file.getName()); // window title and file name - //level.setMapName(file.getName()); // map name (internal) - level.setMapFile(file); currentDir = fileChooser.getCurrentDirectory(); refreshMenusAndToolbars(); Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-11 19:22:43 UTC (rev 1567) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-11 19:28:11 UTC (rev 1568) @@ -214,7 +214,8 @@ * if not */ public boolean isPlainSaveEnabled() { - return mainControl.getCurrentMap().getMapFileName() != null && mainControl.getCurrentMap().getMapFileName().compareTo(IGUIConstants.DEF_MAPFNAME) != 0; + final String mapFileName = getMapFileName(); + return mapFile != null && mapFileName != null && !mapFileName.equals(IGUIConstants.DEF_MAPFNAME); } /** @@ -307,6 +308,8 @@ public void saveAs(@NotNull final File file) { mainControl.setStatusText("Saving the map to a file..."); mainControl.encodeMapFile(file, mapModel); + mapFile = file; + setMapFileName(file.getName()); resetModified(); } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-01-11 19:22:43 UTC (rev 1567) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-01-11 19:28:11 UTC (rev 1568) @@ -1289,9 +1289,6 @@ final File file = fileChooser.getSelectedFile(); if (!file.exists() || ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.WARNING_MESSAGE, JOptionPane.OK_CANCEL_OPTION, "overwriteOtherFile", file.getName()) == JOptionPane.OK_OPTION) { level.saveAs(file); - level.setMapFileName(file.getName()); // window title and file name - //level.setMapName(file.getName()); // map name (internal) - level.setMapFile(file); currentDir = fileChooser.getCurrentDirectory(); refreshMenusAndToolbars(); Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-11 19:22:43 UTC (rev 1567) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-11 19:28:11 UTC (rev 1568) @@ -225,7 +225,8 @@ * if not */ public boolean isPlainSaveEnabled() { - return !(mainControl.getCurrentMap().mapFile == null || mainControl.getCurrentMap().getMapFileName() == null || mainControl.getCurrentMap().getMapFileName().compareTo(IGUIConstants.DEF_MAPFNAME) == 0); + final String mapFileName = getMapFileName(); + return mapFile != null && mapFileName != null && !mapFileName.equals(IGUIConstants.DEF_MAPFNAME); } /** @@ -334,6 +335,8 @@ public void saveAs(@NotNull final File file) { mainControl.setStatusText("Saving the map to a file..."); mainControl.encodeMapFile(file, mapModel); + mapFile = file; + setMapFileName(file.getName()); resetModified(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-11 20:01:04
|
Revision: 1569 http://svn.sourceforge.net/gridarta/?rev=1569&view=rev Author: akirschbaum Date: 2007-01-11 12:01:00 -0800 (Thu, 11 Jan 2007) Log Message: ----------- Remove unused import statements. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/filter/AttributeFilter.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java trunk/crossfire/src/cfeditor/gui/ScriptEditor.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareControl.java trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java trunk/crossfire/src/cfeditor/map/DefaultMapModel.java trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareControl.java trunk/daimonin/src/daieditor/map/MapControl.java trunk/src/app/net/sf/gridarta/CFArchTypeList.java trunk/src/app/net/sf/gridarta/map/MapControlListener.java trunk/src/app/net/sf/gridarta/map/MapModelListener.java trunk/src/app/net/sf/gridarta/map/MapTransactionListener.java Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2007-01-11 19:28:11 UTC (rev 1568) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2007-01-11 20:01:00 UTC (rev 1569) @@ -39,7 +39,6 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import javax.imageio.ImageIO; import javax.swing.JScrollPane; Modified: trunk/crossfire/src/cfeditor/filter/AttributeFilter.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/AttributeFilter.java 2007-01-11 19:28:11 UTC (rev 1568) +++ trunk/crossfire/src/cfeditor/filter/AttributeFilter.java 2007-01-11 20:01:00 UTC (rev 1569) @@ -11,7 +11,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.Set; import javax.swing.JCheckBoxMenuItem; import javax.swing.JMenuItem; import net.sf.japi.swing.ActionFactory; Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2007-01-11 19:28:11 UTC (rev 1568) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2007-01-11 20:01:00 UTC (rev 1569) @@ -32,8 +32,6 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; -import java.util.Collections; -import java.util.List; import javax.swing.JList; import net.sf.gridarta.CFArchType; import org.apache.log4j.Logger; Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java 2007-01-11 19:28:11 UTC (rev 1568) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptArchData.java 2007-01-11 20:01:00 UTC (rev 1569) @@ -35,9 +35,7 @@ import java.awt.event.ActionListener; import java.io.File; import java.io.IOException; -import java.util.ArrayList; import java.util.Iterator; -import java.util.List; import java.util.Vector; import javax.swing.BorderFactory; import javax.swing.Box; Modified: trunk/crossfire/src/cfeditor/gui/ScriptEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2007-01-11 19:28:11 UTC (rev 1568) +++ trunk/crossfire/src/cfeditor/gui/ScriptEditor.java 2007-01-11 20:01:00 UTC (rev 1569) @@ -42,7 +42,6 @@ import javax.swing.event.ChangeListener; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; -import javax.swing.table.TableModel; import org.apache.log4j.Logger; public class ScriptEditor extends JPanel { Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-11 19:28:11 UTC (rev 1568) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-11 20:01:00 UTC (rev 1569) @@ -26,7 +26,6 @@ import cfeditor.CMainControl; import cfeditor.CMainView; -import cfeditor.CMapViewBasic; import cfeditor.IGUIConstants; import cfeditor.gameobject.GameObject; import cfeditor.gui.NewMapDialog; Modified: trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareControl.java 2007-01-11 19:28:11 UTC (rev 1568) +++ trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareControl.java 2007-01-11 20:01:00 UTC (rev 1569) @@ -27,7 +27,6 @@ import cfeditor.CMainControl; import cfeditor.CMainView; -import cfeditor.IGUIConstants; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; Modified: trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java 2007-01-11 19:28:11 UTC (rev 1568) +++ trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java 2007-01-11 20:01:00 UTC (rev 1569) @@ -26,7 +26,6 @@ package cfeditor.gui.selectedsquare; import cfeditor.CMainControl; -import cfeditor.IGUIConstants; import cfeditor.gameobject.GameObject; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; Modified: trunk/crossfire/src/cfeditor/map/DefaultMapModel.java =================================================================== --- trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2007-01-11 19:28:11 UTC (rev 1568) +++ trunk/crossfire/src/cfeditor/map/DefaultMapModel.java 2007-01-11 20:01:00 UTC (rev 1569) @@ -34,7 +34,6 @@ import cfeditor.gameobject.GameObject; import java.awt.Point; import java.util.List; -import net.sf.gridarta.Size2D; import net.sf.gridarta.map.AbstractMapModel; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java 2007-01-11 19:28:11 UTC (rev 1568) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java 2007-01-11 20:01:00 UTC (rev 1569) @@ -21,7 +21,6 @@ package daieditor.gui.pickmapchooser; import daieditor.CMainControl; -import daieditor.IGUIConstants; import daieditor.map.MapControl; import java.util.prefs.Preferences; import static java.util.prefs.Preferences.userNodeForPackage; Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-11 19:28:11 UTC (rev 1568) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-11 20:01:00 UTC (rev 1569) @@ -26,7 +26,6 @@ import daieditor.CMainControl; import daieditor.CMainView; -import daieditor.CMapViewBasic; import daieditor.IGUIConstants; import daieditor.gameobject.GameObject; import daieditor.gui.NewMapDialog; Modified: trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareControl.java =================================================================== --- trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareControl.java 2007-01-11 19:28:11 UTC (rev 1568) +++ trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareControl.java 2007-01-11 20:01:00 UTC (rev 1569) @@ -32,7 +32,6 @@ import daieditor.gameobject.GameObject; import daieditor.map.MapArchObject; import daieditor.map.MapControl; -import daieditor.map.MapModel; import java.awt.Point; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-11 19:28:11 UTC (rev 1568) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-11 20:01:00 UTC (rev 1569) @@ -31,7 +31,6 @@ import daieditor.gameobject.GameObject; import daieditor.gui.map.LevelRenderer; import daieditor.gui.map.SimpleLevelRenderer; -import java.awt.Graphics; import java.awt.Image; import static java.awt.Image.SCALE_SMOOTH; import java.awt.Point; @@ -50,7 +49,6 @@ import net.sf.gridarta.gui.map.MapGrid; import net.sf.gridarta.gui.map.MapGridListener; import net.sf.gridarta.map.AbstractMapControl; -import net.sf.gridarta.map.MapModelEvent; import net.sf.gridarta.map.MapModelListener; import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; Modified: trunk/src/app/net/sf/gridarta/CFArchTypeList.java =================================================================== --- trunk/src/app/net/sf/gridarta/CFArchTypeList.java 2007-01-11 19:28:11 UTC (rev 1568) +++ trunk/src/app/net/sf/gridarta/CFArchTypeList.java 2007-01-11 20:01:00 UTC (rev 1569) @@ -1,7 +1,6 @@ package net.sf.gridarta; import java.awt.Component; -import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; Modified: trunk/src/app/net/sf/gridarta/map/MapControlListener.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapControlListener.java 2007-01-11 19:28:11 UTC (rev 1568) +++ trunk/src/app/net/sf/gridarta/map/MapControlListener.java 2007-01-11 20:01:00 UTC (rev 1569) @@ -21,7 +21,6 @@ package net.sf.gridarta.map; import java.util.EventListener; -import net.sf.gridarta.gameobject.GameObject; import org.jetbrains.annotations.NotNull; /** Modified: trunk/src/app/net/sf/gridarta/map/MapModelListener.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapModelListener.java 2007-01-11 19:28:11 UTC (rev 1568) +++ trunk/src/app/net/sf/gridarta/map/MapModelListener.java 2007-01-11 20:01:00 UTC (rev 1569) @@ -26,7 +26,6 @@ package net.sf.gridarta.map; -import java.util.EventListener; import net.sf.gridarta.gameobject.GameObject; import org.jetbrains.annotations.NotNull; Modified: trunk/src/app/net/sf/gridarta/map/MapTransactionListener.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapTransactionListener.java 2007-01-11 19:28:11 UTC (rev 1568) +++ trunk/src/app/net/sf/gridarta/map/MapTransactionListener.java 2007-01-11 20:01:00 UTC (rev 1569) @@ -21,7 +21,6 @@ package net.sf.gridarta.map; import java.util.EventListener; -import net.sf.gridarta.gameobject.GameObject; import org.jetbrains.annotations.NotNull; /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-11 20:40:44
|
Revision: 1571 http://svn.sourceforge.net/gridarta/?rev=1571&view=rev Author: akirschbaum Date: 2007-01-11 12:40:44 -0800 (Thu, 11 Jan 2007) Log Message: ----------- Remove superfluous casts. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CScriptView.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java Modified: trunk/crossfire/src/cfeditor/CScriptView.java =================================================================== --- trunk/crossfire/src/cfeditor/CScriptView.java 2007-01-11 20:08:48 UTC (rev 1570) +++ trunk/crossfire/src/cfeditor/CScriptView.java 2007-01-11 20:40:44 UTC (rev 1571) @@ -139,7 +139,7 @@ } public void actionPerformed(final ActionEvent e) { - runPlugin((String) e.getActionCommand()); + runPlugin(e.getActionCommand()); } public void runPlugin(final String script) { Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-01-11 20:08:48 UTC (rev 1570) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-01-11 20:40:44 UTC (rev 1571) @@ -339,7 +339,7 @@ @NotNull public G getTopContainer() { G topContainer; if (isInContainer()) { - assert ((G) container) != null; + assert container != null; topContainer = ((G) container).getTopContainer(); } else { topContainer = (G) this; Modified: trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java 2007-01-11 20:08:48 UTC (rev 1570) +++ trunk/src/app/net/sf/gridarta/gui/AbstractGameObjectAttributesDialog.java 2007-01-11 20:40:44 UTC (rev 1571) @@ -623,7 +623,7 @@ case LIST: if (attrib.getMisc() != null && archTypeList.getListTable().containsKey(attrib.getMisc()[0])) { // build the list from vector data - input = buildArrayBox(attrib, (List) archTypeList.getListTable().get(attrib.getMisc()[0])); + input = buildArrayBox(attrib, archTypeList.getListTable().get(attrib.getMisc()[0])); } else { // error: list data is missing or corrupt cComp = new JLabel("Error: Undefined List"); @@ -654,7 +654,7 @@ final int[] activepart = {active & 0x0F, active & 0xF0}; // build the lists from vector data for (int j = 0; j < 2; j++) { - final List<?> listData = (List) archTypeList.getListTable().get(attrib.getMisc()[j]); + final List<?> listData = archTypeList.getListTable().get(attrib.getMisc()[j]); inputs[j] = buildArrayBox(attrib, listData); for (int k = 0; (double) k < listData.size() / 2.0; k++) { if ((Integer) listData.get(k << 1) == activepart[j]) { @@ -795,7 +795,7 @@ * Action method for help. */ public void attribHelp() { - new Help((JFrame) /* XXX */ mainControl.getMainView(), type.createHtmlDocu()).setVisible(true); + new Help(/* XXX */ mainControl.getMainView(), type.createHtmlDocu()).setVisible(true); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-11 21:15:35
|
Revision: 1578 http://svn.sourceforge.net/gridarta/?rev=1578&view=rev Author: akirschbaum Date: 2007-01-11 13:09:12 -0800 (Thu, 11 Jan 2007) Log Message: ----------- Remove redundant default constructors. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/crossfire/src/cfeditor/parameter/MapParameterView.java trunk/daimonin/src/daieditor/SplashScreen.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java trunk/daimonin/src/daieditor/gameobject/face/ArchFaceProvider.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java trunk/daimonin/src/daieditor/gui/map/MapViewSettings.java trunk/daimonin/src/daieditor/map/validation/DefaultErrorCollector.java trunk/daimonin/src/daieditor/map/validation/checks/MapDifficultyChecker.java trunk/src/app/net/sf/gridarta/gameobject/Collector.java Modified: trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2007-01-11 21:02:14 UTC (rev 1577) +++ trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2007-01-11 21:09:12 UTC (rev 1578) @@ -46,13 +46,6 @@ @SuppressWarnings({"MismatchedQueryAndUpdateOfCollection"}) private final List<AnimationObject> animObjects = new ArrayList<AnimationObject>(); - /** - * Create an AnimationObjects container. - */ - public AnimationObjects() { - super(); - } - /** {@inheritDoc} */ public void addAnimationObject(final String animName, final String list) throws DuplicateAnimationException { animObjects.add(new AnimationObject(animName, list, null /* TODO */)); Modified: trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2007-01-11 21:02:14 UTC (rev 1577) +++ trunk/crossfire/src/cfeditor/gameobject/face/FaceObjects.java 2007-01-11 21:09:12 UTC (rev 1578) @@ -34,13 +34,6 @@ */ public class FaceObjects extends AbstractFaceObjects<FaceObject> { - /** - * Create an FaceObjects container. - */ - public FaceObjects() { - super(); - } - /** {@inheritDoc} */ public void collect(@NotNull final Progress progress, @NotNull final File dir) throws IOException { CMainControl.getInstance().getArchetypeSet().collectFaces(progress, dir); Modified: trunk/crossfire/src/cfeditor/gui/ArchComboBox.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2007-01-11 21:02:14 UTC (rev 1577) +++ trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2007-01-11 21:09:12 UTC (rev 1578) @@ -93,9 +93,6 @@ boolean locked = false; - public ArchComboBoxEditor() { - } - public synchronized void lockEditor() { locked = true; } Modified: trunk/crossfire/src/cfeditor/parameter/MapParameterView.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/MapParameterView.java 2007-01-11 21:02:14 UTC (rev 1577) +++ trunk/crossfire/src/cfeditor/parameter/MapParameterView.java 2007-01-11 21:09:12 UTC (rev 1578) @@ -75,11 +75,6 @@ private static final long serialVersionUID = 1L; - public MyCellRenderer() { - super(); - // TODO Auto-generated constructor stub - } - @Override public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) { final String newVal; @@ -105,10 +100,6 @@ private static final long serialVersionUID = 1L; - public MyComboBoxModel() { - super(); - } - @Override public Object getElementAt(final int index) { if (index == 0) { return currentMap; Modified: trunk/daimonin/src/daieditor/SplashScreen.java =================================================================== --- trunk/daimonin/src/daieditor/SplashScreen.java 2007-01-11 21:02:14 UTC (rev 1577) +++ trunk/daimonin/src/daieditor/SplashScreen.java 2007-01-11 21:09:12 UTC (rev 1578) @@ -44,12 +44,6 @@ /** SplashScreen window. */ private JFrame splashScreen; - /** - * Create an instance of SplashScreen. - */ - public SplashScreen() { - } - /** Show the splash screen. */ public void show() { // Only show before Java 1.6.0 Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2007-01-11 21:02:14 UTC (rev 1577) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2007-01-11 21:09:12 UTC (rev 1578) @@ -66,13 +66,6 @@ */ private final Map<String, String> animMap = new HashMap<String, String>(); - /** - * Create an AnimationObjects container. - */ - public AnimationObjects() { - super(); - } - /** {@inheritDoc} */ public void addAnimationObject(final String animName, final String list) throws DuplicateAnimationException { addAnimationObject(animName, list, null); Modified: trunk/daimonin/src/daieditor/gameobject/face/ArchFaceProvider.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/ArchFaceProvider.java 2007-01-11 21:02:14 UTC (rev 1577) +++ trunk/daimonin/src/daieditor/gameobject/face/ArchFaceProvider.java 2007-01-11 21:09:12 UTC (rev 1578) @@ -40,10 +40,6 @@ */ private final Map<String, String> files = new HashMap<String, String>(); - /** Create a ArchFaceProvider. */ - public ArchFaceProvider() { - } - /** * Report position of a face for loading it later. * @param faceName face name to get image for, excluding path and ending Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2007-01-11 21:02:14 UTC (rev 1577) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2007-01-11 21:09:12 UTC (rev 1578) @@ -202,13 +202,6 @@ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** - * Create an FaceObjects container. - */ - public FaceObjects() { - super(); - } - - /** * Adds a new face object. * @param faceName name of face, e.g. <samp>"robe.101"</samp> * @param originalFilename original filename, e.g. <samp>"arch/objects/misc/robe.101.png"</samp> Modified: trunk/daimonin/src/daieditor/gui/map/MapViewSettings.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapViewSettings.java 2007-01-11 21:02:14 UTC (rev 1577) +++ trunk/daimonin/src/daieditor/gui/map/MapViewSettings.java 2007-01-11 21:09:12 UTC (rev 1578) @@ -49,11 +49,6 @@ /** The MapViewSettingsListeners to inform of changes. */ private EventListenerList listenerList = new EventListenerList(); - /** Create MapViewSettings. */ - public MapViewSettings() { - - } - /** * Register a MapViewSettingsListener. * @param listener MapViewSettingsListener to register Modified: trunk/daimonin/src/daieditor/map/validation/DefaultErrorCollector.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/DefaultErrorCollector.java 2007-01-11 21:02:14 UTC (rev 1577) +++ trunk/daimonin/src/daieditor/map/validation/DefaultErrorCollector.java 2007-01-11 21:09:12 UTC (rev 1578) @@ -34,10 +34,6 @@ /** Errors. */ private final List<ValidationError> errors = new ArrayList<ValidationError>(); - /** Create a DefaultErrorCollector. */ - public DefaultErrorCollector() { - } - /** {@inheritDoc} */ public void collect(final ValidationError error) { errors.add(error); Modified: trunk/daimonin/src/daieditor/map/validation/checks/MapDifficultyChecker.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/MapDifficultyChecker.java 2007-01-11 21:02:14 UTC (rev 1577) +++ trunk/daimonin/src/daieditor/map/validation/checks/MapDifficultyChecker.java 2007-01-11 21:09:12 UTC (rev 1578) @@ -12,12 +12,6 @@ */ public class MapDifficultyChecker extends AbstractValidator implements MapValidator { - /** - * Create a MapDifficultyChecker. - */ - public MapDifficultyChecker() { - } - /** {@inheritDoc} */ public void validate(final MapModel mapModel, final ErrorCollector errorCollector) { final MapArchObject mapArch = mapModel.getMapArchObject(); Modified: trunk/src/app/net/sf/gridarta/gameobject/Collector.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Collector.java 2007-01-11 21:02:14 UTC (rev 1577) +++ trunk/src/app/net/sf/gridarta/gameobject/Collector.java 2007-01-11 21:09:12 UTC (rev 1578) @@ -29,12 +29,6 @@ private File destDir; /** - * Create a Collector. - */ - public Collector() { - } - - /** * Sets the Collectables to collect. * @param collectables Collectables to collect. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-11 21:19:59
|
Revision: 1579 http://svn.sourceforge.net/gridarta/?rev=1579&view=rev Author: akirschbaum Date: 2007-01-11 13:19:59 -0800 (Thu, 11 Jan 2007) Log Message: ----------- Make fields private. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/gui/ArchComboBox.java trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java trunk/crossfire/src/cfeditor/parameter/DoubleParameter.java trunk/crossfire/src/cfeditor/parameter/IntegerParameter.java trunk/daimonin/src/daieditor/CFTreasureListTree.java trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxDocument.java trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2007-01-11 21:09:12 UTC (rev 1578) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2007-01-11 21:19:59 UTC (rev 1579) @@ -839,17 +839,17 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - final ImageIcon tlistIcon; // icon for treasurelists + private final ImageIcon tlistIcon; // icon for treasurelists - final ImageIcon tlistOneIcon; // icon for treasure-one-lists + private final ImageIcon tlistOneIcon; // icon for treasure-one-lists - final ImageIcon yesIcon; // icon for "YES" objects + private final ImageIcon yesIcon; // icon for "YES" objects - final ImageIcon noIcon; // icon for "NO" objects + private final ImageIcon noIcon; // icon for "NO" objects - final ImageIcon noface; // icon for faceless arches + private final ImageIcon noface; // icon for faceless arches - final ImageIcon noarch; // icon for unknown arches + private final ImageIcon noarch; // icon for unknown arches /** * Create a TreasureCellRenderer: load icons and initialize fonts. Modified: trunk/crossfire/src/cfeditor/gui/ArchComboBox.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2007-01-11 21:09:12 UTC (rev 1578) +++ trunk/crossfire/src/cfeditor/gui/ArchComboBox.java 2007-01-11 21:19:59 UTC (rev 1579) @@ -83,15 +83,15 @@ public class ArchComboBoxEditor implements ComboBoxEditor { - JPanel editorPanel = null; + private JPanel editorPanel = null; - JLabel icon = null; + private JLabel icon = null; - JTextField editor = null; + private JTextField editor = null; - JPopupMenu popup; + private JPopupMenu popup; - boolean locked = false; + private boolean locked = false; public synchronized void lockEditor() { locked = true; Modified: trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java 2007-01-11 21:09:12 UTC (rev 1578) +++ trunk/crossfire/src/cfeditor/gui/selectedsquare/SelectedSquareView.java 2007-01-11 21:19:59 UTC (rev 1579) @@ -77,7 +77,7 @@ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); /** The main control for this view. */ - @NotNull final CMainControl mainControl; + @NotNull private final CMainControl mainControl; /** The "Import..." button. */ private final JList list; Modified: trunk/crossfire/src/cfeditor/parameter/DoubleParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/DoubleParameter.java 2007-01-11 21:09:12 UTC (rev 1578) +++ trunk/crossfire/src/cfeditor/parameter/DoubleParameter.java 2007-01-11 21:19:59 UTC (rev 1579) @@ -91,9 +91,9 @@ /* we do not use the Double.MAX or JTextField will be *very* large. So * we fall back to [0, 1] range (useful for randoms) */ - double min = 0.0; + private double min = 0.0; - double max = 1.0; + private double max = 1.0; public double getMax() { return max; Modified: trunk/crossfire/src/cfeditor/parameter/IntegerParameter.java =================================================================== --- trunk/crossfire/src/cfeditor/parameter/IntegerParameter.java 2007-01-11 21:09:12 UTC (rev 1578) +++ trunk/crossfire/src/cfeditor/parameter/IntegerParameter.java 2007-01-11 21:19:59 UTC (rev 1579) @@ -88,9 +88,9 @@ private static class IntegerConfig { - int min = Integer.MIN_VALUE; + private int min = Integer.MIN_VALUE; - int max = Integer.MAX_VALUE; + private int max = Integer.MAX_VALUE; public int getMax() { return max; Modified: trunk/daimonin/src/daieditor/CFTreasureListTree.java =================================================================== --- trunk/daimonin/src/daieditor/CFTreasureListTree.java 2007-01-11 21:09:12 UTC (rev 1578) +++ trunk/daimonin/src/daieditor/CFTreasureListTree.java 2007-01-11 21:19:59 UTC (rev 1579) @@ -857,17 +857,17 @@ /** Serial Version UID. */ private static final long serialVersionUID = 1L; - final ImageIcon tlistIcon; // icon for treasurelists + private final ImageIcon tlistIcon; // icon for treasurelists - final ImageIcon tlistOneIcon; // icon for treasure-one-lists + private final ImageIcon tlistOneIcon; // icon for treasure-one-lists - final ImageIcon yesIcon; // icon for "YES" objects + private final ImageIcon yesIcon; // icon for "YES" objects - final ImageIcon noIcon; // icon for "NO" objects + private final ImageIcon noIcon; // icon for "NO" objects - final ImageIcon noface; // icon for faceless arches + private final ImageIcon noface; // icon for faceless arches - final ImageIcon noarch; // icon for unknown arches + private final ImageIcon noarch; // icon for unknown arches /** * Create a TreasureCellRenderer: load icons and initialize fonts. Modified: trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java =================================================================== --- trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java 2007-01-11 21:09:12 UTC (rev 1578) +++ trunk/daimonin/src/daieditor/gui/selectedsquare/SelectedSquareView.java 2007-01-11 21:19:59 UTC (rev 1579) @@ -81,7 +81,7 @@ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); /** The main control for this view. */ - @NotNull final CMainControl mainControl; + @NotNull private final CMainControl mainControl; /** The "Import..." button. */ private final JList list; Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2007-01-11 21:09:12 UTC (rev 1578) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2007-01-11 21:19:59 UTC (rev 1579) @@ -1443,67 +1443,67 @@ static final String BOTTOM = "bottom"; - static JEditTextArea focusedComponent; + private static JEditTextArea focusedComponent; - static final Timer caretTimer; + private static final Timer caretTimer; - final TextAreaPainter painter; + private final TextAreaPainter painter; - JPopupMenu popup; + private JPopupMenu popup; - final EventListenerList listenerList; + private final EventListenerList listenerList; - final MutableCaretEvent caretEvent; + private final MutableCaretEvent caretEvent; - boolean caretBlinks; + private boolean caretBlinks; - boolean caretVisible; + private boolean caretVisible; - boolean blink; + private boolean blink; - boolean editable; + private boolean editable; - int firstLine; + private int firstLine; - int visibleLines; + private int visibleLines; - int electricScroll; + private int electricScroll; - int horizontalOffset; + private int horizontalOffset; - final JScrollBar vertical; + private final JScrollBar vertical; - final JScrollBar horizontal; + private final JScrollBar horizontal; - boolean scrollBarsInitialized; + private boolean scrollBarsInitialized; - InputHandler inputHandler; + private InputHandler inputHandler; - SyntaxDocument document; + private SyntaxDocument document; - final DocumentHandler documentHandler; + private final DocumentHandler documentHandler; - final Segment lineSegment; + private final Segment lineSegment; - int selectionStart; + private int selectionStart; - int selectionStartLine; + private int selectionStartLine; - int selectionEnd; + private int selectionEnd; - int selectionEndLine; + private int selectionEndLine; - boolean biasLeft; + private boolean biasLeft; - int bracketPosition; + private int bracketPosition; - int bracketLine; + private int bracketLine; - int magicCaret; + private int magicCaret; - boolean overwrite; + private boolean overwrite; - boolean rectSelect; + private boolean rectSelect; void fireCaretEvent() { for (final CaretListener listener : listenerList.getListeners(CaretListener.class)) { Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxDocument.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxDocument.java 2007-01-11 21:09:12 UTC (rev 1578) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxDocument.java 2007-01-11 21:19:59 UTC (rev 1579) @@ -116,7 +116,7 @@ } // protected members - TokenMarker tokenMarker; + private TokenMarker tokenMarker; /** * We overwrite this method to update the token marker state immediately so Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java 2007-01-11 21:09:12 UTC (rev 1578) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java 2007-01-11 21:19:59 UTC (rev 1579) @@ -51,47 +51,47 @@ private final Segment currentLine; // protected members - final JEditTextArea textArea; + private final JEditTextArea textArea; - SyntaxStyle[] styles; + private SyntaxStyle[] styles; - Color caretColor; + private Color caretColor; - Color selectionColor; + private Color selectionColor; - Color lineHighlightColor; + private Color lineHighlightColor; - Color bracketHighlightColor; + private Color bracketHighlightColor; - Color eolMarkerColor; + private Color eolMarkerColor; - boolean blockCaret; + private boolean blockCaret; - boolean lineHighlight; + private boolean lineHighlight; - boolean bracketHighlight; + private boolean bracketHighlight; - boolean paintInvalid; + private boolean paintInvalid; - boolean eolMarkers; + private boolean eolMarkers; - final int cols; + private final int cols; - final int rows; + private final int rows; - int tabSize; + private int tabSize; - FontMetrics fm; + private FontMetrics fm; - boolean needMetricsUpdate; // need update for font metrics when true + private boolean needMetricsUpdate; // need update for font metrics when true - boolean needLineUpdate; // need update for line height when true + private boolean needLineUpdate; // need update for line height when true - int defaultLineHeight; + private int defaultLineHeight; - int defaultCharWidth; + private int defaultCharWidth; - Highlight highlights; + private Highlight highlights; /** * Creates a new repaint manager. This should be not be called This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-11 21:49:44
|
Revision: 1575 http://svn.sourceforge.net/gridarta/?rev=1575&view=rev Author: akirschbaum Date: 2007-01-11 12:59:56 -0800 (Thu, 11 Jan 2007) Log Message: ----------- Add final modifier. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/Spells.java trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java trunk/daimonin/src/daieditor/Spells.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java trunk/src/app/net/sf/gridarta/gameobject/GameObject.java trunk/src/app/net/sf/gridarta/gui/maptilelist/MapTileSelection.java trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-11 20:53:14 UTC (rev 1574) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-11 20:59:56 UTC (rev 1575) @@ -534,7 +534,7 @@ * @param load <code>true</code> if archetypes should be loaded from the collection, otherwise (scanning arch tree) <code>false</code>. * @param mapTileBottom <code>true</code> if the map tile list should be displayed on the window bottom, otherwise (right border) <code>false</code>. */ - void setGlobalSettings(final String arch, String map, final String script, final boolean baseImageSet, final boolean load, final boolean mapTileBottom) { + void setGlobalSettings(final String arch, final String map, final String script, final boolean baseImageSet, final boolean load, final boolean mapTileBottom) { CSettings.getInstance(IGUIConstants.APP_NAME).setProperty(USE_IMAGESET, baseImageSet ? "base" : "none"); readGlobalSettings(); Modified: trunk/crossfire/src/cfeditor/Spells.java =================================================================== --- trunk/crossfire/src/cfeditor/Spells.java 2007-01-11 20:53:14 UTC (rev 1574) +++ trunk/crossfire/src/cfeditor/Spells.java 2007-01-11 20:59:56 UTC (rev 1575) @@ -120,7 +120,7 @@ if (IGUIConstants.CONFIG_DIR != null && IGUIConstants.CONFIG_DIR.length() > 0) { final String baseDir = getSpellsBaseDir(); - File dir = new File(baseDir); + final File dir = new File(baseDir); if (!dir.exists() || !dir.isDirectory()) { // FIXME What if dir exists and is not a directory? mkdir will fail then! // create the config dir new File("resource").mkdir(); Modified: trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java 2007-01-11 20:53:14 UTC (rev 1574) +++ trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java 2007-01-11 20:59:56 UTC (rev 1575) @@ -232,12 +232,12 @@ } /** {@inheritDoc} */ - public void mapCursorChangedPos(@NotNull MapCursorEvent e) { + public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { // ignore } /** {@inheritDoc} */ - public void mapCursorChangedMode(@NotNull MapCursorEvent e) { + public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { refreshMenus(); } Modified: trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java 2007-01-11 20:53:14 UTC (rev 1574) +++ trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java 2007-01-11 20:59:56 UTC (rev 1575) @@ -394,7 +394,7 @@ final String shopItems; final String shopRace; final String region; - Size2D mapSize; + final Size2D mapSize; final int enterX; final int enterY; try { Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java 2007-01-11 20:53:14 UTC (rev 1574) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java 2007-01-11 20:59:56 UTC (rev 1575) @@ -77,7 +77,7 @@ private final MapControlListener<MapControl> mapControlListener = new MapControlListener<MapControl>() { /** {@inheritDoc} */ - public void modifiedChanged(@NotNull MapControl mapControl) { + public void modifiedChanged(@NotNull final MapControl mapControl) { refresh(); } Modified: trunk/daimonin/src/daieditor/Spells.java =================================================================== --- trunk/daimonin/src/daieditor/Spells.java 2007-01-11 20:53:14 UTC (rev 1574) +++ trunk/daimonin/src/daieditor/Spells.java 2007-01-11 20:59:56 UTC (rev 1575) @@ -89,7 +89,7 @@ if (IGUIConstants.CONFIG_DIR != null && IGUIConstants.CONFIG_DIR.length() > 0) { final String baseDir = getSpellsBaseDir(); - File dir = new File(baseDir); + final File dir = new File(baseDir); if (!dir.exists() || !dir.isDirectory()) { // FIXME What if dir exists and is not a directory? mkdir will fail then! // create the config dir new File("resource").mkdir(); Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java 2007-01-11 20:53:14 UTC (rev 1574) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObject.java 2007-01-11 20:59:56 UTC (rev 1575) @@ -65,8 +65,8 @@ */ AnimationObject(final String animName, final String animList, final String path) { super(animName, animList, path); - int tmpFacings = 0; - boolean first = true; + final int tmpFacings = 0; + final boolean first = true; for (final String line : animList.split("\n")) { if (first && line.startsWith("facings ")) { } else { Modified: trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java 2007-01-11 20:53:14 UTC (rev 1574) +++ trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java 2007-01-11 20:59:56 UTC (rev 1575) @@ -232,12 +232,12 @@ } /** {@inheritDoc} */ - public void mapCursorChangedPos(@NotNull MapCursorEvent e) { + public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { // ignore } /** {@inheritDoc} */ - public void mapCursorChangedMode(@NotNull MapCursorEvent e) { + public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { refreshMenus(); } Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java 2007-01-11 20:53:14 UTC (rev 1574) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java 2007-01-11 20:59:56 UTC (rev 1575) @@ -86,7 +86,7 @@ private final MapControlListener<MapControl> mapControlListener = new MapControlListener<MapControl>() { /** {@inheritDoc} */ - public void modifiedChanged(@NotNull MapControl mapControl) { + public void modifiedChanged(@NotNull final MapControl mapControl) { refresh(); } Modified: trunk/src/app/net/sf/gridarta/gameobject/GameObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-01-11 20:53:14 UTC (rev 1574) +++ trunk/src/app/net/sf/gridarta/gameobject/GameObject.java 2007-01-11 20:59:56 UTC (rev 1575) @@ -337,7 +337,7 @@ * @see #getContainer() */ @NotNull public G getTopContainer() { - G topContainer; + final G topContainer; if (isInContainer()) { assert container != null; topContainer = ((G) container).getTopContainer(); Modified: trunk/src/app/net/sf/gridarta/gui/maptilelist/MapTileSelection.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/maptilelist/MapTileSelection.java 2007-01-11 20:53:14 UTC (rev 1574) +++ trunk/src/app/net/sf/gridarta/gui/maptilelist/MapTileSelection.java 2007-01-11 20:59:56 UTC (rev 1575) @@ -87,7 +87,7 @@ * * @return <code>true</code> if the state has changed */ - public boolean setMapSquare(@Nullable MapSquare<G, A> mapSquare) { + public boolean setMapSquare(@Nullable final MapSquare<G, A> mapSquare) { if (this.mapSquare == mapSquare) { return false; } Modified: trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java 2007-01-11 20:53:14 UTC (rev 1574) +++ trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java 2007-01-11 20:59:56 UTC (rev 1575) @@ -121,12 +121,12 @@ } /** {@inheritDoc} */ - public void addMapControlListener(@NotNull MapControlListener<? extends MapControl> listener) { + public void addMapControlListener(@NotNull final MapControlListener<? extends MapControl> listener) { listenerList.add(MapControlListener.class, listener); } /** {@inheritDoc} */ - public void removeMapControlListener(@NotNull MapControlListener<? extends MapControl> listener) { + public void removeMapControlListener(@NotNull final MapControlListener<? extends MapControl> listener) { listenerList.remove(MapControlListener.class, listener); } Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2007-01-11 20:53:14 UTC (rev 1574) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2007-01-11 20:59:56 UTC (rev 1575) @@ -1118,7 +1118,7 @@ final int lineEnd = lineElement.getEndOffset() - 1; lineStart = Math.min(lineStart + start, lineEnd); - int lineLen = Math.min(end - start, lineEnd - lineStart); + final int lineLen = Math.min(end - start, lineEnd - lineStart); getText(lineStart, lineLen, seg); buf.append(seg.array, seg.offset, seg.count); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-11 23:13:59
|
Revision: 1584 http://svn.sourceforge.net/gridarta/?rev=1584&view=rev Author: akirschbaum Date: 2007-01-11 15:14:00 -0800 (Thu, 11 Jan 2007) Log Message: ----------- Convert explicit call to MapCursorControl.refreshMenus() to callbacks. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-11 22:44:50 UTC (rev 1583) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-11 23:14:00 UTC (rev 1584) @@ -1408,7 +1408,6 @@ currentMap = map; refreshMenusAndToolbars(); - mapCursorControl.refreshMenus(); //StatusBar.getInstance().setLevelInfo(level); Modified: trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java 2007-01-11 22:44:50 UTC (rev 1583) +++ trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java 2007-01-11 23:14:00 UTC (rev 1584) @@ -29,12 +29,14 @@ import cfeditor.map.MapControl; import java.awt.Point; import javax.swing.Action; +import net.sf.gridarta.MainControlListener; 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.japi.swing.ActionFactory; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * This class processes events from the cursor menu. @@ -74,6 +76,28 @@ private final Action aArchAttributes = ACTION_FACTORY.createAction(true, "archAttributes", this); /** + * The main control listener used to detect changed current maps. + */ + private final MainControlListener<MapControl> mainControlListener = new MainControlListener<MapControl>() { + + /** {@inheritDoc} */ + public void currentMapChanged(@Nullable final MapControl mapControl) { + refreshMenus(); + } + + /** {@inheritDoc} */ + public void mapCreated(@NotNull final MapControl mapControl) { + // ignore + } + + /** {@inheritDoc} */ + public void mapClosing(@NotNull final MapControl mapControl) { + // ignore + } + + }; + + /** * Create a MapCursorControl. * @param mainControl MainControl to use (used for getting the current map etc.) */ @@ -82,6 +106,7 @@ ACTION_FACTORY.createActions(true, this, directionsGo); + mainControl.addMainControlListener(mainControlListener); refreshMenus(); } @@ -244,7 +269,7 @@ /** * Enable/disable menu entries based on the current cursor state. */ - public void refreshMenus() { + private void refreshMenus() { final MapControl mapControl = mainControl.getCurrentMap(); final MapCursor mapCursor = mapControl != null ? mapControl.getMapCursor() : null; Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-01-11 22:44:50 UTC (rev 1583) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-01-11 23:14:00 UTC (rev 1584) @@ -1607,7 +1607,6 @@ currentMap = map; refreshMenusAndToolbars(); - mapCursorControl.refreshMenus(); //StatusBar.getInstance().setLevelInfo(level); Modified: trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java 2007-01-11 22:44:50 UTC (rev 1583) +++ trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java 2007-01-11 23:14:00 UTC (rev 1584) @@ -29,12 +29,14 @@ import daieditor.map.MapControl; import java.awt.Point; import javax.swing.Action; +import net.sf.gridarta.MainControlListener; 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.japi.swing.ActionFactory; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * This class processes events from the cursor menu. @@ -74,6 +76,28 @@ private final Action aArchAttributes = ACTION_FACTORY.createAction(true, "archAttributes", this); /** + * The main control listener used to detect changed current maps. + */ + private final MainControlListener<MapControl> mainControlListener = new MainControlListener<MapControl>() { + + /** {@inheritDoc} */ + public void currentMapChanged(@Nullable final MapControl mapControl) { + refreshMenus(); + } + + /** {@inheritDoc} */ + public void mapCreated(@NotNull final MapControl mapControl) { + // ignore + } + + /** {@inheritDoc} */ + public void mapClosing(@NotNull final MapControl mapControl) { + // ignore + } + + }; + + /** * Create a MapCursorControl. * @param mainControl MainControl to use (used for getting the current map etc.) */ @@ -82,6 +106,7 @@ ACTION_FACTORY.createActions(true, this, directionsGo); + mainControl.addMainControlListener(mainControlListener); refreshMenus(); } @@ -244,7 +269,7 @@ /** * Enable/disable menu entries based on the current cursor state. */ - public void refreshMenus() { + private void refreshMenus() { final MapControl mapControl = mainControl.getCurrentMap(); final MapCursor mapCursor = mapControl != null ? mapControl.getMapCursor() : null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-11 23:35:50
|
Revision: 1585 http://svn.sourceforge.net/gridarta/?rev=1585&view=rev Author: akirschbaum Date: 2007-01-11 15:35:51 -0800 (Thu, 11 Jan 2007) Log Message: ----------- Correctly update cursor information in status bar after switching maps. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/src/app/net/sf/gridarta/gui/StatusBar.java Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2007-01-11 23:14:00 UTC (rev 1584) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2007-01-11 23:35:51 UTC (rev 1585) @@ -126,7 +126,6 @@ mapCursor.addMapCursorListener(this); if (!mapControl.isPickmap()) { mapCursor.addMapCursorListener(mainControl.getMainView().getMapTileListControl().getMapTileListView()); - mapCursor.addMapCursorListener(mainControl.getMainView().getStatusBar()); mapCursor.addMapCursorListener(mainControl.getMapCursorControl()); } this.mainControl = mainControl; Modified: trunk/daimonin/src/daieditor/CMapViewBasic.java =================================================================== --- trunk/daimonin/src/daieditor/CMapViewBasic.java 2007-01-11 23:14:00 UTC (rev 1584) +++ trunk/daimonin/src/daieditor/CMapViewBasic.java 2007-01-11 23:35:51 UTC (rev 1585) @@ -127,7 +127,6 @@ mapCursor.addMapCursorListener(this); if (!mapControl.isPickmap()) { mapCursor.addMapCursorListener(mainControl.getMainView().getMapTileListControl().getMapTileListView()); - mapCursor.addMapCursorListener(mainControl.getMainView().getStatusBar()); mapCursor.addMapCursorListener(mainControl.getMapCursorControl()); } this.mainControl = mainControl; Modified: trunk/src/app/net/sf/gridarta/gui/StatusBar.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/StatusBar.java 2007-01-11 23:14:00 UTC (rev 1584) +++ trunk/src/app/net/sf/gridarta/gui/StatusBar.java 2007-01-11 23:35:51 UTC (rev 1585) @@ -37,10 +37,12 @@ import javax.swing.JPanel; import javax.swing.border.BevelBorder; import net.sf.gridarta.MainControl; +import net.sf.gridarta.MainControlListener; import net.sf.gridarta.gui.map.LevelRenderer; 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.map.MapControl; import net.sf.japi.swing.ActionFactory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -56,7 +58,7 @@ * @author <a href="mailto:dlv...@gm...">Daniel Viegas</a> * @todo Separate labels and methods for mouse coordinates */ -public final class StatusBar extends JPanel implements MapCursorListener, MouseMotionListener { +public final class StatusBar extends JPanel implements MouseMotionListener { /** Serial Version UID. */ private static final long serialVersionUID = 1L; @@ -83,6 +85,51 @@ private final Point mouseMapTmp = new Point(); /** + * The map control for which {@link mapCursorListener} is registered, or + * <code>null</code> if none is registered. + */ + @Nullable private MapControl mapControl = null; + + /** + * The map cursor listener to detect map cursor changes. + */ + private final MapCursorListener mapCursorListener = new MapCursorListener() { + + /** {@inheritDoc} */ + public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { + mapCursorChanged(e.getSource()); + } + + /** {@inheritDoc} */ + public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { + mapCursorChanged(e.getSource()); + } + + }; + + /** + * The main control listener to detect current map changes. + */ + private final MainControlListener<MapControl> mainControlListener = new MainControlListener<MapControl>() { + + /** {@inheritDoc} */ + public void currentMapChanged(@Nullable final MapControl mapControl) { + setCurrentMap(mapControl); + } + + /** {@inheritDoc} */ + public void mapCreated(@NotNull final MapControl mapControl) { + // ignore + } + + /** {@inheritDoc} */ + public void mapClosing(@NotNull final MapControl mapControl) { + // ignore + } + + }; + + /** * Constructs a statusbar that has the given main controller object set * as its controller. * @param mainControl The MainControl for statistical data. @@ -115,6 +162,8 @@ memory = new JLabel(" "); memory.setBorder(new BevelBorder(BevelBorder.LOWERED)); add(memory, gbc); + + mainControl.addMainControlListener(mainControlListener); } /** @@ -168,21 +217,15 @@ return null; } - public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { - mapCursorChanged(e.getSource()); - } - - public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { - mapCursorChanged(e.getSource()); - } - /** * Set coordinates of MapCursor to cursor label and the offset when in drag mode. * @param mapCursor MapCursor to set coordinates from. */ - private void mapCursorChanged(final MapCursor mapCursor) { + private void mapCursorChanged(@Nullable final MapCursor mapCursor) { final String formatCursor; - if (mapCursor.isActive()) { + if (mapCursor == null) { + formatCursor = ""; + } else if (mapCursor.isActive()) { final Point pos = mapCursor.getLocation(); assert pos != null; final int cursorX = pos.x; @@ -229,4 +272,18 @@ } } + private void setCurrentMap(@Nullable final MapControl mapControl) { + if (this.mapControl != null) { + this.mapControl.getMapCursor().removeMapCursorListener(mapCursorListener); + } + + this.mapControl = mapControl; + + if (this.mapControl != null) { + this.mapControl.getMapCursor().addMapCursorListener(mapCursorListener); + } + + mapCursorChanged(mapControl == null ? null : mapControl.getMapCursor()); + } + } // class StatusBar This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-13 13:07:22
|
Revision: 1589 http://svn.sourceforge.net/gridarta/?rev=1589&view=rev Author: akirschbaum Date: 2007-01-13 05:07:21 -0800 (Sat, 13 Jan 2007) Log Message: ----------- Remove MapArchObject.[gs]etFileName(). Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/MapViewIFrame.java trunk/crossfire/src/cfeditor/gui/NewMapDialog.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java trunk/crossfire/src/cfeditor/map/MapArchObject.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CopyBuffer.java trunk/daimonin/src/daieditor/MapViewIFrame.java trunk/daimonin/src/daieditor/gui/NewMapDialog.java trunk/daimonin/src/daieditor/gui/map/MapTilePane.java trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java trunk/daimonin/src/daieditor/map/MapArchObject.java trunk/daimonin/src/daieditor/map/MapControl.java trunk/src/app/net/sf/gridarta/io/AbstractMapReader.java trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java trunk/src/app/net/sf/gridarta/map/MapArchObject.java trunk/src/app/net/sf/gridarta/map/MapControl.java trunk/src/app/net/sf/gridarta/map/MapControlListener.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -924,11 +924,12 @@ archetypeParser.sortTempList(objects); // sort the list (put multiparts at the end) final MapControl control = newLevel(objects, maparch, show, initial); // init the map + control.setMapFile(file); + control.setMapFileName(file.getPath()); if (show) { // finally, show the map and refresh toolbars - currentMap.setMapFile(file); - currentMap.setActiveEditType(tileEdit); // map is loaded with current view settings - currentMap.resetModified(); + control.setActiveEditType(tileEdit); // map is loaded with current view settings + control.resetModified(); refreshMenusAndToolbars(); } Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -74,7 +74,6 @@ this.mainControl = mainControl; // link main control in mapArch = new MapArchObject(); - mapArch.setFileName("cb"); mapArch.setMapName("cb"); } @@ -131,6 +130,7 @@ mapArch.setMapSize(new Size2D(selRec.width + 1, selRec.height + 1)); copyMapCtrl = new MapControl(mainControl, null, mapArch, false, null); // new MapControl + copyMapCtrl.setMapFileName("cb"); copyMap = copyMapCtrl.getMapModel(); if (wasEmpty) { Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -112,6 +112,11 @@ updateTitle(); } + /** {@inheritDoc} */ + public void mapFileNameChanged(@NotNull final MapControl mapControl) { + updateTitle(); + } + }; /** Modified: trunk/crossfire/src/cfeditor/gui/NewMapDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/NewMapDialog.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/crossfire/src/cfeditor/gui/NewMapDialog.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -48,6 +48,7 @@ import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; import net.sf.gridarta.Size2D; +import net.sf.gridarta.map.MapControl; import net.sf.gridarta.map.MapType; import net.sf.japi.swing.ActionFactory; @@ -245,10 +246,8 @@ // set map name and file name if (mapType == MapType.GAMEMAP) { maparch.setMapName(mapName); - maparch.setFileName(filename != null ? filename : IGUIConstants.DEF_MAPFNAME); } else if (mapType == MapType.PICKMAP) { maparch.setMapName("pickmap"); - maparch.setFileName(mapName); } // default map text: @@ -257,9 +256,10 @@ maparch.addText("Date: " + (today.get(Calendar.MONTH) + 1) + "/" + today.get(Calendar.DAY_OF_MONTH) + "/" + today.get(Calendar.YEAR)); if (mapType == MapType.GAMEMAP) { - mainControl.newLevel(null, maparch, true, null); + final MapControl mapControl = mainControl.newLevel(null, maparch, true, null); + mapControl.setMapFileName(filename != null ? filename : IGUIConstants.DEF_MAPFNAME); } else if (mapType == MapType.PICKMAP) { - return mainControl.getMainView().getPickmapChooserControl().addNewPickmap(parent, maparch); + return mainControl.getMainView().getPickmapChooserControl().addNewPickmap(parent, maparch, mapName); } return true; Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/Actions.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -81,6 +81,11 @@ refresh(); } + /** {@inheritDoc} */ + public void mapFileNameChanged(@NotNull final MapControl mapControl) { + // ignore + } + }; /** Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -162,11 +162,12 @@ * Create a new pickmap and display it. * @param parent the parent component to be used for error messages * @param maparch MapArchObject containing map name and -size + * @param pickmapName the pickmap name * @return <code>true</code> if the pickmap was added, <code>false</code> * if an error has occurred */ - public boolean addNewPickmap(final Component parent, final MapArchObject maparch) { - final File mapFile = new File(IGUIConstants.PICKMAP_DIR, maparch.getFileName()); + public boolean addNewPickmap(final Component parent, final MapArchObject maparch, @NotNull final String pickmapName) { + final File mapFile = new File(IGUIConstants.PICKMAP_DIR, pickmapName); if (mapFile.exists()) { ACTION_FACTORY.showMessageDialog(parent, "pickmapExists", mapFile); return false; Modified: trunk/crossfire/src/cfeditor/map/MapArchObject.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapArchObject.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/crossfire/src/cfeditor/map/MapArchObject.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -482,18 +482,8 @@ return loreText.toString(); } - /** - * Parsing the MapArchObject. This special object has it's own parser now - * because it must be easily expandable for possible features. Who knows - * how much information this Object might contain in future? - * @param reader <code>BufferedReader</code> to the mapfile - * @param fname file name of the mapfile (relative name, no path) - * @return true if reading the MapArchObject succeeded with sane results, - * otherwise false - * @throws IOException in case of I/O problems - */ - public boolean parseMapArch(@NotNull final BufferedReader reader, @NotNull final String fname) throws IOException { - setFileName(fname); + /** {@inheritDoc} */ + public boolean parseMapArch(@NotNull final BufferedReader reader) throws IOException { String line2; // input line, includes leading and trailing white space boolean loreflag = false; // flag for lore-text boolean archflag = false; // flag for arch<->end Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -69,6 +69,10 @@ private File mapFile; + /** The filename of this map. */ + // TODO: Rename because the filename is a URI now. + @NotNull private String mapFileName = "<new map>"; + /** * Contains the edit types that have already been (requested and) * calculated (edit types get calculated only when needed to save time). @@ -250,17 +254,26 @@ return mapModel.isPointValid(pos); } - public String getMapFileName() { - return mapModel.getMapArchObject().getFileName(); + /** {@inheritDoc} */ + @NotNull public String getMapFileName() { + return mapFileName; } - public void setMapFileName(final String fname) { + /** {@inheritDoc} */ + public void setMapFileName(@NotNull final String mapFileName) { + if (this.mapFileName.equals(mapFileName)) { + return; + } + + this.mapFileName = mapFileName; + + fireMapFileNameChanged(); + if (mapViewFrame != null) { - final String title = fname + " [ " + mapModel.getMapArchObject().getMapName() + " ]"; + final String title = mapFileName + " [ " + mapModel.getMapArchObject().getMapName() + " ]"; assert mapViewFrame != null; mapViewFrame.setTitle(title); } - mapModel.getMapArchObject().setFileName(fname); } public boolean containsArchObject(final Point pos) { @@ -290,7 +303,7 @@ // we need to link the full path & save the map at creation time // so the pickmap menu can handle it right try { - mapModel.getMapArchObject().setFileName(mapFile.getCanonicalPath()); + setMapFileName(mapFile.getCanonicalPath()); } catch (final IOException e) { // TODO } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -1142,6 +1142,7 @@ // finally, show the map and refresh toolbars newMap.setMapFile(file); + newMap.setMapFileName(file.getPath()); newMap.setActiveEditType(tileEdit); // map is loaded with current view settings newMap.resetModified(); if (view) { Modified: trunk/daimonin/src/daieditor/CopyBuffer.java =================================================================== --- trunk/daimonin/src/daieditor/CopyBuffer.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/daimonin/src/daieditor/CopyBuffer.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -74,7 +74,6 @@ this.mainControl = mainControl; // link main control in mapArch = new MapArchObject(); - mapArch.setFileName("cb"); mapArch.setMapName("cb"); } @@ -131,6 +130,7 @@ mapArch.setMapSize(new Size2D(selRec.width + 1, selRec.height + 1)); copyMapCtrl = new MapControl(mainControl, null, mapArch, false, false); // new MapControl + copyMapCtrl.setMapFileName("cb"); copyMap = copyMapCtrl.getMapModel(); if (wasEmpty) { Modified: trunk/daimonin/src/daieditor/MapViewIFrame.java =================================================================== --- trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/daimonin/src/daieditor/MapViewIFrame.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -113,6 +113,11 @@ updateTitle(); } + /** {@inheritDoc} */ + public void mapFileNameChanged(@NotNull final MapControl mapControl) { + updateTitle(); + } + }; /** Modified: trunk/daimonin/src/daieditor/gui/NewMapDialog.java =================================================================== --- trunk/daimonin/src/daieditor/gui/NewMapDialog.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/daimonin/src/daieditor/gui/NewMapDialog.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -51,6 +51,7 @@ import javax.swing.border.EtchedBorder; import javax.swing.border.TitledBorder; import net.sf.gridarta.Size2D; +import net.sf.gridarta.map.MapControl; import net.sf.gridarta.map.MapType; import net.sf.japi.swing.ActionFactory; @@ -279,7 +280,6 @@ // set map name, file name and difficulty if (mapType == MapType.GAMEMAP) { maparch.setMapName(mapName); - maparch.setFileName(filename != null ? filename : IGUIConstants.DEF_MAPFNAME); try { maparch.setDifficulty((Integer) mapDifficultyField.getValue()); } catch (final IllegalArgumentException e) { @@ -289,7 +289,6 @@ } } else if (mapType == MapType.PICKMAP) { maparch.setMapName("pickmap"); - maparch.setFileName(mapName); } // default map text: @@ -297,9 +296,10 @@ maparch.addText(String.format("Date: %tF", System.currentTimeMillis())); if (mapType == MapType.GAMEMAP) { - mainControl.newLevel(null, maparch, true); + final MapControl mapControl = mainControl.newLevel(null, maparch, true); + mapControl.setMapFileName(filename != null ? filename : IGUIConstants.DEF_MAPFNAME); } else if (mapType == MapType.PICKMAP) { - return mainControl.getMainView().getPickmapChooserControl().addNewPickmap(parent, maparch); + return mainControl.getMainView().getPickmapChooserControl().addNewPickmap(parent, maparch, mapName); } return true; Modified: trunk/daimonin/src/daieditor/gui/map/MapTilePane.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/daimonin/src/daieditor/gui/map/MapTilePane.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -597,7 +597,7 @@ final MapArchObject otherMap = tileHeader.maparch; final Size2D otherMapSize = otherMap.getMapSize(); if (!mapSize.equals(otherMapSize)) { - ACTION_FACTORY.showMessageDialog(this, "mapErrorDifferentSize", map.getFileName(), mapSize.getWidth(), mapSize.getHeight(), otherMap.getFileName(), otherMapSize.getWidth(), otherMapSize.getHeight()); + ACTION_FACTORY.showMessageDialog(this, "mapErrorDifferentSize", mapControl.getMapFileName(), mapSize.getWidth(), mapSize.getHeight(), tileHeader.map.getMapFileName(), otherMapSize.getWidth(), otherMapSize.getHeight()); return; } for (int ii = 0; ii < 2; ii++) { @@ -711,7 +711,7 @@ } /* is a relative call - so we must attach the folder part of map file name to it */ - final StringBuilder path = new StringBuilder(map.linkPath.substring(0, map.linkPath.length() - map.maparch.getFileName().length())); + final StringBuilder path = new StringBuilder(map.linkPath.substring(0, map.linkPath.length() - map.map.getMapFileName().length())); if (!path.toString().endsWith("/") && !path.toString().endsWith(File.separator)) { path.append(File.separator); } @@ -777,7 +777,7 @@ // first of all we read the map arch (if that fails we throw an exception) final MapArchObject maparch = new MapArchObject(); - if (!maparch.parseMapArch(myInput, file.getName())) { + if (!maparch.parseMapArch(myInput)) { return null; // TODO handle this error } Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/Actions.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -90,6 +90,11 @@ refresh(); } + /** {@inheritDoc} */ + public void mapFileNameChanged(@NotNull final MapControl mapControl) { + // ignore + } + }; /** Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -160,11 +160,12 @@ * Create a new pickmap and display it. * @param parent the parent component to be used for error messages * @param maparch MapArchObject containing map name and -size + * @param pickmapName the pickmap name * @return <code>true</code> if the pickmap was added, <code>false</code> * if an error has occurred */ - public boolean addNewPickmap(final Component parent, final MapArchObject maparch) { - final File mapFile = new File(new File(CMainControl.getInstance().getArchDefaultFolder(), IGUIConstants.PICKMAP_DIR), maparch.getFileName()); + public boolean addNewPickmap(final Component parent, final MapArchObject maparch, @NotNull final String pickmapName) { + final File mapFile = new File(new File(CMainControl.getInstance().getArchDefaultFolder(), IGUIConstants.PICKMAP_DIR), pickmapName); if (mapFile.exists()) { ACTION_FACTORY.showMessageDialog(parent, "pickmapExists", mapFile); return false; Modified: trunk/daimonin/src/daieditor/map/MapArchObject.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapArchObject.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/daimonin/src/daieditor/map/MapArchObject.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -403,18 +403,8 @@ return msgText.toString(); } - /** - * Parsing the MapArchObject. This special object has it's own parser now - * because it must be easily expandable for possible features. Who knows - * how much information this Object might contain in future? - * @param reader <code>BufferedReader</code> to the mapfile - * @param fname file name of the mapfile (relative name, no path) - * @return true if reading the MapArchObject succeeded with sane results, - * otherwise false - * @throws IOException in case of I/O problems - */ - public boolean parseMapArch(@NotNull final BufferedReader reader, @NotNull final String fname) throws IOException { - setFileName(fname); + /** {@inheritDoc} */ + public boolean parseMapArch(@NotNull final BufferedReader reader) throws IOException { boolean archflag = false; // flag for arch<->end int width = 0; int height = 0; Modified: trunk/daimonin/src/daieditor/map/MapControl.java =================================================================== --- trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/daimonin/src/daieditor/map/MapControl.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -85,6 +85,10 @@ private File mapFile; + /** The filename of this map. */ + // TODO: Rename because the filename is a URI now. + @NotNull private String mapFileName = "<new map>"; + /** * Action Factory. */ @@ -255,18 +259,27 @@ return mapModel.isPointValid(pos); } + /** {@inheritDoc} */ // TODO: Rename because the filename is a URI now. - public String getMapFileName() { - return mapModel.getMapArchObject().getFileName(); + @NotNull public String getMapFileName() { + return mapFileName; } - public void setMapFileName(final String fname) { + /** {@inheritDoc} */ + public void setMapFileName(@NotNull final String mapFileName) { + if (this.mapFileName.equals(mapFileName)) { + return; + } + + this.mapFileName = mapFileName; + + fireMapFileNameChanged(); + if (mapViewFrame != null) { - final String title = fname + " [ " + mapModel.getMapArchObject().getMapDisplayName() + " ]"; + final String title = mapFileName + " [ " + mapModel.getMapArchObject().getMapDisplayName() + " ]"; assert mapViewFrame != null; mapViewFrame.setTitle(title); } - mapModel.getMapArchObject().setFileName(fname); } /** @@ -287,7 +300,7 @@ // we need to link the full path & save the map at creation time // so the pickmap menu can handle it right try { - mapModel.getMapArchObject().setFileName(mapFile.getCanonicalPath()); + setMapFileName(mapFile.getCanonicalPath()); } catch (final IOException e) { // TODO } Modified: trunk/src/app/net/sf/gridarta/io/AbstractMapReader.java =================================================================== --- trunk/src/app/net/sf/gridarta/io/AbstractMapReader.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/src/app/net/sf/gridarta/io/AbstractMapReader.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -86,10 +86,9 @@ @NotNull public List<G> decodeMapFile() throws IOException { // first of all we read the map arch (if that fails we throw an exception) maparch = createMapArchObject(); - if (!maparch.parseMapArch(myInput, uri)) { + if (!maparch.parseMapArch(myInput)) { throw new InvalidMapFormatException("The file '" + uri + "' does not contain a valid Gridarta (Crossfire, Daimonin) map format!\n"); } - //maparch.setName(uri); // now we read all the ArchObjects // Outer loop: reads "arch ...", inner loop reads until end of arch Modified: trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/src/app/net/sf/gridarta/map/AbstractMapArchObject.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -41,10 +41,6 @@ /** The name of this map. */ @NotNull private String mapName = MAP_NAME_UNNAMED; - /** The filename of this map. */ - // TODO: Rename because the filename is a URI now. - @NotNull private String fileName = "<new map>"; - /** The x coordinate for entering the map. */ private int enterX; @@ -140,22 +136,6 @@ } /** {@inheritDoc} */ - // TODO: Rename because the filename is a URI now. - @NotNull public final String getFileName() { - return fileName; - } - - /** {@inheritDoc} */ - public final void setFileName(@NotNull final String fileName) { - if (this.fileName.equals(fileName)) { - return; - } - - this.fileName = fileName; - setModified(); - } - - /** {@inheritDoc} */ public final int getEnterX() { return enterX; } @@ -264,7 +244,6 @@ protected AbstractMapArchObject(@NotNull final AbstractMapArchObject mapArchObject) { mapSize = mapArchObject.mapSize; mapName = mapArchObject.mapName; - fileName = mapArchObject.fileName; enterX = mapArchObject.enterX; enterY = mapArchObject.enterY; resetTimeout = mapArchObject.resetTimeout; @@ -279,7 +258,6 @@ final AbstractMapArchObject abstractMapArchObject = (AbstractMapArchObject) mapArchObject; mapSize = abstractMapArchObject.mapSize; mapName = abstractMapArchObject.mapName; - fileName = abstractMapArchObject.fileName; enterX = abstractMapArchObject.enterX; enterY = abstractMapArchObject.enterY; resetTimeout = abstractMapArchObject.resetTimeout; @@ -301,7 +279,6 @@ final AbstractMapArchObject mapArchObject = (AbstractMapArchObject) obj; return mapArchObject.mapSize.equals(mapSize) && mapArchObject.mapName.equals(mapName) - && mapArchObject.fileName.equals(fileName) && mapArchObject.enterX == enterX && mapArchObject.enterY == enterY && mapArchObject.resetTimeout == resetTimeout @@ -315,7 +292,6 @@ @Override public int hashCode() { return mapSize.hashCode() + mapName.hashCode() - + fileName.hashCode() + enterX + enterY + resetTimeout Modified: trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/src/app/net/sf/gridarta/map/AbstractMapControl.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -137,4 +137,11 @@ } } + /** Fire a map file name changed event. */ + protected void fireMapFileNameChanged() { + for (final MapControlListener listener : listenerList.getListeners(MapControlListener.class)) { + listener.mapFileNameChanged(this); + } + } + } Modified: trunk/src/app/net/sf/gridarta/map/MapArchObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapArchObject.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/src/app/net/sf/gridarta/map/MapArchObject.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -82,22 +82,6 @@ void setMapName(@NotNull String name); /** - * Get the map filename. - * @return map filename - * @deprecated the filename isn't really an attribute of the MapArchObject. Only use MapControl for this. - * @todo if this remains here, think whether the fileName is really not null or whether a nullable filename makes more sense. - */ - // TODO: Rename because the filename is a URI now. - @Deprecated @NotNull String getFileName(); - - /** - * Set the map fileName. - * @param fileName new map fileName - * @deprecated the fileName isn't really an attribute of the MapArchObject. Only use MapControl for this. - */ - @Deprecated void setFileName(@NotNull String fileName); - - /** * Get enter x coordinate. * @return enter x coordinate. */ @@ -187,12 +171,11 @@ * because it must be easily expandable for possible features. Who knows * how much information this Object might contain in future? * @param reader <code>BufferedReader</code> to the mapfile - * @param fname file name of the mapfile (relative name, no path) * @return true if reading the MapArchObject succeeded with sane results, * otherwise false * @throws IOException in case of I/O problems while reading and parsing the map arch from <var>reader</var>. */ - boolean parseMapArch(BufferedReader reader, String fname) throws IOException; + boolean parseMapArch(BufferedReader reader) throws IOException; /** * Append this MapArchObject as text. Modified: trunk/src/app/net/sf/gridarta/map/MapControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapControl.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/src/app/net/sf/gridarta/map/MapControl.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -89,4 +89,18 @@ */ void removeMapModelListener(@NotNull MapModelListener<G, A> listener); + /** + * Get the map filename. + * @return map filename + * @todo if this remains here, think whether the fileName is really not null or whether a nullable filename makes more sense. + */ + // TODO: Rename because the filename is a URI now. + @NotNull String getMapFileName(); + + /** + * Set the map fileName. + * @param fileName new map fileName + */ + void setMapFileName(@NotNull String mapFileName); + } // interface MapControl Modified: trunk/src/app/net/sf/gridarta/map/MapControlListener.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/MapControlListener.java 2007-01-12 18:37:52 UTC (rev 1588) +++ trunk/src/app/net/sf/gridarta/map/MapControlListener.java 2007-01-13 13:07:21 UTC (rev 1589) @@ -38,4 +38,11 @@ */ void modifiedChanged(@NotNull M mapControl); + /** + * The map file name has changed. + * + * @param mapControl the map control that has changed + */ + void mapFileNameChanged(@NotNull M mapControl); + } // interface MapControlListener This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-13 21:29:32
|
Revision: 1594 http://svn.sourceforge.net/gridarta/?rev=1594&view=rev Author: akirschbaum Date: 2007-01-13 13:29:30 -0800 (Sat, 13 Jan 2007) Log Message: ----------- Rename all license files to *-LICENSE. Modified Paths: -------------- trunk/build.xml trunk/crossfire/build.xml trunk/crossfire/src/cfeditor/messages.properties trunk/daimonin/build.xml trunk/daimonin/src/daieditor/action.properties trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_sv.properties Added Paths: ----------- trunk/daimonin/devlib/junit.jar-LICENSE trunk/daimonin/lib/jlfgr-1_0.jar-LICENSE trunk/lib/Pack200Task.jar-LICENSE trunk/lib/antmeat.jar-LICENSE trunk/lib/japi.jar-LICENSE trunk/lib/java2html.jar-LICENSE trunk/lib/junit-4.1.jar-LICENSE trunk/lib/junit-4.2.jar-LICENSE trunk/lib/log4j-1.2.13.jar-LICENSE trunk/lib/megaxslt.jar-LICENSE trunk/lib/svnClientAdapter.jar-LICENSE trunk/lib/svnant.jar-LICENSE Removed Paths: ------------- trunk/daimonin/devlib/LICENSE-junit.jar trunk/daimonin/lib/LICENSE-jlfgr-1_0.jar trunk/lib/LICENSE-Pack200Task.jar trunk/lib/LICENSE-antmeat.jar trunk/lib/LICENSE-japi.jar trunk/lib/LICENSE-java2html.jar trunk/lib/LICENSE-junit-4.1.jar trunk/lib/LICENSE-junit-4.2.jar trunk/lib/LICENSE-log4j-1.2.13.jar trunk/lib/LICENSE-megaxslt.jar trunk/lib/LICENSE-svnClientAdapter.jar trunk/lib/LICENSE-svnant.jar Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2007-01-13 21:13:01 UTC (rev 1593) +++ trunk/build.xml 2007-01-13 21:29:30 UTC (rev 1594) @@ -586,9 +586,9 @@ link = "${user.javadoc.link}" > <classpath> - <fileset dir="daimonin/lib" includes="*.jar" excludes="LICENSE-*.jar" /> - <fileset dir="crossfire/lib" includes="*.jar" excludes="LICENSE-*.jar" /> - <fileset dir="lib" includes="*.jar" excludes="LICENSE-*.jar" /> + <fileset dir="daimonin/lib" includes="*.jar" excludes="*.jar-LICENSE" /> + <fileset dir="crossfire/lib" includes="*.jar" excludes="*.jar-LICENSE" /> + <fileset dir="lib" includes="*.jar" excludes="*.jar-LICENSE" /> </classpath> <packageset dir="src/app" /> <packageset dir="src" includes="test/**"/> Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2007-01-13 21:13:01 UTC (rev 1593) +++ trunk/crossfire/build.xml 2007-01-13 21:29:30 UTC (rev 1594) @@ -78,8 +78,8 @@ excludes = "test/**/*.java" > <classpath> - <fileset dir="${lib.dir}" includes="*.jar" excludes="LICENSE-*.jar" /> - <fileset dir="../lib/" includes="*.jar" excludes="LICENSE-*.jar" /> + <fileset dir="${lib.dir}" includes="*.jar" excludes="*.jar-LICENSE" /> + <fileset dir="../lib/" includes="*.jar" excludes="*.jar-LICENSE" /> </classpath> <compilerarg line="${javac.args}" /> </javac> @@ -122,7 +122,7 @@ <include name="*-LICENSE" /> </fileset> <fileset dir="../lib"> - <include name="LICENSE-japi.jar" /> + <include name="japi.jar-LICENSE" /> </fileset> <zipgroupfileset dir="../lib/" includes="japi-*.jar" /> @@ -173,7 +173,7 @@ > <classpath> <fileset dir="${lib.dir}" includes="*.jar" excludes="*.jar-LICENSE" /> - <fileset dir="../lib/" includes="*.jar" excludes="LICENSE-*.jar" /> + <fileset dir="../lib/" includes="*.jar" excludes="*.jar-LICENSE" /> </classpath> <sourcepath path="${src.dir}" /> <packageset Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2007-01-13 21:13:01 UTC (rev 1593) +++ trunk/crossfire/src/cfeditor/messages.properties 2007-01-13 21:29:30 UTC (rev 1594) @@ -447,7 +447,7 @@ license.1.title=Gridarta license.1.file=COPYING license.2.title=JAPI -license.2.file=LICENSE-japi.jar +license.2.file=japi.jar-LICENSE license.3.title=SUN Icons license.3.file=jlfgr-1_0.jar-LICENSE license.4.title=BSH Modified: trunk/daimonin/build.xml =================================================================== --- trunk/daimonin/build.xml 2007-01-13 21:13:01 UTC (rev 1593) +++ trunk/daimonin/build.xml 2007-01-13 21:29:30 UTC (rev 1594) @@ -82,8 +82,8 @@ excludes = "test/**/*.java" > <classpath> - <fileset dir="${lib.dir}" includes="*.jar" excludes="LICENSE-*.jar" /> - <fileset dir="../lib/" includes="*.jar" excludes="LICENSE-*.jar" /> + <fileset dir="${lib.dir}" includes="*.jar" excludes="*.jar-LICENSE" /> + <fileset dir="../lib/" includes="*.jar" excludes="*.jar-LICENSE" /> </classpath> <compilerarg line="${javac.args}" /> </javac> @@ -126,10 +126,10 @@ <fileset file="build.properties" /> <fileset file="License" /> <fileset dir="lib"> - <include name="LICENSE-*" /> + <include name="*-LICENSE" /> </fileset> <fileset dir="../lib"> - <include name="LICENSE-japi.jar" /> + <include name="japi.jar-LICENSE" /> </fileset> <fileset dir=".."> <include name="arch/dev/editor/conf/ArchObjectMatchers.dtd" /> @@ -184,8 +184,8 @@ link = "${user.javadoc.link}" > <classpath> - <fileset dir="${lib.dir}" includes="*.jar" excludes="LICENSE-*.jar" /> - <fileset dir="../lib/" includes="*.jar" excludes="LICENSE-*.jar" /> + <fileset dir="${lib.dir}" includes="*.jar" excludes="*.jar-LICENSE" /> + <fileset dir="../lib/" includes="*.jar" excludes="*.jar-LICENSE" /> </classpath> <sourcepath path="${src.dir}" /> <packageset Deleted: trunk/daimonin/devlib/LICENSE-junit.jar =================================================================== --- trunk/daimonin/devlib/LICENSE-junit.jar 2007-01-13 21:13:01 UTC (rev 1593) +++ trunk/daimonin/devlib/LICENSE-junit.jar 2007-01-13 21:29:30 UTC (rev 1594) @@ -1,125 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> -<HTML> -<HEAD> -<TITLE>Common Public License - v 1.0</TITLE> -<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -</HEAD> - -<BODY BGCOLOR="#FFFFFF" VLINK="#800000"> - - -<P ALIGN="CENTER"><B>Common Public License - v 1.0</B> -<P><B></B><FONT SIZE="3"></FONT> -<P><FONT SIZE="3"></FONT><FONT SIZE="2">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.</FONT> -<P><FONT SIZE="2"></FONT> -<P><FONT SIZE="2"><B>1. DEFINITIONS</B></FONT> -<P><FONT SIZE="2">"Contribution" means:</FONT> - -<UL><FONT SIZE="2">a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and<BR CLEAR="LEFT"> -b) in the case of each subsequent Contributor:</FONT></UL> - - -<UL><FONT SIZE="2">i) changes to the Program, and</FONT></UL> - - -<UL><FONT SIZE="2">ii) additions to the Program;</FONT></UL> - - -<UL><FONT SIZE="2">where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. </FONT><FONT SIZE="2">A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. </FONT><FONT SIZE="2">Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. </FONT></UL> - -<P><FONT SIZE="2"></FONT> -<P><FONT SIZE="2">"Contributor" means any person or entity that distributes the Program.</FONT> -<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT> -<P><FONT SIZE="2">"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. </FONT> -<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT> -<P><FONT SIZE="2"></FONT><FONT SIZE="2">"Program" means the Contributions distributed in accordance with this Agreement.</FONT> -<P><FONT SIZE="2"></FONT> -<P><FONT SIZE="2">"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.</FONT> -<P><FONT SIZE="2"><B></B></FONT> -<P><FONT SIZE="2"><B>2. GRANT OF RIGHTS</B></FONT> - -<UL><FONT SIZE="2"></FONT><FONT SIZE="2">a) </FONT><FONT SIZE="2">Subject to the terms of this Agreement, each Contributor hereby grants</FONT><FONT SIZE="2"> Recipient a non-exclusive, worldwide, royalty-free copyright license to</FONT><FONT SIZE="2" COLOR="#FF0000"> </FONT><FONT SIZE="2">reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.</FONT></UL> - - -<UL><FONT SIZE="2"></FONT></UL> - - -<UL><FONT SIZE="2"></FONT><FONT SIZE="2">b) Subject to the terms of this Agreement, each Contributor hereby grants </FONT><FONT SIZE="2">Recipient a non-exclusive, worldwide,</FONT><FONT SIZE="2" COLOR="#008000"> </FONT><FONT SIZE="2">royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. </FONT></UL> - - -<UL><FONT SIZE="2"></FONT></UL> - - -<UL><FONT SIZE="2">c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.</FONT></UL> - - -<UL><FONT SIZE="2"></FONT></UL> - - -<UL><FONT SIZE="2">d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. </FONT></UL> - - -<UL><FONT SIZE="2"></FONT></UL> - -<P><FONT SIZE="2"><B>3. REQUIREMENTS</B></FONT> -<P><FONT SIZE="2"><B></B>A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:</FONT> - -<UL><FONT SIZE="2">a) it complies with the terms and conditions of this Agreement; and</FONT></UL> - - -<UL><FONT SIZE="2">b) its license agreement:</FONT></UL> - - -<UL><FONT SIZE="2">i) effectively disclaims</FONT><FONT SIZE="2"> on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; </FONT></UL> - - -<UL><FONT SIZE="2">ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; </FONT></UL> - - -<UL><FONT SIZE="2">iii)</FONT><FONT SIZE="2"> states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and</FONT></UL> - - -<UL><FONT SIZE="2">iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.</FONT><FONT SIZE="2" COLOR="#0000FF"> </FONT><FONT SIZE="2" COLOR="#FF0000"></FONT></UL> - - -<UL><FONT SIZE="2" COLOR="#FF0000"></FONT><FONT SIZE="2"></FONT></UL> - -<P><FONT SIZE="2">When the Program is made available in source code form:</FONT> - -<UL><FONT SIZE="2">a) it must be made available under this Agreement; and </FONT></UL> - - -<UL><FONT SIZE="2">b) a copy of this Agreement must be included with each copy of the Program. </FONT></UL> - -<P><FONT SIZE="2"></FONT><FONT SIZE="2" COLOR="#0000FF"><STRIKE></STRIKE></FONT> -<P><FONT SIZE="2" COLOR="#0000FF"><STRIKE></STRIKE></FONT><FONT SIZE="2">Contributors may not remove or alter any copyright notices contained within the Program. </FONT> -<P><FONT SIZE="2"></FONT> -<P><FONT SIZE="2">Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. </FONT> -<P><FONT SIZE="2"></FONT> -<P><FONT SIZE="2"><B>4. COMMERCIAL DISTRIBUTION</B></FONT> -<P><FONT SIZE="2">Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.</FONT> -<P><FONT SIZE="2"></FONT> -<P><FONT SIZE="2">For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.</FONT> -<P><FONT SIZE="2"></FONT><FONT SIZE="2" COLOR="#0000FF"></FONT> -<P><FONT SIZE="2" COLOR="#0000FF"></FONT><FONT SIZE="2"><B>5. NO WARRANTY</B></FONT> -<P><FONT SIZE="2">EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is</FONT><FONT SIZE="2"> solely responsible for determining the appropriateness of using and distributing </FONT><FONT SIZE="2">the Program</FONT><FONT SIZE="2"> and assumes all risks associated with its exercise of rights under this Agreement</FONT><FONT SIZE="2">, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, </FONT><FONT SIZE="2">programs or equipment, and unavailability or interruption of operations</FONT><FONT SIZE="2">. </FONT><FONT SIZE="2"></FONT> -<P><FONT SIZE="2"></FONT> -<P><FONT SIZE="2"></FONT><FONT SIZE="2"><B>6. DISCLAIMER OF LIABILITY</B></FONT> -<P><FONT SIZE="2"></FONT><FONT SIZE="2">EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES </FONT><FONT SIZE="2">(INCLUDING WITHOUT LIMITATION LOST PROFITS),</FONT><FONT SIZE="2"> HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</FONT> -<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT> -<P><FONT SIZE="2"><B>7. GENERAL</B></FONT> -<P><FONT SIZE="2"></FONT><FONT SIZE="2">If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.</FONT> -<P><FONT SIZE="2"></FONT> -<P><FONT SIZE="2">If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. </FONT><FONT SIZE="2"></FONT> -<P><FONT SIZE="2"></FONT> -<P><FONT SIZE="2">All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. </FONT><FONT SIZE="2"></FONT> -<P><FONT SIZE="2"></FONT> -<P><FONT SIZE="2"></FONT><FONT SIZE="2">Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to </FONT><FONT SIZE="2">publish new versions (including revisions) of this Agreement from time to </FONT><FONT SIZE="2">time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. </FONT><FONT SIZE="2">Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new </FONT><FONT SIZE="2">version. </FONT><FONT SIZE="2">Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, </FONT><FONT SIZE="2">by implication, estoppel or otherwise</FONT><FONT SIZE="2">.</FONT><FONT SIZE="2"> All rights in the Program not expressly granted under this Agreement are reserved.</FONT> -<P><FONT SIZE="2"></FONT> -<P><FONT SIZE="2">This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.</FONT> -<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT> -<P><FONT SIZE="2"></FONT> - -</BODY> - -</HTML> \ No newline at end of file Copied: trunk/daimonin/devlib/junit.jar-LICENSE (from rev 1591, trunk/daimonin/devlib/LICENSE-junit.jar) =================================================================== --- trunk/daimonin/devlib/junit.jar-LICENSE (rev 0) +++ trunk/daimonin/devlib/junit.jar-LICENSE 2007-01-13 21:29:30 UTC (rev 1594) @@ -0,0 +1,125 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> +<HTML> +<HEAD> +<TITLE>Common Public License - v 1.0</TITLE> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> +</HEAD> + +<BODY BGCOLOR="#FFFFFF" VLINK="#800000"> + + +<P ALIGN="CENTER"><B>Common Public License - v 1.0</B> +<P><B></B><FONT SIZE="3"></FONT> +<P><FONT SIZE="3"></FONT><FONT SIZE="2">THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.</FONT> +<P><FONT SIZE="2"></FONT> +<P><FONT SIZE="2"><B>1. DEFINITIONS</B></FONT> +<P><FONT SIZE="2">"Contribution" means:</FONT> + +<UL><FONT SIZE="2">a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and<BR CLEAR="LEFT"> +b) in the case of each subsequent Contributor:</FONT></UL> + + +<UL><FONT SIZE="2">i) changes to the Program, and</FONT></UL> + + +<UL><FONT SIZE="2">ii) additions to the Program;</FONT></UL> + + +<UL><FONT SIZE="2">where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. </FONT><FONT SIZE="2">A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. </FONT><FONT SIZE="2">Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program. </FONT></UL> + +<P><FONT SIZE="2"></FONT> +<P><FONT SIZE="2">"Contributor" means any person or entity that distributes the Program.</FONT> +<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT> +<P><FONT SIZE="2">"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program. </FONT> +<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT> +<P><FONT SIZE="2"></FONT><FONT SIZE="2">"Program" means the Contributions distributed in accordance with this Agreement.</FONT> +<P><FONT SIZE="2"></FONT> +<P><FONT SIZE="2">"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.</FONT> +<P><FONT SIZE="2"><B></B></FONT> +<P><FONT SIZE="2"><B>2. GRANT OF RIGHTS</B></FONT> + +<UL><FONT SIZE="2"></FONT><FONT SIZE="2">a) </FONT><FONT SIZE="2">Subject to the terms of this Agreement, each Contributor hereby grants</FONT><FONT SIZE="2"> Recipient a non-exclusive, worldwide, royalty-free copyright license to</FONT><FONT SIZE="2" COLOR="#FF0000"> </FONT><FONT SIZE="2">reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.</FONT></UL> + + +<UL><FONT SIZE="2"></FONT></UL> + + +<UL><FONT SIZE="2"></FONT><FONT SIZE="2">b) Subject to the terms of this Agreement, each Contributor hereby grants </FONT><FONT SIZE="2">Recipient a non-exclusive, worldwide,</FONT><FONT SIZE="2" COLOR="#008000"> </FONT><FONT SIZE="2">royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder. </FONT></UL> + + +<UL><FONT SIZE="2"></FONT></UL> + + +<UL><FONT SIZE="2">c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.</FONT></UL> + + +<UL><FONT SIZE="2"></FONT></UL> + + +<UL><FONT SIZE="2">d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement. </FONT></UL> + + +<UL><FONT SIZE="2"></FONT></UL> + +<P><FONT SIZE="2"><B>3. REQUIREMENTS</B></FONT> +<P><FONT SIZE="2"><B></B>A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:</FONT> + +<UL><FONT SIZE="2">a) it complies with the terms and conditions of this Agreement; and</FONT></UL> + + +<UL><FONT SIZE="2">b) its license agreement:</FONT></UL> + + +<UL><FONT SIZE="2">i) effectively disclaims</FONT><FONT SIZE="2"> on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose; </FONT></UL> + + +<UL><FONT SIZE="2">ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; </FONT></UL> + + +<UL><FONT SIZE="2">iii)</FONT><FONT SIZE="2"> states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and</FONT></UL> + + +<UL><FONT SIZE="2">iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.</FONT><FONT SIZE="2" COLOR="#0000FF"> </FONT><FONT SIZE="2" COLOR="#FF0000"></FONT></UL> + + +<UL><FONT SIZE="2" COLOR="#FF0000"></FONT><FONT SIZE="2"></FONT></UL> + +<P><FONT SIZE="2">When the Program is made available in source code form:</FONT> + +<UL><FONT SIZE="2">a) it must be made available under this Agreement; and </FONT></UL> + + +<UL><FONT SIZE="2">b) a copy of this Agreement must be included with each copy of the Program. </FONT></UL> + +<P><FONT SIZE="2"></FONT><FONT SIZE="2" COLOR="#0000FF"><STRIKE></STRIKE></FONT> +<P><FONT SIZE="2" COLOR="#0000FF"><STRIKE></STRIKE></FONT><FONT SIZE="2">Contributors may not remove or alter any copyright notices contained within the Program. </FONT> +<P><FONT SIZE="2"></FONT> +<P><FONT SIZE="2">Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. </FONT> +<P><FONT SIZE="2"></FONT> +<P><FONT SIZE="2"><B>4. COMMERCIAL DISTRIBUTION</B></FONT> +<P><FONT SIZE="2">Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.</FONT> +<P><FONT SIZE="2"></FONT> +<P><FONT SIZE="2">For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.</FONT> +<P><FONT SIZE="2"></FONT><FONT SIZE="2" COLOR="#0000FF"></FONT> +<P><FONT SIZE="2" COLOR="#0000FF"></FONT><FONT SIZE="2"><B>5. NO WARRANTY</B></FONT> +<P><FONT SIZE="2">EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is</FONT><FONT SIZE="2"> solely responsible for determining the appropriateness of using and distributing </FONT><FONT SIZE="2">the Program</FONT><FONT SIZE="2"> and assumes all risks associated with its exercise of rights under this Agreement</FONT><FONT SIZE="2">, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, </FONT><FONT SIZE="2">programs or equipment, and unavailability or interruption of operations</FONT><FONT SIZE="2">. </FONT><FONT SIZE="2"></FONT> +<P><FONT SIZE="2"></FONT> +<P><FONT SIZE="2"></FONT><FONT SIZE="2"><B>6. DISCLAIMER OF LIABILITY</B></FONT> +<P><FONT SIZE="2"></FONT><FONT SIZE="2">EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES </FONT><FONT SIZE="2">(INCLUDING WITHOUT LIMITATION LOST PROFITS),</FONT><FONT SIZE="2"> HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.</FONT> +<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT> +<P><FONT SIZE="2"><B>7. GENERAL</B></FONT> +<P><FONT SIZE="2"></FONT><FONT SIZE="2">If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.</FONT> +<P><FONT SIZE="2"></FONT> +<P><FONT SIZE="2">If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed. </FONT><FONT SIZE="2"></FONT> +<P><FONT SIZE="2"></FONT> +<P><FONT SIZE="2">All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive. </FONT><FONT SIZE="2"></FONT> +<P><FONT SIZE="2"></FONT> +<P><FONT SIZE="2"></FONT><FONT SIZE="2">Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to </FONT><FONT SIZE="2">publish new versions (including revisions) of this Agreement from time to </FONT><FONT SIZE="2">time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. </FONT><FONT SIZE="2">Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new </FONT><FONT SIZE="2">version. </FONT><FONT SIZE="2">Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, </FONT><FONT SIZE="2">by implication, estoppel or otherwise</FONT><FONT SIZE="2">.</FONT><FONT SIZE="2"> All rights in the Program not expressly granted under this Agreement are reserved.</FONT> +<P><FONT SIZE="2"></FONT> +<P><FONT SIZE="2">This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.</FONT> +<P><FONT SIZE="2"></FONT><FONT SIZE="2"></FONT> +<P><FONT SIZE="2"></FONT> + +</BODY> + +</HTML> \ No newline at end of file Deleted: trunk/daimonin/lib/LICENSE-jlfgr-1_0.jar =================================================================== --- trunk/daimonin/lib/LICENSE-jlfgr-1_0.jar 2007-01-13 21:13:01 UTC (rev 1593) +++ trunk/daimonin/lib/LICENSE-jlfgr-1_0.jar 2007-01-13 21:29:30 UTC (rev 1594) @@ -1,10 +0,0 @@ -Copyright 2000 by Sun Microsystems, Inc. All Rights Reserved. - -Sun grants you ("Licensee") a non-exclusive, royalty free, license to use, and redistribute this software graphics artwork, as individual graphics or as a collection, as part of software code or programs that you develop, provided that i) this copyright notice and license accompany the software graphics artwork; and ii) you do not utilize the software graphics artwork in a manner which is disparaging to Sun. Unless enforcement is prohibited by applicable law, you may not modify the graphics, and must use them true to color and unmodified in every way. - -This software graphics artwork is provided "AS IS," without a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE GRAPHICS ARTWORK. - -IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE GRAPHICS ARTWORK, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - -If any of the above provisions are held to be in violation of applicable law, void, or unenforceable in any jurisdiction, then such provisions are waived to the extent necessary for this Disclaimer to be otherwise enforceable in such jurisdiction. - Copied: trunk/daimonin/lib/jlfgr-1_0.jar-LICENSE (from rev 1591, trunk/daimonin/lib/LICENSE-jlfgr-1_0.jar) =================================================================== --- trunk/daimonin/lib/jlfgr-1_0.jar-LICENSE (rev 0) +++ trunk/daimonin/lib/jlfgr-1_0.jar-LICENSE 2007-01-13 21:29:30 UTC (rev 1594) @@ -0,0 +1,10 @@ +Copyright 2000 by Sun Microsystems, Inc. All Rights Reserved. + +Sun grants you ("Licensee") a non-exclusive, royalty free, license to use, and redistribute this software graphics artwork, as individual graphics or as a collection, as part of software code or programs that you develop, provided that i) this copyright notice and license accompany the software graphics artwork; and ii) you do not utilize the software graphics artwork in a manner which is disparaging to Sun. Unless enforcement is prohibited by applicable law, you may not modify the graphics, and must use them true to color and unmodified in every way. + +This software graphics artwork is provided "AS IS," without a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE GRAPHICS ARTWORK. + +IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE GRAPHICS ARTWORK, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +If any of the above provisions are held to be in violation of applicable law, void, or unenforceable in any jurisdiction, then such provisions are waived to the extent necessary for this Disclaimer to be otherwise enforceable in such jurisdiction. + Modified: trunk/daimonin/src/daieditor/action.properties =================================================================== --- trunk/daimonin/src/daieditor/action.properties 2007-01-13 21:13:01 UTC (rev 1593) +++ trunk/daimonin/src/daieditor/action.properties 2007-01-13 21:29:30 UTC (rev 1594) @@ -44,7 +44,7 @@ optionsChooseFile.icon=general/Open16 -oldLibs.okayLibs=.svn CVS README LICENSE-* japi.jar jlfgr-1_0.jar +oldLibs.okayLibs=.svn CVS README LICENSE-* *-LICENSE japi.jar jlfgr-1_0.jar ####### # File @@ -148,8 +148,8 @@ about.icon=general/About16 license.1.file=License -license.2.file=LICENSE-japi.jar -license.3.file=LICENSE-jlfgr-1_0.jar +license.2.file=japi.jar-LICENSE +license.3.file=jlfgr-1_0.jar-LICENSE update.url=http://daimonin.sourceforge.net/editor/update.properties Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2007-01-13 21:13:01 UTC (rev 1593) +++ trunk/daimonin/src/daieditor/messages.properties 2007-01-13 21:29:30 UTC (rev 1594) @@ -651,9 +651,9 @@ license.1.title=Gridarta license.1.file=License license.2.title=JAPI -license.2.file=LICENSE-japi.jar +license.2.file=japi.jar-LICENSE license.3.title=SUN Icons -license.3.file=LICENSE-jlfgr-1_0.jar +license.3.file=jlfgr-1_0.jar-LICENSE aboutRuntimeProperties.title=Runtime properties aboutBuildProperties.title=Build properties Modified: trunk/daimonin/src/daieditor/messages_sv.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_sv.properties 2007-01-13 21:13:01 UTC (rev 1593) +++ trunk/daimonin/src/daieditor/messages_sv.properties 2007-01-13 21:29:30 UTC (rev 1594) @@ -776,9 +776,9 @@ license.1.title=Daimonin Editor license.1.file=License license.2.title=JAPI -license.2.file=LICENSE-japi.jar +license.2.file=japi.jar-LICENSE license.3.title=SUN Icons -license.3.file=LICENSE-jlfgr-1_0.jar +license.3.file=jlfgr-1_0.jar-LICENSE aboutRuntimeProperties.title=Runtime properties aboutBuildProperties.title=Build properties Deleted: trunk/lib/LICENSE-Pack200Task.jar =================================================================== --- trunk/lib/LICENSE-Pack200Task.jar 2007-01-13 21:13:01 UTC (rev 1593) +++ trunk/lib/LICENSE-Pack200Task.jar 2007-01-13 21:29:30 UTC (rev 1594) @@ -1,471 +0,0 @@ -SUN PUBLIC LICENSE Version 1.0 - -1. Definitions. - - 1.0.1. "Commercial Use" means distribution or otherwise making the - Covered Code available to a third party. - - 1.1. "Contributor" means each entity that creates or contributes to - the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the Original Code, - prior Modifications used by a Contributor, and the Modifications made - by that particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications or the - combination of the Original Code and Modifications, in each case - including portions thereof and corresponding documentation released - with the source code. - - 1.4. "Electronic Distribution Mechanism" means a mechanism generally - accepted in the software development community for the electronic - transfer of data. - - 1.5. "Executable" means Covered Code in any form other than Source - Code. - - 1.6. "Initial Developer" means the individual or entity identified as - the Initial Developer in the Source Code notice required by Exhibit A. - - 1.7. "Larger Work" means a work which combines Covered Code or - portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.8.1. "Licensable" means having the right to grant, to the maximum - extent possible, whether at the time of the initial grant or - subsequently acquired, any and all of the rights conveyed herein. - - 1.9. "Modifications" means any addition to or deletion from the - substance or structure of either the Original Code or any previous - Modifications. When Covered Code is released as a series of files, a - Modification is: - - A. Any addition to or deletion from the contents of a file containing - Original Code or previous Modifications. - - B. Any new file that contains any part of the Original Code or - previous Modifications. - - 1.10. "Original Code" means Source Code of computer software code - which is described in the Source Code notice required by Exhibit A as - Original Code, and which, at the time of its release under this - License is not already Covered Code governed by this License. - - 1.10.1. "Patent Claims" means any patent claim(s), now owned or - hereafter acquired, including without limitation, method, process, and - apparatus claims, in any patent Licensable by grantor. - - 1.11. "Source Code" means the preferred form of the Covered Code for - making modifications to it, including all modules it contains, plus - any associated documentation, interface definition files, scripts used - to control compilation and installation of an Executable, or source - code differential comparisons against either the Original Code or - another well known, available Covered Code of the Contributor's - choice. The Source Code can be in a compressed or archival form, - provided the appropriate decompression or de-archiving software is - widely available for no charge. - - 1.12. "You" (or "Your") means an individual or a legal entity - exercising rights under, and complying with all of the terms of, this - License or a future version of this License issued under Section 6.1. - For legal entities, "You" includes any entity which controls, is - controlled by, or is under common control with You. For purposes of - this definition, "control" means (a) the power, direct or indirect, to - cause the direction or management of such entity, whether by contract - or otherwise, or (b) ownership of more than fifty percent (50%) of the - outstanding shares or beneficial ownership of such entity. - -2. Source Code License. - -2.1 The Initial Developer Grant. - - The Initial Developer hereby grants You a world-wide, royalty-free, - non-exclusive license, subject to third party intellectual property - claims: - - (a) under intellectual property rights (other than patent or - trademark) Licensable by Initial Developer to use, reproduce, modify, - display, perform, sublicense and distribute the Original Code (or - portions thereof) with or without Modifications, and/or as part of a - Larger Work; and - - (b) under Patent Claims infringed by the making, using or selling of - Original Code, to make, have made, use, practice, sell, and offer for - sale, and/or otherwise dispose of the Original Code (or portions - thereof). - - (c) the licenses granted in this Section 2.1(a) and (b) are effective - on the date Initial Developer first distributes Original Code under - the terms of this License. - - (d) Notwithstanding Section 2.1(b) above, no patent license is - granted: 1) for code that You delete from the Original Code; 2) - separate from the Original Code; or 3) for infringements caused by: - i) the modification of the Original Code or ii) the combination of the - Original Code with other software or devices. - -2.2. Contributor Grant. - - Subject to third party intellectual property claims, each Contributor - hereby grants You a world-wide, royalty-free, non-exclusive license - - (a) under intellectual property rights (other than patent or - trademark) Licensable by Contributor, to use, reproduce, modify, - display, perform, sublicense and distribute the Modifications created - by such Contributor (or portions thereof) either on an unmodified - basis, with other Modifications, as Covered Code and/or as part of a - Larger Work; and - - (b) under Patent Claims infringed by the making, using, or selling of - Modifications made by that Contributor either alone and/or in - combination with its Contributor Version (or portions of such - combination), to make, use, sell, offer for sale, have made, and/or - otherwise dispose of: 1) Modifications made by that Contributor (or - portions thereof); and 2) the combination of Modifications made by - that Contributor with its Contributor Version (or portions of such - combination). - - (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective - on the date Contributor first makes Commercial Use of the Covered - Code. - - (d) notwithstanding Section 2.2(b) above, no patent license is - granted: 1) for any code that Contributor has deleted from the - Contributor Version; 2) separate from the Contributor Version; 3) for - infringements caused by: i) third party modifications of Contributor - Version or ii) the combination of Modifications made by that - Contributor with other software (except as part of the Contributor - Version) or other devices; or 4) under Patent Claims infringed by - Covered Code in the absence of Modifications made by that Contributor. - -3. Distribution Obligations. - -3.1. Application of License. - - The Modifications which You create or to which You contribute are - governed by the terms of this License, including without limitation - Section 2.2. The Source Code version of Covered Code may be - distributed only under the terms of this License or a future version - of this License released under Section 6.1, and You must include a - copy of this License with every copy of the Source Code You - distribute. You may not offer or impose any terms on any Source Code - version that alters or restricts the applicable version of this - License or the recipients' rights hereunder. However, You may include - an additional document offering the additional rights described in - Section 3.5. - -3.2. Availability of Source Code. - - Any Modification which You create or to which You contribute must be - made available in Source Code form under the terms of this License - either on the same media as an Executable version or via an accepted - Electronic Distribution Mechanism to anyone to whom you made an - Executable version available; and if made available via Electronic - Distribution Mechanism, must remain available for at least twelve (12) - months after the date it initially became available, or at least six - (6) months after a subsequent version of that particular Modification - has been made available to such recipients. You are responsible for - ensuring that the Source Code version remains available even if the - Electronic Distribution Mechanism is maintained by a third party. - -3.3. Description of Modifications. - - You must cause all Covered Code to which You contribute to contain a - file documenting the changes You made to create that Covered Code and - the date of any change. You must include a prominent statement that - the Modification is derived, directly or indirectly, from Original - Code provided by the Initial Developer and including the name of the - Initial Developer in (a) the Source Code, and (b) in any notice in an - Executable version or related documentation in which You describe the - origin or ownership of the Covered Code. - -3.4. Intellectual Property Matters. - - (a) Third Party Claims. - - If Contributor has knowledge that a license under a third party's - intellectual property rights is required to exercise the rights - granted by such Contributor under Sections 2.1 or 2.2, Contributor - must include a text file with the Source Code distribution titled - "LEGAL'' which describes the claim and the party making the claim in - sufficient detail that a recipient will know whom to contact. If - Contributor obtains such knowledge after the Modification is made - available as described in Section 3.2, Contributor shall promptly - modify the LEGAL file in all copies Contributor makes available - thereafter and shall take other steps (such as notifying appropriate - mailing lists or newsgroups) reasonably calculated to inform those who - received the Covered Code that new knowledge has been obtained. - - (b) Contributor APIs. - - If Contributor's Modifications include an application programming - interface ("API") and Contributor has knowledge of patent licenses - which are reasonably necessary to implement that API, Contributor must - also include this information in the LEGAL file. - - (c) Representations. - - Contributor represents that, except as disclosed pursuant to Section - 3.4(a) above, Contributor believes that Contributor's Modifications - are Contributor's original creation(s) and/or Contributor has - sufficient rights to grant the rights conveyed by this License. - -3.5. Required Notices. - - You must duplicate the notice in Exhibit A in each file of the Source - Code. If it is not possible to put such notice in a particular Source - Code file due to its structure, then You must include such notice in a - location (such as a relevant directory) where a user would be likely - to look for such a notice. If You created one or more Modification(s) - You may add your name as a Contributor to the notice described in - Exhibit A. You must also duplicate this License in any documentation - for the Source Code where You describe recipients' rights or ownership - rights relating to Covered Code. You may choose to offer, and to - charge a fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Code. However, You - may do so only on Your own behalf, and not on behalf of the Initial - Developer or any Contributor. You must make it absolutely clear than - any such warranty, support, indemnity or liability obligation is - offered by You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred by the - Initial Developer or such Contributor as a result of warranty, - support, indemnity or liability terms You offer. - -3.6. Distribution of Executable Versions. - - You may distribute Covered Code in Executable form only if the - requirements of Section 3.1-3.5 have been met for that Covered Code, - and if You include a notice stating that the Source Code version of - the Covered Code is available under the terms of this License, - including a description of how and where You have fulfilled the - obligations of Section 3.2. The notice must be conspicuously included - in any notice in an Executable version, related documentation or - collateral in which You describe recipients' rights relating to the - Covered Code. You may distribute the Executable version of Covered - Code or ownership rights under a license of Your choice, which may - contain terms different from this License, provided that You are in - compliance with the terms of this License and that the license for the - Executable version does not attempt to limit or alter the recipient's - rights in the Source Code version from the rights set forth in this - License. If You distribute the Executable version under a different - license You must make it absolutely clear that any terms which differ - from this License are offered by You alone, not by the Initial - Developer or any Contributor. You hereby agree to indemnify the - Initial Developer and every Contributor for any liability incurred by - the Initial Developer or such Contributor as a result of any such - terms You offer. - -3.7. Larger Works. - - You may create a Larger Work by combining Covered Code with other code - not governed by the terms of this License and distribute the Larger - Work as a single product. In such a case, You must make sure the - requirements of this License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this - License with respect to some or all of the Covered Code due to - statute, judicial order, or regulation then You must: (a) comply with - the terms of this License to the maximum extent possible; and (b) - describe the limitations and the code they affect. Such description - must be included in the LEGAL file described in Section 3.4 and must - be included with all distributions of the Source Code. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has - attached the notice in Exhibit A and to related Covered Code. - -6. Versions of the License. - -6.1. New Versions. - - Sun Microsystems, Inc. ("Sun") may publish revised and/or new versions - of the License from time to time. Each version will be given a - distinguishing version number. - -6.2. Effect of New Versions. - - Once Covered Code has been published under a particular version of the - License, You may always continue to use it under the terms of that - version. You may also choose to use such Covered Code under the terms - of any subsequent version of the License published by Sun. No one - other than Sun has the right to modify the terms applicable to Covered - Code created under this License. - -6.3. Derivative Works. - - If You create or use a modified version of this License (which you may - only do in order to apply it to code which is not already Covered Code - governed by this License), You must: (a) rename Your license so that - the phrases "Sun," "Sun Public License," or "SPL" or any confusingly - similar phrase do not appear in your license (except to note that your - license differs from this License) and (b) otherwise make it clear - that Your version of the license contains terms which differ from the - Sun Public License. (Filling in the name of the Initial Developer, - Original Code or Contributor in the notice described in Exhibit A - shall not of themselves be deemed to be modifications of this - License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, - WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF - DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. - THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE - IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, - YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE - COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER - OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. - -8. TERMINATION. - - 8.1. This License and the rights granted hereunder will terminate - automatically if You fail to comply with terms herein and fail to cure - such breach within 30 days of becoming aware of the breach. All - sublicenses to the Covered Code which are properly granted shall - survive any termination of this License. Provisions which, by their - nature, must remain in effect beyond the termination of this License - shall survive. - - 8.2. If You initiate litigation by asserting a patent infringement - claim (excluding declaratory judgment actions) against Initial Developer - or a Contributor (the Initial Devel... [truncated message content] |
From: <aki...@us...> - 2007-01-13 21:50:17
|
Revision: 1596 http://svn.sourceforge.net/gridarta/?rev=1596&view=rev Author: akirschbaum Date: 2007-01-13 13:50:03 -0800 (Sat, 13 Jan 2007) Log Message: ----------- Rename application to "CrossfireEditor.jar". Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/Developer_README.txt trunk/crossfire/INSTALL.txt trunk/crossfire/build.xml trunk/crossfire/resource/HelpFiles/map_basic.html trunk/crossfire/resource/HelpFiles/tut_frames.html trunk/crossfire/resource/conf/autojoin.txt trunk/crossfire/resource/conf/types.xml trunk/crossfire/src/cfeditor/CFJavaEditor.java trunk/crossfire/src/cfeditor/messages.properties trunk/crossfire/src/cfeditor/messages_de.properties trunk/crossfire/src/cfeditor/messages_fr.properties trunk/crossfire/src/cfeditor/messages_sv.properties trunk/src/doc/start.xhtml Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2007-01-13 21:32:41 UTC (rev 1595) +++ trunk/crossfire/ChangeLog 2007-01-13 21:50:03 UTC (rev 1596) @@ -1,5 +1,7 @@ 2007-01-13 Andreas Kirschbaum + * Rename application to "CrossfireEditor.jar". + * Add build information (including the SVN revision number) and licenses to about dialog. Modified: trunk/crossfire/Developer_README.txt =================================================================== --- trunk/crossfire/Developer_README.txt 2007-01-13 21:32:41 UTC (rev 1595) +++ trunk/crossfire/Developer_README.txt 2007-01-13 21:50:03 UTC (rev 1596) @@ -1,5 +1,5 @@ This document describes some hints and requirements for -general "development" on the CFJavaEditor. +general "development" on the CrossfireEditor. If you plan to make changes to the editor code or setup please read the following and keep it in mind: @@ -18,7 +18,7 @@ Tabs are displayed totally different in every editor and there are millions of different editors out there. The insertion of tabs in the source code is messing up the syntax formatting in a way that is UNREPAIRABLE. - + Apart from that, please keep code indentation accurate. This is not just "good practice", it helps to keep code readable and in that way dramatically decreases the chance for overlooked bugs. @@ -37,53 +37,53 @@ as well as java environments. In the past, several people have attempted to add build scripts along with structural changes to optimize the setup on one particular system/environment which has led to conflict. - + Please do *not* attempt to change the structure or any directories for the mere purpose of improving a build process or performance in a java environment. - + Build scripts may be placed in the root directory, it would be especially fine if it is just one or two files but the latter is not required. - + Please excuse me for placing such restriction. I and many users of the editor greatly appreciate build-scripts. We just had some real troubles over this issue in the past and I don't want to have them repeated. - + 3. Unfortunately, the editor has relatively high performance requirements. I've spent a lot of extra-work to keep everything as fast and memory-efficient as possible. So, when you add new datafields or calculations in the archobject area, please make sure they are as effiecient as possible and worth both the time and space they consume. - + Now don't be afraid too much. No development would be possible without adding calculations and data at all. Just bear in mind that, unlike for many other opensource projects, performance - does make a difference for the CFJavaEditor. - + does make a difference for the CrossfireEditor. + 4. The source package name is not java standard (being just "cfeditor"). I am aware of this and still do not want to change it. Please consider how much work has been done on the JavaEditor and respect my freedom to choose the package name. - + 5. The GUI (graphical user interface) of the editor is not as simple as it may seem on first glance. I have invested a lot of time and work to make the GUI user-friendly and especially to make it work at all, for as many systems as possible. - + In case you are unexperienced with java and swing, note that the graphics look different on every system, and with every font. They also have different sizes/proportions and behave different. A seemingly trivial and effectless change can wreck havock for the same GUI run on another system. - + Again, please don't be totally afraid of it, just keep it in mind. Nobody is gonna eat you alive when your code causes a "GUI-bug". The best way to deal with it is to test on different systems. Another good thing is to design all GUIs with care and avoid fixed sizes like hell, wherever you can. - + 6. You might notice that the basic structure of the code obeys the "model-view-controller" scheme. Too bad it is halfway messed up and violated, but please try to stick with it as @@ -96,5 +96,4 @@ replace any of these parts without changing the others. I have yet never seen it realized perfectly, so feel proud when you just tried your best. - - \ No newline at end of file + Modified: trunk/crossfire/INSTALL.txt =================================================================== --- trunk/crossfire/INSTALL.txt 2007-01-13 21:32:41 UTC (rev 1595) +++ trunk/crossfire/INSTALL.txt 2007-01-13 21:50:03 UTC (rev 1596) @@ -1,12 +1,12 @@ -How to run the CFJavaEditor: -^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Simply run the jar file "CFJavaEditor.jar" in the main directory. -In Windows this is done by a doubleclick on "CFJavaEditor.jar". -In Linux/Unix you type in the console: "java -jar CFJavaEditor.jar". +How to run the editor: +^^^^^^^^^^^^^^^^^^^^^ +Simply run the jar file "CrossfireEditor.jar" in the main directory. +In Windows this is done by a doubleclick on "CrossfireEditor.jar". +In Linux/Unix you type in the console: "java -jar CrossfireEditor.jar". If you have enough memory, it is recommended to run the editor with a higher maximum memory size, like 128 Mb: -"java -jar -Xmx128m CFJavaEditor.jar" +"java -jar -Xmx128m CrossfireEditor.jar" (Note that in this way, the editor won't *always* use 128 Mb. It will only use that much when it is required.) @@ -15,8 +15,8 @@ to compile the editor from the sources first. Read next paragraph. -How to build the CFJavaEditor from sources: -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +How to build the CrossfireEditor from sources: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you have checked out the Gridarta sources from CVS, or downloaded a "developer version", then you've got the java sources. Now you can modify the java code, you can add classes, but please @@ -38,28 +38,28 @@ (Note that, if you want, you can also run the editor with ant by typing "ant run". This does exactly the same as -"java -jar CFJavaEditor.jar".) +"java -jar CrossfireEditor.jar".) -How to create a CFJavaEditor release package: -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +How to create a CrossfireEditor release package: +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ A "release" version is meant to be a complete running version of -the CFJavaEditor, without sources. A binary so to speak, though for +the CrossfireEditor, without sources. A binary so to speak, though for Java the most suitable thing is a jar file. The jar file will contain everything except pickmaps, hence a release package should only contain these two things: Jar file and pickmaps. -1. Run Ant to create the jar file "CFJavaEditor.jar" (see above). +1. Run Ant to create the jar file "CrossfireEditor.jar" (see above). 2. Assemble jar file and pickmaps in the following directory tree: - CFJavaEditor/ + crossfire/ resource/ pickmaps/ [all pickmap files] - CFJavaEditor.jar - CHANGES.txt + CrossfireEditor.jar + ChangeLog 3. Zip the package in a widely available compression format. Preferably use tar.gz as this is available both on Unix/Linux @@ -69,7 +69,7 @@ System requirements & Supported Java Versions: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ You need at least 128 MB of system RAM and 400 MHz CPU speed -in order to run the CFJavaEditor. It has been reported to work +in order to run the editor. It has been reported to work on systems with lesser specs, but the speed was very slow. The editor needs Java 1.5. It will not run on Java versions below Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2007-01-13 21:32:41 UTC (rev 1595) +++ trunk/crossfire/build.xml 2007-01-13 21:50:03 UTC (rev 1596) @@ -31,7 +31,7 @@ <property name="resource.dir" value="resource" /> <property name="doc.dir" value="docs" /> <property name="build.dir" value="class" /> - <property name="jarname" value="CFJavaEditor.jar" /> + <property name="jarname" value="CrossfireEditor.jar" /> <property name="build.source.version" value="1.5" /> <property name="build.target.version" value="${build.source.version}" /> <property name="build.source.encoding" value="utf-8" /> Modified: trunk/crossfire/resource/HelpFiles/map_basic.html =================================================================== --- trunk/crossfire/resource/HelpFiles/map_basic.html 2007-01-13 21:32:41 UTC (rev 1595) +++ trunk/crossfire/resource/HelpFiles/map_basic.html 2007-01-13 21:50:03 UTC (rev 1596) @@ -6,7 +6,7 @@ <P><A HREF="start.html"><IMG SRC="back.gif" WIDTH="42" HEIGHT="22" ALIGN="BOTTOM" NATURALSIZEFLAG="3" BORDER="0">Back</A> -<H1 align="center">Creating a Basic Map in the CFJavaEditor</H1> +<H1 align="center">Creating a Basic Map in the CrossfireEditor</H1> <H2 align="center">Step 1 - Create a new empty Map:</H2> Modified: trunk/crossfire/resource/HelpFiles/tut_frames.html =================================================================== --- trunk/crossfire/resource/HelpFiles/tut_frames.html 2007-01-13 21:32:41 UTC (rev 1595) +++ trunk/crossfire/resource/HelpFiles/tut_frames.html 2007-01-13 21:50:03 UTC (rev 1596) @@ -1,7 +1,7 @@ <HTML> <HEAD> <META NAME="GENERATOR" CONTENT="Adobe PageMill 2.0 Mac"> - <TITLE>CFJavaEditor Frames</TITLE> + <TITLE>CrossfireEditor Frames</TITLE> </HEAD> <BODY> Modified: trunk/crossfire/resource/conf/autojoin.txt =================================================================== --- trunk/crossfire/resource/conf/autojoin.txt 2007-01-13 21:32:41 UTC (rev 1595) +++ trunk/crossfire/resource/conf/autojoin.txt 2007-01-13 21:50:03 UTC (rev 1596) @@ -1,7 +1,7 @@ # # autojoin.txt - This file contains data about which (wall-)arches belong # together and in which directions they point. That is used by the -# CFJavaEditor to determine how to join walls in the autojoining mode. +# CrossfireEditor to determine how to join walls in the autojoining mode. # Feel free to modify this file to suite your needs. # # The file must be kept in the following format: Modified: trunk/crossfire/resource/conf/types.xml =================================================================== --- trunk/crossfire/resource/conf/types.xml 2007-01-13 21:32:41 UTC (rev 1595) +++ trunk/crossfire/resource/conf/types.xml 2007-01-13 21:50:03 UTC (rev 1596) @@ -9,12 +9,12 @@ # or new ones are created. # # Therefore, it is important that an Editor is flexible and # # easy to "upgrade" to handle such new features. That's why the # -# CFJavaEditor reads the type-definitions from this xml file. # +# CrossfireEditor reads the type-definitions from this xml file. # # # # If you encounter bugs, typos or missing entries in the LATEST # # VERSION of this file - Don't hesitate to improve it, contact me # # and eventually send the improved file to me: <red...@gm...>. # -# I will put it into the "official version" of the CFJavaEditor # +# I will put it into the "official version" of the CrossfireEditor # # and all fellow Crossfire-Map-Makers can benefit from your work! # # # # IMPORTANT: Make a backup copy of this file before you start # Modified: trunk/crossfire/src/cfeditor/CFJavaEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/CFJavaEditor.java 2007-01-13 21:32:41 UTC (rev 1595) +++ trunk/crossfire/src/cfeditor/CFJavaEditor.java 2007-01-13 21:50:03 UTC (rev 1596) @@ -192,7 +192,7 @@ } private static void usage() { - System.out.println("usage: CFJavaEditor [option...] [mapfile...]"); + System.out.println("usage: java -jar CrossfireEditor.jar [option...] [mapfile...]"); System.out.println(""); System.out.println(" -filelist file convert images from file: first line is a mapfile, second"); System.out.println(" line if a pngfile; file can contain any number of pairs to"); Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2007-01-13 21:32:41 UTC (rev 1595) +++ trunk/crossfire/src/cfeditor/messages.properties 2007-01-13 21:50:03 UTC (rev 1596) @@ -71,7 +71,7 @@ mapTop=Top mapBottom=Bottom -arcDoc.htmlText=<html><head><meta name="CFJavaEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">{0}</h1><h3 style="colour:navy;">Functionality of {0}:</h3><p>{1}</p><h3 style="colour:navy;">Notes on Usage:</h3><p>{2}</p></body></html> +arcDoc.htmlText=<html><head><meta name="CrossfireEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">{0}</h1><h3 style="colour:navy;">Functionality of {0}:</h3><p>{1}</p><h3 style="colour:navy;">Notes on Usage:</h3><p>{2}</p></body></html> # Options optionsImageSet=Image Set Modified: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties 2007-01-13 21:32:41 UTC (rev 1595) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2007-01-13 21:50:03 UTC (rev 1596) @@ -257,7 +257,7 @@ prefsRes.title=Pfade & Ressourcen prefsGUI.title=Aussehen -arcDoc.htmlText=<html><head><meta name="CFJavaEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">{0}</h1><h3 style="colour:navy;">Funktionalität von {0}:</h3><p>{1}</p><h3 style="colour:navy;">Nutzungshinweise:</h3><p>{2}</p></body></html> +arcDoc.htmlText=<html><head><meta name="CrossfireEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">{0}</h1><h3 style="colour:navy;">Funktionalität von {0}:</h3><p>{1}</p><h3 style="colour:navy;">Nutzungshinweise:</h3><p>{2}</p></body></html> # Options Modified: trunk/crossfire/src/cfeditor/messages_fr.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_fr.properties 2007-01-13 21:32:41 UTC (rev 1595) +++ trunk/crossfire/src/cfeditor/messages_fr.properties 2007-01-13 21:50:03 UTC (rev 1596) @@ -57,7 +57,7 @@ ##################### # Preference Modules -arcDoc.htmlText=<html><head><meta name="CFJavaEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Fonctionalit\xE9s de {0}</h3><p>{1}</p><h3 style="colour:navy;">Notes d'utilisation:</h3><p>{2}</p></body></html> +arcDoc.htmlText=<html><head><meta name="CrossfireEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Fonctionalit\xE9s de {0}</h3><p>{1}</p><h3 style="colour:navy;">Notes d'utilisation:</h3><p>{2}</p></body></html> # Options Modified: trunk/crossfire/src/cfeditor/messages_sv.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_sv.properties 2007-01-13 21:32:41 UTC (rev 1595) +++ trunk/crossfire/src/cfeditor/messages_sv.properties 2007-01-13 21:50:03 UTC (rev 1596) @@ -202,7 +202,7 @@ ##################### # Preference Modules -arcDoc.htmlText=<html><head><meta name="CFJavaEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Funktionalitet f\xF6r {0}</h3><p>{1}</p><h3 style="colour:navy;">Tips f\xF6r anv\xE4ndning:</h3><p>{2}</p></body></html> +arcDoc.htmlText=<html><head><meta name="CrossfireEditor" content="tmp"><title>{0}</title></head><body><h1 style="text-align:center;colour:navy;">Type: {0}</h1><h3 style="colour:navy;">Funktionalitet f\xF6r {0}</h3><p>{1}</p><h3 style="colour:navy;">Tips f\xF6r anv\xE4ndning:</h3><p>{2}</p></body></html> # Options Modified: trunk/src/doc/start.xhtml =================================================================== --- trunk/src/doc/start.xhtml 2007-01-13 21:32:41 UTC (rev 1595) +++ trunk/src/doc/start.xhtml 2007-01-13 21:50:03 UTC (rev 1596) @@ -42,12 +42,12 @@ </p> <h3>Get Gridarta4Crossfire</h3> <p> - Gridarta4Crossfire is aka CFJavaEditor. + Gridarta4Crossfire is aka CrossfireEditor. The crossfire website has some useful information about this for you, including a link to download an alpha pre-release of Gridarta4Crossfire: </p> <ul> <li><a href="http://crossfire.real-time.com/editors/java-editor/install/linux_debian-v5.html">Java Installation</a></li> - <li><a href="http://crossfire.real-time.com/editors/java-editor/install/windows.html">CFJavaEditor Installation - Windows</a></li> + <li><a href="http://crossfire.real-time.com/editors/java-editor/install/windows.html">CrossfireEditor Installation - Windows</a></li> </ul> <h3>Get Gridarta4Daimonin</h3> <p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-13 21:58:48
|
Revision: 1597 http://svn.sourceforge.net/gridarta/?rev=1597&view=rev Author: akirschbaum Date: 2007-01-13 13:58:18 -0800 (Sat, 13 Jan 2007) Log Message: ----------- Use 'log' prefix for logging text messages. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainView.java trunk/src/app/net/sf/gridarta/data/NamedTreeNode.java trunk/src/app/net/sf/gridarta/messages.properties Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-13 21:50:03 UTC (rev 1596) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2007-01-13 21:58:18 UTC (rev 1597) @@ -1039,7 +1039,7 @@ */ public boolean saveLevelAsWanted(final MapControl level) { if (level == null) { - log.warn(ACTION_FACTORY.getString("saveLevelAsWithNull")); + log.warn(ACTION_FACTORY.getString("logSaveLevelAsWithNull")); return false; } @@ -1161,7 +1161,7 @@ throw new IOException("cannot rename " + tmpFile + " to " + file); } if (log.isInfoEnabled()) { - log.info(ACTION_FACTORY.format("imageCreated", file, mapControl.getMapFileName())); + log.info(ACTION_FACTORY.format("logImageCreated", file, mapControl.getMapFileName())); } } catch (final IOException e) { ACTION_FACTORY.showMessageDialog(mainView, "createImgIOException", file); Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2007-01-13 21:50:03 UTC (rev 1596) +++ trunk/crossfire/src/cfeditor/CMainView.java 2007-01-13 21:58:18 UTC (rev 1597) @@ -664,7 +664,7 @@ view.show(); return; } catch (final PropertyVetoException e) { - log.warn(ACTION_FACTORY.format("unexpectedException", e)); + log.warn(ACTION_FACTORY.format("logUnexpectedException", e)); } } updateFocus(true); Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2007-01-13 21:50:03 UTC (rev 1596) +++ trunk/daimonin/src/daieditor/CMainControl.java 2007-01-13 21:58:18 UTC (rev 1597) @@ -1258,7 +1258,7 @@ */ public boolean saveLevelAsWanted(final MapControl level) { if (level == null) { - log.warn(ACTION_FACTORY.getString("saveLevelAsWithNull")); + log.warn(ACTION_FACTORY.getString("logSaveLevelAsWithNull")); return false; } @@ -1364,7 +1364,7 @@ throw new IOException("cannot rename " + tmpFile + " to " + file); } if (log.isInfoEnabled()) { - log.info(ACTION_FACTORY.format("imageCreated", file, mapControl.getMapFileName())); + log.info(ACTION_FACTORY.format("logImageCreated", file, mapControl.getMapFileName())); } } catch (final IOException e) { ACTION_FACTORY.showMessageDialog(mainView, "createImgIOException", file); Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2007-01-13 21:50:03 UTC (rev 1596) +++ trunk/daimonin/src/daieditor/CMainView.java 2007-01-13 21:58:18 UTC (rev 1597) @@ -534,7 +534,7 @@ view.requestFocus(); view.restoreSubcomponentFocus(); } catch (final PropertyVetoException e) { - log.warn(ACTION_FACTORY.format("unexpectedException", e)); + log.warn(ACTION_FACTORY.format("logUnexpectedException", e)); } } } else { @@ -548,7 +548,7 @@ view.restoreSubcomponentFocus(); return; } catch (final PropertyVetoException e) { - log.warn(ACTION_FACTORY.format("unexpectedException", e)); + log.warn(ACTION_FACTORY.format("logUnexpectedException", e)); } } } @@ -597,7 +597,7 @@ view.restoreSubcomponentFocus(); return; } catch (final PropertyVetoException e) { - log.warn(ACTION_FACTORY.format("unexpectedException", e)); + log.warn(ACTION_FACTORY.format("logUnexpectedException", e)); } } updateFocus(true); Modified: trunk/src/app/net/sf/gridarta/data/NamedTreeNode.java =================================================================== --- trunk/src/app/net/sf/gridarta/data/NamedTreeNode.java 2007-01-13 21:50:03 UTC (rev 1596) +++ trunk/src/app/net/sf/gridarta/data/NamedTreeNode.java 2007-01-13 21:58:18 UTC (rev 1597) @@ -128,7 +128,7 @@ private void append(final String path, final T namedObject) { childNodeArray = null; if (path == null) { - log.warn(ACTION_FACTORY.format("namedTreeNodeWithoutPath", namedObject.getPath(), namedObject.getName(), namedObject.getClass().getName())); + log.warn(ACTION_FACTORY.format("logNamedTreeNodeWithoutPath", namedObject.getPath(), namedObject.getName(), namedObject.getClass().getName())); return; } assert dir : "append may only be invoked on directory nodes."; Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2007-01-13 21:50:03 UTC (rev 1596) +++ trunk/src/app/net/sf/gridarta/messages.properties 2007-01-13 21:58:18 UTC (rev 1597) @@ -1,7 +1,6 @@ # Warning: This file MUST be ISO-8859-1 # See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding -namedTreeNodeWithoutPath=No path! Object Path: {0} Object Name: {1} Object Type: {2} chooseNamedObject.title=Choose a {0} archCollectArches=Collecting Arches... archCollectErrorIOException.title=Collect Error @@ -166,9 +165,10 @@ ####################### # Various Log Messages -saveLevelAsWithNull=DEBUG: CMainControl.saveLevelAsWanted(CMapControl level) invoked with null argument. -imageCreated=Created image "{0}" of map "{1}". -unexpectedException=Unexpected exception: {0} +logImageCreated=Created image "{0}" of map "{1}". +logNamedTreeNodeWithoutPath=No path! Object Path: {0} Object Name: {1} Object Type: {2} +logSaveLevelAsWithNull=DEBUG: CMainControl.saveLevelAsWanted(CMapControl level) invoked with null argument. +logUnexpectedException=Unexpected exception: {0} # Edit undo.text=Undo This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-13 22:17:12
|
Revision: 1598 http://svn.sourceforge.net/gridarta/?rev=1598&view=rev Author: akirschbaum Date: 2007-01-13 14:17:03 -0800 (Sat, 13 Jan 2007) Log Message: ----------- Allow selection of tail parts in pickmaps. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/daimonin/src/daieditor/CopyBuffer.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2007-01-13 21:58:18 UTC (rev 1597) +++ trunk/crossfire/ChangeLog 2007-01-13 22:17:03 UTC (rev 1598) @@ -1,5 +1,7 @@ 2007-01-13 Andreas Kirschbaum + * Allow selection of tail parts in pickmaps. + * Rename application to "CrossfireEditor.jar". * Add build information (including the SVN revision number) and Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-01-13 21:58:18 UTC (rev 1597) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2007-01-13 22:17:03 UTC (rev 1598) @@ -333,9 +333,7 @@ final List<GameObject> objects = new ArrayList<GameObject>(max); for (final MapSquare<GameObject, MapArchObject> mapSquare : mapSquares) { for (final GameObject node : mapSquare) { - if (!node.isTail()) { - objects.add(node); - } + objects.add(node.getHead()); } } return objects.isEmpty() ? null : objects; Modified: trunk/daimonin/src/daieditor/CopyBuffer.java =================================================================== --- trunk/daimonin/src/daieditor/CopyBuffer.java 2007-01-13 21:58:18 UTC (rev 1597) +++ trunk/daimonin/src/daieditor/CopyBuffer.java 2007-01-13 22:17:03 UTC (rev 1598) @@ -335,9 +335,7 @@ final List<GameObject> objects = new ArrayList<GameObject>(max); for (final MapSquare<GameObject, MapArchObject> mapSquare : mapSquares) { for (final GameObject node : mapSquare) { - if (!node.isTail()) { - objects.add(node); - } + objects.add(node.getHead()); } } return objects.isEmpty() ? null : objects; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2007-01-13 22:28:35
|
Revision: 1599 http://svn.sourceforge.net/gridarta/?rev=1599&view=rev Author: akirschbaum Date: 2007-01-13 14:28:31 -0800 (Sat, 13 Jan 2007) Log Message: ----------- Fix pickmaps having default file name. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java Modified: trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-13 22:17:03 UTC (rev 1598) +++ trunk/crossfire/src/cfeditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-13 22:28:31 UTC (rev 1599) @@ -191,6 +191,7 @@ final MapControl mapControl = new MapControl(mainControl, objects, maparch, true, null); mapControl.getMapViewFrame().setAutoscrolls(true); mapControl.setMapFile(mapFile); + mapControl.setMapFileName(mapFile.getPath()); mapControl.resetModified(); final int index = getIndex(mapFile); Modified: trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java =================================================================== --- trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-13 22:17:03 UTC (rev 1598) +++ trunk/daimonin/src/daieditor/gui/pickmapchooser/PickmapChooserControl.java 2007-01-13 22:28:31 UTC (rev 1599) @@ -189,6 +189,7 @@ final MapControl mapControl = new MapControl(mainControl, objects, maparch, true, true); mapControl.getMapViewFrame().setAutoscrolls(true); mapControl.setMapFile(mapFile); + mapControl.setMapFileName(mapFile.getPath()); mapControl.resetModified(); final int index = getIndex(mapFile); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2007-01-14 01:50:26
|
Revision: 1610 http://svn.sourceforge.net/gridarta/?rev=1610&view=rev Author: christianhujer Date: 2007-01-13 17:50:21 -0800 (Sat, 13 Jan 2007) Log Message: ----------- Optimized imports. Modified Paths: -------------- trunk/crossfire/src/cfeditor/filter/AttributeFilter.java trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java trunk/crossfire/src/cfeditor/gui/AboutDialog.java trunk/crossfire/src/cfeditor/map/MapControl.java trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java trunk/src/app/net/sf/gridarta/Spells.java trunk/src/app/net/sf/gridarta/io/IOUtils.java Modified: trunk/crossfire/src/cfeditor/filter/AttributeFilter.java =================================================================== --- trunk/crossfire/src/cfeditor/filter/AttributeFilter.java 2007-01-14 01:48:05 UTC (rev 1609) +++ trunk/crossfire/src/cfeditor/filter/AttributeFilter.java 2007-01-14 01:50:21 UTC (rev 1610) @@ -15,8 +15,8 @@ import net.sf.gridarta.gameobject.GameObject; import net.sf.japi.swing.ActionFactory; import org.apache.log4j.Logger; +import org.jdom.Element; import org.jetbrains.annotations.NotNull; -import org.jdom.Element; /** * Filter for attributes. Modified: trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-14 01:48:05 UTC (rev 1609) +++ trunk/crossfire/src/cfeditor/gameobject/scripts/ScriptedEvent.java 2007-01-14 01:50:21 UTC (rev 1610) @@ -22,8 +22,8 @@ import cfeditor.CMainControl; import cfeditor.gameobject.GameObject; +import java.awt.FlowLayout; import java.io.File; -import java.awt.FlowLayout; import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; Modified: trunk/crossfire/src/cfeditor/gui/AboutDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/AboutDialog.java 2007-01-14 01:48:05 UTC (rev 1609) +++ trunk/crossfire/src/cfeditor/gui/AboutDialog.java 2007-01-14 01:50:21 UTC (rev 1610) @@ -27,7 +27,6 @@ import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; -import java.util.Enumeration; import java.util.Properties; import java.util.ResourceBundle; import java.util.SortedSet; Modified: trunk/crossfire/src/cfeditor/map/MapControl.java =================================================================== --- trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-14 01:48:05 UTC (rev 1609) +++ trunk/crossfire/src/cfeditor/map/MapControl.java 2007-01-14 01:50:21 UTC (rev 1610) @@ -24,7 +24,6 @@ package cfeditor.map; -import cfeditor.AutojoinLists; import cfeditor.CMainControl; import cfeditor.CopyBuffer; import cfeditor.IGUIConstants; Modified: trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java 2007-01-14 01:48:05 UTC (rev 1609) +++ trunk/daimonin/src/daieditor/gameobject/scripts/ScriptArchData.java 2007-01-14 01:50:21 UTC (rev 1610) @@ -51,8 +51,8 @@ import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.WindowConstants; +import net.sf.gridarta.gameobject.scripts.UndefinedEventArchetypeException; import net.sf.gridarta.io.PathManager; -import net.sf.gridarta.gameobject.scripts.UndefinedEventArchetypeException; import net.sf.gridarta.textedit.scripteditor.ScriptEditControl; import net.sf.japi.swing.ActionFactory; import net.sf.japi.util.Arrays2; Modified: trunk/src/app/net/sf/gridarta/Spells.java =================================================================== --- trunk/src/app/net/sf/gridarta/Spells.java 2007-01-14 01:48:05 UTC (rev 1609) +++ trunk/src/app/net/sf/gridarta/Spells.java 2007-01-14 01:50:21 UTC (rev 1610) @@ -7,10 +7,10 @@ import javax.swing.JFileChooser; import javax.swing.filechooser.FileFilter; import javax.xml.parsers.DocumentBuilder; +import net.sf.gridarta.io.IOUtils; import net.sf.japi.swing.ActionFactory; import net.sf.japi.util.filter.file.FilenameFileFilter; import net.sf.japi.xml.NodeListIterator; -import net.sf.gridarta.io.IOUtils; import org.apache.log4j.Logger; import org.w3c.dom.Document; import org.w3c.dom.Element; Modified: trunk/src/app/net/sf/gridarta/io/IOUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/io/IOUtils.java 2007-01-14 01:48:05 UTC (rev 1609) +++ trunk/src/app/net/sf/gridarta/io/IOUtils.java 2007-01-14 01:50:21 UTC (rev 1610) @@ -11,8 +11,8 @@ import java.io.InputStreamReader; import java.io.Reader; import java.io.UnsupportedEncodingException; +import java.net.MalformedURLException; import java.net.URI; -import java.net.MalformedURLException; import java.net.URL; import org.jetbrains.annotations.NotNull; 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...> - 2007-01-15 07:20:07
|
Revision: 1612 http://svn.sourceforge.net/gridarta/?rev=1612&view=rev Author: christianhujer Date: 2007-01-14 02:59:22 -0800 (Sun, 14 Jan 2007) Log Message: ----------- Reduced differences in build.xml. Modified Paths: -------------- trunk/crossfire/build.xml trunk/daimonin/build.xml Modified: trunk/crossfire/build.xml =================================================================== --- trunk/crossfire/build.xml 2007-01-14 10:38:03 UTC (rev 1611) +++ trunk/crossfire/build.xml 2007-01-14 10:59:22 UTC (rev 1612) @@ -23,15 +23,16 @@ <!-- set properties and clean build directory --> <target name="init"> + <property name="package" value="cfeditor" /> + <property name="targetName" value="Crossfire" /> <property file="developer.properties" /> <property name="src.dir" value="src" /> <property name="lib.dir" value="lib" /> <property name="devlib.dir" value="devlib/" /><!-- Don't forget trailing / ! --> <property name="test.dir" value="test" /> <property name="resource.dir" value="resource" /> - <property name="doc.dir" value="docs" /> <property name="build.dir.production" value="class/production" /> - <property name="jarname" value="CrossfireEditor.jar" /> + <property name="jarname" value="${targetName}Editor.jar" /> <property name="build.source.version" value="1.5" /> <property name="build.target.version" value="${build.source.version}" /> <property name="build.source.encoding" value="utf-8" /> @@ -94,7 +95,6 @@ <unjar src="${lib.dir}/bsh-commands.jar" dest="${build.dir.production}" /> <unjar src="${lib.dir}/bsh-classgen.jar" dest="${build.dir.production}" /> <unjar src="${lib.dir}/bsh-util.jar" dest="${build.dir.production}" /> - <unjar src="${lib.dir}/log4j.jar" dest="${build.dir.production}" /> <delete dir="${build.dir.production}/META-INF" /> <!-- copy the resource files into the build dir --> @@ -124,11 +124,11 @@ <fileset dir="../lib"> <include name="japi.jar-LICENSE" /> </fileset> - + <zipfileset src="../lib/log4j-1.2.13.jar" /> <zipgroupfileset dir="../lib/" includes="japi-*.jar" /> <!-- creating the manifest --> <manifest> - <attribute name="Main-Class" value="cfeditor.CFJavaEditor"/> + <attribute name="Main-Class" value="${package}.CFJavaEditor"/> </manifest> </jar> @@ -156,11 +156,11 @@ author = "yes" use = "yes" splitindex = "yes" - windowtitle = "Daimonin Editor — API Documentation" - doctitle = "Daimonin Editor<br />API Documentation" - header = "Daimonin Editor<br />API Documentation" - footer = "Daimonin Editor<br />API Documentation" - bottom = "<div style="text-align:center;">© 2003 Andreas Vogl, Michael Toennis, 2004-2006 The Daimonin Developers, 2006 The Gridarta Developers. All rights reserved.</div>" + windowtitle = "${targetName} Editor — API Documentation" + doctitle = "${targetName} Editor<br />API Documentation" + header = "${targetName} Editor<br />API Documentation" + footer = "${targetName} Editor<br />API Documentation" + bottom = "<div style="text-align:center;">© 2003 Andreas Vogl, Michael Toennis, 2004-2006 The ${targetName} Developers, 2006 The Gridarta Developers. All rights reserved.</div>" serialwarn = "yes" charset = "utf-8" docencoding = "utf-8" @@ -168,7 +168,7 @@ encoding = "${build.source.encoding}" linksource = "yes" private = "yes" - overview = "src/cfeditor/overview.html" + overview = "src/${package}/overview.html" link = "${user.javadoc.link}" > <classpath> @@ -251,7 +251,7 @@ <target name = "ftpPublish" description = "publishes ${jarname} using ftp" - depends="preparePublish" + depends = "preparePublish" > <ftp server="${user.ftp.host}" Modified: trunk/daimonin/build.xml =================================================================== --- trunk/daimonin/build.xml 2007-01-14 10:38:03 UTC (rev 1611) +++ trunk/daimonin/build.xml 2007-01-14 10:59:22 UTC (rev 1612) @@ -23,6 +23,8 @@ <!-- set properties and clean build directory --> <target name="init"> + <property name="package" value="daieditor" /> + <property name="targetName" value="Daimonin" /> <property file="developer.properties" /> <property name="src.dir" value="src" /> <property name="lib.dir" value="lib" /> @@ -30,9 +32,8 @@ <property name="test.dir" value="test" /> <property name="resource.dir" value="resource" /> <property name="arch.dir" value="../arch" /> - <property name="config.dir" value="../arch/dev/editor/conf" /> <property name="build.dir.production" value="class/production" /> - <property name="jarname" value="DaimoninEditor.jar" /> + <property name="jarname" value="${targetName}Editor.jar" /> <property name="build.source.version" value="1.5" /> <property name="build.target.version" value="${build.source.version}" /> <property name="build.source.encoding" value="utf-8" /> @@ -89,8 +90,6 @@ <!-- create JAR file --> <target name="jar" depends="compile" description="compiles source and creates jar."> - <delete dir="${build.dir.production}/META-INF" /> - <!-- copy the resource files into the build dir --> <copy todir="${build.dir.production}"> <fileset dir="${resource.dir}"> @@ -104,9 +103,6 @@ <copy todir="${build.dir.production}"> <fileset dir="../src/app" excludes="**/*.java,**/package.html,**/overview.html" /> </copy> - <!--copy todir="${build.dir.production}"> - <fileset dir="${config.dir}" /> - </copy--> <copy todir="${build.dir.production}"> <fileset dir="${src.dir}" includes="**/*.properties" /> </copy> @@ -123,21 +119,17 @@ <fileset dir="${build.dir.production}" excludes="MANIFEST.MF,test/**"/> <fileset file="build.properties" /> <fileset file="../COPYING" /> - <fileset dir="lib"> + <fileset dir="${lib.dir}"> <include name="*-LICENSE" /> </fileset> <fileset dir="../lib"> <include name="japi.jar-LICENSE" /> </fileset> - <fileset dir=".."> - <include name="arch/dev/editor/conf/ArchObjectMatchers.dtd" /> - <include name="arch/dev/editor/conf/ArchObjectMatchers.xml" /> - </fileset> <zipfileset src="../lib/log4j-1.2.13.jar" /> <zipgroupfileset dir="../lib/" includes="japi-*.jar" /> <!-- creating the manifest --> <manifest> - <attribute name="Main-Class" value="daieditor.CFJavaEditor"/> + <attribute name="Main-Class" value="${package}.CFJavaEditor"/> <attribute name="SplashScreen-Image" value="icons/CFIntro.gif" /> </manifest> </jar> @@ -166,11 +158,11 @@ author = "yes" use = "yes" splitindex = "yes" - windowtitle = "Daimonin Editor — API Documentation" - doctitle = "Daimonin Editor<br />API Documentation" - header = "Daimonin Editor<br />API Documentation" - footer = "Daimonin Editor<br />API Documentation" - bottom = "<div style="text-align:center;">© 2003 Andreas Vogl, Michael Toennis, 2004-2006 The Daimonin Developers, 2006 The Gridarta Developers. All rights reserved.</div>" + windowtitle = "${targetName} Editor — API Documentation" + doctitle = "${targetName} Editor<br />API Documentation" + header = "${targetName} Editor<br />API Documentation" + footer = "${targetName} Editor<br />API Documentation" + bottom = "<div style="text-align:center;">© 2003 Andreas Vogl, Michael Toennis, 2004-2006 The ${targetName} Developers, 2006 The Gridarta Developers. All rights reserved.</div>" serialwarn = "yes" charset = "utf-8" docencoding = "utf-8" @@ -178,7 +170,7 @@ encoding = "${build.source.encoding}" linksource = "yes" private = "yes" - overview = "src/daieditor/overview.html" + overview = "src/${package}/overview.html" link = "${user.javadoc.link}" > <classpath> @@ -259,8 +251,29 @@ </target> <target + name = "ftpPublish" + description = "publishes ${jarname} using ftp" + depends = "preparePublish" + > + <ftp + server="${user.ftp.host}" + userid="${user.ftp.user}" + password="${user.ftp.pass}" + remotedir="${user.ftp.dir}" + depends="${user.ftp.depends}" + passive="${user.ftp.passive}" + ignoreNoncriticalErrors="${user.ftp.ignoreNoncriticalErrors}" + > + <fileset dir="."> + <include name="${jarname}" /> + <include name="update.properties" /> + </fileset> + </ftp> + </target> + + <target name = "scpPublish" - description = "Releases a nightly build on sourceforge usable for auto-update." + description = "publishes ${jarname} using scp" depends = "preparePublish" > <scp @@ -276,11 +289,4 @@ </scp> </target> - <target - name = "release" - description = "Releases a build on sourceforge usable for auto-update plus a new release package on sourceforge and freshmeat." - depends = "scpPublish" - > - </target> - </project> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |