m_nPixWidth = getSize().width / m_game.board.width; m_nPixHeight = getSize().height / m_game.board.height;
hexSide = (int) ( Math.min((getSize().height - 14)/(heightFactor + 2), getSize().width/(widthFactor + 2))); hexSide = Math.max(hexSide, minHexSide); hexSideByCos30 = (int) Math.round(hexSide* cos30); hexSideBySin30 = (int) Math.round(hexSide/2); halfRoadWidth =  (int) (hexSide/4); halfRoadWidthByCos30 = (int) (hexSide*cos30/4); halfRoadWidthBySin30 = (int) (hexSide/8); if ((halfRoadWidthByCos30 == 0) ||(halfRoadWidthByCos30 == 0)){ halfRoadWidth = 0; halfRoadWidthByCos30 = 0; halfRoadWidthBySin30 = 0; } leftMargin = (int)((getSize().width - m_game.board.width*(hexSide + hexSideBySin30) - hexSideBySin30)/2); topMargin =(int)(((getSize().height - 14) - hexSideByCos30*(2*m_game.board.height + 1))/2);
    private void initializeMap() {        m_dialog.show();        m_nPixWidth = getSize().width / m_game.board.width;        m_nPixHeight = getSize().height / m_game.board.height;        m_mapImage = createImage(Math.max(1, getSize().width), Math.max(1, getSize().height)); // area must be > 0        drawMap();    }