cad.simcad.pathfinding.ui
Class UIMediator

java.lang.Object
  |
  +--cad.simcad.pathfinding.ui.UIMediator

public class UIMediator
extends java.lang.Object

Version:
1.0
Author:
Charles-Philip Bentley

Field Summary
protected  int _activeControlTabbed
           
protected  int _activeFeaturedTabbed
           
protected  Owner _activeOwner
           
protected  AlgoStatDisplayer _asd
           
protected  java.lang.String _currentDesignObjectName
           
protected  Filler _currentFiller
           
protected  java.lang.String _currentSimObjectName
           
protected  int _mapDisplayerType
           
protected  java.util.Vector _objectDisplayer
           
protected  boolean _showAlgoStatsInWindow
           
protected  boolean _showFillerImages
           
static int DEF
           
static int DESIGN
           
static int MAP
           
static int PLAY
           
static int RTS
           
static int SIM
           
static int STRUCTURE
           
static int TERRAIN
           
static int UNIT
           
 
Constructor Summary
UIMediator(AStarInterface asf)
          Creates new Mediator
 
Method Summary
 void addMapUIListener(MapUIEventListener listener)
           
 void addObjectDisplayer(ObjectDisplayer od)
          Tells the Mediator about a new Object wishing to display features of objects
 void blankMap()
           
 void fireMapOpenedEvent(MapUIEvent pui)
          Notice the Listeners and the PathUser that a Path has been computed
 int getActiveControlTabbed()
           
 int getActiveFeaturedTabbed()
           
 Owner getActiveOwner()
           
 java.util.Properties getAlgoProperties()
           
 java.lang.String getAlgoProperty(java.lang.String s)
           
 int getBottomY()
           
 java.awt.Color getColor(Filler tt)
           
 java.lang.String getDesignObjectName()
           
 Filler getDisplayedFiller()
          Returns the filler displayed in the first registered ObjectDisplayer
 PathPlace getDisplayedPathPlace()
          Returns the filler displayed in the first registered ObjectDisplayer
 SimObject getDisplayedSimObject()
          Returns the filler displayed in the first registered ObjectDisplayer
 Filler getFillerSelected()
           
 java.awt.Image getImage(Filler fil)
           
 java.awt.Image getImage(SimObject so)
           
 javax.swing.ImageIcon getImageIcon(Filler fil)
           
 javax.swing.ImageIcon getImageIcon(SimObject so)
           
 ImageLibrary getImageLibray()
           
 javax.swing.JScrollPane getMapDisplayerScrollPane()
           
 int getMapDisplayerType()
           
 javax.swing.JComponent getMiniMapComponent()
           
 java.util.Properties getProperties()
           
 java.lang.String getProperty(java.lang.String s)
           
 int getRightX()
           
 Filler getSelectedFiller()
           
 java.lang.String getSelectedSimObject()
           
 int getVBottomY()
           
 int getViewableHeight()
           
 int getViewableWidth()
           
 int getVRightX()
           
 int getVViewableHeight()
           
 int getVViewableWidth()
           
 int getVXCentered()
           
 int getVYCentered()
           
 void initializeColorHashTable()
           
 void reconstructMapDisplayer()
          Calls the creator of the Map displayer to replace it by a new one
 void redoPathing()
          MapDisplayer redo the computation of the last Path.
 void removeMapUIListener(MapUIEventListener listener)
           
 void resetAllMapCells()
           
 void setActiveControlTabbed(int i)
           
 void setActiveFeaturedTabbed(int i)
           
 void setActiveOwner(Owner o)
           
 void setAlgoProperty(java.lang.String key, java.lang.String value)
           
 void setAlgoStatDisplayer(AlgoStatDisplayer asd)
           
 void setControlPanel(ControlPanel cp)
           
 void setDesignObjectName(java.lang.String name)
           
 void setDrawBorder(boolean b)
           
 void setFillerSelected(Filler fil)
           
 void setIncidentObjectAt(PathPlace pp)
           
 void setMapDisplayer(MapDisplayer md)
           
 void setMapDisplayerScrollPane(javax.swing.JScrollPane jp)
           
 void setMapDisplayerType(int i)
           
 void setMiniMapComponent(javax.swing.JComponent jc)
           
 void setProperty(java.lang.String key, java.lang.String value)
           
 void setSelectedFiller(Filler fil)
           
 void setSelectedSimObject(java.lang.String simo)
           
 void setShowCoordinate(boolean b)
          Ask the MapDisplayer to show coordinates values
 void setShowFillerImages(boolean value)
           
 void setShowStatsInSeperateWindow(boolean b)
           
 void setShowValues(boolean b)
           
 void setSizeOfCells(int value)
           
 void setStatusTextDisplayer(StatusTextDisplayer std)
           
 void setViewPosition(int x, int y)
           
 void showAlgoStats(java.util.Properties pr)
           
 boolean showFillerImages()
           
 void showSecAux(java.lang.String s)
           
 void showSimObjectFeatures(SimObject so)
           
 void showSimulationStatus(java.lang.String s)
           
 boolean showStatsInSeperateWindow()
           
 void showStatusString(java.lang.String s)
           
 void showTerrainFeatures(MapUnit mu)
           
 void showToolTip(java.lang.String s)
           
 void updateAllVisualComponents()
           
 void updateMiniMap()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_currentFiller

