Class visGraphics
java.lang.Object
|
+--visGraphics
- public class visGraphics
- extends java.lang.Object
The visGraphics
class implements the color and font settings
and provides methods to draw players, balls and flags.
- Version:
- 1.15
- Author:
- Guido Wedig
Field Summary |
(package private) static java.awt.Color |
ball
|
(package private) static java.awt.Color |
current
|
(package private) java.awt.Font |
f
|
(package private) static java.awt.Color |
field
|
(package private) static java.awt.Color |
flag
|
(package private) static java.awt.Color |
nose
|
(package private) static java.awt.Color |
opp
|
(package private) static java.awt.Color |
own
|
(package private) static java.awt.Color |
vision
|
Method Summary |
void |
drawBall(java.awt.Graphics g,
int xPos,
int yPos,
int diameter)
draws the ball at specified position with diameter and color. |
void |
drawFlag(java.awt.Graphics g,
int x,
int y)
draws a flag on the soccer field. |
private void |
drawNumber(java.awt.Graphics g,
int x,
int y,
java.lang.String number)
Draws the number of a player. |
void |
drawPlayer(java.awt.Graphics g,
int xPos,
int yPos,
boolean currentPlayer,
boolean oppPlayer,
boolean ownPlayer,
double HeadDir,
double BodyDir,
java.lang.String number,
boolean visCo,
boolean visOp,
boolean visNumber,
boolean visPerspectiv,
int viewWidth,
double sizeFactor,
int width,
int height)
Draws a player and colors it depending on the type (currentPlayer, oppPlayer or
ownPlayer)
Depending on the parameters the vision perspective and number will be drawn. |
void |
drawPlayer(java.awt.Graphics g,
int xPos,
int yPos,
double HeadDir,
double BodyDir,
int width,
int height)
Draws a core player with body, nose and shoulders.
|
private int |
getNoseAngle(double HeadDir,
double BodyDir)
computes and returns angle for nose and vision perspective drawing |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
current
static java.awt.Color current
own
static java.awt.Color own
opp
static java.awt.Color opp
nose
static java.awt.Color nose
field
static java.awt.Color field
vision
static java.awt.Color vision
flag
static java.awt.Color flag
ball
static java.awt.Color ball
f
java.awt.Font f
visGraphics
public visGraphics()
drawFlag
public void drawFlag(java.awt.Graphics g,
int x,
int y)
- draws a flag on the soccer field.
drawBall
public void drawBall(java.awt.Graphics g,
int xPos,
int yPos,
int diameter)
- draws the ball at specified position with diameter and color.
drawNumber
private void drawNumber(java.awt.Graphics g,
int x,
int y,
java.lang.String number)
- Draws the number of a player.
getNoseAngle
private int getNoseAngle(double HeadDir,
double BodyDir)
- computes and returns angle for nose and vision perspective drawing
drawPlayer
public void drawPlayer(java.awt.Graphics g,
int xPos,
int yPos,
double HeadDir,
double BodyDir,
int width,
int height)
- Draws a core player with body, nose and shoulders.
The head direction visualized by a little red line which represents the player´s nose.
Furthermore this method visualizes the body direction by showing the player's shoulders in
the same color as the player it self.
drawPlayer
public void drawPlayer(java.awt.Graphics g,
int xPos,
int yPos,
boolean currentPlayer,
boolean oppPlayer,
boolean ownPlayer,
double HeadDir,
double BodyDir,
java.lang.String number,
boolean visCo,
boolean visOp,
boolean visNumber,
boolean visPerspectiv,
int viewWidth,
double sizeFactor,
int width,
int height)
- Draws a player and colors it depending on the type (currentPlayer, oppPlayer or
ownPlayer)
Depending on the parameters the vision perspective and number will be drawn.
- Parameters:
g
- graphic to be used for paintingxPos
- x position of playeryPos
- y position of playercurrentPlayer
- is he/she the current player ?oppPlayer
- is he/she a player of opposite team ?coPlayer
- is he/she a player of own team ?HeadDir
- head directionBodyDir
- body directionnumber
- his/her numbervisCo
- show co playervisOp
- show opp playervisNumber
- show his/her numbervisPerspective
- visibile perpective on/offviewWidth
- his view widthsizeFactor
- size factor for vision perspectivewidth
- width of playerheight
- height of player