[Jais-checkins] jaisteam/src/jais/visualization PlayFieldPanel.java,1.18,1.19
Status: Beta
Brought to you by:
maestrodd
|
From: <pr...@us...> - 2002-07-13 23:45:14
|
Update of /cvsroot/jais/jaisteam/src/jais/visualization
In directory usw-pr-cvs1:/tmp/cvs-serv19700/jais/visualization
Modified Files:
PlayFieldPanel.java
Log Message:
corrected the displaying of the objects on playfield:
set to int cast on correct pos. and subtr. the objects radius
Index: PlayFieldPanel.java
===================================================================
RCS file: /cvsroot/jais/jaisteam/src/jais/visualization/PlayFieldPanel.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** PlayFieldPanel.java 13 Jul 2002 16:21:51 -0000 1.18
--- PlayFieldPanel.java 13 Jul 2002 23:45:11 -0000 1.19
***************
*** 235,240 ****
l_flagInfo = (FlagInfo) it.next();
Coordinate l_coord=m_myWorld.getMyself().getAbsPosition();
! drawFlag(determNewXPosition((int)l_flagInfo.calculateAbsPosition(l_coord,m_myWorld.getAbsViewAngle()).getX()),
! determNewYPosition((int)l_flagInfo.calculateAbsPosition(l_coord,m_myWorld.getAbsViewAngle()).getY()),
l_isSeenFlag
);
--- 235,240 ----
l_flagInfo = (FlagInfo) it.next();
Coordinate l_coord=m_myWorld.getMyself().getAbsPosition();
! drawFlag((int)determNewXPosition(l_flagInfo.calculateAbsPosition(l_coord,m_myWorld.getAbsViewAngle()).getX()),
! (int)determNewYPosition(l_flagInfo.calculateAbsPosition(l_coord,m_myWorld.getAbsViewAngle()).getY()),
l_isSeenFlag
);
***************
*** 257,262 ****
l_flagInfo = (FlagInfo) it.next();
Coordinate l_coord=m_myWorld.getMyself().getAbsPosition();
! drawFlag(determNewXPosition((int)l_flagInfo.calculateAbsPosition(l_coord,m_myWorld.getAbsViewAngle()).getX()),
! determNewYPosition((int)l_flagInfo.calculateAbsPosition(l_coord,m_myWorld.getAbsViewAngle()).getY()),
l_isSeenFlag
);
--- 257,262 ----
l_flagInfo = (FlagInfo) it.next();
Coordinate l_coord=m_myWorld.getMyself().getAbsPosition();
! drawFlag((int)determNewXPosition(l_flagInfo.calculateAbsPosition(l_coord,m_myWorld.getAbsViewAngle()).getX()),
! (int)determNewYPosition(l_flagInfo.calculateAbsPosition(l_coord,m_myWorld.getAbsViewAngle()).getY()),
l_isSeenFlag
);
***************
*** 329,341 ****
//determ first the x and y pos. of the second point of
//body direction line
! drawMyselfBodyDirection(determNewXPosition(
! determSecondLinePointOfMyselfBodyDirectionX(
! m_myWorld.getAbsBodyDir())
! ),
! determNewYPosition(
! determSecondLinePointOfMyselfBodyDirectionY(
! m_myWorld.getAbsBodyDir())
! )
! );
logger.info("Read/Drew body direction info!");
--- 329,335 ----
//determ first the x and y pos. of the second point of
//body direction line
! drawMyselfBodyDirection(determNewXPosition(determSecondLinePointOfMyselfBodyDirectionX(m_myWorld.getAbsBodyDir()))
! ,determNewYPosition(determSecondLinePointOfMyselfBodyDirectionY(m_myWorld.getAbsBodyDir()))
! );
logger.info("Read/Drew body direction info!");
***************
*** 345,351 ****
//body direction line
m_myselfBodyAngle = m_myWorld.getAbsBodyDir();
! int myselfBodyDirX=determNewXPosition(determSecondLinePointOfMyselfBodyDirectionX(m_myselfBodyAngle));
! int myselfBodyDirY=determNewYPosition(determSecondLinePointOfMyselfBodyDirectionY(m_myselfBodyAngle));
! drawMyselfBodyDirection(myselfBodyDirX,myselfBodyDirY);
logger.info("Read/Drew body direction info!");
--- 339,345 ----
//body direction line
m_myselfBodyAngle = m_myWorld.getAbsBodyDir();
! int l_myselfBodyDirX=determNewXPosition(determSecondLinePointOfMyselfBodyDirectionX(m_myselfBodyAngle));
! int l_myselfBodyDirY=determNewYPosition(determSecondLinePointOfMyselfBodyDirectionY(m_myselfBodyAngle));
! drawMyselfBodyDirection(l_myselfBodyDirX,l_myselfBodyDirY);
logger.info("Read/Drew body direction info!");
***************
*** 360,365 ****
if(m_myWorld.getBall().getAbsPositionOfNextRound()!=null)
{
! drawnBallPosInNextRound(determNewXPosition((int)(Math.round(m_myWorld.getBall().getAbsPositionOfNextRound().getX()))),
! determNewYPosition((int)(Math.round(m_myWorld.getBall().getAbsPositionOfNextRound().getY())))
);
}
--- 354,359 ----
if(m_myWorld.getBall().getAbsPositionOfNextRound()!=null)
{
! drawnBallPosInNextRound((int)determNewXPosition((Math.round(m_myWorld.getBall().getAbsPositionOfNextRound().getX()))),
! (int)determNewYPosition((Math.round(m_myWorld.getBall().getAbsPositionOfNextRound().getY())))
);
}
***************
*** 382,393 ****
* @param f_nextPosY s
*/
! private void drawnBallPosInNextRound(int f_nextPosX,int f_nextPosY)
{
! int l_ballDiameterInNextRound = 7;
//set color of ball in next round
! m_graphics.setColor(Color.darkGray);
//draw ball in next round
! m_graphics.fillOval(f_nextPosX,f_nextPosY,l_ballDiameterInNextRound,l_ballDiameterInNextRound);
}
--- 376,387 ----
* @param f_nextPosY s
*/
! private void drawnBallPosInNextRound(int f_nextPosX, int f_nextPosY)
{
! int l_ballDiameterInNextRound = 8;
//set color of ball in next round
! m_graphics.setColor(Color.gray);
//draw ball in next round
! m_graphics.fillOval(f_nextPosX-4,f_nextPosY,l_ballDiameterInNextRound-4,l_ballDiameterInNextRound);
}
***************
*** 583,586 ****
--- 577,581 ----
private void drawSeenBall(int f_ballXPos,int f_ballYPos,boolean f_visible)
{
+ int l_ballDiameter=8;
logger.debug("Drawing seen ball!");
if(f_visible)
***************
*** 588,592 ****
else
m_graphics.setColor(COLOR_BALL_INVISIBLE);
! m_graphics.fillOval(f_ballXPos,f_ballYPos,7,7);
logger.debug("Drew seen seen ball!");
}
--- 583,587 ----
else
m_graphics.setColor(COLOR_BALL_INVISIBLE);
! m_graphics.fillOval(f_ballXPos-4,f_ballYPos-4,l_ballDiameter,l_ballDiameter);
logger.debug("Drew seen seen ball!");
}
|