protected Filler _currentFiller

_currentSimObjectName

protected java.lang.String _currentSimObjectName

_currentDesignObjectName

protected java.lang.String _currentDesignObjectName

_activeControlTabbed

protected int _activeControlTabbed

PLAY

public static final int PLAY
See Also:
Constant Field Values

DESIGN

public static final int DESIGN
See Also:
Constant Field Values

MAP

public static final int MAP
See Also:
Constant Field Values

SIM

public static final int SIM
See Also:
Constant Field Values

_activeFeaturedTabbed

protected int _activeFeaturedTabbed

UNIT

public static final int UNIT
See Also:
Constant Field Values

TERRAIN

public static final int TERRAIN
See Also:
Constant Field Values

STRUCTURE

public static final int STRUCTURE
See Also:
Constant Field Values

DEF

public static final int DEF
See Also:
Constant Field Values

RTS

public static final int RTS
See Also:
Constant Field Values

_mapDisplayerType

protected int _mapDisplayerType

_asd

protected AlgoStatDisplayer _asd

_objectDisplayer

protected java.util.Vector _objectDisplayer

_activeOwner

protected Owner _activeOwner

_showFillerImages

protected boolean _showFillerImages

_showAlgoStatsInWindow

protected boolean _showAlgoStatsInWindow
Constructor Detail

UIMediator

public UIMediator(AStarInterface asf)
Creates new Mediator

Method Detail

setIncidentObjectAt

public void setIncidentObjectAt(PathPlace pp)

showStatsInSeperateWindow

public boolean showStatsInSeperateWindow()

setShowStatsInSeperateWindow

public void setShowStatsInSeperateWindow(boolean b)

showFillerImages

public boolean showFillerImages()

setShowFillerImages

public void setShowFillerImages(boolean value)

setActiveOwner

public void setActiveOwner(Owner o)

getActiveOwner

public Owner getActiveOwner()

setDesignObjectName

public void setDesignObjectName(java.lang.String name)

getDesignObjectName

public java.lang.String getDesignObjectName()

addObjectDisplayer

public void addObjectDisplayer(ObjectDisplayer od)
Tells the Mediator about a new Object wishing to display features of objects


getImageIcon

public javax.swing.ImageIcon getImageIcon(SimObject so)

getImageIcon

public javax.swing.ImageIcon getImageIcon(Filler fil)

getImage

public java.awt.Image getImage(Filler fil)

getImage

public java.awt.Image getImage(SimObject so)

showSimObjectFeatures

public void showSimObjectFeatures(SimObject so)

getDisplayedFiller

public Filler getDisplayedFiller()
Returns the filler displayed in the first registered ObjectDisplayer


getDisplayedSimObject

public SimObject getDisplayedSimObject()
Returns the filler displayed in the first registered ObjectDisplayer


getDisplayedPathPlace

public PathPlace getDisplayedPathPlace()
Returns the filler displayed in the first registered ObjectDisplayer


showTerrainFeatures

public void showTerrainFeatures(MapUnit mu)

redoPathing

public void redoPathing()
MapDisplayer redo the computation of the last Path.


setAlgoStatDisplayer

