Class Map

java.lang.Object
  |
  +--Map

public class Map
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Inner Class Summary
static class Map.Element
          base class for map elements
static interface Map.ElementAction
          An interface for classes which want to modify a set of elements
static class Map.Entity
           
static class Map.LightSource
           
static class Map.Line
          line
static interface Map.Listener
           
static interface Map.ScriptListener
           
static class Map.Sector
          sector
static class Map.SectSpecial
           
static class Map.Side
          side
static class Map.Vertex
          vertex
 
Field Summary
 boolean _isClipCached
           
static int DEF_CEILING_TEX
           
static int DEF_FLOOR_TEX
           
static int DEF_WALL_TEX
           
static java.lang.String DGMAP_EXT
           
static java.lang.String JSFMAP_EXT
           
static int NUM_DEF_TEXS
           
static long serialVersionUID
           
 
Constructor Summary
Map(java.lang.String name, int x, int y, java.lang.String defFloorTex, java.lang.String defCeilingTex, java.lang.String defWallTex)
           
 
Method Summary
 void addInProgress(java.awt.Point p)
           
 void addLight(Map.LightSource light)
           
 void addSector(Map.Sector s)
           
 boolean addSelection(Map.Element elem, boolean cache)
           
 void clearSelections(boolean cache)
           
 void doSelectionActions(Map.ElementAction act)
           
 boolean exportMap(java.lang.String filename)
          export the map into sdl-dg map format
 Map.LightSource findLight(Point3D p)
           
 Point3D findSelectionsCenter()
          find the centerpoint of all selected elements the centerpoint is the center of the bounding box which contains all the other centers
 void flipLine(Map.Line line)
           
 void flipSectorLines(Map.Sector s)
           
 void flipVertexLines(Map.Vertex v)
           
 int getDefaultTex(int which)
           
 Map.Element getFirstSelection()
           
 Map.Vertex getLastSelectedVertex()
           
 Map.Element getLastSelection()
           
 int getMapHeightZ()
           
 java.awt.Rectangle getMapRect()
           
 java.awt.Dimension getMapSize()
           
 int getNumSelections()
           
 boolean hasSelections()
           
 boolean hasTypeSelected(java.lang.Class c)
           
static Map importMap(java.lang.String filename)
           
 boolean isSelected(Map.Element elem)
           
static Map loadMap(java.lang.String filename)
          read the map from a file named by filename, using serialization
static void main(java.lang.String[] args)
           
 boolean mapContains(java.awt.Point p)
           
 void mergeVertexes(Map.Vertex v)
           
 void moveLightRelative(Map.LightSource light, Point3D diff, boolean cache)
           
 boolean moveLine(Map.Line line, java.awt.Point dist)
           
 boolean moveSector(Map.Sector s, java.awt.Point dist, boolean cache)
           
 void moveVertexRelative(Map.Vertex v, java.awt.Point diff, boolean cache)
           
 void notifyListeners(java.awt.Rectangle clip)
           
 void notifyListenersFromCachedClip()
          notify map listeners based on the interally maintained aggregate cache of map modification clip rectangles
 void notifyListenersSize()
           
 void notifyListenersTransient()
           
 void notifyScriptListeners()
           
 int numSelections()
           
 void removeElement(Map.Element e)
           
 boolean removeSelection(Map.Element elem, boolean cache)
           
 void save(java.lang.String filename)
           
 boolean saveAs(java.lang.String filename)
          save the map into a file named by filename, using serialization
 void setDefaultTex(int which, int index)
           
 void setDefaultTex(int which, java.lang.String str)
           
 void setMapSize(int x, int y)
           
 void setRubberBand(int ox, int oy, int oz, int ex, int ey, int ez)
           
 boolean setSelection(Map.Element elem, boolean cache)
           
 void setTransient(boolean state, java.awt.Point p0, java.awt.Point p1)
           
 void splitLine(Map.Line line)
           
 boolean toggleSelection(Map.Element elem, boolean cache)
           
 void unsetRubberBand()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JSFMAP_EXT

public static final java.lang.String JSFMAP_EXT

DGMAP_EXT

public static final java.lang.String DGMAP_EXT

serialVersionUID

public static final long serialVersionUID

DEF_FLOOR_TEX

