|
From: <cro...@li...> - 2002-12-18 22:48:14
|
Module Name: CFJavaEditor
Committed By: avogl
Date: Wed Dec 18 22:48:14 UTC 2002
Added Files:
CFJavaEditor/src/cfeditor: MultiArchData.java MultiPositionData.java
Log Message:
Forgot to add these new classes with last commit
--AV
Start of context diffs
Index: CFJavaEditor/src/cfeditor/MultiArchData.java
diff -c /dev/null CFJavaEditor/src/cfeditor/MultiArchData.java:1.1
*** /dev/null Wed Dec 18 14:48:14 2002
--- CFJavaEditor/src/cfeditor/MultiArchData.java Wed Dec 18 14:48:14 2002
***************
*** 0 ****
--- 1,125 ----
+ /*
+ * Crossfire Java Editor.
+ * Copyright (C) 2000 Michael Toennies
+ *
+ * (code based on: Gridder. 2D grid based level editor. (C) 2000 Pasi Keränen)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ */
+ package cfeditor;
+
+ /**
+ * Subclass of ArchObject to store multipart information.
+ * This data is only needed by multiparts. When the editor is running,
+ * usually a big number of ArchObjects exist - most of them single-tile
+ * objects. The encapsulation of this "multpart-only" data can save
+ * a little bit of memory.
+ *
+ * @author <a href="mailto:and...@gm...">Andreas Vogl</a>
+ */
+ public class MultiArchData {
+ private boolean refflag; // true: this arch is a part of the tail - NOT the head
+
+ private int refnr; // if != -1 - multi tile
+ // if refnr == nodenr
+ // then first tile
+ // else refnr==first tile
+ private int refx; // multi tile: offset pos from head
+ private int refy; // sic!
+ private int refcount; // head: number of parts (>0 means it's ahead)
+ private int refmaxx; // head: parts in x
+ private int refmaxy; // head: parts in y
+ private int refmaxxm; // head: parts in x to count minus ref
+ private int refmaxym; // head: parts in y sic
+ private int multiShapeID; // the ID of the multiPositionData (only for multiparts in isoView!)
+ private int multiPartNr; // the part number for this tile (only for multiparts in isoView!)
+ private boolean isLowestPart; // lowest part of all multi tiles (only for multiparts in isoView!)
+
+ private ArchObject head; // multi tile, this is the head
+ private ArchObject nextref; // next multi tile of this arch in map
+
+ /**
+ * Constructor: Initializing the data
+ */
+ public MultiArchData() {
+ refmaxx = refmaxy = 0;
+ refnr = -1;
+ refflag = false;
+ refcount = 0;
+ head = nextref = null;
+ isLowestPart = false;
+ refx=0;
+ refy=0;
+ }
+
+ /**
+ * @returns an identical copy of this MultiArchData object.
+ * The links are not copied though! A cloned multipart needs to
+ * be re-linked properly before it can be used!
+ */
+ public MultiArchData getClone() {
+ MultiArchData clone = new MultiArchData();
+
+ clone.refflag = refflag; // true: this arch is a multi tile part
+ // and NOT the head
+ clone.refnr = refnr; // if != -1 - multi tile; if refnr == nodenr then first tile
+ // else refnr==first tile; multi tile: offset pos from head
+ clone.refy = refy; // sic!
+ clone.refcount = refcount; // head: number of parts
+ clone.refmaxx = refmaxx; // head: parts in x
+ clone.refmaxy = refmaxy; // head: parts in y
+ clone.refmaxxm = refmaxxm; // head: parts in x to count minus ref
+ clone.refmaxym = refmaxym; // head: parts in y sic
+ clone.multiShapeID = multiShapeID; // ID for the multiPositionData
+ clone.multiPartNr = multiPartNr; // part number for the multiPositionData
+ clone.isLowestPart = isLowestPart; // lowest part of all multi tiles
+
+ return clone;
+ }
+
+ // --- GET/SET methods ---
+ public boolean getRefflag() {return refflag;}
+ public void setRefflag(boolean state) {refflag = state;}
+ public boolean isLowestPart() {return isLowestPart;}
+ public void setLowestPart(boolean state) {isLowestPart = state;}
+
+ public int getRefNr() {return refnr;}
+ public void setRefNr(int value) {refnr = value;}
+ public int getRefX() {return refx;}
+ public void setRefX(int value) {refx = value;}
+ public int getRefY() {return refy;}
+ public void setRefY(int value) {refy = value;}
+ public int getRefCount() {return refcount;}
+ public void setRefCount(int value) {refcount = value;}
+ public int getRefMaxx() {return refmaxx;}
+ public void setRefMaxx(int value) {refmaxx = value;}
+ public int getRefMaxxm() {return refmaxxm;}
+ public void setRefMaxxm(int value) {refmaxxm = value;}
+ public int getRefMaxy() {return refmaxy;}
+ public void setRefMaxy(int value) {refmaxy = value;}
+ public int getRefMaxym() {return refmaxym;}
+ public void setRefMaxym(int value) {refmaxym = value;}
+ public int getMultiShapeID() {return multiShapeID;}
+ public void setMultiShapeID(int value) {multiShapeID = value;}
+ public int getMultiPartNr() {return multiPartNr;}
+ public void setMultiPartNr(int value) {multiPartNr = value;}
+
+ public ArchObject getHead() {return head;}
+ public void setHead(ArchObject node) {head = node;}
+ public ArchObject getNext() {return nextref;}
+ public void setNext(ArchObject node) {nextref = node;}
+ }
|
|
From: <cro...@li...> - 2003-01-12 23:33:07
|
Module Name: CFJavaEditor
Committed By: avogl
Date: Sun Jan 12 23:33:06 UTC 2003
Modified Files:
CFJavaEditor/src/cfeditor: CArchPanel.java CArchPanelPan.java
CFJavaEditor.java CMapArchPanel.java CMapTileList.java
CMapViewBasic.java COptionDialog.java
Log Message:
Small update for the CFJavaEditor:
For the first time I have tested the CFJavaEditor with
Java SDK 1.4.1 on WinXP. Everything worked fine as far as
I could see, but a few methods have been declared deprecated.
Now I replaced these deprecations.
Apart from that I have changed the scrollbar behaviour of
the map view window: When clicking on one of the scrollbar
arrows, the view scrolls now by the length of one tile
(32 pixels) instead of just one pixel as before.
--AndreasV
Start of context diffs
Index: CFJavaEditor/src/cfeditor/CArchPanel.java
diff -c CFJavaEditor/src/cfeditor/CArchPanel.java:1.4 CFJavaEditor/src/cfeditor/CArchPanel.java:1.5
*** CFJavaEditor/src/cfeditor/CArchPanel.java:1.4 Sun Nov 3 08:43:18 2002
--- CFJavaEditor/src/cfeditor/CArchPanel.java Sun Jan 12 15:33:04 2003
***************
*** 127,137 ****
}
public void disableTabPane() {
! m_tabDesktop.disable();
}
public void enableTabPane() {
! m_tabDesktop.enable();
if(m_selectedPanel != null)
m_selectedPanel.showArchList();
}
--- 127,137 ----
}
public void disableTabPane() {
! m_tabDesktop.setEnabled(false);
}
public void enableTabPane() {
! m_tabDesktop.setEnabled(true);
if(m_selectedPanel != null)
m_selectedPanel.showArchList();
}
Index: CFJavaEditor/src/cfeditor/CArchPanelPan.java
diff -c CFJavaEditor/src/cfeditor/CArchPanelPan.java:1.3 CFJavaEditor/src/cfeditor/CArchPanelPan.java:1.4
*** CFJavaEditor/src/cfeditor/CArchPanelPan.java:1.3 Sun Nov 3 08:43:18 2002
--- CFJavaEditor/src/cfeditor/CArchPanelPan.java Sun Jan 12 15:33:04 2003
***************
*** 143,151 ****
}
int addArchPanelCombo(String name) {
! this.disable();
this.jbox.addItem(name);
! this.enable();
return(combo_counter++);
}
--- 143,151 ----
}
int addArchPanelCombo(String name) {
! this.setEnabled(false);
this.jbox.addItem(name);
! this.setEnabled(true);
return(combo_counter++);
}
Index: CFJavaEditor/src/cfeditor/CFJavaEditor.java
diff -c CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.6 CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.7
*** CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.6 Wed Dec 18 14:33:32 2002
--- CFJavaEditor/src/cfeditor/CFJavaEditor.java Sun Jan 12 15:33:05 2003
***************
*** 30,36 ****
* The launcher that launches the whole level editor application.
*
* @author <a href="mailto:mic...@no...">Michael Toennies</a>
! * @version $Revision: 1.6 $
*/
public class CFJavaEditor {
/**
--- 30,36 ----
* The launcher that launches the whole level editor application.
*
* @author <a href="mailto:mic...@no...">Michael Toennies</a>
! * @version $Revision: 1.7 $
*/
public class CFJavaEditor {
/**
Index: CFJavaEditor/src/cfeditor/CMapTileList.java
diff -c CFJavaEditor/src/cfeditor/CMapTileList.java:1.7 CFJavaEditor/src/cfeditor/CMapTileList.java:1.8
*** CFJavaEditor/src/cfeditor/CMapTileList.java:1.7 Wed Dec 18 14:33:32 2002
--- CFJavaEditor/src/cfeditor/CMapTileList.java Sun Jan 12 15:33:05 2003
***************
*** 268,278 ****
String liststring;
String num, numx, numy;
! m_list.disable();
model.removeAllElements();
if(map ==null) {
getPanelArch(-1);
! m_list.enable();
return;
}
--- 268,278 ----
String liststring;
String num, numx, numy;
! m_list.setEnabled(false);
model.removeAllElements();
if(map ==null) {
getPanelArch(-1);
! m_list.setEnabled(true);
return;
}
***************
*** 319,325 ****
// refresh the MapArchPanel to display the new arch
m_view.refreshMapArchPanel();
! m_list.enable();
}
/**
--- 319,325 ----
// refresh the MapArchPanel to display the new arch
m_view.refreshMapArchPanel();
! m_list.setEnabled(true);
}
/**
Index: CFJavaEditor/src/cfeditor/COptionDialog.java
diff -c CFJavaEditor/src/cfeditor/COptionDialog.java:1.5 CFJavaEditor/src/cfeditor/COptionDialog.java:1.6
*** CFJavaEditor/src/cfeditor/COptionDialog.java:1.5 Sun Nov 3 08:43:19 2002
--- CFJavaEditor/src/cfeditor/COptionDialog.java Sun Jan 12 15:33:05 2003
***************
*** 121,127 ****
m_loadArches.setSelected(m_control.isArchLoadedFromCollection());
m_loadArches.addActionListener(new selectArchLoadAL(m_loadArches, this));
optionPartPanel.add(m_loadArches);
! if (m_control.isArchLoadedFromCollection()) m_archField.disable();
mainPanel.add(optionPartPanel);
--- 121,127 ----
m_loadArches.setSelected(m_control.isArchLoadedFromCollection());
m_loadArches.addActionListener(new selectArchLoadAL(m_loadArches, this));
optionPartPanel.add(m_loadArches);
! if (m_control.isArchLoadedFromCollection()) m_archField.setEnabled(false);
mainPanel.add(optionPartPanel);
***************
*** 240,250 ****
public void actionPerformed(ActionEvent event) {
// state has changed
if (cbox.isSelected()) {
! m_archField.disable();
frame.update(frame.getGraphics());
}
else {
! m_archField.enable();
frame.update(frame.getGraphics());
}
}
--- 240,250 ----
public void actionPerformed(ActionEvent event) {
// state has changed
if (cbox.isSelected()) {
! m_archField.setEnabled(false);
frame.update(frame.getGraphics());
}
else {
! m_archField.setEnabled(true);
frame.update(frame.getGraphics());
}
}
|
|
From: <cro...@li...> - 2003-05-04 19:17:54
|
Module Name: CFJavaEditor
Committed By: avogl
Date: Sun May 4 19:17:53 UTC 2003
Modified Files:
CFJavaEditor/src/cfeditor: CFTreasureListTree.java
CMapPropertiesDialog.java
Log Message:
Fixed a bug which caused the MapProperties not to
appear due to an exception (Only happened when default
font is applied).
--AV
Start of context diffs
Index: CFJavaEditor/src/cfeditor/CFTreasureListTree.java
diff -c CFJavaEditor/src/cfeditor/CFTreasureListTree.java:1.4 CFJavaEditor/src/cfeditor/CFTreasureListTree.java:1.5
*** CFJavaEditor/src/cfeditor/CFTreasureListTree.java:1.4 Sat May 3 11:23:07 2003
--- CFJavaEditor/src/cfeditor/CFTreasureListTree.java Sun May 4 12:17:52 2003
***************
*** 866,871 ****
--- 866,873 ----
*/
public TreasureCellRenderer() {
plain = CMainControl.getInstance().getPlainFont();
+ if (plain == null)
+ plain = JFontChooser.default_font;
bold = new Font(plain.getName(), Font.BOLD, plain.getSize());
// get icons
Index: CFJavaEditor/src/cfeditor/CMapPropertiesDialog.java
diff -c CFJavaEditor/src/cfeditor/CMapPropertiesDialog.java:1.6 CFJavaEditor/src/cfeditor/CMapPropertiesDialog.java:1.7
*** CFJavaEditor/src/cfeditor/CMapPropertiesDialog.java:1.6 Sat May 3 11:23:07 2003
--- CFJavaEditor/src/cfeditor/CMapPropertiesDialog.java Sun May 4 12:17:52 2003
***************
*** 197,206 ****
}
optionPanel.add(scrollPane2);
! if (m_control.getPlainFont().getSize() <= 12)
! optionPanel.setPreferredSize(new Dimension(240, 185));
! else
optionPanel.setPreferredSize(new Dimension(280, 185));
// set constraints
c.weightx = 1.0; c.weighty = 1.0;
--- 197,207 ----
}
optionPanel.add(scrollPane2);
!
! if (m_control.isBigFont())
optionPanel.setPreferredSize(new Dimension(280, 185));
+ else
+ optionPanel.setPreferredSize(new Dimension(240, 185));
// set constraints
c.weightx = 1.0; c.weighty = 1.0;
|
|
From: <cro...@li...> - 2003-05-05 23:19:18
|
Module Name: CFJavaEditor
Committed By: avogl
Date: Mon May 5 23:19:16 UTC 2003
Modified Files:
CFJavaEditor/src/cfeditor: CFJavaEditor.java CMainControl.java
CMapViewBasic.java JFontChooser.java
Log Message:
Bernd Edler has written a patch which does the
following:
When a user invokes "Enter Exit", the new opening mapview
is centered on the destination spot.
This makes the whole "Enter Exit" thing a lot
more convenient to use.
Start of context diffs
Index: CFJavaEditor/src/cfeditor/CFJavaEditor.java
diff -c CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.10 CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.11
*** CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.10 Sat May 3 11:23:07 2003
--- CFJavaEditor/src/cfeditor/CFJavaEditor.java Mon May 5 16:19:15 2003
***************
*** 31,37 ****
* The launcher that launches the whole level editor application.
*
* @author <a href="mailto:mic...@no...">Michael Toennies</a>
! * @version $Revision: 1.10 $
*/
public class CFJavaEditor {
/**
--- 31,37 ----
* The launcher that launches the whole level editor application.
*
* @author <a href="mailto:mic...@no...">Michael Toennies</a>
! * @version $Revision: 1.11 $
*/
public class CFJavaEditor {
/**
Index: CFJavaEditor/src/cfeditor/CMainControl.java
diff -c CFJavaEditor/src/cfeditor/CMainControl.java:1.12 CFJavaEditor/src/cfeditor/CMainControl.java:1.13
*** CFJavaEditor/src/cfeditor/CMainControl.java:1.12 Sat May 3 11:23:07 2003
--- CFJavaEditor/src/cfeditor/CMainControl.java Mon May 5 16:19:15 2003
***************
*** 359,433 ****
public ArchObject getArch(int i) {return(archList.getArch(i));}
public CopyBuffer getCopyBuffer() {return copybuffer;}
public Font getPlainFont() {return plainFont;}
public Font getBoldFont() {return boldFont;}
public void newPlainFont(Font newfont) {plainFont = newfont;}
public void newBoldFont(Font newfont) {boldFont = newfont;}
public boolean isBigFont() {return (((getPlainFont()==null)?JFontChooser.default_font.getSize():
getPlainFont().getSize()) > 13);}
- /**
- * Read the typenumbers file (associate names with type numbers)
- *
- private void loadTypeDef() {
- String thisLine, thisLine2;
- int x,y;
- boolean typeflag=false;
-
- try {
- String baseDir = (IGUIConstants.isoView ? CMainControl.getInstance().getArchDefaultFolder()+File.separator+IGUIConstants.CONFIG_DIR : IGUIConstants.CONFIG_DIR);
- CFileReader myInput = new CFileReader(baseDir, IGUIConstants.TYPENR_FILE);
-
- while ((thisLine2 = myInput.getReader().readLine()) != null) {
- // hm, thats ugly, but i need to cut off the damn white spaces for the names
- thisLine = thisLine2;
- if(thisLine2.length()>1) {
- for(x=0;x<thisLine2.length();x++) {
- if(thisLine2.charAt(x) != ' ' && thisLine2.charAt(x) != 0x09)
- break;
- }
- for(y=thisLine2.length()-1;y>=x;y--) {
- if(thisLine2.charAt(y) != ' ')
- break;
- }
- // our clean line
- thisLine = thisLine2.substring(x,y+1);
-
- // we are in space, search for cmd
- if(typeflag == false) {
- if(thisLine.regionMatches(0,"!Type ", 0, 6)) {
- // kill white spaces afer arch...
- // (hm, no command for this in java? )
- for(x=6;x<thisLine.length();x++) {
- if(thisLine.charAt(x) != ' ')
- break;
- }
-
- // we had find our type name
- // System.out.println("Adding type: "+thisLine.substring(x));
- archObjectParser.addObjectTyp(thisLine.substring(x));
- typeflag = true;
- } else
- System.out.println("ERROR Read typedef:Unknown cmd "+thisLine);
- } else {
- if(thisLine.regionMatches(0,"!Tend", 0, 5)) {
- typeflag = false;
- }
- else if(thisLine.regionMatches(0,"field ", 0, 6)) {
- archObjectParser.addObjectForm(thisLine.substring(6));
- }
- }
- }
- }
- myInput.close();
- }
- catch (FileNotFoundException e) {}
- catch (IOException e) {
- System.out.println("Couldn't load \""+IGUIConstants.TYPENR_FILE+"\"");
- }
- }*/
-
void setMapAndArchPosition(int archid, int x, int y) {
m_currentMap.m_view.setMapAndArchPosition(archid, x,y);
}
--- 359,375 ----
public ArchObject getArch(int i) {return(archList.getArch(i));}
public CopyBuffer getCopyBuffer() {return copybuffer;}
+ /** IMPORTANT: plainFont can be null! */
public Font getPlainFont() {return plainFont;}
+ /** IMPORTANT: boldFont can be null! */
public Font getBoldFont() {return boldFont;}
+
public void newPlainFont(Font newfont) {plainFont = newfont;}
public void newBoldFont(Font newfont) {boldFont = newfont;}
public boolean isBigFont() {return (((getPlainFont()==null)?JFontChooser.default_font.getSize():
getPlainFont().getSize()) > 13);}
void setMapAndArchPosition(int archid, int x, int y) {
m_currentMap.m_view.setMapAndArchPosition(archid, x,y);
}
***************
*** 1254,1259 ****
--- 1196,1205 ----
newfile = new File(m_mapDir.getAbsolutePath(), path.substring(1));
} else {
// we have a relative path:
+ if (m_currentMap.mapFile == null) {
+ showMessage("Map not Saved", "Please save this map first.", JOptionPane.ERROR_MESSAGE);
+ return;
+ }
newfile = new File(m_currentMap.mapFile.getParent(), path);
}
Index: CFJavaEditor/src/cfeditor/CMapViewBasic.java
diff -c CFJavaEditor/src/cfeditor/CMapViewBasic.java:1.9 CFJavaEditor/src/cfeditor/CMapViewBasic.java:1.10
*** CFJavaEditor/src/cfeditor/CMapViewBasic.java:1.9 Sat May 3 11:23:07 2003
--- CFJavaEditor/src/cfeditor/CMapViewBasic.java Mon May 5 16:19:15 2003
***************
*** 262,269 ****
}
/**
! * highlight the tile at given koordinates (just as
! * if it had been selected with leftclick)
* @param dx x-coordinate
* @param dy y-coordinate
*/
--- 262,271 ----
}
/**
! * Highlight the tile at given koordinates (just as
! * if it had been selected with leftclick). Besides, the mapview is
! * always centered on the koordinates as far as possible.
! *
* @param dx x-coordinate
* @param dy y-coordinate
*/
***************
*** 273,278 ****
--- 275,299 ----
mapMouseRightPos.y = dy;
mapMouseRightOff.x = 0;
mapMouseRightOff.y = 0;
+
+ // set scroll position accordingly to center on target
+ Rectangle scrollto;
+ if (!IGUIConstants.isoView) {
+ scrollto = new Rectangle ( (dx+1)*32 +16 - getViewport().getViewRect().width/2 ,
+ (dy+1)*32 +16 - getViewport().getViewRect().height/2,
+ getViewport().getViewRect().width,
+ getViewport().getViewRect().height);
+ if (scrollto.x+scrollto.width > getViewport().getViewSize().width)
+ scrollto.x = getViewport().getViewSize().width - scrollto.width;
+ if (scrollto.x < 0 )
+ scrollto.x = 0;
+ if (scrollto.y+scrollto.height > getViewport().getViewSize().height)
+ scrollto.y = getViewport().getViewSize().height - scrollto.height;
+ if (scrollto.y < 0 )
+ scrollto.y = 0;
+ getViewport().setViewPosition( scrollto.getLocation() );
+ //getViewport().scrollRectToVisible(scrollto);
+ }
if (!highlight_on) {
highlight_on = true;
Index: CFJavaEditor/src/cfeditor/JFontChooser.java
diff -c CFJavaEditor/src/cfeditor/JFontChooser.java:1.6 CFJavaEditor/src/cfeditor/JFontChooser.java:1.7
*** CFJavaEditor/src/cfeditor/JFontChooser.java:1.6 Sat May 3 11:23:07 2003
--- CFJavaEditor/src/cfeditor/JFontChooser.java Mon May 5 16:19:15 2003
***************
*** 10,16 ****
*
* Valentin Tablan 06/04/2001
*
! * $Id: JFontChooser.java,v 1.6 2003/05/03 18:23:07 avogl Exp $
*
*/
package cfeditor;
--- 10,16 ----
*
* Valentin Tablan 06/04/2001
*
! * $Id: JFontChooser.java,v 1.7 2003/05/05 23:19:15 avogl Exp $
*
*/
package cfeditor;
|
|
From: <cro...@li...> - 2003-05-12 21:18:01
|
Module Name: CFJavaEditor
Committed By: avogl
Date: Mon May 12 21:18:00 UTC 2003
Modified Files:
CFJavaEditor/src/cfeditor: CFJavaEditor.java CMainControl.java
CMapModel.java CMapViewIFrame.java JFontChooser.java
Log Message:
Two patches submitted by Bernd Edler:
1. "Enter Exit" now also works for pits and trapdoors
2. For exits without x/y dest. coordinations set,
"Enter Exit" takes the EnterX/Y values from map header
(As the CF server does.)
Apart from that I've (hopefully) improved the behaviour
for the "Enter North/East/West/South" command with map tiles.
Instead of always opening the top-left part of the map the
editor tries to do something smarter... hard to explain,
just try it out.
--AndreasV
Start of context diffs
Index: CFJavaEditor/src/cfeditor/CFJavaEditor.java
diff -c CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.11 CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.12
*** CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.11 Mon May 5 16:19:15 2003
--- CFJavaEditor/src/cfeditor/CFJavaEditor.java Mon May 12 14:17:59 2003
***************
*** 31,37 ****
* The launcher that launches the whole level editor application.
*
* @author <a href="mailto:mic...@no...">Michael Toennies</a>
! * @version $Revision: 1.11 $
*/
public class CFJavaEditor {
/**
--- 31,37 ----
* The launcher that launches the whole level editor application.
*
* @author <a href="mailto:mic...@no...">Michael Toennies</a>
! * @version $Revision: 1.12 $
*/
public class CFJavaEditor {
/**
Index: CFJavaEditor/src/cfeditor/CMainControl.java
diff -c CFJavaEditor/src/cfeditor/CMainControl.java:1.13 CFJavaEditor/src/cfeditor/CMainControl.java:1.14
*** CFJavaEditor/src/cfeditor/CMainControl.java:1.13 Mon May 5 16:19:15 2003
--- CFJavaEditor/src/cfeditor/CMainControl.java Mon May 12 14:17:59 2003
***************
*** 1211,1216 ****
--- 1211,1222 ----
oldmap = m_currentMap; // store old map control
openFile(newfile); // open the new map
+
+ if (dx==0 && dy==0) {
+ // use the entry point defined by the map header
+ dx=m_currentMap.m_model.getMapArchObject().getEnterX();
+ dy=m_currentMap.m_model.getMapArchObject().getEnterY();
+ }
m_currentMap.m_view.setHotspot(dx, dy); // set hotspot
// Update the main view so the new map instantly pops up.
***************
*** 1257,1262 ****
--- 1263,1303 ----
oldmap = m_currentMap; // store old map control
openFile(newfile); // open the new map
+
+ // set viewport view on the new map
+ if (!IGUIConstants.isoView) {
+ Rectangle scrollto = null; // new vieport rect
+ JViewport newViewPort = m_currentMap.m_view.getViewPort();
+ JViewport oldViewPort = oldmap.m_view.getViewPort();
+
+ if (direction == IGUIConstants.SOUTH) {
+ scrollto = new Rectangle(oldViewPort.getViewRect().x, 0,
+ oldViewPort.getViewRect().width, oldViewPort.getViewRect().height);
+ }
+ else if (direction == IGUIConstants.NORTH) {
+ scrollto = new Rectangle(oldViewPort.getViewRect().x, newViewPort.getViewSize().height-oldViewPort.getViewRect().height,
+ oldViewPort.getViewRect().width, oldViewPort.getViewRect().height);
+ }
+ else if (direction == IGUIConstants.EAST) {
+ scrollto = new Rectangle(0, oldViewPort.getViewRect().y,
+ oldViewPort.getViewRect().width, oldViewPort.getViewRect().height);
+ }
+ else if (direction == IGUIConstants.WEST) {
+ scrollto = new Rectangle(newViewPort.getViewSize().width-oldViewPort.getViewRect().width, oldViewPort.getViewRect().y,
+ oldViewPort.getViewRect().width, oldViewPort.getViewRect().height);
+ }
+
+ if (scrollto.x+scrollto.width > newViewPort.getViewSize().width)
+ scrollto.x = newViewPort.getViewSize().width - scrollto.width;
+ if (scrollto.x < 0 )
+ scrollto.x = 0;
+ if (scrollto.y+scrollto.height > newViewPort.getViewSize().height)
+ scrollto.y = newViewPort.getViewSize().height - scrollto.height;
+ if (scrollto.y < 0 )
+ scrollto.y = 0;
+ newViewPort.setViewPosition( scrollto.getLocation() );
+ //getViewport().scrollRectToVisible(scrollto);
+ }
// Update the main view so the new map instantly pops up.
m_view.update(m_view.getGraphics());
Index: CFJavaEditor/src/cfeditor/CMapModel.java
diff -c CFJavaEditor/src/cfeditor/CMapModel.java:1.8 CFJavaEditor/src/cfeditor/CMapModel.java:1.9
*** CFJavaEditor/src/cfeditor/CMapModel.java:1.8 Sat May 3 11:23:07 2003
--- CFJavaEditor/src/cfeditor/CMapModel.java Mon May 12 14:17:59 2003
***************
*** 39,44 ****
--- 39,47 ----
public static final boolean JOIN_ENABLE = true;
public static final boolean JOIN_DISABLE = false;
+ // list of exit types (Integer values)
+ private static Set exitTypes = new HashSet();
+
/** Level grid data. */
MapArchObject m_mapArch=null; // the MapArchObject
ArchObject[][] m_mapGrid = null; // containing all arches grid-wise
***************
*** 46,55 ****
private int m_mapWidth = 8;
/** The height of the level (in tiles). */
private int m_mapHeight = 8;
! /** The controller of this model. */
! /** The level file or null if none exists. */
! /** The name of the level. */
! //private String m_strMapName = "";
/** Flag that indicates if the level has been changed since last save. */
private boolean m_fLevelChanged = false;
--- 49,55 ----
private int m_mapWidth = 8;
/** The height of the level (in tiles). */
private int m_mapHeight = 8;
!
/** Flag that indicates if the level has been changed since last save. */
private boolean m_fLevelChanged = false;
***************
*** 66,92 ****
* @param start first element in the <code>ArchObject</code> list of this map
* @param map the map header (<code>MapArchObject</code>)
*/
-
CMapModel (CMainControl mc, CMapControl control, ArchObject start,
MapArchObject map) {
main_control = mc;
m_control = control;
m_mapWidth = map.getWidth();
m_mapHeight = map.getHeight();
- //m_strMapName = map.getName();
m_fLevelChanged = false;
isoView = IGUIConstants.isoView; // is ISO view applied?
m_mapGrid = new ArchObject[m_mapWidth][m_mapHeight];
initMap(m_mapWidth, m_mapHeight);
- // if a new map, we generate the starting map arch
- /*if(start == null)
- start = new ArchObject();*/
-
addArchListToMap(start, map); // init mapArchObject and (when not new map) the arch list
setMapX(m_mapWidth);
setMapY(m_mapHeight);
}
ArchObject getMouseRightPosObject() {
--- 66,104 ----
* @param start first element in the <code>ArchObject</code> list of this map
* @param map the map header (<code>MapArchObject</code>)
*/
CMapModel (CMainControl mc, CMapControl control, ArchObject start,
MapArchObject map) {
main_control = mc;
m_control = control;
m_mapWidth = map.getWidth();
m_mapHeight = map.getHeight();
m_fLevelChanged = false;
isoView = IGUIConstants.isoView; // is ISO view applied?
m_mapGrid = new ArchObject[m_mapWidth][m_mapHeight];
initMap(m_mapWidth, m_mapHeight);
addArchListToMap(start, map); // init mapArchObject and (when not new map) the arch list
setMapX(m_mapWidth);
setMapY(m_mapHeight);
+
+ // init static component
+ if (exitTypes.isEmpty())
+ init();
+ }
+
+ /**
+ * Initialize static components
+ */
+ private static void init() {
+ synchronized(exitTypes) {
+ if (exitTypes.isEmpty()) {
+ exitTypes.add(new Integer(41)); // teleporter
+ exitTypes.add(new Integer(66)); // exit
+ exitTypes.add(new Integer(94)); // pit
+ exitTypes.add(new Integer(95)); // trapdoor
+ }
+ }
}
ArchObject getMouseRightPosObject() {
***************
*** 830,837 ****
/**
* Searching for a valid exit at the highlighted map-spot.
! * (This can be either a teleporter (41), or exit (66))
! * If
*
* @return: ArchObject exit-arch if existent, otherwise null
*/
--- 842,848 ----
/**
* Searching for a valid exit at the highlighted map-spot.
! * (This can be a teleporter, exit, pit etc.)
*
* @return: ArchObject exit-arch if existent, otherwise null
*/
***************
*** 844,859 ****
// first, check if the selected arch is a valid exit
exit = main_control.getMainView().getMapTileSelection();
! if (exit == null || (exit.getArchTypNr() != 41 &&
! exit.getArchTypNr() != 66)) {
// if not, we check the whole selected spot for an exit
! for (exit = m_mapGrid[hspot.x][hspot.y];
! exit != null && exit.getArchTypNr() != 41 &&
! exit.getArchTypNr() != 66; exit = exit.getNextArch());
}
! if (exit == null || (exit.getArchTypNr() != 41 &&
! exit.getArchTypNr() != 66))
exit = null; // make sure it's either an exit, or null
// if we have a multipart exit, return the head
--- 855,867 ----
// first, check if the selected arch is a valid exit
exit = main_control.getMainView().getMapTileSelection();
! if (exit == null || !exitTypes.contains(new Integer(exit.getArchTypNr()))) {
// if not, we check the whole selected spot for an exit
! for (exit = m_mapGrid[hspot.x][hspot.y]; exit != null &&
! !exitTypes.contains(new Integer(exit.getArchTypNr())); exit = exit.getNextArch());
}
! if (exit == null || !exitTypes.contains(new Integer(exit.getArchTypNr())))
exit = null; // make sure it's either an exit, or null
// if we have a multipart exit, return the head
Index: CFJavaEditor/src/cfeditor/CMapViewIFrame.java
diff -c CFJavaEditor/src/cfeditor/CMapViewIFrame.java:1.4 CFJavaEditor/src/cfeditor/CMapViewIFrame.java:1.5
*** CFJavaEditor/src/cfeditor/CMapViewIFrame.java:1.4 Sat May 3 11:23:07 2003
--- CFJavaEditor/src/cfeditor/CMapViewIFrame.java Mon May 12 14:17:59 2003
***************
*** 102,107 ****
--- 102,109 ----
// following a bunch of wrapper methods which just pass access
// to the basic mapview object 'view':
public Point getMapMouseRightPos() {return view.getMapMouseRightPos();}
+ public JViewport getViewPort() {return view.getViewport();}
+ public Dimension getSize() {return view.getSize();}
public boolean isGridVisible() {return view.isGridVisible();}
public void updateLookAndFeel() {view.updateLookAndFeel();}
public boolean isHighlight() {return view.isHighlight();}
Index: CFJavaEditor/src/cfeditor/JFontChooser.java
diff -c CFJavaEditor/src/cfeditor/JFontChooser.java:1.7 CFJavaEditor/src/cfeditor/JFontChooser.java:1.8
*** CFJavaEditor/src/cfeditor/JFontChooser.java:1.7 Mon May 5 16:19:15 2003
--- CFJavaEditor/src/cfeditor/JFontChooser.java Mon May 12 14:17:59 2003
***************
*** 10,16 ****
*
* Valentin Tablan 06/04/2001
*
! * $Id: JFontChooser.java,v 1.7 2003/05/05 23:19:15 avogl Exp $
*
*/
package cfeditor;
--- 10,16 ----
*
* Valentin Tablan 06/04/2001
*
! * $Id: JFontChooser.java,v 1.8 2003/05/12 21:17:59 avogl Exp $
*
*/
package cfeditor;
|
|
From: <cro...@li...> - 2003-07-13 17:49:12
|
Module Name: CFJavaEditor
Committed By: avogl
Date: Sun Jul 13 17:49:11 UTC 2003
Modified Files:
CFJavaEditor/src/cfeditor: ArchObject.java ArchObjectParser.java
ArchObjectStack.java CArchPanel.java CFJavaEditor.java
CMainControl.java CMainMenu.java CMainView.java CMapViewBasic.java
CPickmapPanel.java IGUIConstants.java JFontChooser.java
Log Message:
Enhanced map drawing logic to display big multipart images
correctly, as far as I understand the system.
There's also a new menu command which allows to quickly
open pickmaps in the mapview, for more detailed editing.
--AndreasV
The following files had too many changes to show the context diffs here:
cvs rdiff -r1.6 -r1.7 CFJavaEditor/src/cfeditor/ArchObjectParser.java
cvs rdiff -r1.10 -r1.11 CFJavaEditor/src/cfeditor/ArchObjectStack.java
Start of context diffs
Index: CFJavaEditor/src/cfeditor/ArchObject.java
diff -c CFJavaEditor/src/cfeditor/ArchObject.java:1.7 CFJavaEditor/src/cfeditor/ArchObject.java:1.8
*** CFJavaEditor/src/cfeditor/ArchObject.java:1.7 Sat May 3 11:23:06 2003
--- CFJavaEditor/src/cfeditor/ArchObject.java Sun Jul 13 10:49:10 2003
***************
*** 71,76 ****
--- 71,78 ----
private boolean editflag; // if true, object is in a editor
// for example in the map arch panel
+ private boolean artifacts_flag; // if set, this is not a "real" arch
+ // It will NOT be included in the arch collection
private ArchObject next; // to chain ArchObjects in maps
private ArchObject prev; // same
***************
*** 106,111 ****
--- 108,114 ----
container = inv_prev = inv_next = null;
noface = true; // this sucker has no face
+ artifacts_flag = false; // will be true for arches from the artifacts file
faceName = null; // if there is a face cmd, this is the face name
facenr = -1; // if we have a face AND we have loaded the face, this is his number.
// if faceName!=null and facenr==-1, we haven't loaded the face
***************
*** 338,344 ****
return(tmp_arch);
}
!
public void setPrevInv(ArchObject p)
{
inv_prev = p;
--- 341,354 ----
return(tmp_arch);
}
!
! public void setArtifactFlag(boolean aflag) {
! artifacts_flag = aflag;
! }
! public boolean getArtifactFlag() {
! return(artifacts_flag);
! }
!
public void setPrevInv(ArchObject p)
{
inv_prev = p;
***************
*** 355,361 ****
{
return(inv_next);
}
!
public ArchObject getStartInv()
{
return(inv_start);
--- 365,371 ----
{
return(inv_next);
}
!
public ArchObject getStartInv()
{
return(inv_start);
Index: CFJavaEditor/src/cfeditor/CFJavaEditor.java
diff -c CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.13 CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.14
*** CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.13 Mon Jul 7 02:51:26 2003
--- CFJavaEditor/src/cfeditor/CFJavaEditor.java Sun Jul 13 10:49:11 2003
***************
*** 31,37 ****
* The launcher that launches the whole level editor application.
*
* @author <a href="mailto:mic...@no...">Michael Toennies</a>
! * @version $Revision: 1.13 $
*/
public class CFJavaEditor {
/**
--- 31,37 ----
* The launcher that launches the whole level editor application.
*
* @author <a href="mailto:mic...@no...">Michael Toennies</a>
! * @version $Revision: 1.14 $
*/
public class CFJavaEditor {
/**
Index: CFJavaEditor/src/cfeditor/CMainControl.java
diff -c CFJavaEditor/src/cfeditor/CMainControl.java:1.15 CFJavaEditor/src/cfeditor/CMainControl.java:1.16
*** CFJavaEditor/src/cfeditor/CMainControl.java:1.15 Mon Jul 7 02:51:26 2003
--- CFJavaEditor/src/cfeditor/CMainControl.java Sun Jul 13 10:49:11 2003
***************
*** 233,242 ****
// now collect all arch you can find in the arch path!!
System.gc();
! // Synchronize menus and toolbars
!
! // File f = new File("../maps/MWizard5");
! // openFile( f);
}
/**
* Loading the joinlist from file and attaching all to 'joinlist'.
--- 233,239 ----
// now collect all arch you can find in the arch path!!
System.gc();
! m_view.updateFocus(false); /*MTMT*/
}
/**
* Loading the joinlist from file and attaching all to 'joinlist'.
***************
*** 730,744 ****
if (activePickmap == null) {
showMessage("Cannot close Pickmap", "There are no pickmaps.");
}
! else if (!activePickmap.isLevelChanged()) {
! closeLevel(activePickmap, true);
! }
! else if (askConfirm(
! "Close Pickmap "+activePickmap.getMapFileName() +"?",
! "If you close the pickmap '"+activePickmap.getMapFileName()+"', all\n"+
! "recent changes will be lost. Do you really want to close it?") ) {
! // okay, then do it:
! closeLevel(activePickmap, true); // close the old map
}
}
}
--- 727,749 ----
if (activePickmap == null) {
showMessage("Cannot close Pickmap", "There are no pickmaps.");
}
! else {
! // if pickmap was modified, ask for confirmation:
! if (!activePickmap.isLevelChanged() || askConfirm("Close Pickmap "+activePickmap.getMapFileName() +"?",
! "If you close the pickmap '"+activePickmap.getMapFileName()+"', all recent\n"+
! "changes will be lost. Do you really want to close it?")) {
! File pickmapFile = activePickmap.mapFile;
! // close pickmap
! closeLevel(activePickmap, true);
!
! // also delete pickmap file?
! if (askConfirm("Delete File "+activePickmap.getMapFileName() +"?",
! "The pickmap '"+activePickmap.getMapFileName()+"' has been closed.\n"+
! "Do you also want to remove the pickmap file '"+activePickmap.getMapFileName()+"' from your harddisk?\n"+
! "(Doing so will permanently delete the pickmap.)")) {
! pickmapFile.delete();
! }
! }
}
}
}
***************
*** 791,796 ****
--- 796,836 ----
refreshMenusAndToolbars();
System.gc();
return true;
+ }
+
+ /**
+ * Open active pickmap as normal map for extensive editing
+ */
+ public void openActivePickmapAsMapWanted() {
+ if (!CPickmapPanel.getInstance().isLoadComplete()) {
+ showMessage("Cannot open Pickmap", "Pickmaps aren't loaded.\n"+
+ "Either there are no pickmaps or the loading process is not complete.");
+ }
+ else {
+ if (!getMainView().isPickmapActive()) {
+ showMessage("Cannot open Pickmap", "Pickmaps are currently hidden.\n"+
+ "Please select a pickmap before activating this command.");
+ }
+ else {
+ CMapControl activePickmap = CPickmapPanel.getInstance().getCurrentPickmap();
+ if (activePickmap == null) {
+ showMessage("Cannot open Pickmap", "There are no pickmaps.");
+ }
+ else {
+ // open pickmap as map
+ File pickmapFile = activePickmap.mapFile;
+ if (!pickmapFile.exists()) {
+ if(askConfirm("Cannot open Pickmap", "The map file for '"+activePickmap.getMapFileName()+"' does not exist.\n"+
+ "Do you want to create the file by saving this pickmap?")) {
+ saveActivePickmapWanted();
+ openFile(pickmapFile);
+ }
+ }
+ else
+ openFile(pickmapFile);
+ }
+ }
+ }
}
/**
Index: CFJavaEditor/src/cfeditor/CMapViewBasic.java
diff -c CFJavaEditor/src/cfeditor/CMapViewBasic.java:1.11 CFJavaEditor/src/cfeditor/CMapViewBasic.java:1.12
*** CFJavaEditor/src/cfeditor/CMapViewBasic.java:1.11 Mon Jul 7 02:51:26 2003
--- CFJavaEditor/src/cfeditor/CMapViewBasic.java Sun Jul 13 10:49:11 2003
***************
*** 696,701 ****
--- 696,704 ----
}
else {
// ---------- draw rectangular map --------------
+ // this vector contains all heads of multi-tiles with oversized images
+ Vector oversizedMultiHeads = new Vector();
+
for (int y = 0; y < m_mapHeight; y++ ) {
for (int x = 0; x < m_mapWidth; x++ ) {
if(m_mapGrid[x][y]==null) {
***************
*** 721,727 ****
main_control.unknownTileIconX.paintIcon(this, grfx, x*32+bOffset,y*32+bOffset);
}
else {
! archlist.getFace(node.getFaceNr()).paintIcon(this, grfx, x*32+bOffset,y*32+bOffset);
}
}
}
--- 724,735 ----
main_control.unknownTileIconX.paintIcon(this, grfx, x*32+bOffset,y*32+bOffset);
}
else {
! // draw object face
! img = archlist.getFace(node.getFaceNr());
! if (!node.isMulti() || (img.getIconWidth() == 32 && img.getIconHeight() == 32))
! archlist.getFace(node.getFaceNr()).paintIcon(this, grfx, x*32+bOffset,y*32+bOffset);
! else if (node.getRefCount() > 0)
! oversizedMultiHeads.addElement(node); // store oversized arches for later
}
}
}
***************
*** 730,735 ****
--- 738,750 ----
}
}
}
+ // at the end, we have to draw the oversized multipart images on top of the rest
+ for (int i=0; i<oversizedMultiHeads.size(); i++) {
+ node = (ArchObject)(oversizedMultiHeads.elementAt(i));
+ archlist.getFace(node.getFaceNr()).paintIcon(this, grfx, node.getMapX()*32+bOffset, node.getMapY()*32+bOffset);
+ }
+ oversizedMultiHeads = null;
+
// grid lines
if (showMapGrid && !is_snapshot) {
for (int x = 0; x <= m_mapWidth; x++ ) {
***************
*** 780,785 ****
--- 795,801 ----
}
else {
// ---------- draw tile for rectangular view (non-iso) --------------
+ ImageIcon img = null; // tmp image
// first, draw the object's faces:
if(m_mapGrid[x][y]==null) {
***************
*** 805,811 ****
if(node.getFaceNr() == -1) {
main_control.unknownTileIconX.paintIcon(this, tmp_grfx, 0,0);
} else {
! archlist.getFace(node.getFaceNr()).paintIcon(this, tmp_grfx, 0,0);
}
}
}
--- 821,834 ----
if(node.getFaceNr() == -1) {
main_control.unknownTileIconX.paintIcon(this, tmp_grfx, 0,0);
} else {
! img = archlist.getFace(node.getFaceNr());
! if (!node.isMulti() || (img.getIconWidth() == 32 && img.getIconHeight() == 32)
! || node.getRefCount() > 0)
! img.paintIcon(this, tmp_grfx, 0,0);
! else {
! // this is an oversized image and not the head, so it must be shifted
! img.paintIcon(this, tmp_grfx, -32*node.getRefX(), -32*node.getRefY());
! }
}
}
}
Index: CFJavaEditor/src/cfeditor/CPickmapPanel.java
diff -c CFJavaEditor/src/cfeditor/CPickmapPanel.java:1.5 CFJavaEditor/src/cfeditor/CPickmapPanel.java:1.6
*** CFJavaEditor/src/cfeditor/CPickmapPanel.java:1.5 Mon Jul 7 02:51:26 2003
--- CFJavaEditor/src/cfeditor/CPickmapPanel.java Sun Jul 13 10:49:11 2003
***************
*** 109,117 ****
m_control.refreshMenusAndToolbars();
// did we get something?
! if (!m_pickmaps.isEmpty())
loadComplete = true;
updateActivePickmap(); // make sure we know which one is on top
}
--- 109,121 ----
m_control.refreshMenusAndToolbars();
// did we get something?
! if (!m_pickmaps.isEmpty()) {
loadComplete = true;
+ if (IGUIConstants.isoView)
+ m_control.getMainView().movePickmapPanelToFront();
+ }
+
updateActivePickmap(); // make sure we know which one is on top
}
***************
*** 175,181 ****
public boolean addNewPickmap(MapArchObject maparch) {
CMapViewBasic bmapview = null;
! File mapFile = new File(IGUIConstants.PICKMAP_DIR +File.separator+ maparch.getFileName());
if (mapFile.exists()) {
m_control.showMessage("Cannot Create Pickmap", "A pickmap named '"+mapFile+"' already exists.\n"+
"Either remove the existing one or choose a different name.", JOptionPane.ERROR_MESSAGE);
--- 179,186 ----
public boolean addNewPickmap(MapArchObject maparch) {
CMapViewBasic bmapview = null;
! File mapFile = new File((IGUIConstants.isoView ? CMainControl.getInstance().getArchDefaultFolder()+File.separator+IGUIConstants.PICKMAP_DIR+File.separator+maparch.getFileName() :
! IGUIConstants.PICKMAP_DIR + File.separator + maparch.getFileName()));
if (mapFile.exists()) {
m_control.showMessage("Cannot Create Pickmap", "A pickmap named '"+mapFile+"' already exists.\n"+
"Either remove the existing one or choose a different name.", JOptionPane.ERROR_MESSAGE);
Index: CFJavaEditor/src/cfeditor/JFontChooser.java
diff -c CFJavaEditor/src/cfeditor/JFontChooser.java:1.9 CFJavaEditor/src/cfeditor/JFontChooser.java:1.10
*** CFJavaEditor/src/cfeditor/JFontChooser.java:1.9 Mon Jul 7 02:51:26 2003
--- CFJavaEditor/src/cfeditor/JFontChooser.java Sun Jul 13 10:49:11 2003
***************
*** 10,16 ****
*
* Valentin Tablan 06/04/2001
*
! * $Id: JFontChooser.java,v 1.9 2003/07/07 09:51:26 avogl Exp $
*
*/
package cfeditor;
--- 10,16 ----
*
* Valentin Tablan 06/04/2001
*
! * $Id: JFontChooser.java,v 1.10 2003/07/13 17:49:11 avogl Exp $
*
*/
package cfeditor;
|
|
From: <cro...@li...> - 2003-07-17 20:36:44
|
Module Name: CFJavaEditor
Committed By: avogl
Date: Thu Jul 17 20:36:43 UTC 2003
Modified Files:
CFJavaEditor/src/cfeditor: ArchObjectStack.java CFJavaEditor.java
JFontChooser.java
Log Message:
Fixed path-related problem in the collected png
image loader.
--AV
Start of context diffs
Index: CFJavaEditor/src/cfeditor/ArchObjectStack.java
diff -c CFJavaEditor/src/cfeditor/ArchObjectStack.java:1.11 CFJavaEditor/src/cfeditor/ArchObjectStack.java:1.12
*** CFJavaEditor/src/cfeditor/ArchObjectStack.java:1.11 Sun Jul 13 10:49:11 2003
--- CFJavaEditor/src/cfeditor/ArchObjectStack.java Thu Jul 17 13:36:43 2003
***************
*** 486,504 ****
do {
// first we parse the face name out of the ascii data
// that precedes the png byte-data
! face = ""; c = '\0'; l = '\0';
face_complete = false;
! do {
! r = stream.read();
! } while (r != -1 && (char)r != '.');
do {
! while(c != '.' && r != -1) {
r = stream.read();
c = (char)r;
face += String.valueOf(c);
}
!
// r == -1 means End of File reached!
if (r != -1) {
for (t=0; t<3; t++)
--- 486,506 ----
do {
// first we parse the face name out of the ascii data
// that precedes the png byte-data
! face = ""; c = '\0'; l = '\0'; r = '\0';
face_complete = false;
! for (t=0; t<3; t++) {
! do{
! r = stream.read();
! }while(r != -1 && (char)r != ' ');
! }
do {
! while((c != '.' || face.length() < 3) && r != -1) {
r = stream.read();
c = (char)r;
face += String.valueOf(c);
}
! //System.out.println("face = '"+face+"'");
// r == -1 means End of File reached!
if (r != -1) {
for (t=0; t<3; t++)
***************
*** 525,531 ****
if (r != -1) {
// now we try to figure the size of the png data in byte,
// later we jump back to the beginning position and read those bytes
! stream.getBufferedStream().mark(10000); // mark position
t = 0; size=0;
do {
r = stream.read(); // read one character
--- 527,533 ----
if (r != -1) {
// now we try to figure the size of the png data in byte,
// later we jump back to the beginning position and read those bytes
! stream.getBufferedStream().mark(100000); // mark position
t = 0; size=0;
do {
r = stream.read(); // read one character
Index: CFJavaEditor/src/cfeditor/CFJavaEditor.java
diff -c CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.14 CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.15
*** CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.14 Sun Jul 13 10:49:11 2003
--- CFJavaEditor/src/cfeditor/CFJavaEditor.java Thu Jul 17 13:36:43 2003
***************
*** 31,37 ****
* The launcher that launches the whole level editor application.
*
* @author <a href="mailto:mic...@no...">Michael Toennies</a>
! * @version $Revision: 1.14 $
*/
public class CFJavaEditor {
/**
--- 31,37 ----
* The launcher that launches the whole level editor application.
*
* @author <a href="mailto:mic...@no...">Michael Toennies</a>
! * @version $Revision: 1.15 $
*/
public class CFJavaEditor {
/**
Index: CFJavaEditor/src/cfeditor/JFontChooser.java
diff -c CFJavaEditor/src/cfeditor/JFontChooser.java:1.10 CFJavaEditor/src/cfeditor/JFontChooser.java:1.11
*** CFJavaEditor/src/cfeditor/JFontChooser.java:1.10 Sun Jul 13 10:49:11 2003
--- CFJavaEditor/src/cfeditor/JFontChooser.java Thu Jul 17 13:36:43 2003
***************
*** 10,16 ****
*
* Valentin Tablan 06/04/2001
*
! * $Id: JFontChooser.java,v 1.10 2003/07/13 17:49:11 avogl Exp $
*
*/
package cfeditor;
--- 10,16 ----
*
* Valentin Tablan 06/04/2001
*
! * $Id: JFontChooser.java,v 1.11 2003/07/17 20:36:43 avogl Exp $
*
*/
package cfeditor;
|
|
From: <cro...@li...> - 2003-07-19 15:15:38
|
Module Name: CFJavaEditor
Committed By: avogl
Date: Sat Jul 19 15:15:36 UTC 2003
Modified Files:
CFJavaEditor/src/cfeditor: ArchObjectStack.java CFJavaEditor.java
JFontChooser.java
CFJavaEditor/src/cfeditor/textedit/textarea: CTokenMarker.java
DefaultInputHandler.java HTMLTokenMarker.java InputHandler.java
JEditTextArea.java JavaScriptTokenMarker.java KeywordMap.java
PythonTokenMarker.java SyntaxDocument.java SyntaxStyle.java
SyntaxUtilities.java TextAreaPainter.java TextUtilities.java
Token.java TokenMarker.java XMLTokenMarker.java
Log Message:
Fixed a bug which prevented the last image in the archive
to get loaded properly.
Also fixed a problem which might have caused the <Strg>-S
quicksave shortcut not to work in the script pad.
--AndreasV
Start of context diffs
Index: CFJavaEditor/src/cfeditor/ArchObjectStack.java
diff -c CFJavaEditor/src/cfeditor/ArchObjectStack.java:1.12 CFJavaEditor/src/cfeditor/ArchObjectStack.java:1.13
*** CFJavaEditor/src/cfeditor/ArchObjectStack.java:1.12 Thu Jul 17 13:36:43 2003
--- CFJavaEditor/src/cfeditor/ArchObjectStack.java Sat Jul 19 08:15:36 2003
***************
*** 500,506 ****
c = (char)r;
face += String.valueOf(c);
}
! //System.out.println("face = '"+face+"'");
// r == -1 means End of File reached!
if (r != -1) {
for (t=0; t<3; t++)
--- 500,506 ----
c = (char)r;
face += String.valueOf(c);
}
!
// r == -1 means End of File reached!
if (r != -1) {
for (t=0; t<3; t++)
***************
*** 540,548 ****
} while (t < tag.length() && r != -1);
// again, r == -1 means End of File reached
! if (r != -1) {
! size -= tag.length(); // must subtract the size of final string
!
stream.getBufferedStream().reset(); // jump to beginning of png data
// now we create a buffer of appropriate size and
--- 540,554 ----
} while (t < tag.length() && r != -1);
// again, r == -1 means End of File reached
! if (r != -1 || size > 0) {
! if (r == -1) {
! // for the last png, subtract one because last was EOF
! size--;
! }
! else {
! // for all other pngs, must subtract the size of next starting tag
! size -= tag.length();
! }
stream.getBufferedStream().reset(); // jump to beginning of png data
// now we create a buffer of appropriate size and
Index: CFJavaEditor/src/cfeditor/CFJavaEditor.java
diff -c CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.15 CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.16
*** CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.15 Thu Jul 17 13:36:43 2003
--- CFJavaEditor/src/cfeditor/CFJavaEditor.java Sat Jul 19 08:15:36 2003
***************
*** 31,37 ****
* The launcher that launches the whole level editor application.
*
* @author <a href="mailto:mic...@no...">Michael Toennies</a>
! * @version $Revision: 1.15 $
*/
public class CFJavaEditor {
/**
--- 31,37 ----
* The launcher that launches the whole level editor application.
*
* @author <a href="mailto:mic...@no...">Michael Toennies</a>
! * @version $Revision: 1.16 $
*/
public class CFJavaEditor {
/**
Index: CFJavaEditor/src/cfeditor/JFontChooser.java
diff -c CFJavaEditor/src/cfeditor/JFontChooser.java:1.11 CFJavaEditor/src/cfeditor/JFontChooser.java:1.12
*** CFJavaEditor/src/cfeditor/JFontChooser.java:1.11 Thu Jul 17 13:36:43 2003
--- CFJavaEditor/src/cfeditor/JFontChooser.java Sat Jul 19 08:15:36 2003
***************
*** 10,16 ****
*
* Valentin Tablan 06/04/2001
*
! * $Id: JFontChooser.java,v 1.11 2003/07/17 20:36:43 avogl Exp $
*
*/
package cfeditor;
--- 10,16 ----
*
* Valentin Tablan 06/04/2001
*
! * $Id: JFontChooser.java,v 1.12 2003/07/19 15:15:36 avogl Exp $
*
*/
package cfeditor;
Index: CFJavaEditor/src/cfeditor/textedit/textarea/CTokenMarker.java
diff -c CFJavaEditor/src/cfeditor/textedit/textarea/CTokenMarker.java:1.1 CFJavaEditor/src/cfeditor/textedit/textarea/CTokenMarker.java:1.2
*** CFJavaEditor/src/cfeditor/textedit/textarea/CTokenMarker.java:1.1 Mon Apr 7 17:45:02 2003
--- CFJavaEditor/src/cfeditor/textedit/textarea/CTokenMarker.java Sat Jul 19 08:15:36 2003
***************
*** 14,20 ****
* C token marker.
*
* @author Slava Pestov
! * @version $Id: CTokenMarker.java,v 1.1 2003/04/08 00:45:02 avogl Exp $
*/
public class CTokenMarker extends TokenMarker
{
--- 14,20 ----
* C token marker.
*
* @author Slava Pestov
! * @version $Id: CTokenMarker.java,v 1.2 2003/07/19 15:15:36 avogl Exp $
*/
public class CTokenMarker extends TokenMarker
{
|
|
From: <cro...@li...> - 2003-08-03 19:02:35
|
Module Name: CFJavaEditor
Committed By: avogl
Date: Sun Aug 3 19:02:35 UTC 2003
Modified Files:
CFJavaEditor/src/cfeditor: ArchObjectStack.java
Log Message:
Small patch to make the JavaEditor ignore
all directories starting with dot ('.') character,
concerning the arch loading proccess.
--AndreasV
Start of context diffs
Index: CFJavaEditor/src/cfeditor/ArchObjectStack.java
diff -c CFJavaEditor/src/cfeditor/ArchObjectStack.java:1.13 CFJavaEditor/src/cfeditor/ArchObjectStack.java:1.14
*** CFJavaEditor/src/cfeditor/ArchObjectStack.java:1.13 Sat Jul 19 08:15:36 2003
--- CFJavaEditor/src/cfeditor/ArchObjectStack.java Sun Aug 3 12:02:34 2003
***************
*** 344,350 ****
name = f.getName();
if (f.isDirectory()) {
// now, setup the arch panels
! if(name.equalsIgnoreCase("cvs")!=true && name.equalsIgnoreCase("dev")!=true)
{
if(folder_level > 0 && folder_level < 2) // add first folders as panels
{
--- 344,351 ----
name = f.getName();
if (f.isDirectory()) {
// now, setup the arch panels
! if(name.equalsIgnoreCase("cvs")!=true && name.equalsIgnoreCase("dev")!=true
! && !name.startsWith("."))
{
if(folder_level > 0 && folder_level < 2) // add first folders as panels
{
***************
*** 363,370 ****
loadArchFromFiles(new File(f, children[i]),index);
folder_level--;
}
! }
! else {
if(name.equalsIgnoreCase("cvs")!=true && name.equalsIgnoreCase("dev")!=true) {
if((len = (int)name.length()) >= 5) {
--- 364,371 ----
loadArchFromFiles(new File(f, children[i]),index);
folder_level--;
}
! }
! else {
if(name.equalsIgnoreCase("cvs")!=true && name.equalsIgnoreCase("dev")!=true) {
if((len = (int)name.length()) >= 5) {
|
|
From: <cro...@li...> - 2003-09-25 22:44:09
|
Module Name: CFJavaEditor
Committed By: avogl
Date: Thu Sep 25 22:43:57 UTC 2003
Modified Files:
CFJavaEditor/src/cfeditor: CAttribDialog.java
Log Message:
Fixed a bug in the parse logic for floating points.
Also improved handling of fixed attributes in
combination with type-changing.
--AV
Start of context diffs
Index: CFJavaEditor/src/cfeditor/CAttribDialog.java
diff -c CFJavaEditor/src/cfeditor/CAttribDialog.java:1.7 CFJavaEditor/src/cfeditor/CAttribDialog.java:1.8
*** CFJavaEditor/src/cfeditor/CAttribDialog.java:1.7 Sat May 3 11:23:07 2003
--- CFJavaEditor/src/cfeditor/CAttribDialog.java Thu Sep 25 15:43:56 2003
***************
*** 1199,1205 ****
double def_value = 0; // value from the default arch
// try to parse floating point
value = Double.parseDouble(((FloatAttrib)attr).input.getText().trim());
! def_value = Double.parseDouble(defarch.getAttributeString(attr.ref.getNameOld(), null).trim());
if (value != def_value)
new_ArchText = new_ArchText+attr.ref.getNameOld()+" "+value+"\n";
}
--- 1199,1207 ----
double def_value = 0; // value from the default arch
// try to parse floating point
value = Double.parseDouble(((FloatAttrib)attr).input.getText().trim());
! String defValueStr = defarch.getAttributeString(attr.ref.getNameOld(), null).trim();
! if (defValueStr.length() > 0)
! def_value = Double.parseDouble(defValueStr);
if (value != def_value)
new_ArchText = new_ArchText+attr.ref.getNameOld()+" "+value+"\n";
}
***************
*** 1312,1321 ****
// Also write all the 'fixed' attributes into the archtext
for (int i=0; type.getAttr().length > i; i++) {
! if (type.getAttr()[i].getDataType() == CFArchAttrib.T_FIXED &&
! defarch.getAttributeString(type.getAttr()[i].getNameOld(), null).length()==0)
new_ArchText = new_ArchText+type.getAttr()[i].getNameOld()+" "+
type.getAttr()[i].getNameNew()+"\n";
}
// before we modify the archtext, we look for errors and save them.
--- 1314,1332 ----
// Also write all the 'fixed' attributes into the archtext
for (int i=0; type.getAttr().length > i; i++) {
! if (type.getAttr()[i].getDataType() == CFArchAttrib.T_FIXED) {
! String defaultValue = defarch.getAttributeString(type.getAttr()[i].getNameOld(), null);
! if (defaultValue.length()==0 || (arch.getArchTypNr() != defarch.getArchTypNr() &&
! !defaultValue.equalsIgnoreCase(type.getAttr()[i].getNameNew()))) {
! // usually, fixed attributes are only applied when *not* defined in the defarch.
! // the reason behind this is: if the default arch violates our fixed attribute,
! // we assume the default arch is "right" and we are "wrong". The typedefs aren't that trustworthy.
! // BUT - if the arch has a changed type, the defarch has lost it's credibility.
! // So, in this special case, the fixed attribute applies always.
new_ArchText = new_ArchText+type.getAttr()[i].getNameOld()+" "+
type.getAttr()[i].getNameNew()+"\n";
+ }
+ }
}
// before we modify the archtext, we look for errors and save them.
|
|
From: <cro...@li...> - 2003-10-12 14:23:50
|
Module Name: CFJavaEditor
Committed By: avogl
Date: Sun Oct 12 14:23:47 UTC 2003
Modified Files:
CFJavaEditor/src/cfeditor: ArchObject.java ArchObjectStack.java
CArchPanel.java CArchPanelPan.java CMainControl.java CMainView.java
CMapArchPanel.java CMapFileDecode.java CPickmapPanel.java
ScriptArchData.java
Log Message:
CFJavaEditor Update:
The archpanel tabs used to be sorted in the same order
as read from the arch directory file, which led
to unpredictable results on unix systems.
Now the archpanel tabs are always sorted in alphabetical
order. Due to the way Java handles tabbed panes, the
order is displayed left->right, bottom->up.
Anyways, as long as the archpanel width is not resized,
the order should now always stay exactly the same.
This patch was submitted by Mark Wedel.
I extended it to affect the pickmaps panel too.
Also added support for script event options.
--AndreasV
The following files had too many changes to show the context diffs here:
cvs rdiff -r1.6 -r1.7 CFJavaEditor/src/cfeditor/CPickmapPanel.java
cvs rdiff -r1.2 -r1.3 CFJavaEditor/src/cfeditor/ScriptArchData.java
Start of context diffs
Index: CFJavaEditor/src/cfeditor/ArchObject.java
diff -c CFJavaEditor/src/cfeditor/ArchObject.java:1.8 CFJavaEditor/src/cfeditor/ArchObject.java:1.9
*** CFJavaEditor/src/cfeditor/ArchObject.java:1.8 Sun Jul 13 10:49:10 2003
--- CFJavaEditor/src/cfeditor/ArchObject.java Sun Oct 12 07:23:46 2003
***************
*** 341,354 ****
return(tmp_arch);
}
!
public void setArtifactFlag(boolean aflag) {
artifacts_flag = aflag;
}
public boolean getArtifactFlag() {
return(artifacts_flag);
}
!
public void setPrevInv(ArchObject p)
{
inv_prev = p;
--- 341,354 ----
return(tmp_arch);
}
!
public void setArtifactFlag(boolean aflag) {
artifacts_flag = aflag;
}
public boolean getArtifactFlag() {
return(artifacts_flag);
}
!
public void setPrevInv(ArchObject p)
{
inv_prev = p;
***************
*** 365,371 ****
{
return(inv_next);
}
!
public ArchObject getStartInv()
{
return(inv_start);
--- 365,371 ----
{
return(inv_next);
}
!
public ArchObject getStartInv()
{
return(inv_start);
***************
*** 982,987 ****
--- 982,992 ----
public void addEventPlugin(String eventType, String pluginName) {
if (script == null) script = new ScriptArchData();
script.addEventData(eventType, pluginName, ScriptArchData.EDATA_PLUGIN_NAME);
+ }
+
+ public void addEventOptions(String eventType, String eventOptions) {
+ if (script == null) script = new ScriptArchData();
+ script.addEventData(eventType, eventOptions, ScriptArchData.EDATA_EVENT_OPTIONS);
}
public void addEventScript(String eventType, String filePath) {
Index: CFJavaEditor/src/cfeditor/ArchObjectStack.java
diff -c CFJavaEditor/src/cfeditor/ArchObjectStack.java:1.14 CFJavaEditor/src/cfeditor/ArchObjectStack.java:1.15
*** CFJavaEditor/src/cfeditor/ArchObjectStack.java:1.14 Sun Aug 3 12:02:34 2003
--- CFJavaEditor/src/cfeditor/ArchObjectStack.java Sun Oct 12 07:23:46 2003
***************
*** 192,200 ****
if (IGUIConstants.isoView)
loadArchesFromArtifacts(m_control.getArchDefaultFolder()+File.separator+IGUIConstants.ARTIFACTS_FILE);
- m_control.enableTabPane();
CMainStatusbar.getInstance().setText(" Sorting...");
connectFaces(); // attach faces to arches
System.gc();
// load the autojoin lists
--- 192,201 ----
if (IGUIConstants.isoView)
loadArchesFromArtifacts(m_control.getArchDefaultFolder()+File.separator+IGUIConstants.ARTIFACTS_FILE);
CMainStatusbar.getInstance().setText(" Sorting...");
connectFaces(); // attach faces to arches
+ m_control.enableTabPane();
+ m_control.getMainView().finishArchPanelBuildProccess();
System.gc();
// load the autojoin lists
Index: CFJavaEditor/src/cfeditor/CArchPanel.java
diff -c CFJavaEditor/src/cfeditor/CArchPanel.java:1.7 CFJavaEditor/src/cfeditor/CArchPanel.java:1.8
*** CFJavaEditor/src/cfeditor/CArchPanel.java:1.7 Sun Jul 13 10:49:11 2003
--- CFJavaEditor/src/cfeditor/CArchPanel.java Sun Oct 12 07:23:46 2003
***************
*** 94,103 ****
public void stateChanged(ChangeEvent e) {
JTabbedPane tp = (JTabbedPane)e.getSource();
! selectedArch=-1;
panelNode node = panelNodeStart;
! for(int i=0;i<tp.getSelectedIndex();i++)
node=node.next;
m_selectedPanel=node.data;
if(m_selectedPanel != null)
m_selectedPanel.showArchList();
--- 94,107 ----
public void stateChanged(ChangeEvent e) {
JTabbedPane tp = (JTabbedPane)e.getSource();
! // This is weird: we need to compare against SelectedComponent,
! // and *not* SelectedIndex. The index seemed to get all messed up during
! // load proccess, leading to odd behaviour and sometimes wrecked panes.
! Component sel = tp.getSelectedComponent();
panelNode node = panelNodeStart;
! while (node != null && node.data.getPanel() != sel)
node=node.next;
+
m_selectedPanel=node.data;
if(m_selectedPanel != null)
m_selectedPanel.showArchList();
***************
*** 121,127 ****
if(m_selectedPanel == null)
return null;
return(m_selectedPanel.getArchListObject());
-
}
public void showArchPanelQuickObject(ArchObject arch) {
--- 125,130 ----
***************
*** 146,151 ****
--- 149,158 ----
m_selectedPanel.showArchList();
}
+ /**
+ * Add a new arch panel. This happens during load proccess.
+ * @param name
+ */
public void addPanel(String name) {
panelNode newnode = new panelNode(new CArchPanelPan(this, m_control), name);
***************
*** 155,165 ****
if(panelNodeLast != null)
panelNodeLast.next = newnode;
panelNodeLast = newnode;
! this.m_tabDesktop.add(newnode.data.getPanel(),name);
! // make it aktive
! this.m_tabDesktop.setSelectedIndex(m_tabDesktop.getTabCount()-1);
m_selectedPanel = newnode.data;
}
void appExitNotify() {
--- 162,192 ----
if(panelNodeLast != null)
panelNodeLast.next = newnode;
panelNodeLast = newnode;
!
! // insert new panels in alphabetical order
! int i;
! for (i=0; i<m_tabDesktop.getTabCount() && name.compareToIgnoreCase(m_tabDesktop.getTitleAt(i)) > 0; i++);
! this.m_tabDesktop.insertTab(name, null, newnode.data.getPanel(), null, i);
!
! // careful: during the build proccess we are setting 'm_selectedPanel'
! // in spite of the fact that this panel might *not* actually be selected
m_selectedPanel = newnode.data;
+ }
+ /**
+ * After the build proccess is completed and the panels have
+ * been fully constructed, we must correct the 'm_selectedPanel'
+ * setting and make sure the arch list is properly drawn.
+ */
+ public void finishBuildProccess() {
+ Component sel = m_tabDesktop.getSelectedComponent();
+ panelNode node = panelNodeStart;
+ while (node != null && node.data.getPanel() != sel)
+ node=node.next;
+
+ m_selectedPanel = node.data;
+ if(m_selectedPanel != null)
+ m_selectedPanel.showArchList();
}
void appExitNotify() {
***************
*** 168,180 ****
m_splitPane.getDividerLocation() );
}
-
public int getPanelArch() {
return(selectedArch);
}
void refresh() {
! archQuickPanel.refresh(); // why is this not working??? Look in CArchQuickView...
repaint();
}
--- 195,206 ----
m_splitPane.getDividerLocation() );
}
public int getPanelArch() {
return(selectedArch);
}
void refresh() {
! archQuickPanel.refresh(); // refresh quickview
repaint();
}
Index: CFJavaEditor/src/cfeditor/CArchPanelPan.java
diff -c CFJavaEditor/src/cfeditor/CArchPanelPan.java:1.5 CFJavaEditor/src/cfeditor/CArchPanelPan.java:1.6
*** CFJavaEditor/src/cfeditor/CArchPanelPan.java:1.5 Sat May 3 11:23:06 2003
--- CFJavaEditor/src/cfeditor/CArchPanelPan.java Sun Oct 12 07:23:46 2003
***************
*** 212,218 ****
for(int i=0;i<this.listcounter;i++) {
if(index >=0) {
if(index == 0) {
! // this.model.addElement(this.list.substring(offset,offset+5) + " I:"+this.list.substring(offset+5,offset+10) );
this.model.addElement(this.list.substring(offset,offset+5));
} else {
if(index == Integer.parseInt(this.list.substring(offset+5,offset+10)))
--- 212,218 ----
for(int i=0;i<this.listcounter;i++) {
if(index >=0) {
if(index == 0) {
! // this.model.addElement(this.list.substring(offset,offset+5) + " I:"+this.list.substring(offset+5,offset+10) );
this.model.addElement(this.list.substring(offset,offset+5));
} else {
if(index == Integer.parseInt(this.list.substring(offset+5,offset+10)))
***************
*** 229,236 ****
/* This is the only method defined by ListCellRenderer. We just
* reconfigure the Jlabel each time we're called.
*/
! public Component getListCellRendererComponent(
! JList list,
Object value, // value to display
int index, // cell index
boolean iss, // is the cell selected
--- 229,235 ----
/* This is the only method defined by ListCellRenderer. We just
* reconfigure the Jlabel each time we're called.
*/
! public Component getListCellRendererComponent(JList list,
Object value, // value to display
int index, // cell index
boolean iss, // is the cell selected
***************
*** 243,257 ****
*/
super.getListCellRendererComponent(list, value, index, iss, chf);
-
/* We additionally set the JLabels icon property here.
*/
!
!
! ArchObject arch = m_control.getArchObjectStack().getArch(
! Integer.parseInt(value.toString()));
if(iss) {
! m_panel.selectedArch = Integer.parseInt(value.toString()); m_control.SetStatusText(" "+value.toString()+" ");
}
m_control.setPlainFont(this);
setText(arch.getArchName());
--- 242,253 ----
*/
super.getListCellRendererComponent(list, value, index, iss, chf);
/* We additionally set the JLabels icon property here.
*/
! ArchObject arch = m_control.getArchObjectStack().getArch(Integer.parseInt(value.toString()));
if(iss) {
! m_panel.selectedArch = Integer.parseInt(value.toString());
! m_control.SetStatusText(" "+value.toString()+" ");
}
m_control.setPlainFont(this);
setText(arch.getArchName());
Index: CFJavaEditor/src/cfeditor/CMainControl.java
diff -c CFJavaEditor/src/cfeditor/CMainControl.java:1.16 CFJavaEditor/src/cfeditor/CMainControl.java:1.17
*** CFJavaEditor/src/cfeditor/CMainControl.java:1.16 Sun Jul 13 10:49:11 2003
--- CFJavaEditor/src/cfeditor/CMainControl.java Sun Oct 12 07:23:46 2003
***************
*** 1517,1531 ****
return;
}
! int tabIndex = CPickmapPanel.getInstance().getPickmapTabIndex(activePickmap);
! if (tabIndex >= 0) {
! closeLevel(activePickmap, true); // close the old map
! CPickmapPanel.getInstance().openPickmap(mfile, tabIndex); // open the new map
! CPickmapPanel.getInstance().setActivePickmap(tabIndex);
! // Update the main view so the new map instantly pops up.
! m_view.update(m_view.getGraphics());
! }
}
}
}
--- 1517,1528 ----
return;
}
! closeLevel(activePickmap, true); // close the old map
! CPickmapPanel.getInstance().openPickmap(mfile); // open the new map
! CPickmapPanel.getInstance().setActivePickmap(mfile.getName());
! // Update the main view so the new map instantly pops up.
! m_view.update(m_view.getGraphics());
}
}
}
Index: CFJavaEditor/src/cfeditor/CMainView.java
diff -c CFJavaEditor/src/cfeditor/CMainView.java:1.11 CFJavaEditor/src/cfeditor/CMainView.java:1.12
*** CFJavaEditor/src/cfeditor/CMainView.java:1.11 Sun Jul 13 10:49:11 2003
--- CFJavaEditor/src/cfeditor/CMainView.java Sun Oct 12 07:23:46 2003
***************
*** 256,261 ****
--- 256,265 ----
m_archPanel.movePickmapPanelToFront();
}
+ public void finishArchPanelBuildProccess() {
+ m_archPanel.finishBuildProccess();
+ }
+
/**
* @returns the active arch in the left-side panel.
* This can either be a default arch from the archlist, or
***************
*** 404,409 ****
--- 408,421 ----
*/
void refreshMapArchPanel() {
m_mapArchPanel.refresh();
+ }
+
+ /**
+ * refresh the arch panel (left window)
+ */
+ void refreshArchPanel() {
+ m_archPanel.invalidate();
+ m_archPanel.refresh();
}
/**
Index: CFJavaEditor/src/cfeditor/CMapArchPanel.java
diff -c CFJavaEditor/src/cfeditor/CMapArchPanel.java:1.10 CFJavaEditor/src/cfeditor/CMapArchPanel.java:1.11
*** CFJavaEditor/src/cfeditor/CMapArchPanel.java:1.10 Sat May 3 11:23:07 2003
--- CFJavaEditor/src/cfeditor/CMapArchPanel.java Sun Oct 12 07:23:46 2003
***************
*** 548,554 ****
});
grid.add(s_new);
! s_path = new JButton("File Path");
s_path.setMargin(new Insets(3, 3, 3, 3));
s_path.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
--- 548,554 ----
});
grid.add(s_new);
! s_path = new JButton("Edit Params");
s_path.setMargin(new Insets(3, 3, 3, 3));
s_path.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
|
|
From: <cro...@li...> - 2003-10-17 15:06:28
|
Module Name: CFJavaEditor
Committed By: avogl
Date: Fri Oct 17 15:05:46 UTC 2003
Modified Files:
CFJavaEditor/src/cfeditor: CArchPanel.java
Log Message:
Small bug: When no arches could be found,
an exception was thrown.
Fixed by this checkin.
--AV
Start of context diffs
Index: CFJavaEditor/src/cfeditor/CArchPanel.java
diff -c CFJavaEditor/src/cfeditor/CArchPanel.java:1.8 CFJavaEditor/src/cfeditor/CArchPanel.java:1.9
*** CFJavaEditor/src/cfeditor/CArchPanel.java:1.8 Sun Oct 12 07:23:46 2003
--- CFJavaEditor/src/cfeditor/CArchPanel.java Fri Oct 17 08:05:45 2003
***************
*** 184,192 ****
while (node != null && node.data.getPanel() != sel)
node=node.next;
! m_selectedPanel = node.data;
! if(m_selectedPanel != null)
m_selectedPanel.showArchList();
}
void appExitNotify() {
--- 184,193 ----
while (node != null && node.data.getPanel() != sel)
node=node.next;
! if(node != null && node.data != null) {
! m_selectedPanel = node.data;
m_selectedPanel.showArchList();
+ }
}
void appExitNotify() {
|
|
From: <cro...@li...> - 2004-06-09 11:50:06
|
Module Name: CFJavaEditor Committed By: avogl Date: Wed Jun 9 11:49:59 UTC 2004 Modified Files: CFJavaEditor/src/cfeditor: ScriptArchData.java Log Message: Fix for proper copying of the script edit parameter when objects are copied in the editor. --AV The following files had too many changes to show the context diffs here: cvs rdiff -r1.3 -r1.4 CFJavaEditor/src/cfeditor/ScriptArchData.java |
|
From: <cro...@li...> - 2004-11-18 15:35:46
|
Module Name: CFJavaEditor
Committed By: avogl
Date: Thu Nov 18 15:35:38 UTC 2004
Modified Files:
CFJavaEditor/src/cfeditor: CDialogBase.java CFJavaEditor.java
CMapPropertiesDialog.java CNewMapDialog.java COptionDialog.java
CStartupScreen.java JFontChooser.java
Log Message:
Overlooked a serious compatibility problem with the overloading
of the deprecated method 'show' in two classes.
Fixed that.
--AndreasV
Start of context diffs
Index: CFJavaEditor/src/cfeditor/CDialogBase.java
diff -c CFJavaEditor/src/cfeditor/CDialogBase.java:1.4 CFJavaEditor/src/cfeditor/CDialogBase.java:1.5
*** CFJavaEditor/src/cfeditor/CDialogBase.java:1.4 Wed Nov 17 20:51:16 2004
--- CFJavaEditor/src/cfeditor/CDialogBase.java Thu Nov 18 07:35:38 2004
***************
*** 36,61 ****
*/
public class CDialogBase extends JDialog {
! public CDialogBase(Frame parentFrame, String title ) {
super( parentFrame, title );
}
/**
* Centers this dialog when showing.
*/
! public void show() {
! Window owner = getOwner();
! Rectangle ownerBounds;
! if (owner != null)
! ownerBounds = owner.getBounds();
! else
! ownerBounds = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
! Dimension ownSize = getSize();
! Rectangle ownBounds = new Rectangle(ownSize);
! ownBounds.x = ownerBounds.x + (ownerBounds.width - ownSize.width)/2;
! ownBounds.y = ownerBounds.y + (ownerBounds.height - ownSize.height)/2;
! setBounds(ownBounds);
! super.setVisible(true);
}
}
--- 36,65 ----
*/
public class CDialogBase extends JDialog {
! public CDialogBase(Frame parentFrame, String title) {
super( parentFrame, title );
}
/**
* Centers this dialog when showing.
*/
! public void setVisible(boolean visible) {
! if (visible) {
! Window owner = getOwner();
! Rectangle ownerBounds;
! if (owner != null)
! ownerBounds = owner.getBounds();
! else
! ownerBounds = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
! Dimension ownSize = getSize();
! Rectangle ownBounds = new Rectangle(ownSize);
! ownBounds.x = ownerBounds.x + (ownerBounds.width - ownSize.width)/2;
! ownBounds.y = ownerBounds.y + (ownerBounds.height - ownSize.height)/2;
! setBounds(ownBounds);
! super.setVisible(true);
! }
! else
! super.setVisible(false);
}
}
Index: CFJavaEditor/src/cfeditor/CFJavaEditor.java
diff -c CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.17 CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.18
*** CFJavaEditor/src/cfeditor/CFJavaEditor.java:1.17 Wed Nov 17 20:51:16 2004
--- CFJavaEditor/src/cfeditor/CFJavaEditor.java Thu Nov 18 07:35:38 2004
***************
*** 31,37 ****
* The launcher that launches the whole level editor application.
*
* @author <a href="mailto:mic...@no...">Michael Toennies</a>
! * @version $Revision: 1.17 $
*/
public class CFJavaEditor {
/**
--- 31,37 ----
* The launcher that launches the whole level editor application.
*
* @author <a href="mailto:mic...@no...">Michael Toennies</a>
! * @version $Revision: 1.18 $
*/
public class CFJavaEditor {
/**
Index: CFJavaEditor/src/cfeditor/CMapPropertiesDialog.java
diff -c CFJavaEditor/src/cfeditor/CMapPropertiesDialog.java:1.9 CFJavaEditor/src/cfeditor/CMapPropertiesDialog.java:1.10
*** CFJavaEditor/src/cfeditor/CMapPropertiesDialog.java:1.9 Wed Nov 17 20:51:17 2004
--- CFJavaEditor/src/cfeditor/CMapPropertiesDialog.java Thu Nov 18 07:35:38 2004
***************
*** 334,340 ****
m_control.getMainView().getY()+(m_control.getMainView().getHeight()-480)/2,
545, 480);
pack();
! show();
}
/**
--- 334,340 ----
m_control.getMainView().getY()+(m_control.getMainView().getHeight()-480)/2,
545, 480);
pack();
! setVisible(true);
}
/**
Index: CFJavaEditor/src/cfeditor/CStartupScreen.java
diff -c CFJavaEditor/src/cfeditor/CStartupScreen.java:1.3 CFJavaEditor/src/cfeditor/CStartupScreen.java:1.4
*** CFJavaEditor/src/cfeditor/CStartupScreen.java:1.3 Wed Nov 17 20:51:17 2004
--- CFJavaEditor/src/cfeditor/CStartupScreen.java Thu Nov 18 07:35:38 2004
***************
*** 94,100 ****
m_image = null;
! setVisible( false );
dispose();
}
--- 94,100 ----
m_image = null;
! setVisible(false);
dispose();
}
***************
*** 111,125 ****
* Overridden to startup a timer that then closes this window after
* a few seconds.
*/
! public void show() {
! super.setVisible(true);
! m_autoCloseTimer = new Timer( 3000, new ActionListener() {
public void actionPerformed( ActionEvent event ) {
close();
}
! } );
! m_autoCloseTimer.setInitialDelay( 3000 );
! m_autoCloseTimer.setRepeats( false );
! m_autoCloseTimer.start();
}
}
--- 111,129 ----
* Overridden to startup a timer that then closes this window after
* a few seconds.
*/
! public void setVisible(boolean visible) {
! if (visible) {
! super.setVisible(true);
! m_autoCloseTimer = new Timer( 3000, new ActionListener() {
public void actionPerformed( ActionEvent event ) {
close();
}
! });
! m_autoCloseTimer.setInitialDelay( 3000 );
! m_autoCloseTimer.setRepeats( false );
! m_autoCloseTimer.start();
! }
! else
! super.setVisible(false);
}
}
Index: CFJavaEditor/src/cfeditor/JFontChooser.java
diff -c CFJavaEditor/src/cfeditor/JFontChooser.java:1.13 CFJavaEditor/src/cfeditor/JFontChooser.java:1.14
*** CFJavaEditor/src/cfeditor/JFontChooser.java:1.13 Wed Nov 17 20:51:17 2004
--- CFJavaEditor/src/cfeditor/JFontChooser.java Thu Nov 18 07:35:38 2004
***************
*** 10,16 ****
*
* Valentin Tablan 06/04/2001
*
! * $Id: JFontChooser.java,v 1.13 2004/11/18 04:51:17 avogl Exp $
*
*/
package cfeditor;
--- 10,16 ----
*
* Valentin Tablan 06/04/2001
*
! * $Id: JFontChooser.java,v 1.14 2004/11/18 15:35:38 avogl Exp $
*
*/
package cfeditor;
|
|
From: <cro...@li...> - 2005-01-12 20:10:28
|
Module Name: CFJavaEditor
Committed By: tchize
Date: Wed Jan 12 20:10:19 UTC 2005
Modified Files:
CFJavaEditor/src/cfeditor: ArchObjectStack.java CFileInputStream.java
FaceObject.java
Added Files:
CFJavaEditor/src/cfeditor: TrackedBufferedInputStream.java
Log Message:
Fixed a memory consumption problem in editor.
Now all png are lazy loaded (when first drawn) and
are soft referenced (can be garbage collected).
Overall, 5 maps loaded in editor makes the jvm consume
about 25M total.
The following files had too many changes to show the context diffs here:
cvs rdiff -r1.17 -r1.18 CFJavaEditor/src/cfeditor/ArchObjectStack.java
Start of context diffs
Index: CFJavaEditor/src/cfeditor/CFileInputStream.java
diff -c CFJavaEditor/src/cfeditor/CFileInputStream.java:1.4 CFJavaEditor/src/cfeditor/CFileInputStream.java:1.5
*** CFJavaEditor/src/cfeditor/CFileInputStream.java:1.4 Sun Jan 9 14:05:34 2005
--- CFJavaEditor/src/cfeditor/CFileInputStream.java Wed Jan 12 12:10:18 2005
***************
*** 45,51 ****
// streams
private FileInputStream fileInput; // binary file input stream
private InputStream inStream; // basic binary input stream
! private BufferedInputStream stream; // buffered stream
/**
* Constructor: Open a byte-stream to the specified resource file.
--- 45,51 ----
// streams
private FileInputStream fileInput; // binary file input stream
private InputStream inStream; // basic binary input stream
! private TrackedBufferedInputStream stream; // buffered stream
/**
* Constructor: Open a byte-stream to the specified resource file.
***************
*** 73,79 ****
// first we look if the resource is available as normal binary-file
// in the specified directory
fileInput = new FileInputStream(filedir +File.separator+ filename);
! stream = new BufferedInputStream(fileInput);
is_binfile = true;
}
catch(FileNotFoundException e) {
--- 73,79 ----
// first we look if the resource is available as normal binary-file
// in the specified directory
fileInput = new FileInputStream(filedir +File.separator+ filename);
! stream = new TrackedBufferedInputStream(fileInput);
is_binfile = true;
}
catch(FileNotFoundException e) {
***************
*** 81,87 ****
// second we look if the resource is available as normal binary-file
// in the editor's root directory
fileInput = new FileInputStream(filename);
! stream = new BufferedInputStream(fileInput);
is_binfile = true;
}
catch(FileNotFoundException ex) {
--- 81,87 ----
// second we look if the resource is available as normal binary-file
// in the editor's root directory
fileInput = new FileInputStream(filename);
! stream = new TrackedBufferedInputStream(fileInput);
is_binfile = true;
}
catch(FileNotFoundException ex) {
***************
*** 89,95 ****
// the system-jar-archive:
inStream = ClassLoader.getSystemResourceAsStream(filename);
if (inStream != null) {
! stream = new BufferedInputStream(inStream);
is_jar = true;
}
}
--- 89,95 ----
// the system-jar-archive:
inStream = ClassLoader.getSystemResourceAsStream(filename);
if (inStream != null) {
! stream = new TrackedBufferedInputStream(inStream);
is_jar = true;
}
}
***************
*** 105,111 ****
/**
* @return <code>BufferedInputStream</code> to the resource file
*/
! public BufferedInputStream getBufferedStream() {return stream;}
/**
* Read one byte from the stream
--- 105,111 ----
/**
* @return <code>BufferedInputStream</code> to the resource file
*/
! public TrackedBufferedInputStream getBufferedStream() {return stream;}
/**
* Read one byte from the stream
Index: CFJavaEditor/src/cfeditor/TrackedBufferedInputStream.java
diff -c /dev/null CFJavaEditor/src/cfeditor/TrackedBufferedInputStream.java:1.1
*** /dev/null Wed Jan 12 12:10:21 2005
--- CFJavaEditor/src/cfeditor/TrackedBufferedInputStream.java Wed Jan 12 12:10:18 2005
***************
*** 0 ****
--- 1,85 ----
+ /*
+ * Created on 12 janv. 2005
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+ package cfeditor;
+
+ import java.io.BufferedInputStream;
+ import java.io.IOException;
+ import java.io.InputStream;
+
+ import org.apache.log4j.Logger;
+
+ /**
+ * @author tchize
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+ public class TrackedBufferedInputStream extends BufferedInputStream {
+ private static Logger log = Logger.getLogger(TrackedBufferedInputStream.class);
+
+ private long position = 0;
+ private long lastPosition = -1;
+
+ public TrackedBufferedInputStream(InputStream stream) {
+ super(stream);
+ }
+ public TrackedBufferedInputStream(InputStream stream, int size) {
+ super(stream, size);
+ }
+ /* (non-Javadoc)
+ * @see java.io.InputStream#mark(int)
+ */
+ public synchronized void mark(int max) {
+ // TODO Auto-generated method stub
+ super.mark(max);
+ lastPosition = position;
+ }
+ /* (non-Javadoc)
+ * @see java.io.InputStream#read()
+ */
+ public synchronized int read() throws IOException {
+ // TODO Auto-generated method stub
+ int result = super.read();
+ if (result>=0)
+ position++;
+ return result;
+ }
+ /* (non-Javadoc)
+ * @see java.io.InputStream#read(byte[], int, int)
+ */
+ public synchronized int read(byte[] data, int offset, int length)
+ throws IOException {
+ // TODO Auto-generated method stub
+ int result = super.read(data, offset, length);
+ if (result>0)
+ position+=result;
+ return result;
+ }
+ /* (non-Javadoc)
+ * @see java.io.InputStream#reset()
+ */
+ public synchronized void reset() throws IOException {
+ // TODO Auto-generated method stub
+ super.reset();
+ position = lastPosition;
+ }
+ /* (non-Javadoc)
+ * @see java.io.InputStream#skip(long)
+ */
+ public synchronized long skip(long count) throws IOException {
+ // TODO Auto-generated method stub
+ long realSkipped = super.skip(count);
+ position+=realSkipped;
+ return realSkipped;
+ }
+
+ public long getPosition(){
+ if (log.isDebugEnabled())
+ log.debug("getPosition : "+position);
+ return position;
+ }
+ }
|
|
From: <cro...@li...> - 2005-01-15 10:34:40
|
Module Name: CFJavaEditor
Committed By: tchize
Date: Sat Jan 15 10:34:29 UTC 2005
Modified Files:
CFJavaEditor/src/cfeditor/menu: FilterCheckBoxEntry.java
CFJavaEditor/src/cfeditor/parameter: DoubleParameter.java
IntegerParameter.java MapParameter.java MapParameterView.java
Log Message:
fixed bugs in MapPluginParameter, FilterPluginParameter, IntegerPluginParameter and DoublePluginParameter
Start of context diffs
Index: CFJavaEditor/src/cfeditor/menu/FilterCheckBoxEntry.java
diff -c CFJavaEditor/src/cfeditor/menu/FilterCheckBoxEntry.java:1.1 CFJavaEditor/src/cfeditor/menu/FilterCheckBoxEntry.java:1.2
*** CFJavaEditor/src/cfeditor/menu/FilterCheckBoxEntry.java:1.1 Sun Jan 9 14:05:53 2005
--- CFJavaEditor/src/cfeditor/menu/FilterCheckBoxEntry.java Sat Jan 15 02:34:28 2005
***************
*** 19,27 ****
public FilterCheckBoxEntry(FilterConfig config){
super("<<set me>>");
this.config=config;
! config.isEnabled();
}
public void setChecked(boolean checked) {
super.setChecked(checked);
if (checked)
config.enable();
--- 19,29 ----
public FilterCheckBoxEntry(FilterConfig config){
super("<<set me>>");
this.config=config;
! setChecked(config.isEnabled());
}
public void setChecked(boolean checked) {
+ if (checked==isChecked())
+ return;
super.setChecked(checked);
if (checked)
config.enable();
Index: CFJavaEditor/src/cfeditor/parameter/DoubleParameter.java
diff -c CFJavaEditor/src/cfeditor/parameter/DoubleParameter.java:1.1 CFJavaEditor/src/cfeditor/parameter/DoubleParameter.java:1.2
*** CFJavaEditor/src/cfeditor/parameter/DoubleParameter.java:1.1 Sun Jan 9 14:05:54 2005
--- CFJavaEditor/src/cfeditor/parameter/DoubleParameter.java Sat Jan 15 02:34:27 2005
***************
*** 91,101 ****
--- 91,105 ----
}
public void setMax(double max) {
((DoubleConfig)getConfig()).setMax(max);
+ if (((Double)getValue()).doubleValue()>((DoubleConfig)getConfig()).getMax())
+ setValue(new Double(((DoubleConfig)getConfig()).getMax()));
}
public double getMin() {
return ((DoubleConfig)getConfig()).getMin();
}
public void setMin(double min) {
((DoubleConfig)getConfig()).setMin(min);
+ if (((Double)getValue()).doubleValue()<((DoubleConfig)getConfig()).getMin())
+ setValue(new Double(((DoubleConfig)getConfig()).getMin()));
}
}
|
|
From: <cro...@li...> - 2005-01-30 20:34:53
|
Module Name: CFJavaEditor Committed By: tchize Date: Sun Jan 30 20:34:47 UTC 2005 Modified Files: CFJavaEditor/src/cfeditor: CMapViewBasic.java Log Message: Splitted flat and iso renderers The following files had too many changes to show the context diffs here: cvs rdiff -r1.15 -r1.16 CFJavaEditor/src/cfeditor/CMapViewBasic.java |
|
From: <cro...@li...> - 2005-02-05 11:10:41
|
Module Name: CFJavaEditor
Committed By: tchize
Date: Sat Feb 5 11:10:32 UTC 2005
Modified Files:
CFJavaEditor/src/cfeditor: CMapControl.java CMapViewBasic.java
CMapViewIFrame.java
Log Message:
Added backbuffering to flat renderer
Flat renderer uses a backbuffer to render.
Redraws of big maps are much faster on slow configurations.
Pickmaps are not backbuffered to prevent memory leaks.
The following files had too many changes to show the context diffs here:
cvs rdiff -r1.16 -r1.17 CFJavaEditor/src/cfeditor/CMapViewBasic.java
Start of context diffs
Index: CFJavaEditor/src/cfeditor/CMapControl.java
diff -c CFJavaEditor/src/cfeditor/CMapControl.java:1.12 CFJavaEditor/src/cfeditor/CMapControl.java:1.13
*** CFJavaEditor/src/cfeditor/CMapControl.java:1.12 Sun Jan 9 14:05:34 2005
--- CFJavaEditor/src/cfeditor/CMapControl.java Sat Feb 5 03:10:31 2005
***************
*** 361,367 ****
* Repaints the view.
*/
void repaint() {
! m_view.repaint();
}
/**
--- 361,367 ----
* Repaints the view.
*/
void repaint() {
! m_view.modelChanged();
}
/**
Index: CFJavaEditor/src/cfeditor/CMapViewIFrame.java
diff -c CFJavaEditor/src/cfeditor/CMapViewIFrame.java:1.7 CFJavaEditor/src/cfeditor/CMapViewIFrame.java:1.8
*** CFJavaEditor/src/cfeditor/CMapViewIFrame.java:1.7 Sun Jan 9 14:05:36 2005
--- CFJavaEditor/src/cfeditor/CMapViewIFrame.java Sat Feb 5 03:10:31 2005
***************
*** 126,131 ****
--- 126,132 ----
public void setHotspot(int dx, int dy) {view.setHotspot(dx, dy);}
public void printFullImage(String filename) throws java.io.IOException {view.printFullImage(filename);}
void refreshDataFromModel() {view.refreshDataFromModel();}
+ void modelChanged() {view.modelChanged();}
void changedFlagNotify() {view.changedFlagNotify();}
void setMapAndArchPosition(int archid, int x, int y) {
view.setMapAndArchPosition(archid, x, y);
|
|
From: <cro...@li...> - 2005-04-07 23:06:43
|
Module Name: CFJavaEditor
Committed By: cavesomething
Date: Thu Apr 7 23:06:36 UTC 2005
Modified Files:
CFJavaEditor/src/cfeditor: CMapPropertiesDialog.java MapArchObject.java
Log Message:
Changed map properties dialog to have a box for entering region, and made the editor not strip it out
Start of context diffs
Index: CFJavaEditor/src/cfeditor/CMapPropertiesDialog.java
diff -c CFJavaEditor/src/cfeditor/CMapPropertiesDialog.java:1.10 CFJavaEditor/src/cfeditor/CMapPropertiesDialog.java:1.11
*** CFJavaEditor/src/cfeditor/CMapPropertiesDialog.java:1.10 Thu Nov 18 07:35:38 2004
--- CFJavaEditor/src/cfeditor/CMapPropertiesDialog.java Thu Apr 7 16:06:34 2005
***************
*** 44,49 ****
--- 44,50 ----
private JTextArea m_textArea; // the msg text/arch text
private JTextArea m_loreArea; // the lore text
private JTextField m_nameField = new JTextField(); // name of arch
+ private JTextField m_regionField = new JTextField(); // map's region
private JTextField m_levelWidthField = new JTextField(); // len x
private JTextField m_levelHeightField = new JTextField(); // len y
private JCheckBox m_unique = new JCheckBox(); // map unique
***************
*** 119,124 ****
--- 120,126 ----
IGUIConstants.DIALOG_INSETS ) ) );
createPanelLine(mapPanel, m_nameField, 16, m_level.getMapName(), "Name: ");
+ createPanelLine(mapPanel, m_regionField, 16, map.getMapRegion(), "Region: ");
createPanelLine(mapPanel, m_levelWidthField, 10,
String.valueOf(m_level.getMapWidth()), "Width: ");
createPanelLine(mapPanel, m_levelHeightField, 10,
***************
*** 393,398 ****
--- 395,401 ----
int t_difficulty, t_darkness;
int t_temp, t_pressure, t_humid;
int t_winds, t_windd, t_sky;
+ String t_region;
// first check if the entries are all okay
try {
***************
*** 405,411 ****
t_reset_timeout = parseProperty(m_resetTimeout.getText(), "Reset Timeout");
t_difficulty = parseProperty(m_difficulty.getText(), "Difficulty");
t_darkness = parseProperty(m_darkness.getText(), "Darkness");
!
if (!IGUIConstants.isoView) {
t_temp = parseProperty(m_temp.getText(), "Temperature");
t_pressure = parseProperty(m_pressure.getText(), "Pressure");
--- 408,415 ----
t_reset_timeout = parseProperty(m_resetTimeout.getText(), "Reset Timeout");
t_difficulty = parseProperty(m_difficulty.getText(), "Difficulty");
t_darkness = parseProperty(m_darkness.getText(), "Darkness");
! t_region = m_regionField.getText();
!
if (!IGUIConstants.isoView) {
t_temp = parseProperty(m_temp.getText(), "Temperature");
t_pressure = parseProperty(m_pressure.getText(), "Pressure");
***************
*** 458,463 ****
--- 462,468 ----
m_control.setLevelProperties (m_level, m_textArea.getText(), m_loreArea.getText(),
m_nameField.getText(), t_width, t_height);
+ map.setMapRegion(t_region);
map.setEnterX(t_enter_x);
map.setEnterY(t_enter_y);
map.setResetTimeout(t_reset_timeout);
***************
*** 546,551 ****
--- 551,557 ----
m_textArea.setText(m_level.getMapText());
m_loreArea.setText(m_level.getMapLore());
m_nameField.setText(m_level.getMapName());
+ m_regionField.setText(""+map.getMapRegion());
m_levelWidthField.setText(""+map.getWidth());
m_levelHeightField.setText(""+map.getHeight());
m_enterX.setText(""+map.getEnterX());
Index: CFJavaEditor/src/cfeditor/MapArchObject.java
diff -c CFJavaEditor/src/cfeditor/MapArchObject.java:1.7 CFJavaEditor/src/cfeditor/MapArchObject.java:1.8
*** CFJavaEditor/src/cfeditor/MapArchObject.java:1.7 Sun Jan 9 14:05:35 2005
--- CFJavaEditor/src/cfeditor/MapArchObject.java Thu Apr 7 16:06:35 2005
***************
*** 89,94 ****
--- 89,95 ----
private String name; // map name (this is the name that appears in the game)
private String filename; // name of the map file
+ private String region; // the region the map is in
private String[] tile_path = new String[MAX_TILE]; // Used with map tiling. 0=north, 1=east, 2=south, 3=west
/**
***************
*** 156,161 ****
--- 157,164 ----
public void setOutdoor(boolean b) {outdoor=b;}
public String getTilePath(int n) {return tile_path[n];}
public void setTilePath(int n, String s) {tile_path[n]=s;}
+ public String getMapRegion() {return region;}
+ public void setMapRegion(String new_region) {region=new_region;}
public int getTemp() {return temp;}
public void setTemp(int t) {temp=t;}
***************
*** 307,312 ****
--- 310,317 ----
}
else if (line.startsWith("name"))
name = line.substring(line.indexOf(" ")+1).trim();
+ else if (line.startsWith("region"))
+ region = line.substring(line.indexOf(" ")+1).trim();
else if (line.startsWith("width") || line.startsWith("x "))
width = getLineValue(line);
else if (line.startsWith("height") || line.startsWith("y "))
***************
*** 440,446 ****
stream.write("arch map\n");
if (name.length() > 0)
stream.write("name "+name+"\n");
!
// maptext
stream.write(TAG_START_TEXT+"\n");
stream.write(msgText.toString().trim()+"\n");
--- 445,452 ----
stream.write("arch map\n");
if (name.length() > 0)
stream.write("name "+name+"\n");
! if (region.length() > 0)
! stream.write("region "+region+"\n");
// maptext
stream.write(TAG_START_TEXT+"\n");
stream.write(msgText.toString().trim()+"\n");
|
|
From: <cro...@li...> - 2005-04-08 11:27:14
|
Module Name: CFJavaEditor
Committed By: avogl
Date: Fri Apr 8 11:27:06 UTC 2005
Modified Files:
CFJavaEditor/src/cfeditor: IGUIConstants.java
Log Message:
Increased JavaEditor version number to 0.986.
This was long overdue, tons of changes have happened
since last version.
Anyone developing the editor, fell free to increase the version
number when it seems fit.
Start of context diffs
Index: CFJavaEditor/src/cfeditor/IGUIConstants.java
diff -c CFJavaEditor/src/cfeditor/IGUIConstants.java:1.16 CFJavaEditor/src/cfeditor/IGUIConstants.java:1.17
*** CFJavaEditor/src/cfeditor/IGUIConstants.java:1.16 Sun Jan 9 14:05:35 2005
--- CFJavaEditor/src/cfeditor/IGUIConstants.java Fri Apr 8 04:27:05 2005
***************
*** 36,42 ****
public interface IGUIConstants {
/** Version number of the CFJavaEditor <br>
* should be increased when a certain amount of changes happened */
! public static final String VERSION = "0.985";
/** Internal version number of the included online-documentation <br>
* increasing the number causes an automated popup of the docu
--- 36,42 ----
public interface IGUIConstants {
/** Version number of the CFJavaEditor <br>
* should be increased when a certain amount of changes happened */
! public static final String VERSION = "0.986";
/** Internal version number of the included online-documentation <br>
* increasing the number causes an automated popup of the docu
|
|
From: <cro...@li...> - 2005-04-10 23:50:58
|
Module Name: CFJavaEditor
Committed By: cavesomething
Date: Sun Apr 10 23:50:35 UTC 2005
Modified Files:
CFJavaEditor/src/cfeditor: MapArchObject.java
Log Message:
fix error that makes files not get saved in some cases
Start of context diffs
Index: CFJavaEditor/src/cfeditor/MapArchObject.java
diff -c CFJavaEditor/src/cfeditor/MapArchObject.java:1.8 CFJavaEditor/src/cfeditor/MapArchObject.java:1.9
*** CFJavaEditor/src/cfeditor/MapArchObject.java:1.8 Thu Apr 7 16:06:35 2005
--- CFJavaEditor/src/cfeditor/MapArchObject.java Sun Apr 10 16:50:35 2005
***************
*** 89,95 ****
private String name; // map name (this is the name that appears in the game)
private String filename; // name of the map file
! private String region; // the region the map is in
private String[] tile_path = new String[MAX_TILE]; // Used with map tiling. 0=north, 1=east, 2=south, 3=west
/**
--- 89,95 ----
private String name; // map name (this is the name that appears in the game)
private String filename; // name of the map file
! private String region = ""; // the region the map is in
private String[] tile_path = new String[MAX_TILE]; // Used with map tiling. 0=north, 1=east, 2=south, 3=west
/**
|
|
From: <cro...@li...> - 2005-06-07 19:17:25
|
Module Name: CFJavaEditor
Committed By: tchize
Date: Tue Jun 7 19:17:19 UTC 2005
Modified Files:
CFJavaEditor/src/cfeditor: CUndoStack.java
Log Message:
FIX: memory leaks from map views
mapviews are handling a backbuffer, mapcontrol has a handle to mapview, mapcontrol were not released because indireclty used as key to undostack instances.
SOLUCE: replaced the hastable used by undo stack with a WeakHashMap
PROBLEM: solve with 1.5 jvm but with is still not freed with 1.4 (jvm bug with internal frames maybe?)
PLANNED SOLUCE: have internalframe only keep weak refs to its parents.
Start of context diffs
Index: CFJavaEditor/src/cfeditor/CUndoStack.java
diff -c CFJavaEditor/src/cfeditor/CUndoStack.java:1.3 CFJavaEditor/src/cfeditor/CUndoStack.java:1.4
*** CFJavaEditor/src/cfeditor/CUndoStack.java:1.3 Sat May 3 11:23:07 2003
--- CFJavaEditor/src/cfeditor/CUndoStack.java Tue Jun 7 12:17:18 2005
***************
*** 36,42 ****
/** The controller of the undo stack model. */
private static CMainControl mStatic_control;
/** The shared hashtable that maps levels to undo stacks. */
! private static Hashtable m_hashFromLevelToStack = new Hashtable();
/** The undo stack. Contains all undoable operations. */
private Vector m_undoStack = new Vector(10, 10);
--- 36,42 ----
/** The controller of the undo stack model. */
private static CMainControl mStatic_control;
/** The shared hashtable that maps levels to undo stacks. */
! private static WeakHashMap m_hashFromLevelToStack = new WeakHashMap();
/** The undo stack. Contains all undoable operations. */
private Vector m_undoStack = new Vector(10, 10);
|
|
From: <cro...@li...> - 2005-12-04 21:15:36
|
Module Name: CFJavaEditor
Committed By: akirschbaum
Date: Sun Dec 4 21:15:27 UTC 2005
Modified Files:
CFJavaEditor/src/cfeditor: CFTreasureListTree.java CMapControl.java
ReplaceDialog.java
CFJavaEditor/src/cfeditor/menu: MenuEntry.java
CFJavaEditor/src/cfeditor/textedit/scripteditor: CFPythonPopup.java
ScriptEditControl.java ScriptEditView.java
Log Message:
Properly terminate files with a newline to prevent compiler warnings.
Start of context diffs
Index: CFJavaEditor/src/cfeditor/CFTreasureListTree.java
diff -c CFJavaEditor/src/cfeditor/CFTreasureListTree.java:1.8 CFJavaEditor/src/cfeditor/CFTreasureListTree.java:1.9
*** CFJavaEditor/src/cfeditor/CFTreasureListTree.java:1.8 Sun Jan 9 14:05:35 2005
--- CFJavaEditor/src/cfeditor/CFTreasureListTree.java Sun Dec 4 13:15:26 2005
***************
*** 978,981 ****
}
}
! }
\ No newline at end of file
--- 978,981 ----
}
}
! }
Index: CFJavaEditor/src/cfeditor/CMapControl.java
diff -c CFJavaEditor/src/cfeditor/CMapControl.java:1.13 CFJavaEditor/src/cfeditor/CMapControl.java:1.14
*** CFJavaEditor/src/cfeditor/CMapControl.java:1.13 Sat Feb 5 03:10:31 2005
--- CFJavaEditor/src/cfeditor/CMapControl.java Sun Dec 4 13:15:26 2005
***************
*** 528,531 ****
public CMapModel getMapModel(){
return m_model;
}
! }
\ No newline at end of file
--- 528,531 ----
public CMapModel getMapModel(){
return m_model;
}
! }
Index: CFJavaEditor/src/cfeditor/ReplaceDialog.java
diff -c CFJavaEditor/src/cfeditor/ReplaceDialog.java:1.2 CFJavaEditor/src/cfeditor/ReplaceDialog.java:1.3
*** CFJavaEditor/src/cfeditor/ReplaceDialog.java:1.2 Wed Nov 17 20:51:17 2004
--- CFJavaEditor/src/cfeditor/ReplaceDialog.java Sun Dec 4 13:15:26 2005
***************
*** 428,431 ****
}
}
}
! }
\ No newline at end of file
--- 428,431 ----
}
}
}
! }
Index: CFJavaEditor/src/cfeditor/menu/MenuEntry.java
diff -c CFJavaEditor/src/cfeditor/menu/MenuEntry.java:1.1 CFJavaEditor/src/cfeditor/menu/MenuEntry.java:1.2
*** CFJavaEditor/src/cfeditor/menu/MenuEntry.java:1.1 Sun Jan 9 14:05:53 2005
--- CFJavaEditor/src/cfeditor/menu/MenuEntry.java Sun Dec 4 13:15:26 2005
***************
*** 114,117 ****
return separator;
}
protected abstract void fireUpdate();
! }
\ No newline at end of file
--- 114,117 ----
return separator;
}
protected abstract void fireUpdate();
! }
Index: CFJavaEditor/src/cfeditor/textedit/scripteditor/CFPythonPopup.java
diff -c CFJavaEditor/src/cfeditor/textedit/scripteditor/CFPythonPopup.java:1.3 CFJavaEditor/src/cfeditor/textedit/scripteditor/CFPythonPopup.java:1.4
*** CFJavaEditor/src/cfeditor/textedit/scripteditor/CFPythonPopup.java:1.3 Sun Jan 9 14:05:53 2005
--- CFJavaEditor/src/cfeditor/textedit/scripteditor/CFPythonPopup.java Sun Dec 4 13:15:27 2005
***************
*** 250,253 ****
}
}
! }
\ No newline at end of file
--- 250,253 ----
}
}
! }
|
|
From: <cro...@li...> - 2005-12-04 22:16:25
|
Module Name: CFJavaEditor
Committed By: akirschbaum
Date: Sun Dec 4 22:16:19 UTC 2005
Modified Files:
CFJavaEditor/src/cfeditor: AnimationObject.java ArchObjectParser.java
ArchObjectStack.java CMapFileDecode.java CMapFileEncode.java
FaceObject.java
CFJavaEditor/src/cfeditor/gui: ScriptEditor.java
Log Message:
Remove empty declarations to prevent compiler warnings.
Start of context diffs
Index: CFJavaEditor/src/cfeditor/AnimationObject.java
diff -c CFJavaEditor/src/cfeditor/AnimationObject.java:1.4 CFJavaEditor/src/cfeditor/AnimationObject.java:1.5
*** CFJavaEditor/src/cfeditor/AnimationObject.java:1.4 Wed Nov 17 20:51:16 2004
--- CFJavaEditor/src/cfeditor/AnimationObject.java Sun Dec 4 14:16:18 2005
***************
*** 47,53 ****
m_control = control;
animObjCount=0;
! };
public void addAnimObject(String name, String list) {
animObjects[animObjCount] = new AnimObjectNode();
--- 47,53 ----
m_control = control;
animObjCount=0;
! }
public void addAnimObject(String name, String list) {
animObjects[animObjCount] = new AnimObjectNode();
***************
*** 83,89 ****
Integer num = (Integer) animHashTable.get(name);
return(num.intValue());
}
! }; // End of class
class AnimObjectNode {
String animName;
--- 83,89 ----
Integer num = (Integer) animHashTable.get(name);
return(num.intValue());
}
! } // End of class
class AnimObjectNode {
String animName;
***************
*** 93,97 ****
animName=null;
animList=null;
}
! }; // End of class
--- 93,97 ----
animName=null;
animList=null;
}
! } // End of class
Index: CFJavaEditor/src/cfeditor/ArchObjectParser.java
diff -c CFJavaEditor/src/cfeditor/ArchObjectParser.java:1.9 CFJavaEditor/src/cfeditor/ArchObjectParser.java:1.10
*** CFJavaEditor/src/cfeditor/ArchObjectParser.java:1.9 Sun Jan 9 14:05:34 2005
--- CFJavaEditor/src/cfeditor/ArchObjectParser.java Sun Dec 4 14:16:18 2005
***************
*** 765,768 ****
}
}
! };
--- 765,768 ----
}
}
! }
Index: CFJavaEditor/src/cfeditor/ArchObjectStack.java
diff -c CFJavaEditor/src/cfeditor/ArchObjectStack.java:1.19 CFJavaEditor/src/cfeditor/ArchObjectStack.java:1.20
*** CFJavaEditor/src/cfeditor/ArchObjectStack.java:1.19 Sun Sep 11 14:44:58 2005
--- CFJavaEditor/src/cfeditor/ArchObjectStack.java Sun Dec 4 14:16:18 2005
***************
*** 79,85 ****
faceListCount=0;
archObjCount=0;
ArchObject.setArchStack(this); // add static reference to ArchObject
! };
public void incArchObjCount() {archObjCount++;}
--- 79,85 ----
faceListCount=0;
archObjCount=0;
ArchObject.setArchStack(this); // add static reference to ArchObject
! }
public void incArchObjCount() {archObjCount++;}
***************
*** 219,225 ****
// load the treasurelists data
CFTreasureListTree.init();
}
! };
/**
* Load "pseudo arches" from file "artifacts"
--- 219,225 ----
// load the treasurelists data
CFTreasureListTree.init();
}
! }
/**
* Load "pseudo arches" from file "artifacts"
***************
*** 1525,1530 ****
this.arch = data;
this.next = null;
}
! }; // End of class
! }; // End of class stack
--- 1525,1530 ----
this.arch = data;
this.next = null;
}
! } // End of class
! } // End of class stack
Index: CFJavaEditor/src/cfeditor/CMapFileDecode.java
diff -c CFJavaEditor/src/cfeditor/CMapFileDecode.java:1.11 CFJavaEditor/src/cfeditor/CMapFileDecode.java:1.12
*** CFJavaEditor/src/cfeditor/CMapFileDecode.java:1.11 Sun Sep 11 14:44:58 2005
--- CFJavaEditor/src/cfeditor/CMapFileDecode.java Sun Dec 4 14:16:18 2005
***************
*** 45,51 ****
private CMainControl main_control; // link to the main control (for archlist)
public CMapFileDecode() {
! };
public MapArchObject getMapArch() {
return maparch;
--- 45,51 ----
private CMainControl main_control; // link to the main control (for archlist)
public CMapFileDecode() {
! }
public MapArchObject getMapArch() {
return maparch;
***************
*** 311,314 ****
return null; // this happens when the file end is reached
}
! };
--- 311,314 ----
return null; // this happens when the file end is reached
}
! }
Index: CFJavaEditor/src/cfeditor/FaceObject.java
diff -c CFJavaEditor/src/cfeditor/FaceObject.java:1.5 CFJavaEditor/src/cfeditor/FaceObject.java:1.6
*** CFJavaEditor/src/cfeditor/FaceObject.java:1.5 Wed Jan 12 12:10:18 2005
--- CFJavaEditor/src/cfeditor/FaceObject.java Sun Dec 4 14:16:18 2005
***************
*** 57,63 ****
public FaceObject() {
face = null;
index = -1;
! };
/**
* FaceObject with informations on how to localize ressource (lazy loading)
* @param directory
--- 57,63 ----
public FaceObject() {
face = null;
index = -1;
! }
/**
* FaceObject with informations on how to localize ressource (lazy loading)
* @param directory
***************
*** 144,148 ****
public void setIndex(int i) {
index = i;
}
! };
--- 144,148 ----
public void setIndex(int i) {
index = i;
}
! }
Index: CFJavaEditor/src/cfeditor/gui/ScriptEditor.java
diff -c CFJavaEditor/src/cfeditor/gui/ScriptEditor.java:1.2 CFJavaEditor/src/cfeditor/gui/ScriptEditor.java:1.3
*** CFJavaEditor/src/cfeditor/gui/ScriptEditor.java:1.2 Sun Sep 11 14:44:58 2005
--- CFJavaEditor/src/cfeditor/gui/ScriptEditor.java Sun Dec 4 14:16:19 2005
***************
*** 307,313 ****
paramTable.add(getParameterView(param).getConfigComponent(param.getConfig(),param),gbc);
gbc.gridx=4;
paramTable.add(getParameterView(param).getValueComponent(param.getValue(),param),gbc);
! };
public String getUid(){
if (uuid==null)
generateUid();
--- 307,313 ----
paramTable.add(getParameterView(param).getConfigComponent(param.getConfig(),param),gbc);
gbc.gridx=4;
paramTable.add(getParameterView(param).getValueComponent(param.getValue(),param),gbc);
! }
public String getUid(){
if (uuid==null)
generateUid();
|
|
From: <cro...@li...> - 2005-12-05 19:13:52
|
Module Name: CFJavaEditor
Committed By: akirschbaum
Date: Mon Dec 5 19:13:46 UTC 2005
Modified Files:
CFJavaEditor/src/cfeditor: CResourceLoader.java
Log Message:
Declare constants as 'static' to remove compiler warnings.
Start of context diffs
Index: CFJavaEditor/src/cfeditor/CResourceLoader.java
diff -c CFJavaEditor/src/cfeditor/CResourceLoader.java:1.2 CFJavaEditor/src/cfeditor/CResourceLoader.java:1.3
*** CFJavaEditor/src/cfeditor/CResourceLoader.java:1.2 Sun Sep 11 14:44:58 2005
--- CFJavaEditor/src/cfeditor/CResourceLoader.java Mon Dec 5 11:13:46 2005
***************
*** 37,55 ****
/**
* The current working directory location
*/
! public final int LOCATION_CURRENT = 1;
/**
* The user's home directory location
*/
! public final int LOCATION_HOME = 2;
/**
* The JAR ressources
*/
! public final int LOCATION_JAR = 3;
/**
* The Unknown
*/
! public final int LOCATION_UNKNOWN = 0;
private int type;
private URL url;
--- 37,55 ----
/**
* The current working directory location
*/
! public static final int LOCATION_CURRENT = 1;
/**
* The user's home directory location
*/
! public static final int LOCATION_HOME = 2;
/**
* The JAR ressources
*/
! public static final int LOCATION_JAR = 3;
/**
* The Unknown
*/
! public static final int LOCATION_UNKNOWN = 0;
private int type;
private URL url;
|