public void setAlgoStatDisplayer(AlgoStatDisplayer asd)

showAlgoStats

public void showAlgoStats(java.util.Properties pr)

setStatusTextDisplayer

public void setStatusTextDisplayer(StatusTextDisplayer std)

showSimulationStatus

public void showSimulationStatus(java.lang.String s)

showStatusString

public void showStatusString(java.lang.String s)

showToolTip

public void showToolTip(java.lang.String s)

showSecAux

public void showSecAux(java.lang.String s)

setActiveFeaturedTabbed

public void setActiveFeaturedTabbed(int i)
Post:
Update the variable tracking the active Control Tabbed notice any MapDisplayer of that fact, calling setEditMode method.

getActiveFeaturedTabbed

public int getActiveFeaturedTabbed()

getActiveControlTabbed

public int getActiveControlTabbed()

setActiveControlTabbed

public void setActiveControlTabbed(int i)
Post:
Update the variable tracking the active Control Tabbed notice any MapDisplayer of that fact, calling setEditMode method.

getMapDisplayerScrollPane

public javax.swing.JScrollPane getMapDisplayerScrollPane()

getVRightX

public int getVRightX()

getVBottomY

public int getVBottomY()

getVXCentered

public int getVXCentered()

getVYCentered

public int getVYCentered()

getVViewableWidth

public int getVViewableWidth()

setViewPosition

public void setViewPosition(int x,
                            int y)

getVViewableHeight

public int getVViewableHeight()
Returns:
the number of pixel that the viewport sees

setMapDisplayerScrollPane

public void setMapDisplayerScrollPane(javax.swing.JScrollPane jp)

getMiniMapComponent

public javax.swing.JComponent getMiniMapComponent()

setControlPanel

public void setControlPanel(ControlPanel cp)

setMiniMapComponent

public void setMiniMapComponent(javax.swing.JComponent jc)

setMapDisplayer

public void setMapDisplayer(MapDisplayer md)

getImageLibray

public ImageLibrary getImageLibray()

updateAllVisualComponents

public void updateAllVisualComponents()

updateMiniMap

public void updateMiniMap()

resetAllMapCells

public void resetAllMapCells()

setShowCoordinate

public void setShowCoordinate(boolean b)
Ask the MapDisplayer to show coordinates values


blankMap

public void blankMap()

setDrawBorder

public void setDrawBorder(boolean b)

setSizeOfCells

public void setSizeOfCells(int value)

setSelectedFiller

public void setSelectedFiller(Filler fil)

getSelectedFiller

public Filler getSelectedFiller()

setSelectedSimObject

public void setSelectedSimObject(java.lang.String simo)

getSelectedSimObject

public java.lang.String getSelectedSimObject()

getRightX

public int getRightX()

getBottomY

public int getBottomY()

getViewableWidth

public int getViewableWidth()

getViewableHeight

public int getViewableHeight()

getProperty

public java.lang.String getProperty(java.lang.String s)

getAlgoProperty

public java.lang.String getAlgoProperty(java.lang.String s)

getAlgoProperties

public java.util.Properties getAlgoProperties()

setAlgoProperty

public void setAlgoProperty(java.lang.String key,
                            java.lang.String value)

getProperties

public java.util.Properties getProperties()

setProperty

public void setProperty(java.lang.String key,
                        java.lang.String value)

setFillerSelected

public void setFillerSelected(Filler fil)

getFillerSelected

public Filler getFillerSelected()

setShowValues

public void setShowValues(boolean b)

reconstructMapDisplayer

public void reconstructMapDisplayer()
Calls the creator of the Map displayer to replace it by a new one


getMapDisplayerType

public int getMapDisplayerType()

setMapDisplayerType

public void setMapDisplayerType(int i)

initializeColorHashTable

public void initializeColorHashTable()

getColor

public java.awt.Color getColor(Filler tt)

addMapUIListener

public void addMapUIListener(MapUIEventListener listener)

removeMapUIListener

public void removeMapUIListener(MapUIEventListener listener)

fireMapOpenedEvent

public void fireMapOpenedEvent(MapUIEvent pui)
Notice the Listeners and the PathUser that a Path has been computed


Logo

With the help of www.sourceforge.net and www.info.ucl.ac.be