public static final int DEF_FLOOR_TEX

DEF_CEILING_TEX

public static final int DEF_CEILING_TEX

DEF_WALL_TEX

public static final int DEF_WALL_TEX

NUM_DEF_TEXS

public static final int NUM_DEF_TEXS

_isClipCached

public boolean _isClipCached
Constructor Detail

Map

public Map(java.lang.String name,
           int x,
           int y,
           java.lang.String defFloorTex,
           java.lang.String defCeilingTex,
           java.lang.String defWallTex)
Method Detail

setMapSize

public void setMapSize(int x,
                       int y)

getMapHeightZ

public int getMapHeightZ()

getMapSize

public java.awt.Dimension getMapSize()

getMapRect

public java.awt.Rectangle getMapRect()

mapContains

public boolean mapContains(java.awt.Point p)

addSelection

public boolean addSelection(Map.Element elem,
                            boolean cache)

isSelected

public boolean isSelected(Map.Element elem)

removeSelection

public boolean removeSelection(Map.Element elem,
                               boolean cache)

toggleSelection

public boolean toggleSelection(Map.Element elem,
                               boolean cache)

clearSelections

public void clearSelections(boolean cache)

setSelection

public boolean setSelection(Map.Element elem,
                            boolean cache)

getNumSelections

public int getNumSelections()

getLastSelection

public Map.Element getLastSelection()

getFirstSelection

public Map.Element getFirstSelection()

getLastSelectedVertex

public Map.Vertex getLastSelectedVertex()

doSelectionActions

public void doSelectionActions(Map.ElementAction act)

hasTypeSelected

public boolean hasTypeSelected(java.lang.Class c)

findSelectionsCenter

public Point3D findSelectionsCenter()
find the centerpoint of all selected elements the centerpoint is the center of the bounding box which contains all the other centers

numSelections

public int numSelections()

hasSelections

public boolean hasSelections()

getDefaultTex

public int getDefaultTex(int which)

setDefaultTex

public void setDefaultTex(int which,
                          int index)

setDefaultTex

public void setDefaultTex(int which,
                          java.lang.String str)

save

public void save(java.lang.String filename)

addInProgress

public void addInProgress(java.awt.Point p)

setTransient

public void setTransient(boolean state,
                         java.awt.Point p0,
                         java.awt.Point p1)

unsetRubberBand

public void unsetRubberBand()

setRubberBand

public void setRubberBand(int ox,
                          int oy,
                          int oz,
                          int ex,
                          int ey,
                          int ez)

notifyListenersFromCachedClip

public void notifyListenersFromCachedClip()
notify map listeners based on the interally maintained aggregate cache of map modification clip rectangles

notifyListeners

public void notifyListeners(java.awt.Rectangle clip)

notifyListenersTransient

public void notifyListenersTransient()

notifyListenersSize

public void notifyListenersSize()

notifyScriptListeners

public void notifyScriptListeners()

addLight

public void addLight(Map.LightSource light)

addSector

public void addSector(Map.Sector s)

removeElement

public void removeElement(Map.Element e)

moveVertexRelative

public void moveVertexRelative(Map.Vertex v,
                               java.awt.Point diff,
                               boolean cache)

moveLightRelative

public void moveLightRelative(Map.LightSource light,
                              Point3D diff,
                              boolean cache)

moveSector

public boolean moveSector(Map.Sector s,
                          java.awt.Point dist,
                          boolean cache)

moveLine

public boolean moveLine(Map.Line line,
                        java.awt.Point dist)

mergeVertexes

public void mergeVertexes(Map.Vertex v)

flipLine

public void flipLine(Map.Line line)

flipSectorLines

public void flipSectorLines(Map.Sector s)

flipVertexLines

public void flipVertexLines(Map.Vertex v)

splitLine

public void splitLine(Map.Line line)

findLight

public Map.LightSource findLight(Point3D p)

saveAs

public boolean saveAs(java.lang.String filename)
save the map into a file named by filename, using serialization

loadMap

public static Map loadMap(java.lang.String filename)
read the map from a file named by filename, using serialization

exportMap

public boolean exportMap(java.lang.String filename)
export the map into sdl-dg map format

importMap

public static Map importMap(java.lang.String filename)

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception