org.globalse.arena.frag.visual
Class DrawManager

java.lang.Object
  |
  +--org.globalse.arena.frag.visual.DrawManager

public class DrawManager
extends java.lang.Object

Class for managing the drawing things such as drawCircle or other things. It gets the parameter from the implemented ObjectPainter $Id: DrawManager.html,v 1.1 2003/02/12 18:06:20 schoecke Exp $ $Author: schoecke $


Constructor Summary
DrawManager(ObjectManager objman, WorldPainter worldPainter)
          Creates a new DrawManager Panel.
 
Method Summary
 void addShape(java.lang.String obj, java.awt.Shape shape)
          adds a shape to the list of shapes, that are currently on the screen
 void clearCurrPainted()
          removes alle the elements which are saved for painting in the DrawManager.
 void drawArea(java.lang.String obj, double xCenter, double yCenter, double zCenter, double xSize, double ySize, java.awt.Color col, boolean foreground)
          Paints a specified area with a specified colour.
 void drawGLObject(java.lang.String obj, MathVector pos)
          draws gl object
 void drawImage(java.lang.String obj, MathVector pos, java.awt.Image pImg, boolean foreground)
          Draws an image to the specified position.
 IDrawPane getDrawPane()
          returns a JLayeredPane for doing the real painting.
 MathVector[] getMapPosition()
          Returns the actual visible part of the game map.
 java.lang.String getObjAtPos(int x, int y)
          Returns the Object at a position of the GamePane.
 ObjectPainter getObjectPainter()
          Returns a objectpainter object.
 WorldPainter getWorldPainter()
          Returns a worldpainter object.
 void paintObjects()
          Is a forward call to the DrawPane class where the objects are drawn.
 void setDrawPane(IDrawPane mainPane)
          Method setDrawPane.
 void setMapCenter(MathVector center)
          This methods sets the visible part of the map in the DrawManager instance.
 void setScale(int scale)
          Sets the scale of the map in Percent.
 void updateMapPosition()
          updates the internally view of the map position so that the drawManager knows which is the visible part
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawManager

public DrawManager(ObjectManager objman,
                   WorldPainter worldPainter)
Creates a new DrawManager Panel. This class is responsible for the visualization of the visible FRAGObjects
Parameters:
objman - The current instance of ObjectManager
worldPainter - The instance of the class, responsible for drawing the world background
See Also:
ObjectManager
Method Detail

drawImage

public void drawImage(java.lang.String obj,
                      MathVector pos,
                      java.awt.Image pImg,
                      boolean foreground)
Draws an image to the specified position. the shape, that is covered from the image is recored to currPainted for mapping screen coordinates back to world coordinates
Parameters:
obj - String of the object which is drawn
foreground - if true the object is drawn in the forground else in the background
pos - The position of the Object (Absolute position, not position on the screen)
pImg - The image for the Object

drawArea

public void drawArea(java.lang.String obj,
                     double xCenter,
                     double yCenter,
                     double zCenter,
                     double xSize,
                     double ySize,
                     java.awt.Color col,
                     boolean foreground)
Paints a specified area with a specified colour. the shape, that is covered from the rect is recored to currPainted for mapping screen coordinates back to world coordinates
Parameters:
obj - The Object which is drawn (String)
xCenter - center in x coordinates of double
yCenter - center in y coordinates of double
zCenter - center in z coordinates of double
xSize - double The xSize
ySize - double The ySize
col - The color of the Area
foreground - true, when the object must be drawn into the foreground

addShape

public void addShape(java.lang.String obj,
                     java.awt.Shape shape)
adds a shape to the list of shapes, that are currently on the screen
Parameters:
obj - string-name of the object
shape - instanceof Shape; the shape that the object covers on the screen

setMapCenter

public void setMapCenter(MathVector center)
This methods sets the visible part of the map in the DrawManager instance.
Parameters:
center - Center of the visible part.

getObjAtPos

public java.lang.String getObjAtPos(int x,
                                    int y)
Returns the Object at a position of the GamePane.
Parameters:
x - The x coordinate
y - The y coordinate
Returns:
A String containing the name of the object at the given position, null if there is no object

setScale

public void setScale(int scale)
Sets the scale of the map in Percent. Only x=0 mod 10 please.
Parameters:
scale - The scale factor

getMapPosition

public MathVector[] getMapPosition()
Returns the actual visible part of the game map.
Returns:
MathVector[]

updateMapPosition

public void updateMapPosition()
updates the internally view of the map position so that the drawManager knows which is the visible part

getWorldPainter

public WorldPainter getWorldPainter()
Returns a worldpainter object. the DrawPane uses this method
Returns:
The worldpainter object
See Also:
DrawPane

getObjectPainter

public ObjectPainter getObjectPainter()
Returns a objectpainter object. the DrawPane uses this method.
Returns:
returns an objectpainter
See Also:
ObjectPainter

getDrawPane

public IDrawPane getDrawPane()
returns a JLayeredPane for doing the real painting.
Returns:
JLayeredPane

paintObjects

public void paintObjects()
Is a forward call to the DrawPane class where the objects are drawn.
See Also:
DrawPane

clearCurrPainted

public void clearCurrPainted()
removes alle the elements which are saved for painting in the DrawManager.

setDrawPane

public void setDrawPane(IDrawPane mainPane)
Method setDrawPane.
Parameters:
mainPane - instanceof IDrawPane

drawGLObject

public void drawGLObject(java.lang.String obj,
                         MathVector pos)
draws gl object
Parameters:
obj - String name of the object
pos - MathVector pos where the object is drawn.



This page is hosted by the Chair for Applied Software Engineering of the Technische Universität München.
Imprint (Impressum)