You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(103) |
Jun
(121) |
Jul
(16) |
Aug
(67) |
Sep
(126) |
Oct
(161) |
Nov
(164) |
Dec
(588) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(394) |
Feb
(181) |
Mar
(131) |
Apr
(180) |
May
(255) |
Jun
(11) |
Jul
(79) |
Aug
(70) |
Sep
(274) |
Oct
(138) |
Nov
(195) |
Dec
(8) |
2008 |
Jan
(3) |
Feb
(142) |
Mar
(162) |
Apr
(124) |
May
(148) |
Jun
(157) |
Jul
(425) |
Aug
(373) |
Sep
(264) |
Oct
(315) |
Nov
(225) |
Dec
(6) |
2009 |
Jan
(67) |
Feb
(78) |
Mar
(279) |
Apr
(294) |
May
(92) |
Jun
(65) |
Jul
(134) |
Aug
(41) |
Sep
(138) |
Oct
(125) |
Nov
(126) |
Dec
(122) |
2010 |
Jan
(15) |
Feb
(48) |
Mar
(9) |
Apr
(195) |
May
(373) |
Jun
(507) |
Jul
(42) |
Aug
(16) |
Sep
(38) |
Oct
(81) |
Nov
(64) |
Dec
(18) |
2011 |
Jan
(13) |
Feb
(12) |
Mar
(39) |
Apr
(1) |
May
(2) |
Jun
(27) |
Jul
(27) |
Aug
(31) |
Sep
(14) |
Oct
(102) |
Nov
(20) |
Dec
(37) |
2012 |
Jan
(22) |
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(2) |
Jun
(18) |
Jul
(6) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(47) |
Jun
(7) |
Jul
(107) |
Aug
|
Sep
|
Oct
(112) |
Nov
(31) |
Dec
(17) |
2014 |
Jan
(29) |
Feb
(111) |
Mar
(34) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(18) |
Dec
(10) |
From: <aki...@us...> - 2006-12-18 18:53:11
|
Revision: 1184 http://svn.sourceforge.net/gridarta/?rev=1184&view=rev Author: akirschbaum Date: 2006-12-18 10:53:10 -0800 (Mon, 18 Dec 2006) Log Message: ----------- Simplify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapViewBasic.java Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 23:44:15 UTC (rev 1183) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-18 18:53:10 UTC (rev 1184) @@ -456,10 +456,7 @@ changedFlagNotify(); final Point dragPoint = event.getPoint(); // Mouse pointer - Point temp = renderer.getTileLocationAt(dragPoint, null); // tile under Mouse pointer - if (temp == null) { - temp = new Point(-1, -1); - } + final Point temp = renderer.getTileLocationAt(dragPoint, null); // tile under Mouse pointer if ((event.getModifiers() & InputEvent.BUTTON1_MASK) != 0) { // Left Mouse Button: Selected area gets highlighted @@ -469,7 +466,7 @@ mapCursor.setLocation(temp); // Right Mouse Button: Arches get inserted all the way - if (temp.x == -1 || temp.y == -1) { + if (temp == null) { mainControl.getMainView().setMapTileList(null, null); } else { mapControl.insertSelArchToMap(temp, false); @@ -479,7 +476,7 @@ // Middle Mouse Button: Arches get deleted all the way - if (temp.x == -1 || temp.y == -1) { + if (temp == null) { mainControl.getMainView().setMapTileList(null, null); } else { // delete the topmost arch (matching the view settings) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 23:44:21
|
Revision: 1183 http://svn.sourceforge.net/gridarta/?rev=1183&view=rev Author: akirschbaum Date: 2006-12-17 15:44:15 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java trunk/crossfire/src/cfeditor/gui/map/LevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 23:33:58 UTC (rev 1182) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 23:44:15 UTC (rev 1183) @@ -277,15 +277,6 @@ paintHighlightTile(grfx, point); } - @Override public void setHighlightTile(final Point point) { - if (isPickmap) { - paintHighlightTile(getGraphics(), point); - } else { - paintHighlightTile(backBuffer.getGraphics(), point); - repaint(); - } - } - /** * If the given map-square is highlighted, the highligh-icon is drawn * on that square. Modified: trunk/crossfire/src/cfeditor/gui/map/LevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/LevelRenderer.java 2006-12-17 23:33:58 UTC (rev 1182) +++ trunk/crossfire/src/cfeditor/gui/map/LevelRenderer.java 2006-12-17 23:44:15 UTC (rev 1183) @@ -52,8 +52,6 @@ public abstract void modelChanged(); - public abstract void setHighlightTile(final Point point); - public abstract void freeBackBuffer(); } // class LevelRenderer This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 23:33:59
|
Revision: 1182 http://svn.sourceforge.net/gridarta/?rev=1182&view=rev Author: akirschbaum Date: 2006-12-17 15:33:58 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Accelerate map drawing speed. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java trunk/crossfire/src/cfeditor/gui/map/LevelRenderer.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-12-17 23:28:03 UTC (rev 1181) +++ trunk/crossfire/ChangeLog 2006-12-17 23:33:58 UTC (rev 1182) @@ -1,3 +1,7 @@ +2006-12-18 Andreas Kirschbaum + + * Accelerate map drawing speed. + 2006-12-17 Andreas Kirschbaum * Split fill and floodfill into separate functions in user Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 23:28:03 UTC (rev 1181) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 23:33:58 UTC (rev 1182) @@ -549,9 +549,6 @@ if (!mapControl.isPickmap()) { mainControl.getMainView().setMapTileList(mainControl.getCurrentMap(), null); } - - // paint the highlight-icon - renderer.setHighlightTile(/*((JComponent)renderer).getGraphics(), */mapLoc); } } Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 23:28:03 UTC (rev 1181) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 23:33:58 UTC (rev 1182) @@ -46,6 +46,7 @@ import net.sf.gridarta.gui.map.MapGridListener; import net.sf.gridarta.map.MapModelEvent; import net.sf.gridarta.map.MapModelListener; +import net.sf.gridarta.map.MapSquare; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -54,6 +55,7 @@ * The component that does the actual rendering of tiles in the palette. * Flat version. * @author unknown + * @author Andreas Kirschbaum */ public final class DefaultLevelRenderer extends LevelRenderer implements MapGridListener, MapModelListener { @@ -168,10 +170,7 @@ bufGrfx.fillRect(0, 0, viewWidth, viewHeight); // paint the mapview into the image - final Point storeOffset = new Point(borderOffset); - borderOffset.setLocation(0, 0); paintComponent(bufGrfx, true); - borderOffset.setLocation(storeOffset); return bufImage; } @@ -179,16 +178,21 @@ if (isPickmap) { paintComponent(grfx, false); } else { - grfx.drawImage(backBuffer, borderOffset.x, borderOffset.y, null); + paintFromBackbuffer(grfx, 0, 0, bufferedSize.width, bufferedSize.height); } } + private void paintFromBackbuffer(final Graphics grfx, final int x, final int y, final int width, final int height) { + if (grfx == null) { + return; + } + + grfx.drawImage(backBuffer, x + borderOffset.x, y + borderOffset.y, x + borderOffset.x + width, y + borderOffset.y + height, x, y, x + width, y + height, null); + } + @Override public void modelChanged() { if (!isPickmap) { - final Point storeOffset = new Point(borderOffset); - borderOffset.setLocation(0, 0); paintComponent(backBuffer.getGraphics(), false); - borderOffset.setLocation(storeOffset); } repaint(); } @@ -244,7 +248,7 @@ * more difficult. :( * @param point Map coordinates for the tile to draw */ - @Override public void paintTile(final Point point) { + private void paintTile(final Point point) { final Graphics grfx; if (isPickmap) { grfx = getGraphics(); // graphics context for drawing in the mapview @@ -309,16 +313,16 @@ private void paintSelection(final Graphics grfx) { for (int y = 0; y < mapSize.getHeight(); y++) { for (int x = 0; x < mapSize.getWidth(); x++) { - if (grfx.hitClip(x * 32 + borderOffset.x, y * 32 + borderOffset.y, 32, 32)) { + if (grfx.hitClip(x * 32, y * 32, 32, 32)) { final int gridFlags = mapGrid.getFlags(x, y); if ((gridFlags & MapGrid.GRID_FLAG_SELECTION) != 0) { - CMainControl.getMapSelIcon().paintIcon(this, grfx, x * 32 + borderOffset.x, y * 32 + borderOffset.y); + CMainControl.getMapSelIcon().paintIcon(this, grfx, x * 32, y * 32); } if ((gridFlags & MapGrid.GRID_FLAG_SELECTING) != 0) { - CMainControl.getMapSelIcon().paintIcon(this, grfx, x * 32 + borderOffset.x, y * 32 + borderOffset.y); + CMainControl.getMapSelIcon().paintIcon(this, grfx, x * 32, y * 32); } if ((gridFlags & MapGrid.GRID_FLAG_CURSOR) != 0) { - CMainControl.getMapCursorIcon().paintIcon(this, grfx, x * 32 + borderOffset.x, y * 32 + borderOffset.y); + CMainControl.getMapCursorIcon().paintIcon(this, grfx, x * 32, y * 32); } } } @@ -335,18 +339,10 @@ // grid lines if (mapViewBasic.isGridVisible()) { for (int x = 0; x <= mapGrid.getSize().getWidth(); x++) { - grfx.drawLine( - x * 32 + borderOffset.x, - borderOffset.x, - x * 32 + borderOffset.y, - mapGrid.getSize().getHeight() * 32 + borderOffset.y); + grfx.drawLine(x * 32, 0, x * 32, mapGrid.getSize().getHeight() * 32); } for (int y = 0; y <= mapGrid.getSize().getHeight(); y++) { - grfx.drawLine( - borderOffset.x, - y * 32 + borderOffset.y, - mapGrid.getSize().getWidth() * 32 + borderOffset.x, - y * 32 + borderOffset.y); + grfx.drawLine(0, y * 32, mapGrid.getSize().getWidth() * 32, y * 32); } } } @@ -375,13 +371,21 @@ /** {@inheritDoc} */ public void mapGridChanged(@NotNull final MapGridEvent e) { - resizeMapGrid(); + final Rectangle recChange = mapGrid.getRecChange(); + for (int x = recChange.x; x < recChange.x + recChange.width; x++) { + for (int y = recChange.y; y < recChange.y + recChange.height; y++) { + paintTile(new Point(x, y)); + } + } + + if (!isPickmap) { + paintFromBackbuffer(getGraphics(), recChange.x * 32, recChange.y * 32, recChange.width * 32, recChange.height * 32); + } } /** {@inheritDoc} */ public void mapGridResized(@NotNull final MapGridEvent e) { - mapSize = e.getSource().getSize(); - modelChanged(); + resizeMapGrid(); } /** {@inheritDoc} */ @@ -391,7 +395,35 @@ /** {@inheritDoc} */ public void mapSquaresChanged(final MapModelEvent e) { - modelChanged(); + final MapSquare<GameObject>[] squares = e.getSquares(); + int minX = bufferedSize.width; + int minY = bufferedSize.height; + int maxX = 0; + int maxY = 0; + if (squares != null) { + for (final MapSquare square : squares) { + final int x = square.getMapX(); + final int y = square.getMapY(); + paintTile(new Point(x, y)); + + if (minX > x) { + minX = x; + } + if (minY > y) { + minY = y; + } + if (maxX < x) { + maxX = x; + } + if (maxY < y) { + maxY = y; + } + } + } + + if (!isPickmap && minX <= maxX && minY <= maxY) { + paintFromBackbuffer(getGraphics(), minX * 32, minY * 32, (maxX + 1 - minX) * 32, (maxY + 1 - minY) * 32); + } } /** {@inheritDoc} */ @@ -443,12 +475,12 @@ if (!mapModel.containsArchObject(point)) { if (isPickmap) { grfx.setColor(IGUIConstants.BG_COLOR); - grfx.fillRect(point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y, 32, 32); + grfx.fillRect(point.x * 32, point.y * 32, 32, 32); } else { - CMainControl.getUnknownTileIcon().paintIcon(DefaultLevelRenderer.this, grfx, point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y); + CMainControl.getUnknownTileIcon().paintIcon(DefaultLevelRenderer.this, grfx, point.x * 32, point.y * 32); } } else { - grfx.fillRect(point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y, 32, 32); + grfx.fillRect(point.x * 32, point.y * 32, 32, 32); for (final GameObject node : mapModel.getMapSquare(point)) { filter.objectInSquare(node); if (!filter.canShow(node)) { @@ -480,7 +512,7 @@ offset.y = -32 * node.getMultiY(); } } - img.paintIcon(DefaultLevelRenderer.this, grfx, point.x * 32 + borderOffset.x + offset.x, point.y * 32 + borderOffset.y + offset.y); + img.paintIcon(DefaultLevelRenderer.this, grfx, point.x * 32 + offset.x, point.y * 32 + offset.y); } } } @@ -491,7 +523,7 @@ final Color alpha = highLightMask[i]; final Color c = grfx.getColor(); grfx.setColor(alpha); - grfx.fillRect(point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y, 32, 32); + grfx.fillRect(point.x * 32, point.y * 32, 32, 32); grfx.setColor(c); } } Modified: trunk/crossfire/src/cfeditor/gui/map/LevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/LevelRenderer.java 2006-12-17 23:28:03 UTC (rev 1181) +++ trunk/crossfire/src/cfeditor/gui/map/LevelRenderer.java 2006-12-17 23:33:58 UTC (rev 1182) @@ -41,8 +41,6 @@ */ public abstract BufferedImage getFullImage(); - public abstract void paintTile(final Point point); - /** * Returns the map location at the given point or null if no map location * is at the point. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 23:28:04
|
Revision: 1181 http://svn.sourceforge.net/gridarta/?rev=1181&view=rev Author: akirschbaum Date: 2006-12-17 15:28:03 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Set change rectangle to minimal affected area. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/map/MapGrid.java Modified: trunk/src/app/net/sf/gridarta/gui/map/MapGrid.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/MapGrid.java 2006-12-17 23:11:15 UTC (rev 1180) +++ trunk/src/app/net/sf/gridarta/gui/map/MapGrid.java 2006-12-17 23:28:03 UTC (rev 1181) @@ -171,13 +171,18 @@ /** Clear all selection and pre-selection flags from the grid. */ public void unSelect() { + beginRecChange(); for (int x = 0; x < gridSize.getWidth(); x++) { for (int y = 0; y < gridSize.getHeight(); y++) { - gridFlags[x][y] &= ~(GRID_FLAG_SELECTION | GRID_FLAG_SELECTING); + if ((gridFlags[x][y] & (GRID_FLAG_SELECTION | GRID_FLAG_SELECTING)) != 0) { + gridFlags[x][y] &= ~(GRID_FLAG_SELECTION | GRID_FLAG_SELECTING); + updateRecChange(x, y); + } } } - recChange.setBounds(0, 0, gridSize.getWidth(), gridSize.getHeight()); - fireMapGridChangedEvent(); + if (endRecChange()) { + fireMapGridChangedEvent(); + } } /** @@ -188,7 +193,7 @@ final int tmpFlags = gridFlags[pos.x][pos.y]; gridFlags[pos.x][pos.y] &= ~GRID_FLAG_CURSOR; if (tmpFlags != gridFlags[pos.x][pos.y]) { - recChange.setBounds(pos.x, pos.y, 0, 0); + recChange.setBounds(pos.x, pos.y, 1, 1); fireMapGridChangedEvent(); } } @@ -199,7 +204,7 @@ */ public void setCursor(final Point pos) { gridFlags[pos.x][pos.y] |= GRID_FLAG_CURSOR; - recChange.setBounds(pos.x, pos.y, 0, 0); + recChange.setBounds(pos.x, pos.y, 1, 1); fireMapGridChangedEvent(); } @@ -212,13 +217,18 @@ */ public void preSelect(final Point start, final Point end) { calcRec(start, end); + beginRecChange(); for (int x = cornerMin.x; x <= cornerMax.x; x++) { for (int y = cornerMin.y; y <= cornerMax.y; y++) { - gridFlags[x][y] |= GRID_FLAG_SELECTING; + if ((gridFlags[x][y] & GRID_FLAG_SELECTING) == 0) { + gridFlags[x][y] |= GRID_FLAG_SELECTING; + updateRecChange(x, y); + } } } - recChange.setBounds(mapRec); - fireMapGridChangedEvent(); + if (endRecChange()) { + fireMapGridChangedEvent(); + } } /** @@ -229,13 +239,18 @@ */ public void unPreSelect(final Point start, final Point end) { calcRec(start, end); + beginRecChange(); for (int x = cornerMin.x; x <= cornerMax.x; x++) { for (int y = cornerMin.y; y <= cornerMax.y; y++) { - gridFlags[x][y] &= ~GRID_FLAG_SELECTING; + if ((gridFlags[x][y] & GRID_FLAG_SELECTING) != 0) { + gridFlags[x][y] &= ~GRID_FLAG_SELECTING; + updateRecChange(x, y); + } } } - recChange.setBounds(0, 0, gridSize.getWidth(), gridSize.getHeight()); - fireMapGridChangedEvent(); + if (endRecChange()) { + fireMapGridChangedEvent(); + } } /** @@ -247,18 +262,25 @@ */ public void select(final Point dragStart, final Point pos, final SelectionMode selectionMode) { calcRec(dragStart, pos); + beginRecChange(); switch (selectionMode) { case ADD: for (int x = cornerMin.x; x <= cornerMax.x; x++) { for (int y = cornerMin.y; y <= cornerMax.y; y++) { - gridFlags[x][y] |= GRID_FLAG_SELECTION; + if ((gridFlags[x][y] & GRID_FLAG_SELECTION) == 0) { + gridFlags[x][y] |= GRID_FLAG_SELECTION; + updateRecChange(x, y); + } } } break; case SUB: for (int x = cornerMin.x; x <= cornerMax.x; x++) { for (int y = cornerMin.y; y <= cornerMax.y; y++) { - gridFlags[x][y] &= ~GRID_FLAG_SELECTION; + if ((gridFlags[x][y] & GRID_FLAG_SELECTION) != 0) { + gridFlags[x][y] &= ~GRID_FLAG_SELECTION; + updateRecChange(x, y); + } } } break; @@ -266,12 +288,14 @@ for (int x = cornerMin.x; x <= cornerMax.x; x++) { for (int y = cornerMin.y; y <= cornerMax.y; y++) { gridFlags[x][y] ^= GRID_FLAG_SELECTION; + updateRecChange(x, y); } } break; } - recChange.setBounds(cornerMin.x, cornerMin.y, cornerMax.x - cornerMin.x, cornerMax.y - cornerMin.y); - fireMapGridChangedEvent(); + if (endRecChange()) { + fireMapGridChangedEvent(); + } } /** @@ -440,6 +464,54 @@ } } + /** + * Begin a set of changes. + * + * @note Until {@link #endRecChange()} is called, {@link #recChange} does + * not contain a valid rectangle: <code>width</code> and + * <code>height</code> is used as coordinates. + */ + private void beginRecChange() { + recChange.x = gridSize.getWidth(); + recChange.y = gridSize.getHeight(); + recChange.width = 0; + recChange.height = 0; + } + + /** + * Add a point to the set of changes. + * + * @param x the x-coordinate + * + * @param y the y-coordinate + */ + private void updateRecChange(final int x, final int y) { + if (recChange.x > x) { + recChange.x = x; + } + if (recChange.y > y) { + recChange.y = y; + } + if (recChange.width < x) { + recChange.width = x; + } + if (recChange.height < y) { + recChange.height = y; + } + } + + /** + * End the set of changes and store the bounding box for all recorded + * changes in {@link #recChange}. + * + * @return <code>true</code> if the set of changes is not empty + */ + private boolean endRecChange() { + recChange.width = recChange.width - recChange.x + 1; + recChange.height = recChange.height - recChange.y + 1; + return recChange.width > 0 && recChange.height > 0; + } + /** Modes that describe how tiles get selected. */ public enum SelectionMode { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-17 23:11:17
|
Revision: 1180 http://svn.sourceforge.net/gridarta/?rev=1180&view=rev Author: christianhujer Date: 2006-12-17 15:11:15 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Added scope 'Project without textedit' Modified Paths: -------------- trunk/gridarta.ipr Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2006-12-17 22:58:52 UTC (rev 1179) +++ trunk/gridarta.ipr 2006-12-17 23:11:15 UTC (rev 1180) @@ -76,7 +76,9 @@ <component name="DependenciesAnalyzeManager"> <option name="myForwardDirection" value="false" /> </component> - <component name="DependencyValidationManager" /> + <component name="DependencyValidationManager"> + <scope name="Project without textedit" pattern="!src[gridarta]:net.sf.gridarta.textedit.scripteditor..*&&!src[gridarta]:net.sf.gridarta.textedit.textarea..*" /> + </component> <component name="EclipseCompilerSettings"> <option name="DEBUGGING_INFO" value="true" /> <option name="GENERATE_NO_WARNINGS" value="true" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-17 22:58:52
|
Revision: 1179 http://svn.sourceforge.net/gridarta/?rev=1179&view=rev Author: christianhujer Date: 2006-12-17 14:58:52 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Fixed some nullability issues. Improved documentation. Changed visibility modifiers to be more strict. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditMenuBar.java trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java trunk/src/app/net/sf/gridarta/textedit/textarea/KeywordMap.java trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxDocument.java trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java 2006-12-17 22:54:19 UTC (rev 1178) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/CFPythonPopup.java 2006-12-17 22:58:52 UTC (rev 1179) @@ -146,8 +146,8 @@ } /** - * @return true when this popup menu has been fully initialized and is - * ready for use + * Returns whether this popup menu has been fully initialized and is ready for use. + * @return <code>true</code> if initialized, otherwise <code>false</code>. */ public boolean isInitialized() { return isReady; Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditMenuBar.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditMenuBar.java 2006-12-17 22:54:19 UTC (rev 1178) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditMenuBar.java 2006-12-17 22:58:52 UTC (rev 1179) @@ -49,7 +49,7 @@ /** * Constructor - Builds the MenuBar. - * @param control + * @param control Control that's being used for the menubar. */ public ScriptEditMenuBar(final ScriptEditControl control) { this.control = control; // reference to ScriptEditControl control Modified: trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java 2006-12-17 22:54:19 UTC (rev 1178) +++ trunk/src/app/net/sf/gridarta/textedit/scripteditor/ScriptEditView.java 2006-12-17 22:58:52 UTC (rev 1179) @@ -37,6 +37,8 @@ import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JTabbedPane; +import javax.swing.WindowConstants; +import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import javax.swing.text.BadLocationException; @@ -81,13 +83,13 @@ */ public ScriptEditView(final ScriptEditControl control) { super("Script Pad"); // window title - setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); + setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); textAreas = new ArrayList<JEditTextArea>(); menuBar = new ScriptEditMenuBar(control); // build menu bar setJMenuBar(menuBar); // add menu bar to frame - tabPane = new JTabbedPane(JTabbedPane.TOP); // init tab pane + tabPane = new JTabbedPane(SwingConstants.TOP); // init tab pane tabPane.addChangeListener(new EditTabListener(this)); // // set the window icon @@ -252,7 +254,7 @@ private int index; // index of selected tab - public EditTabListener(final ScriptEditView view) { + private EditTabListener(final ScriptEditView view) { this.view = view; index = view.getSelectedIndex(); } @@ -278,7 +280,7 @@ * Constructor. * @param control ScriptEditControl */ - public EditWindowListener(final ScriptEditControl control) { + private EditWindowListener(final ScriptEditControl control) { this.control = control; } Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java 2006-12-17 22:54:19 UTC (rev 1178) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/InputHandler.java 2006-12-17 22:58:52 UTC (rev 1179) @@ -189,8 +189,13 @@ * @param name the action name * @return action stored for <var>name</var> or <code>null</code> if no such action was found */ - @Nullable public static ActionListener getAction(final String name) { - return actions.get(name); + @NotNull public static ActionListener getAction(final String name) { + final ActionListener action = actions.get(name); + if (action != null) { + return action; + } else { + throw new IllegalArgumentException("No action for " + name); + } } /** Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2006-12-17 22:54:19 UTC (rev 1178) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/JEditTextArea.java 2006-12-17 22:58:52 UTC (rev 1179) @@ -17,6 +17,7 @@ import java.awt.FontMetrics; import java.awt.Insets; import java.awt.LayoutManager; +import java.awt.Adjustable; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.StringSelection; @@ -131,8 +132,8 @@ // Initialize the GUI setLayout(new ScrollLayout()); add(CENTER, painter); - add(RIGHT, vertical = new JScrollBar(JScrollBar.VERTICAL)); - add(BOTTOM, horizontal = new JScrollBar(JScrollBar.HORIZONTAL)); + add(RIGHT, vertical = new JScrollBar(Adjustable.VERTICAL)); + add(BOTTOM, horizontal = new JScrollBar(Adjustable.HORIZONTAL)); // Add some event listeners vertical.addAdjustmentListener(new AdjustHandler()); @@ -1436,75 +1437,75 @@ } // protected members - protected static final String CENTER = "center"; + static final String CENTER = "center"; - protected static final String RIGHT = "right"; + static final String RIGHT = "right"; - protected static final String BOTTOM = "bottom"; + static final String BOTTOM = "bottom"; - protected static JEditTextArea focusedComponent; + static JEditTextArea focusedComponent; - protected static final Timer caretTimer; + static final Timer caretTimer; - protected final TextAreaPainter painter; + final TextAreaPainter painter; - protected JPopupMenu popup; + JPopupMenu popup; - protected final EventListenerList listenerList; + final EventListenerList listenerList; - protected final MutableCaretEvent caretEvent; + final MutableCaretEvent caretEvent; - protected boolean caretBlinks; + boolean caretBlinks; - protected boolean caretVisible; + boolean caretVisible; - protected boolean blink; + boolean blink; - protected boolean editable; + boolean editable; - protected int firstLine; + int firstLine; - protected int visibleLines; + int visibleLines; - protected int electricScroll; + int electricScroll; - protected int horizontalOffset; + int horizontalOffset; - protected final JScrollBar vertical; + final JScrollBar vertical; - protected final JScrollBar horizontal; + final JScrollBar horizontal; - protected boolean scrollBarsInitialized; + boolean scrollBarsInitialized; - protected InputHandler inputHandler; + InputHandler inputHandler; - protected SyntaxDocument document; + SyntaxDocument document; - protected final DocumentHandler documentHandler; + final DocumentHandler documentHandler; - protected final Segment lineSegment; + final Segment lineSegment; - protected int selectionStart; + int selectionStart; - protected int selectionStartLine; + int selectionStartLine; - protected int selectionEnd; + int selectionEnd; - protected int selectionEndLine; + int selectionEndLine; - protected boolean biasLeft; + boolean biasLeft; - protected int bracketPosition; + int bracketPosition; - protected int bracketLine; + int bracketLine; - protected int magicCaret; + int magicCaret; - protected boolean overwrite; + boolean overwrite; - protected boolean rectSelect; + boolean rectSelect; - protected void fireCaretEvent() { + void fireCaretEvent() { final Object[] listeners = listenerList.getListenerList(); for (int i = listeners.length - 2; i >= 0; i--) { if (listeners[i] == CaretListener.class) { @@ -1513,7 +1514,7 @@ } } - protected void updateBracketHighlight(final int newCaretPosition) { + void updateBracketHighlight(final int newCaretPosition) { if (newCaretPosition == 0) { bracketPosition = bracketLine = -1; return; @@ -1533,7 +1534,7 @@ bracketLine = bracketPosition = -1; } - protected void documentChanged(final DocumentEvent evt) { + void documentChanged(final DocumentEvent evt) { final DocumentEvent.ElementChange ch = evt.getChange(document.getDefaultRootElement()); final int count; Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/KeywordMap.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/KeywordMap.java 2006-12-17 22:54:19 UTC (rev 1178) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/KeywordMap.java 2006-12-17 22:58:52 UTC (rev 1179) @@ -102,11 +102,11 @@ this.ignoringCase = ignoringCase; } - protected int getStringMapKey(final String s) { + int getStringMapKey(final String s) { return (Character.toUpperCase(s.charAt(0)) + Character.toUpperCase(s.charAt(s.length() - 1))) % mapLength; } - protected int getSegmentMapKey(final Segment s, final int off, final int len) { + int getSegmentMapKey(final Segment s, final int off, final int len) { return (Character.toUpperCase(s.array[off]) + Character.toUpperCase(s.array[off + len - 1])) % mapLength; } @@ -119,7 +119,7 @@ private final Keyword next; - public Keyword(final char[] keyword, final byte id, final Keyword next) { + Keyword(final char[] keyword, final byte id, final Keyword next) { this.keyword = keyword; this.id = id; this.next = next; Modified: trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxDocument.java =================================================================== --- trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxDocument.java 2006-12-17 22:54:19 UTC (rev 1178) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/SyntaxDocument.java 2006-12-17 22:58:52 UTC (rev 1179) @@ -116,7 +116,7 @@ } // protected members - protected TokenMarker tokenMarker; + 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 2006-12-17 22:54:19 UTC (rev 1178) +++ trunk/src/app/net/sf/gridarta/textedit/textarea/TextAreaPainter.java 2006-12-17 22:58:52 UTC (rev 1179) @@ -51,47 +51,47 @@ private final Segment currentLine; // protected members - protected final JEditTextArea textArea; + final JEditTextArea textArea; - protected SyntaxStyle[] styles; + SyntaxStyle[] styles; - protected Color caretColor; + Color caretColor; - protected Color selectionColor; + Color selectionColor; - protected Color lineHighlightColor; + Color lineHighlightColor; - protected Color bracketHighlightColor; + Color bracketHighlightColor; - protected Color eolMarkerColor; + Color eolMarkerColor; - protected boolean blockCaret; + boolean blockCaret; - protected boolean lineHighlight; + boolean lineHighlight; - protected boolean bracketHighlight; + boolean bracketHighlight; - protected boolean paintInvalid; + boolean paintInvalid; - protected boolean eolMarkers; + boolean eolMarkers; - protected final int cols; + final int cols; - protected final int rows; + final int rows; - protected int tabSize; + int tabSize; - protected FontMetrics fm; + FontMetrics fm; - protected boolean needMetricsUpdate; // need update for font metrics when true + boolean needMetricsUpdate; // need update for font metrics when true - protected boolean needLineUpdate; // need update for line height when true + boolean needLineUpdate; // need update for line height when true - protected int defaultLineHeight; + int defaultLineHeight; - protected int defaultCharWidth; + int defaultCharWidth; - protected Highlight highlights; + Highlight highlights; /** * Creates a new repaint manager. This should be not be called @@ -527,7 +527,7 @@ * This is the first method which gets directly called from paint(). All * lines which are sceduled for redraw get drawn with this method. */ - protected void paintLine(final Graphics gfx, final TokenMarker tokenMarker, final int line, final int x) { + void paintLine(final Graphics gfx, final TokenMarker tokenMarker, final int line, final int x) { final Font defaultFont = getFont(); final Color defaultColor = getForeground(); @@ -547,7 +547,7 @@ } } - protected void paintPlainLine(final Graphics gfx, final int line, final Font defaultFont, final Color defaultColor, int x, int y) { + void paintPlainLine(final Graphics gfx, final int line, final Font defaultFont, final Color defaultColor, int x, int y) { paintHighlight(gfx, line, y); textArea.getLineText(line, currentLine); @@ -567,7 +567,7 @@ * When syntax highlighting is enabled, this method is called from * paintLine() to do the actual drawing of the line. */ - protected void paintSyntaxLine(final Graphics gfx, final TokenMarker tokenMarker, final int line, final Font defaultFont, final Color defaultColor, int x, int y) { + void paintSyntaxLine(final Graphics gfx, final TokenMarker tokenMarker, final int line, final Font defaultFont, final Color defaultColor, int x, int y) { textArea.getLineText(currentLineIndex, currentLine); currentLineTokens = tokenMarker.markTokens(currentLine, currentLineIndex); @@ -587,7 +587,7 @@ } } - protected void paintHighlight(final Graphics gfx, final int line, final int y) { + void paintHighlight(final Graphics gfx, final int line, final int y) { if (line >= textArea.getSelectionStartLine() && line <= textArea.getSelectionEndLine()) { paintLineHighlight(gfx, line, y); } @@ -605,7 +605,7 @@ } } - protected void paintLineHighlight(final Graphics gfx, final int line, int y) { + void paintLineHighlight(final Graphics gfx, final int line, int y) { final int height = fm.getHeight(); y += fm.getLeading() + fm.getMaxDescent(); @@ -655,7 +655,7 @@ } - protected void paintBracketHighlight(final Graphics gfx, final int line, int y) { + void paintBracketHighlight(final Graphics gfx, final int line, int y) { final int position = textArea.getBracketPosition(); if (position == -1) { return; @@ -670,7 +670,7 @@ gfx.drawRect(x, y, fm.charWidth('(') - 1, fm.getHeight() - 1); } - protected void paintCaret(final Graphics gfx, final int line, int y) { + void paintCaret(final Graphics gfx, final int line, int y) { if (textArea.isCaretVisible()) { final int offset = textArea.getCaretPosition() - textArea.getLineStartOffset(line); final int caretX = textArea._offsetToX(line, offset); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-17 22:54:19
|
Revision: 1178 http://svn.sourceforge.net/gridarta/?rev=1178&view=rev Author: christianhujer Date: 2006-12-17 14:54:19 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Minor documentation and nullability improvements. Modified Paths: -------------- trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java Modified: trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java =================================================================== --- trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java 2006-12-17 22:40:38 UTC (rev 1177) +++ trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java 2006-12-17 22:54:19 UTC (rev 1178) @@ -38,9 +38,15 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; +import org.jetbrains.annotations.NotNull; -/** This class is testing #MapCursor. */ +/** + * Unit test for {@link MapCursor}. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @author <a href="mailto:dlv...@gm...">Daniel Viegas</a> + */ public class MapCursorTest implements MapCursorListener { + private static MapCursor cursor; private static final Size2D gridSize = new Size2D(6, 7); private static final MapGrid grid = new MapGrid(gridSize); @@ -391,15 +397,17 @@ cursor = null; } - public void mapCursorChangedPos(final MapCursorEvent e) { + public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { changedPosCounter++; } - public void mapCursorChangedMode(final MapCursorEvent e) { + public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { changedModeCounter++; } - /** Test if number of events fired is correct */ + /** + * Test if number of events fired is correct. + */ private void testEvents(final int nPos, final int nMode) { assertEquals("Position change event", nPos, changedPosCounter); changedPosCounter = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-17 22:40:38
|
Revision: 1177 http://svn.sourceforge.net/gridarta/?rev=1177&view=rev Author: christianhujer Date: 2006-12-17 14:40:38 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Fixed imports and some javadoc issues. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CArchPanel.java trunk/crossfire/src/cfeditor/CArchPanelPan.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CFTreasureListTree.java trunk/crossfire/src/cfeditor/CMainStatusbar.java trunk/crossfire/src/cfeditor/CMainToolbar.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapTileList.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/CNewMapDialog.java trunk/crossfire/src/cfeditor/CopyBuffer.java trunk/crossfire/src/cfeditor/MapViewIFrame.java trunk/crossfire/src/cfeditor/ReplaceDialog.java trunk/crossfire/src/cfeditor/Spells.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java trunk/daimonin/src/daieditor/CFJavaEditor.java trunk/daimonin/src/daieditor/CFTreasureListTree.java trunk/daimonin/src/daieditor/CMainStatusbar.java trunk/daimonin/src/daieditor/CMapViewBasic.java trunk/daimonin/src/daieditor/ReplaceDialog.java trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java trunk/daimonin/src/daieditor/gui/map/MapUserListener.java trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java Modified: trunk/crossfire/src/cfeditor/CArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanel.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/CArchPanel.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -26,11 +26,8 @@ import cfeditor.gameobject.GameObject; import java.awt.BorderLayout; -import java.awt.Component; import java.awt.Dimension; import java.awt.Toolkit; -import java.util.ArrayList; -import java.util.List; import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.JSplitPane; Modified: trunk/crossfire/src/cfeditor/CArchPanelPan.java =================================================================== --- trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/CArchPanelPan.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -30,8 +30,6 @@ import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -43,7 +41,6 @@ import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JViewport; -import javax.swing.ListModel; import javax.swing.ListSelectionModel; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -30,9 +30,9 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Iterator; import net.sf.gridarta.io.IOUtils; import org.apache.log4j.Logger; import org.jdom.Attribute; Modified: trunk/crossfire/src/cfeditor/CFTreasureListTree.java =================================================================== --- trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/CFTreasureListTree.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -43,7 +43,6 @@ import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JDialog; -import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSplitPane; Modified: trunk/crossfire/src/cfeditor/CMainStatusbar.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainStatusbar.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/CMainStatusbar.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -40,8 +40,8 @@ import net.sf.gridarta.gui.map.MapCursorEvent; import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.japi.swing.ActionFactory; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NotNull; /** * <code>CMainStatusbar</code> implements the main statusbar of the Modified: trunk/crossfire/src/cfeditor/CMainToolbar.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainToolbar.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/CMainToolbar.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -28,9 +28,9 @@ import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.InputEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.awt.event.InputEvent; import java.util.Enumeration; import java.util.Vector; import javax.swing.ButtonGroup; Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -31,8 +31,8 @@ import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; -import java.awt.Rectangle; import java.awt.Point; +import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.event.ActionEvent; import java.awt.event.WindowAdapter; @@ -52,8 +52,8 @@ import javax.swing.JOptionPane; import javax.swing.JSplitPane; import javax.swing.JTabbedPane; -import javax.swing.UIManager; import javax.swing.SwingConstants; +import javax.swing.UIManager; import javax.swing.event.InternalFrameEvent; import javax.swing.event.InternalFrameListener; import net.sf.gridarta.gui.GSplitPane; @@ -162,7 +162,6 @@ /** * Constructs the main view and registers the given main controller. - * @param mainControl the controller of this view */ CMainView() { super(IGUIConstants.APP_NAME + " - " + IGUIConstants.APP_WINDOW_TITLE); Modified: trunk/crossfire/src/cfeditor/CMapTileList.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapTileList.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/CMapTileList.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -35,9 +35,9 @@ import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.InputEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.awt.event.InputEvent; import java.util.Date; import javax.swing.BorderFactory; import javax.swing.DefaultListCellRenderer; @@ -45,15 +45,14 @@ import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; -import javax.swing.SwingConstants; -import javax.swing.ScrollPaneConstants; import static javax.swing.JViewport.SIMPLE_SCROLL_MODE; +import javax.swing.ScrollPaneConstants; import static javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER; import static javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER; +import javax.swing.SwingConstants; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import net.sf.gridarta.gameobject.GameObjectContainer; -import net.sf.gridarta.gui.map.MapCursor; import net.sf.gridarta.gui.map.MapCursorEvent; import net.sf.gridarta.gui.map.MapCursorListener; import org.jetbrains.annotations.NotNull; Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -31,10 +31,10 @@ import cfeditor.map.MapModel; import java.awt.Point; import java.awt.Rectangle; +import java.awt.event.InputEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionListener; -import java.awt.event.InputEvent; import java.io.File; import java.io.IOException; import java.util.ArrayList; @@ -581,7 +581,6 @@ * This method is only called for pickmaps. Take the currently * highlighted arch on the map (if any) and insert it on this pickmap. * @param pos tile-coordinates in pickmap - * @return array of coordinates for tiles that need to be redrawn */ private void insertMapArchToPickmap(final Point pos) { final MapControl currentMap = mainControl.getCurrentMap(); Modified: trunk/crossfire/src/cfeditor/CNewMapDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/CNewMapDialog.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -28,10 +28,10 @@ import cfeditor.map.MapArchObject; import java.awt.Component; import java.awt.FlowLayout; -import java.util.Calendar; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; +import java.util.Calendar; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JButton; Modified: trunk/crossfire/src/cfeditor/CopyBuffer.java =================================================================== --- trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/CopyBuffer.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -26,15 +26,14 @@ package cfeditor; import cfeditor.gameobject.GameObject; -import cfeditor.map.DefaultMapModel; import cfeditor.map.MapArchObject; import cfeditor.map.MapControl; import cfeditor.map.MapModel; import java.awt.Point; import java.awt.Rectangle; import java.util.HashSet; -import net.sf.gridarta.Size2D; import net.sf.gridarta.MainControl; +import net.sf.gridarta.Size2D; import net.sf.gridarta.map.MapSquare; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -24,7 +24,6 @@ package cfeditor; -import cfeditor.gameobject.GameObject; import cfeditor.gui.MapView; import cfeditor.map.MapControl; import java.awt.BorderLayout; Modified: trunk/crossfire/src/cfeditor/ReplaceDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/ReplaceDialog.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -28,7 +28,6 @@ import cfeditor.map.MapControl; import java.awt.FlowLayout; import java.awt.Point; -import java.awt.Rectangle; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.ArrayList; @@ -45,7 +44,6 @@ import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.WindowConstants; -import net.sf.gridarta.Size2D; import net.sf.gridarta.map.MapSquare; import net.sf.japi.swing.ActionFactory; Modified: trunk/crossfire/src/cfeditor/Spells.java =================================================================== --- trunk/crossfire/src/cfeditor/Spells.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/Spells.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -27,7 +27,6 @@ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.FileReader; -import java.io.FileWriter; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -52,8 +52,8 @@ import net.sf.gridarta.io.IOUtils; import net.sf.japi.swing.Progress; import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NotNull; /** * The <code>ArchetypeSet</code> contains all the Archetypes. Modified: trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObject.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -27,8 +27,8 @@ import java.io.Serializable; import javax.swing.ImageIcon; +import net.sf.gridarta.gameobject.NamedObject; import net.sf.gridarta.gameobject.anim.AbstractAnimationObject; -import net.sf.gridarta.gameobject.NamedObject; /** * A single animation object. Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -38,14 +38,8 @@ import java.awt.Image; import java.awt.Point; import java.awt.Rectangle; -import java.awt.event.MouseEvent; -import java.awt.event.MouseMotionAdapter; -import java.awt.event.MouseMotionListener; -import java.awt.geom.NoninvertibleTransformException; import java.awt.image.BufferedImage; -import java.util.Vector; import javax.swing.ImageIcon; -import javax.swing.JComponent; import net.sf.gridarta.Size2D; import net.sf.gridarta.gui.map.MapGrid; import net.sf.gridarta.gui.map.MapGridEvent; @@ -407,6 +401,8 @@ /** * Resize the backing buffer to the new grid size. + * It will only be resized if the map is not a pickmap. + * @return <code>true</code> if the back buffer was resized, otherwise <code>false</code>. */ private boolean resizeBackBuffer() { if (isPickmap) { Modified: trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/crossfire/src/cfeditor/gui/map/MapCursorControl.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -266,8 +266,8 @@ final boolean hasCursor = mapCursor != null && mapCursor.isActive(); - for (int direction = 0; direction < directionsGo.length; direction++) { - ACTION_FACTORY.getAction(directionsGo[direction]).setEnabled(hasCursor); + for (final String aDirectionsGo : directionsGo) { + ACTION_FACTORY.getAction(aDirectionsGo).setEnabled(hasCursor); } aSelectTile.setEnabled(hasCursor); aStartStopDrag.setEnabled(hasCursor); Modified: trunk/daimonin/src/daieditor/CFJavaEditor.java =================================================================== --- trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -25,11 +25,11 @@ package daieditor; import static daieditor.CMainControl.PREFS_LANGUAGE; +import java.io.BufferedReader; import java.io.File; -import java.io.BufferedReader; +import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; -import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.List; import java.util.Locale; Modified: trunk/daimonin/src/daieditor/CFTreasureListTree.java =================================================================== --- trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/daimonin/src/daieditor/CFTreasureListTree.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -48,7 +48,6 @@ import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JDialog; -import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JSplitPane; Modified: trunk/daimonin/src/daieditor/CMainStatusbar.java =================================================================== --- trunk/daimonin/src/daieditor/CMainStatusbar.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/daimonin/src/daieditor/CMainStatusbar.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -40,8 +40,8 @@ import net.sf.gridarta.gui.map.MapCursorEvent; import net.sf.gridarta.gui.map.MapCursorListener; import net.sf.japi.swing.ActionFactory; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NotNull; /** * <code>CMainStatusbar</code> implements the main statusbar of the Modified: trunk/daimonin/src/daieditor/CMapViewBasic.java =================================================================== --- trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/daimonin/src/daieditor/CMapViewBasic.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -56,8 +56,8 @@ import net.sf.gridarta.map.MapModelListener; import net.sf.gridarta.map.MapSquare; import org.apache.log4j.Logger; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.NotNull; /** * <code>CMapViewBasic</code> is the true mapview object. However, it is not Modified: trunk/daimonin/src/daieditor/ReplaceDialog.java =================================================================== --- trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/daimonin/src/daieditor/ReplaceDialog.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -44,8 +44,8 @@ import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.WindowConstants; +import net.sf.gridarta.MainControl; import net.sf.gridarta.map.MapSquare; -import net.sf.gridarta.MainControl; import net.sf.japi.swing.ActionFactory; /** Modified: trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/daimonin/src/daieditor/gameobject/face/FaceObjects.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -36,9 +36,9 @@ import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; +import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStreamWriter; -import java.io.InputStream; import net.sf.gridarta.gameobject.face.AbstractFaceObjects; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.Progress; Modified: trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/daimonin/src/daieditor/gui/map/MapCursorControl.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -265,8 +265,8 @@ final boolean hasCursor = mapCursor != null && mapCursor.isActive(); - for (int direction = 0; direction < directionsGo.length; direction++) { - ACTION_FACTORY.getAction(directionsGo[direction]).setEnabled(hasCursor); + for (final String aDirectionsGo : directionsGo) { + ACTION_FACTORY.getAction(aDirectionsGo).setEnabled(hasCursor); } aSelectTile.setEnabled(hasCursor); aStartStopDrag.setEnabled(hasCursor); Modified: trunk/daimonin/src/daieditor/gui/map/MapUserListener.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapUserListener.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/daimonin/src/daieditor/gui/map/MapUserListener.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -28,10 +28,10 @@ import daieditor.gui.map.tools.ToolSelectorPane; import daieditor.map.MapControl; import java.awt.Point; +import java.awt.event.InputEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; -import java.awt.event.InputEvent; import net.sf.gridarta.gui.map.MapCursor; import org.jetbrains.annotations.Nullable; Modified: trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java 2006-12-17 21:30:18 UTC (rev 1176) +++ trunk/daimonin/src/daieditor/gui/map/tools/ToolSelectorPane.java 2006-12-17 22:40:38 UTC (rev 1177) @@ -2,8 +2,8 @@ import daieditor.gui.map.event.MouseOpEvent; import java.awt.BorderLayout; +import java.awt.event.InputEvent; import java.awt.event.MouseEvent; -import java.awt.event.InputEvent; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTabbedPane; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 21:30:19
|
Revision: 1176 http://svn.sourceforge.net/gridarta/?rev=1176&view=rev Author: akirschbaum Date: 2006-12-17 13:30:18 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Simplify code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 21:24:26 UTC (rev 1175) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 21:30:18 UTC (rev 1176) @@ -190,18 +190,13 @@ } @Override public void modelChanged() { - if (isPickmap) { - //pickmaps don't have double buffers - //maybe later could have them share one single buffer ? - repaint(); - } else { - log.debug("modelChanged(), we are in a backbuffered behaviour."); + if (!isPickmap) { final Point storeOffset = new Point(borderOffset); borderOffset.setLocation(0, 0); paintComponent(backBuffer.getGraphics(), false); borderOffset.setLocation(storeOffset); - repaint(); } + repaint(); } private final Rectangle tmpRec = new Rectangle(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 21:24:29
|
Revision: 1175 http://svn.sourceforge.net/gridarta/?rev=1175&view=rev Author: akirschbaum Date: 2006-12-17 13:24:26 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Move code to handle component size changes to DefaultLevelRenderer. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java trunk/crossfire/src/cfeditor/gui/map/LevelRenderer.java Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 21:18:38 UTC (rev 1174) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 21:24:26 UTC (rev 1175) @@ -29,7 +29,6 @@ import cfeditor.gui.map.DefaultLevelRenderer; import cfeditor.map.MapControl; import cfeditor.map.MapModel; -import java.awt.Dimension; import java.awt.Point; import java.awt.Rectangle; import java.awt.event.MouseAdapter; @@ -283,20 +282,8 @@ /** Refreshes the data in the view from the model. */ void refreshDataFromModel() { - - final Dimension forcedSize; - mapSize = mapControl.getMapSize(); - log.debug("refreshDataFromModel"); - // define how much drawing space we need for the map - forcedSize = new Dimension(mapSize.getWidth() * 32 + (isPickmap() ? 0 : 64), mapSize.getHeight() * 32 + (isPickmap() ? 0 : 64)); - renderer.setPreferredSize(forcedSize); - renderer.setMinimumSize(forcedSize); changedFlagNotify(); - if (renderer.resizeBackBuffer()) { - renderer.setSize(forcedSize); - renderer.revalidate(); - } renderer.modelChanged(); } Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 21:18:38 UTC (rev 1174) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 21:24:26 UTC (rev 1175) @@ -143,7 +143,7 @@ new Color(1.0f, 0.0f, 0.0f, 0.33f), new Color(0.0f, 1.0f, 0.0f, 0.33f), new Color(0.0f, 1.0f, 1.0f, 0.33f)}; - resizeBackBuffer(); + resizeMapGrid(); } /** This method is called when the look and feel has changed. */ @@ -386,7 +386,7 @@ /** {@inheritDoc} */ public void mapGridChanged(@NotNull final MapGridEvent e) { - modelChanged(); + resizeMapGrid(); } /** {@inheritDoc} */ @@ -410,7 +410,10 @@ modelChanged(); } - @Override public boolean resizeBackBuffer() { + /** + * Resize the backing buffer to the new grid size. + */ + private boolean resizeBackBuffer() { if (isPickmap) { return false; } @@ -502,4 +505,22 @@ } } + /** + * Update cached information to new map grid size. + */ + private void resizeMapGrid() { + // define how much drawing space we need for the map + mapSize = mapGrid.getSize(); + final Dimension forcedSize = new Dimension(mapSize.getWidth() * 32 + (isPickmap() ? 0 : 64), mapSize.getHeight() * 32 + (isPickmap() ? 0 : 64)); + setPreferredSize(forcedSize); + setMinimumSize(forcedSize); + + if (resizeBackBuffer()) { + setSize(forcedSize); + revalidate(); + } + + modelChanged(); + } + } // class DefaultLevelRenderer Modified: trunk/crossfire/src/cfeditor/gui/map/LevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/LevelRenderer.java 2006-12-17 21:18:38 UTC (rev 1174) +++ trunk/crossfire/src/cfeditor/gui/map/LevelRenderer.java 2006-12-17 21:24:26 UTC (rev 1175) @@ -56,8 +56,6 @@ public abstract void setHighlightTile(final Point point); - public abstract boolean resizeBackBuffer(); - public abstract void freeBackBuffer(); } // class LevelRenderer This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 21:18:38
|
Revision: 1174 http://svn.sourceforge.net/gridarta/?rev=1174&view=rev Author: akirschbaum Date: 2006-12-17 13:18:38 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Speed up map resizing. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java Modified: trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java 2006-12-17 21:02:58 UTC (rev 1173) +++ trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java 2006-12-17 21:18:38 UTC (rev 1174) @@ -454,6 +454,8 @@ final MapArchObject map = mapControl.getMapArch(); + mapControl.getMapModel().beginTransaction("Map properties"); // TODO: I18N/L10N + final String mapNameString = mapName.getText(); mapControl.getMapModel().resizeMap(mapSize); map.setText(mapDescription.getText()); @@ -493,6 +495,7 @@ map.setTilePath(i, fieldTilePath[i].getText()); } + mapControl.getMapModel().endTransaction(); mainControl.refreshMenusAndToolbars(); mapControl.notifyViews(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 21:02:58
|
Revision: 1173 http://svn.sourceforge.net/gridarta/?rev=1173&view=rev Author: akirschbaum Date: 2006-12-17 13:02:58 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 20:58:40 UTC (rev 1172) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 21:02:58 UTC (rev 1173) @@ -28,7 +28,6 @@ import cfeditor.CMainControl; import cfeditor.CMapViewBasic; import cfeditor.IGUIConstants; -import cfeditor.filter.AttributeFilter; import cfeditor.gameobject.ArchetypeSet; import cfeditor.gameobject.GameObject; import cfeditor.map.MapControl; @@ -126,8 +125,6 @@ filter = mainControl.getFilterControl(); archlist = mainControl.getArchetypeSet(); - final AttributeFilter af = new AttributeFilter(); - af.addAttribute("no_pass", "1"); isPickmap = pickmap; // initialize the tmp. graphic buffer tmpImage = new BufferedImage(32, 32, BufferedImage.TYPE_INT_ARGB); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 20:58:40
|
Revision: 1172 http://svn.sourceforge.net/gridarta/?rev=1172&view=rev Author: akirschbaum Date: 2006-12-17 12:58:40 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/MapViewIFrame.java Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 20:51:37 UTC (rev 1171) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 20:58:40 UTC (rev 1172) @@ -310,40 +310,6 @@ frame.updateTitle(); } - /** - * Determine which map-squares need to be painted if the given rectangle is - * to be redrawn. - * @param ax map x-coords. of first corner of the rect - * @param ay map y-coords. of first corner of the rect - * @param bx map x-coords. of second corner of the rect (opposing edge to - * ax, ay) - * @param by map y-coords. of second corner of the rect (opposing edge to - * ax, ay) - * @return a <code>Point</code> array containing the coords of the tiles - * which need to be redrawn - */ - Point[] calcRectRedraw(final int ax, final int ay, final int bx, final int by) { - int i = 0; // counter - - // get rect. coords of highlighted area: top(left) and bot(tomright) corner - final int topx = Math.min(ax, bx); // left - final int topy = Math.min(ay, by); // top - final int botx = Math.max(ax, bx); // right - final int boty = Math.max(ay, by); // bottom - - final Point[] redraw = new Point[(botx - topx + 1) * (boty - topy + 1)]; // create instance of needed size - - for (int posx = topx; posx <= botx; posx++) { - for (int posy = topy; posy <= boty; posy++) { - // pack all tiles from the rect into the Point-array - redraw[i] = new Point(posx, posy); - i++; - } - } - - return redraw; - } - public Point[] getSelection() { final List<Point> selection = new ArrayList<Point>(); final Size2D mapSize = mapModel.getMapSize(); Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-12-17 20:51:37 UTC (rev 1171) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-12-17 20:58:40 UTC (rev 1172) @@ -174,10 +174,6 @@ view.changedFlagNotify(); } - Point[] calcRectRedraw(final int ax, final int ay, final int bx, final int by) { - return view.calcRectRedraw(ax, ay, bx, by); - } - /** * Return the Action for selecting this window. * @return the Action for selecting this window This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 20:51:38
|
Revision: 1171 http://svn.sourceforge.net/gridarta/?rev=1171&view=rev Author: akirschbaum Date: 2006-12-17 12:51:37 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/MapViewIFrame.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-17 20:50:11 UTC (rev 1170) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-17 20:51:37 UTC (rev 1171) @@ -465,10 +465,6 @@ return copybuffer; } - void setMapAndArchPosition(final GameObject gameObject, final Point pos) { - currentMap.getMapViewFrame().setMapAndArchPosition(gameObject, pos); - } - /** Set all global settings from the preferences. */ public void readGlobalSettings() { imageSet = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(USE_IMAGESET, "base"); Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 20:50:11 UTC (rev 1170) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 20:51:37 UTC (rev 1171) @@ -310,15 +310,6 @@ frame.updateTitle(); } - void setMapAndArchPosition(final GameObject gameObject, final Point pos) { - if (pos.x == -1 || pos.y == -1) { - mainControl.getMainView().setMapTileList(null, null); - } else { - mainControl.getMainView().setMapTileList(mainControl.getCurrentMap(), gameObject); - } - modelChanged(); - } - /** * Determine which map-squares need to be painted if the given rectangle is * to be redrawn. Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-12-17 20:50:11 UTC (rev 1170) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-12-17 20:51:37 UTC (rev 1171) @@ -174,10 +174,6 @@ view.changedFlagNotify(); } - void setMapAndArchPosition(final GameObject gameObject, final Point pos) { - view.setMapAndArchPosition(gameObject, pos); - } - Point[] calcRectRedraw(final int ax, final int ay, final int bx, final int by) { return view.calcRectRedraw(ax, ay, bx, by); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 20:50:11
|
Revision: 1170 http://svn.sourceforge.net/gridarta/?rev=1170&view=rev Author: akirschbaum Date: 2006-12-17 12:50:11 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Make DefaultLevelRenderer aware of map model changes. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 20:10:22 UTC (rev 1169) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 20:50:11 UTC (rev 1170) @@ -149,6 +149,7 @@ setViewportView(renderer); getViewport().setScrollMode(JViewport.SIMPLE_SCROLL_MODE); + mapModel.addMapModelListener(renderer); mapModel.addMapModelListener(this); refreshDataFromModel(); @@ -700,19 +701,16 @@ /** {@inheritDoc} */ public void mapSizeChanged(final MapModelEvent e) { mapGrid.resize(e.getMapModel().getMapSize()); - refreshDataFromModel(); } /** {@inheritDoc} */ public void mapSquaresChanged(final MapModelEvent e) { - modelChanged(); - // TODO: only repaint a specific region + // ignore } /** {@inheritDoc} */ public void mapObjectsChanged(final MapModelEvent e) { - modelChanged(); - // TODO: only repaint a specific region + // ignore } public final class CPaintOp implements EditOperation { Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 20:10:22 UTC (rev 1169) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 20:50:11 UTC (rev 1170) @@ -51,6 +51,8 @@ import net.sf.gridarta.gui.map.MapGrid; import net.sf.gridarta.gui.map.MapGridEvent; import net.sf.gridarta.gui.map.MapGridListener; +import net.sf.gridarta.map.MapModelEvent; +import net.sf.gridarta.map.MapModelListener; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -60,7 +62,7 @@ * Flat version. * @author unknown */ -public final class DefaultLevelRenderer extends LevelRenderer implements MapGridListener { +public final class DefaultLevelRenderer extends LevelRenderer implements MapGridListener, MapModelListener { private static final Logger log = Logger.getLogger(DefaultLevelRenderer.class); @@ -396,6 +398,21 @@ modelChanged(); } + /** {@inheritDoc} */ + public void mapSizeChanged(final MapModelEvent e) { + // ignore: will trigger an mapGridChanged() callback + } + + /** {@inheritDoc} */ + public void mapSquaresChanged(final MapModelEvent e) { + modelChanged(); + } + + /** {@inheritDoc} */ + public void mapObjectsChanged(final MapModelEvent e) { + modelChanged(); + } + @Override public boolean resizeBackBuffer() { if (isPickmap) { return false; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 20:10:22
|
Revision: 1169 http://svn.sourceforge.net/gridarta/?rev=1169&view=rev Author: akirschbaum Date: 2006-12-17 12:10:22 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove redundant this modifier. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapViewBasic.java Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 20:07:37 UTC (rev 1168) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 20:10:22 UTC (rev 1169) @@ -236,7 +236,7 @@ public void setGridVisible(final boolean gridVisible) { this.gridVisible = gridVisible; - this.modelChanged(); + modelChanged(); } /** Notifies that this level view is about to be closed. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 20:07:37
|
Revision: 1168 http://svn.sourceforge.net/gridarta/?rev=1168&view=rev Author: akirschbaum Date: 2006-12-17 12:07:37 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMapViewBasic.java trunk/crossfire/src/cfeditor/MapViewIFrame.java Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 20:05:15 UTC (rev 1167) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-17 20:07:37 UTC (rev 1168) @@ -352,35 +352,6 @@ return redraw; } - /** - * Paint a given array of map-squares. This is much more efficient than - * repainting the whole map and should be used wherever possible. - * @param tile a <code>Point</code> array containing map coords of all - * tiles to draw - */ - public void paintTileArray(final Point[] tile) { - if (tile != null) { - // for rectangular maps we paint only the needed tiles - log.debug("-> redraw map:"); - if (tile.length <= 25) { - for (int i = tile.length - 1; i >= 0; i--) { - // paint the tiles - if (mapControl.getMapModel().isPointValid(tile[i])) { - renderer.paintTile(tile[i]); - } - if (log.isDebugEnabled()) { - log.debug("redraw: (" + tile[i].x + ", " + tile[i].y + ")"); - } - } - if (!isPickmap()) { - repaint(); - } - } else { - modelChanged(); // at some point it's more efficient to draw the whole thing - } - } - } - public Point[] getSelection() { final List<Point> selection = new ArrayList<Point>(); final Size2D mapSize = mapModel.getMapSize(); Modified: trunk/crossfire/src/cfeditor/MapViewIFrame.java =================================================================== --- trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-12-17 20:05:15 UTC (rev 1167) +++ trunk/crossfire/src/cfeditor/MapViewIFrame.java 2006-12-17 20:07:37 UTC (rev 1168) @@ -182,10 +182,6 @@ return view.calcRectRedraw(ax, ay, bx, by); } - public void paintTileArray(final Point[] tile) { - view.paintTileArray(tile); - } - /** * Return the Action for selecting this window. * @return the Action for selecting this window This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 20:05:15
|
Revision: 1167 http://svn.sourceforge.net/gridarta/?rev=1167&view=rev Author: akirschbaum Date: 2006-12-17 12:05:15 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Move code to paint one tile into a separate function. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 19:10:09 UTC (rev 1166) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 20:05:15 UTC (rev 1167) @@ -101,6 +101,12 @@ private final MapGrid mapGrid; + private final CFilterControl filter; + + private final ArchetypeSet archlist; + + private final Point offset = new Point(); + /** * Creates a DefaultLevelRenderer. * @param mapViewBasic MapView to render @@ -115,6 +121,8 @@ mapModel = mapControl.getMapModel(); mapSize = mapModel.getMapSize(); this.mapGrid = mapGrid; + filter = mainControl.getFilterControl(); + archlist = mainControl.getArchetypeSet(); final AttributeFilter af = new AttributeFilter(); af.addAttribute("no_pass", "1"); @@ -219,8 +227,6 @@ * "screenshot"-image, false for normal drawing */ public void paintComponent(final Graphics grfx, final boolean isSnapshot) { - final ArchetypeSet archlist = mainControl.getArchetypeSet(); - if (isPickmap) { // draw greenisch background for pickmaps grfx.setColor(IGUIConstants.BG_COLOR); @@ -228,65 +234,12 @@ grfx.setColor(mainControl.getMainView().getBackground()); // background color of window } grfx.fillRect(0, 0, getWidth(), getHeight()); - // ---------- draw rectangular map -------------- - // this vector contains all heads of multi-tiles with oversized images - final Vector<GameObject> oversizedMultiHeads = new Vector<GameObject>(); - final CFilterControl filter = mainControl.getFilterControl(); final Point point = new Point(); for (point.y = 0; point.y < mapGrid.getSize().getHeight(); point.y++) { for (point.x = 0; point.x < mapGrid.getSize().getWidth(); point.x++) { - filter.newSquare(); - if (!mapModel.containsArchObject(point)) { - // empty square - if (isPickmap) { - grfx.fillRect(point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y, 32, 32); - } else { - CMainControl.getUnknownTileIcon().paintIcon(this, grfx, point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y); - } - } else { - for (final GameObject node : mapModel.getMapSquare(point)) { - filter.objectInSquare(node); - if (!filter.canShow(node)) { - continue; - } - if (mainControl.isTileEdit(node) || isPickmap) { - if (node.getArchetypeName() == null) { - CMainControl.getNoarchTileIcon().paintIcon(this, grfx, point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y); - } else if (node.getFaceFlag()) { - CMainControl.getNofaceTileIcon().paintIcon(this, grfx, point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y); - } else { - if (node.getFaceNr() == -1) { - CMainControl.getUnknownTileIcon().paintIcon(this, grfx, point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y); - } else { - // draw object face - final ImageIcon img = archlist.getFace(node.getFaceNr()); - if (!node.isMulti() || (img.getIconWidth() == 32 && img.getIconHeight() == 32)) { - archlist.getFace(node.getFaceNr()).paintIcon(this, grfx, point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y); - } else if (node.isHead()) { - oversizedMultiHeads.addElement(node); // store oversized arches for later - } - } - } - } - } - } - for (int i = 0; i < CFilterControl.MAX_HIGHLIGHT; i++) { - if (!filter.highLightedSquare(i)) { - continue; - } - final Color alpha = highLightMask[i]; - final Color c = grfx.getColor(); - grfx.setColor(alpha); - grfx.fillRect(point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y, 32, 32); - grfx.setColor(c); - } + paintTile(grfx, point); } } - // at the end, we have to draw the oversized multipart images on top of the rest - for (int i = 0; i < oversizedMultiHeads.size(); i++) { - final GameObject node = oversizedMultiHeads.elementAt(i); - archlist.getFace(node.getFaceNr()).paintIcon(this, grfx, node.getMapX() * 32 + borderOffset.x, node.getMapY() * 32 + borderOffset.y); - } if (!isSnapshot) { paintGrid(grfx); @@ -310,59 +263,9 @@ } else { grfx = backBuffer.getGraphics(); } - final ArchetypeSet archlist = mainControl.getArchetypeSet(); // arch stack - // ---------- draw tile for rectangular view (non-iso) -------------- - final CFilterControl filter = mainControl.getFilterControl(); - filter.newSquare(); - // first, draw the object's faces: - if (!mapModel.containsArchObject(point)) { - // draw the empty-tile icon (direcly to the mapview) - if (isPickmap) { - grfx.setColor(IGUIConstants.BG_COLOR); - grfx.fillRect(point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y, 32, 32); - } else { - CMainControl.getUnknownTileIcon().paintIcon(this, grfx, point.x * 32, point.y * 32); - } - } else { - tmpGrfx.fillRect(0, 0, 32, 32); - // loop through all arches on that square and draw em - for (final GameObject node : mapModel.getMapSquare(point)) { - filter.objectInSquare(node); - if (!filter.canShow(node)) { - continue; - } - if (mainControl.isTileEdit(node)) { - if (node.getArchetypeName() == null) { - CMainControl.getNoarchTileIcon().paintIcon(this, tmpGrfx, 0, 0); - } else if (node.getFaceFlag()) { - CMainControl.getNofaceTileIcon().paintIcon(this, tmpGrfx, 0, 0); - } else { - if (node.getFaceNr() == -1) { - CMainControl.getUnknownTileIcon().paintIcon(this, tmpGrfx, 0, 0); - } else { - final ImageIcon img = archlist.getFace(node.getFaceNr()); - if (!node.isMulti() || (img.getIconWidth() == 32 && img.getIconHeight() == 32)) { - img.paintIcon(this, tmpGrfx, 0, 0); - } else { - // this is an oversized image, so it must be shifted - img.paintIcon(this, tmpGrfx, -32 * node.getMultiX(), -32 * node.getMultiY()); - } - } - } - } - } - } - for (int i = 0; i < CFilterControl.MAX_HIGHLIGHT; i++) { - if (!filter.highLightedSquare(i)) { - continue; - } - final Color alpha = highLightMask[i]; - final Color c = grfx.getColor(); - tmpGrfx.setColor(alpha); - tmpGrfx.fillRect(0, 0, 32, 32); - tmpGrfx.setColor(c); - } + paintTile(grfx, point); + // We have been drawing to the tmp. buffer, now convert it to // an ImageIcon and paint it into the mapview: if (mapModel.containsArchObject(point)) { @@ -526,4 +429,63 @@ tmpImage = null; } + public void paintTile(final Graphics grfx, final Point point) { + // ---------- draw tile for rectangular view (non-iso) -------------- + filter.newSquare(); + if (!mapModel.containsArchObject(point)) { + if (isPickmap) { + grfx.setColor(IGUIConstants.BG_COLOR); + grfx.fillRect(point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y, 32, 32); + } else { + CMainControl.getUnknownTileIcon().paintIcon(DefaultLevelRenderer.this, grfx, point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y); + } + } else { + grfx.fillRect(point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y, 32, 32); + for (final GameObject node : mapModel.getMapSquare(point)) { + filter.objectInSquare(node); + if (!filter.canShow(node)) { + continue; + } + if (mainControl.isTileEdit(node) || isPickmap) { + final ImageIcon img; + if (node.getArchetypeName() == null) { + img = CMainControl.getNoarchTileIcon(); + offset.x = 0; + offset.y = 0; + } else if (node.getFaceFlag()) { + img = CMainControl.getNofaceTileIcon(); + offset.x = 0; + offset.y = 0; + } else if (node.getFaceNr() == -1) { + img = CMainControl.getUnknownTileIcon(); + offset.x = 0; + offset.y = 0; + } else { + img = archlist.getFace(node.getFaceNr()); + if (!node.isMulti() || (img.getIconWidth() == 32 && img.getIconHeight() == 32)) { + offset.x = 0; + offset.y = 0; + } else { + // this is an oversized image, so it must be shifted + // XXX: it must also be clipped to not overwrite filter information + offset.x = -32 * node.getMultiX(); + offset.y = -32 * node.getMultiY(); + } + } + img.paintIcon(DefaultLevelRenderer.this, grfx, point.x * 32 + borderOffset.x + offset.x, point.y * 32 + borderOffset.y + offset.y); + } + } + } + for (int i = 0; i < CFilterControl.MAX_HIGHLIGHT; i++) { + if (!filter.highLightedSquare(i)) { + continue; + } + final Color alpha = highLightMask[i]; + final Color c = grfx.getColor(); + grfx.setColor(alpha); + grfx.fillRect(point.x * 32 + borderOffset.x, point.y * 32 + borderOffset.y, 32, 32); + grfx.setColor(c); + } + } + } // class DefaultLevelRenderer This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 19:10:12
|
Revision: 1166 http://svn.sourceforge.net/gridarta/?rev=1166&view=rev Author: akirschbaum Date: 2006-12-17 11:10:09 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove use of Graphics2D. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 18:34:18 UTC (rev 1165) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 19:10:09 UTC (rev 1166) @@ -36,14 +36,12 @@ import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; -import java.awt.Graphics2D; import java.awt.Image; import java.awt.Point; import java.awt.Rectangle; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionAdapter; import java.awt.event.MouseMotionListener; -import java.awt.geom.AffineTransform; import java.awt.geom.NoninvertibleTransformException; import java.awt.image.BufferedImage; import java.util.Vector; @@ -95,8 +93,6 @@ /** Current size of {@link #backBuffer} image. */ private final Dimension bufferedSize = new Dimension(); - private final AffineTransform renderTransform; - private final MapModel mapModel; private final CMainControl mainControl; @@ -136,7 +132,6 @@ setFocusable(true); borderOffset.setLocation(pickmap ? 0 : 32, pickmap ? 0 : 32); - renderTransform = new AffineTransform(1.0f, 0.0f, 0.0f, 1.0f, borderOffset.x, borderOffset.y); highLightMask = new Color[]{ new Color(1.0f, 0.0f, 0.0f, 0.33f), new Color(0.0f, 1.0f, 0.0f, 0.33f), @@ -174,16 +169,16 @@ // paint the mapview into the image final Point storeOffset = new Point(borderOffset); borderOffset.setLocation(0, 0); - paintComponent((Graphics2D) bufGrfx, true); + paintComponent(bufGrfx, true); borderOffset.setLocation(storeOffset); return bufImage; } @Override public void paintComponent(final Graphics grfx) { if (isPickmap) { - paintComponent((Graphics2D) grfx, false); + paintComponent(grfx, false); } else { - ((Graphics2D) grfx).drawImage(backBuffer, renderTransform, null); + grfx.drawImage(backBuffer, borderOffset.x, borderOffset.y, null); } } @@ -196,7 +191,7 @@ log.debug("modelChanged(), we are in a backbuffered behaviour."); final Point storeOffset = new Point(borderOffset); borderOffset.setLocation(0, 0); - paintComponent((Graphics2D) backBuffer.getGraphics(), false); + paintComponent(backBuffer.getGraphics(), false); borderOffset.setLocation(storeOffset); repaint(); } @@ -223,7 +218,7 @@ * @param isSnapshot true when this drawing is for a * "screenshot"-image, false for normal drawing */ - public void paintComponent(final Graphics2D grfx, final boolean isSnapshot) { + public void paintComponent(final Graphics grfx, final boolean isSnapshot) { final ArchetypeSet archlist = mainControl.getArchetypeSet(); if (isPickmap) { @@ -420,7 +415,7 @@ * It's recommended to paint the complete selection after the map itself, otherwise map elements actually might hide selections. * @param grfx Graphics for painting */ - private void paintSelection(final Graphics2D grfx) { + private void paintSelection(final Graphics grfx) { for (int y = 0; y < mapSize.getHeight(); y++) { for (int x = 0; x < mapSize.getWidth(); x++) { if (grfx.hitClip(x * 32 + borderOffset.x, y * 32 + borderOffset.y, 32, 32)) { @@ -467,15 +462,10 @@ /** {@inheritDoc} */ @Override @Nullable public Point getTileLocationAt(@NotNull final Point point, @Nullable final Point retPoint) { - try { - renderTransform.inverseTransform(point, point); - } catch (final NoninvertibleTransformException e) { - } - final int xm, ym; - if (point.x >= 0 && point.x < mapSize.getWidth() * 32 && point.y >= 0 && point.y < mapSize.getHeight() * 32) { - xm = point.x / 32; - ym = point.y / 32; + if (point.x >= borderOffset.x && point.x < mapSize.getWidth() * 32 + borderOffset.x && point.y >= borderOffset.y && point.y < mapSize.getHeight() * 32 + borderOffset.y) { + xm = (point.x - borderOffset.x) / 32; + ym = (point.y - borderOffset.y) / 32; } else { xm = -1; ym = -1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 18:34:21
|
Revision: 1165 http://svn.sourceforge.net/gridarta/?rev=1165&view=rev Author: akirschbaum Date: 2006-12-17 10:34:18 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove code to scroll while dragging the mouse. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 18:30:49 UTC (rev 1164) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 18:34:18 UTC (rev 1165) @@ -142,14 +142,6 @@ new Color(0.0f, 1.0f, 0.0f, 0.33f), new Color(0.0f, 1.0f, 1.0f, 0.33f)}; resizeBackBuffer(); - /*taken from java doc, scroll while dragged*/ - final MouseMotionListener doScrollRectToVisible = new MouseMotionAdapter() { - @Override public void mouseDragged(final MouseEvent e) { - final Rectangle r = new Rectangle(e.getX(), e.getY(), 1, 1); - ((JComponent) e.getSource()).scrollRectToVisible(r); - } - }; - addMouseMotionListener(doScrollRectToVisible); } /** This method is called when the look and feel has changed. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 18:30:49
|
Revision: 1164 http://svn.sourceforge.net/gridarta/?rev=1164&view=rev Author: akirschbaum Date: 2006-12-17 10:30:49 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Remove redundant statement. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 18:29:59 UTC (rev 1163) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 18:30:49 UTC (rev 1164) @@ -177,7 +177,6 @@ final BufferedImage bufImage = new BufferedImage(viewWidth, viewHeight, BufferedImage.TYPE_INT_ARGB); final Graphics bufGrfx = bufImage.getGraphics(); bufGrfx.setColor(Color.white); - bufGrfx.setColor(Color.white); bufGrfx.fillRect(0, 0, viewWidth, viewHeight); // paint the mapview into the image This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 18:30:02
|
Revision: 1163 http://svn.sourceforge.net/gridarta/?rev=1163&view=rev Author: akirschbaum Date: 2006-12-17 10:29:59 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Rename variable names. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 18:07:43 UTC (rev 1162) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-17 18:29:59 UTC (rev 1163) @@ -170,15 +170,15 @@ /** {@inheritDoc} */ @Override public BufferedImage getFullImage() { - final int mapWidth = 32 * mapSize.getWidth(); - final int mapHeight = 32 * mapSize.getHeight(); + final int viewWidth = 32 * mapSize.getWidth(); + final int viewHeight = 32 * mapSize.getHeight(); // first create a storing place for the image - final BufferedImage bufImage = new BufferedImage(mapWidth, mapHeight, BufferedImage.TYPE_INT_ARGB); + final BufferedImage bufImage = new BufferedImage(viewWidth, viewHeight, BufferedImage.TYPE_INT_ARGB); final Graphics bufGrfx = bufImage.getGraphics(); bufGrfx.setColor(Color.white); bufGrfx.setColor(Color.white); - bufGrfx.fillRect(0, 0, mapWidth, mapHeight); + bufGrfx.fillRect(0, 0, viewWidth, viewHeight); // paint the mapview into the image final Point storeOffset = new Point(borderOffset); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-17 18:07:43
|
Revision: 1162 http://svn.sourceforge.net/gridarta/?rev=1162&view=rev Author: christianhujer Date: 2006-12-17 10:07:43 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Fix for bug introduced with commit #1143. Some unification of CFArchTypeList. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CAttribDialog.java trunk/crossfire/src/cfeditor/CFArchType.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/daimonin/src/daieditor/CFArchType.java trunk/daimonin/src/daieditor/CFArchTypeList.java Modified: trunk/crossfire/src/cfeditor/CAttribDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-17 18:07:13 UTC (rev 1161) +++ trunk/crossfire/src/cfeditor/CAttribDialog.java 2006-12-17 18:07:43 UTC (rev 1162) @@ -204,7 +204,11 @@ //typeNr = 0; // for invalid types, we take "type 0" boolean typeFound = false; int i = 0; + type = null; for (final CFArchType tmp : archTypeList) { + if (type == null) { + type = tmp; + } if (tmp.getTypeNr() == this.gameObject.getArchTypNr()) { if (tmp.getTypeAttr() == null) { // no type-attributes, so we only compared type-numbers @@ -252,9 +256,6 @@ } i++; } - if (!typeFound) { - type = archTypeList.getArchType(0); - } // get the type data //type = archTypeList.getType(typeNr); @@ -1348,7 +1349,7 @@ // deal with syntax errors now if (errors != null) { - if (typeStruct == archTypeList.getHead().getNext()) { + if (typeStruct == archTypeList.getArchType(1)) { // for generic (misc) type, all errors are automatically kept. // "misc" is no real type - it is more a default mask for unknown types gameObject.addObjectText(errors.trim()); Modified: trunk/crossfire/src/cfeditor/CFArchType.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchType.java 2006-12-17 18:07:13 UTC (rev 1161) +++ trunk/crossfire/src/cfeditor/CFArchType.java 2006-12-17 18:07:43 UTC (rev 1162) @@ -83,8 +83,6 @@ private final CFArchType defaultArchType; // contains default attributes - private CFArchType next = null; // next CFArchType in the list - private String desc = null; // descrption of this type private String use = null; // notes on usage of this type @@ -293,17 +291,19 @@ int importNum = 0; if (importName != null) { - CFArchType impType = tlist.getHead(); - boolean foundType = false; // search through all known types, looking for import type - for (; !foundType && impType != null && impType != this; - impType = foundType ? impType : impType.getNext()) { - if (impType.getTypeName().equalsIgnoreCase(importName)) { - foundType = true; + CFArchType impType = null; + for (final CFArchType archType : tlist) { + if (archType == this) { + continue; } + if (archType.typeName.equalsIgnoreCase(importName)) { + impType = archType; + break; + } } - if (foundType) { + if (impType != null) { // initialize array to store imported attribs importList = new CFArchAttrib[impType.attr.length]; @@ -412,21 +412,11 @@ /** * Create the documentation to this GameObject-type. * @return the full html-text to be (parsed and) displayed - * @fixme my HTML is broken */ public String createHtmlDocu() { return ACTION_FACTORY.format("arcDoc.htmlText", typeName, desc != null ? desc.trim() : "", use != null ? use.trim() : ""); } - // convenience functions: - public CFArchType getNext() { - return next; - } - - public void setNext(final CFArchType cfType) { - next = cfType; - } - public CFArchAttrib[] getAttr() { return attr; } Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-12-17 18:07:13 UTC (rev 1161) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-12-17 18:07:43 UTC (rev 1162) @@ -84,8 +84,6 @@ */ private Map<String, List<String>> ignoreListTable; - private int length = 0; // Number of types in the list - /** List of exit object types. (Integer values) */ private static final HashSet<Integer> EXIT_TYPES = new HashSet<Integer>(); @@ -180,7 +178,6 @@ // if we manage to parse it properly from the file if (head.load(elem, this)) { cfType = head; - //length++; // our list is now one element longer } } @@ -223,15 +220,14 @@ // attach the new CFArchType element to the list // if we manage to parse it properly from the file if (newType.load(elem, this)) { - cfType.setNext(newType); - cfType = cfType.getNext(); - length++; // our list is now one element longer + archTypeList.add(newType); + cfType = newType; } } } if (log.isInfoEnabled()) { - log.info("Loaded " + length + " types from '" + IGUIConstants.TYPEDEF_FILE + "'"); + log.info("Loaded " + archTypeList.size() + " types from '" + IGUIConstants.TYPEDEF_FILE + "'"); } } } finally { @@ -275,18 +271,6 @@ return list; } - /** - * Returns the number of CFArchTypes in this list (excluding the default type). - * @return The number of CFArchTypes in this list. - */ - public int getLength() { - return length; - } - - public CFArchType getHead() { - return head; - } - private void parseTypes(final Element root) { // parse all type elements final List entries = root.getChildren("type"); @@ -320,6 +304,10 @@ return bitmaskTable; } + public CFArchType getDefaultArchType() { + return defaultArchType; + } + /** * Return the ignore list table which contains all definitions of ignore lists for arch attributes. * @return ignore list table @@ -355,6 +343,15 @@ } /** + * Returns the number of CFArchTypes in the list. + * The default type is not counted. + * @return Number of CFArchTypes in the list. + */ + public int getLength() { + return archTypeList.size(); + } + + /** * Find and return the type-structure (<code>CFArchType</code>) that * matches for the given arch. This is not only a comparison between * type numbers - special type-attributes must also be dealt with. @@ -368,16 +365,11 @@ */ public CFArchType getTypeOfArch(final GameObject arch) { // check if the type of the object is present in the definitions - CFArchType tmp = head.getNext(); // tmp cycles through all types - CFArchType type = tmp; // return value: the type of the arch, first one (misc) if no other found - - boolean typeFound = false; - - for (int i = 0; tmp != null && !typeFound; tmp = tmp.getNext(), i++) { + for (final CFArchType tmp : archTypeList) { if (tmp.getTypeNr() == arch.getArchTypNr()) { if (tmp.getTypeAttr() == null) { // no type-attributes, so we only compared type-numbers - typeFound = true; + return tmp; } else { // check if all the type-attributes match @@ -396,18 +388,13 @@ // we've got a match after all if (match) { - typeFound = true; + return tmp; } } - - // we found our type - if (typeFound) { - type = tmp; // this is the type we are looking for - } } } - - return type; + // type of archobject not found - return first one (misc) + return archTypeList.get(0); } /** @@ -415,7 +402,7 @@ * @return <code>true</code> if this typelist contains no data, otherwise <code>false</code>. */ public boolean isEmpty() { - return head == null || head.getNext() == null; + return archTypeList.size() == 0; } /** @@ -429,18 +416,8 @@ */ public CFArchType getTypeByName(final String typeName) { // return: matching type or first type (misc) if no other found - CFArchType type = head.getNext(); - boolean typeFound = false; // true when type is found - - for (CFArchType tmp = type; tmp != null && !typeFound; tmp = tmp.getNext()) { - if (tmp.getTypeName().equals(typeName.trim())) { - // we found our type - type = tmp; - typeFound = true; - } - } - - return type; + final CFArchType type = archTypeNames.get(typeName.trim()); + return type == null ? archTypeList.get(0) : type; } } // class CFArchTypeList Modified: trunk/daimonin/src/daieditor/CFArchType.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchType.java 2006-12-17 18:07:13 UTC (rev 1161) +++ trunk/daimonin/src/daieditor/CFArchType.java 2006-12-17 18:07:43 UTC (rev 1162) @@ -277,14 +277,12 @@ // search through all known types, looking for import type CFArchType impType = null; for (final CFArchType archType : tlist) { - if (impType != null) { - break; - } if (archType == this) { continue; } if (archType.typeName.equalsIgnoreCase(importName)) { impType = archType; + break; } } Modified: trunk/daimonin/src/daieditor/CFArchTypeList.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchTypeList.java 2006-12-17 18:07:13 UTC (rev 1161) +++ trunk/daimonin/src/daieditor/CFArchTypeList.java 2006-12-17 18:07:43 UTC (rev 1162) @@ -391,7 +391,7 @@ boolean match = true; for (int t = 0, l = numArgs * 2; t < l && match; t += 2) { final String archvalue = arch.getAttributeString(tmp.getTypeAttr()[t]); - if (!archvalue.equals(tmp.getTypeAttr()[t + 1]) && !("0".equals(tmp.getTypeAttr()[t + 1]) && archvalue.length() == 0)) { + if (!archvalue.equals(tmp.getTypeAttr()[t + 1]) && !(tmp.getTypeAttr()[t + 1].equals("0") && archvalue.length() == 0)) { match = false; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <chr...@us...> - 2006-12-17 18:07:21
|
Revision: 1161 http://svn.sourceforge.net/gridarta/?rev=1161&view=rev Author: christianhujer Date: 2006-12-17 10:07:13 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Some unification of startup code (unfinnished). Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFJavaEditor.java trunk/daimonin/src/daieditor/CFJavaEditor.java Modified: trunk/crossfire/src/cfeditor/CFJavaEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/CFJavaEditor.java 2006-12-17 17:22:53 UTC (rev 1160) +++ trunk/crossfire/src/cfeditor/CFJavaEditor.java 2006-12-17 18:07:13 UTC (rev 1161) @@ -52,7 +52,7 @@ * The main method that is invoked by the Java Runtime. * @param args The command line parameters given to the level editor. */ - public static void main(final String[] args) { + public static void main(final String... args) { // Make sure the locale is set before any ActionFactory is used. final String locName = CSettings.getInstance(IGUIConstants.APP_NAME).getProperty(PREFS_LANGUAGE, null); if (locName != null) { @@ -65,39 +65,49 @@ String outfile = null; // if specified in the parameters, create image of map and exit String inlist = null; boolean doShow = true; - boolean err = false; - - for (int i = 0; i < args.length; i++) { - // get command line parameters for "infile" (map to open initially) - // and "outfile" (image created from infile map) - if (args[i].compareTo("-infile") == 0 && i < args.length - 1) { - infiles.add(args[++i]); - } else if (args[i].compareTo("-outfile") == 0 && i < args.length - 1) { - outfile = args[++i]; - } else if (args[i].compareTo("-filelist") == 0 && i < args.length - 1) { - inlist = args[++i]; - } else if (args[i].compareTo("-nogui") == 0) { - doShow = false; - } else if (args[i].compareTo("--help") == 0 - || args[i].compareTo("-help") == 0 - || args[i].compareTo("-h") == 0) { - usage(); - System.exit(0); - } else if (args[i].compareTo("--") == 0) { - i++; - while (i < args.length) { - infiles.add(args[i++]); + boolean err = false; // whether a fatal error (exit required) occurred. + boolean exit = false; // whether to quit using System.exit(); + String op = null; // option, stored for error messages + try { // parse command line arguments + for (int i = 0; i < args.length; i++) { + final String arg = args[i]; + // get command line parameters for "infile" (map to open initially) + // and "outfile" (image created from infile map) + if (arg.equals("--help") || arg.equals("-h")) { + usage(); + return; + } else if (arg.equals(op = "--exit")) { + exit = true; + } else if (arg.equals(op = "--outfile") || arg.equals(op = "-o")) { + if (outfile != null) { + System.err.println("Warning: Option -outfile specified more than once. Overriding previous argument."); + } + outfile = args[++i]; + } else if (arg.equals(op = "--filelist")) { + inlist = args[++i]; + } else if (arg.equals(op = "--nogui")) { + doShow = false; + } else if (arg.equals("--")) { + while (++i < args.length) { + infiles.add(args[i]); + } + } else if (arg.startsWith("-")) { + System.err.println("Got unknown option: " + arg); + err = true; + } else { + infiles.add(arg); } - break; - } else if (!args[i].startsWith("-")) { - infiles.add(args[i]); - } else { - System.err.println("Got unknown option: " + args[i]); - err = true; } + } catch (final ArrayIndexOutOfBoundsException e) { + System.err.println("Missing argument for option " + op + '.'); + err = true; } if (err) { - System.exit(1); + if (exit) { + System.exit(1); + } else { + return; + } } if (inlist != null && infiles.size() > 0) { System.err.println("-filelist option and loading maps are mutually exclusive"); Modified: trunk/daimonin/src/daieditor/CFJavaEditor.java =================================================================== --- trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-12-17 17:22:53 UTC (rev 1160) +++ trunk/daimonin/src/daieditor/CFJavaEditor.java 2006-12-17 18:07:13 UTC (rev 1161) @@ -26,6 +26,10 @@ import static daieditor.CMainControl.PREFS_LANGUAGE; import java.io.File; +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.IOException; +import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -75,31 +79,46 @@ splashScreen.show(); final List<String> infiles = new ArrayList<String>(); // map file names to open initially String outfile = null; // if specified in the parameters, create image of map and exit + boolean err = false; // whether a fatal error (exit required) occurred. + boolean exit = false; // whether to quit using System.exit(); String op = null; // option, stored for error messages try { // parse command line arguments for (int i = 0; i < args.length; i++) { final String arg = args[i]; // get command line parameters for "infile" (map to open initially) // and "outfile" (image created from infile map) - if ("-help".equals(arg) || "--help".equals(arg) || "-h".equals(arg)) { - System.err.println("Usage: java -jar DaimoninEditor.jar [--outfile pngfile] [map file...]"); + if (arg.equals("--help") || arg.equals("-h")) { + usage(); return; - } else if (arg.equals(op = "-outfile") || arg.equals(op = "--outfile") || arg.equals(op = "-o")) { + } else if (arg.equals(op = "--exit")) { + exit = true; + } else if (arg.equals(op = "--outfile") || arg.equals(op = "-o")) { if (outfile != null) { System.err.println("Warning: Option -outfile specified more than once. Overriding previous argument."); } outfile = args[++i]; + } else if (arg.equals("--")) { + while (++i < args.length) { + infiles.add(args[i]); + } } else if (arg.startsWith("-")) { System.err.println("Got unknown option: " + arg); - return; + err = true; } else { infiles.add(arg); } } } catch (final ArrayIndexOutOfBoundsException e) { System.err.println("Missing argument for option " + op + '.'); - return; + err = true; } + if (err) { + if (exit) { + System.exit(1); + } else { + return; + } + } // print jre version, for easier recognition of jre-specific problems System.err.println("Running java version " + System.getProperty("java.version")); @@ -121,4 +140,53 @@ splashScreen.hide(); } + private static void makeImage(final CMainControl mainControl, final File in, final File out) { + if (log.isInfoEnabled()) { + log.info("converting " + in + " to " + out); + } + + if (in.canRead()) { + mainControl.openFile(in); + mainControl.createImageWanted(out); + mainControl.close(); + } + } + + private static void processFile(final CMainControl mainControl, final String filelist) { + try { + final BufferedReader reader = new BufferedReader(new FileReader(filelist)); + try { + while (true) { + final String in = reader.readLine(); + final String out = reader.readLine(); + if (in == null || out == null) { + log.info("done."); + System.exit(0); + } + makeImage(mainControl, new File(in), new File(out)); + } + } catch (final IOException e) { + log.info("done."); + System.exit(0); + } + } catch (final FileNotFoundException e) { + log.warn("Read error: ", e); + System.exit(-1); + } + System.exit(0); + } + + private static void usage() { + System.out.println("usage: java -jar DaimoninEditor.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"); + System.out.println(" convert"); + System.out.println(" -help print this help"); + System.out.println(" -infile mapfile map name to load initially"); + System.out.println(" -nogui do not show gui window; only useful for converting maps"); + System.out.println(" -outfile pngfile png file name to convert map to; needs exactly one -infile"); + System.out.println(" or mapfile"); + } + } // class CFJavaEditor This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2006-12-17 17:22:53
|
Revision: 1160 http://svn.sourceforge.net/gridarta/?rev=1160&view=rev Author: akirschbaum Date: 2006-12-17 09:22:53 -0800 (Sun, 17 Dec 2006) Log Message: ----------- Add Nullable annotation. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFilterControl.java Modified: trunk/crossfire/src/cfeditor/CFilterControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CFilterControl.java 2006-12-17 17:17:10 UTC (rev 1159) +++ trunk/crossfire/src/cfeditor/CFilterControl.java 2006-12-17 17:22:53 UTC (rev 1160) @@ -19,6 +19,7 @@ import javax.swing.JMenu; import javax.swing.JMenuItem; import net.sf.japi.swing.ActionFactory; +import org.jetbrains.annotations.Nullable; /** * Control for filters. @@ -56,7 +57,7 @@ private final boolean highLightResult[]; - private final MapControl mapControl; + @Nullable private final MapControl mapControl; private static final CFilterControl defaultFilter = new CFilterControl(null); @@ -65,7 +66,7 @@ * Do not highlight anything and does not filterOut anything * @param mapControl MapControl to create FilterControl for. */ - public CFilterControl(final MapControl mapControl) { + public CFilterControl(@Nullable final MapControl mapControl) { final boolean[] highLight = new boolean[]{false, false, false,}; filterOutConfig = (NamedFilterConfig) filterList.createConfig(); highLightConfig = new NamedFilterConfig[]{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |