Printing line and row numbers into the board picture
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Sat, 19 Sep 2009 22:06:17 +0200
changeset 102bda5bd82b435
parent 101 c7244cdd143e
child 103 9a1eda26132d
Printing line and row numbers into the board picture
freemarkerdor/pom.xml
webidor/pom.xml
webidor/src/main/java/cz/xelfi/quoridor/webidor/resources/BoardImage.java
     1.1 --- a/freemarkerdor/pom.xml	Sat Sep 19 19:17:52 2009 +0200
     1.2 +++ b/freemarkerdor/pom.xml	Sat Sep 19 22:06:17 2009 +0200
     1.3 @@ -10,13 +10,13 @@
     1.4    <groupId>org.apidesign</groupId>
     1.5    <artifactId>freemarkerdor</artifactId>
     1.6    <name>freemarkerdor</name>
     1.7 -  <version>1.16</version>
     1.8 +  <version>1.17</version>
     1.9    <url>http://maven.apache.org</url>
    1.10    <dependencies>
    1.11      <dependency>
    1.12        <groupId>${project.groupId}</groupId>
    1.13        <artifactId>webidor</artifactId>
    1.14 -      <version>1.1</version>
    1.15 +      <version>1.2</version>
    1.16      </dependency>
    1.17      <dependency>
    1.18        <groupId>org.netbeans.modules</groupId>
     2.1 --- a/webidor/pom.xml	Sat Sep 19 19:17:52 2009 +0200
     2.2 +++ b/webidor/pom.xml	Sat Sep 19 22:06:17 2009 +0200
     2.3 @@ -9,7 +9,7 @@
     2.4    <groupId>org.apidesign</groupId>
     2.5    <artifactId>webidor</artifactId>
     2.6    <packaging>jar</packaging>
     2.7 -  <version>1.1</version>
     2.8 +  <version>1.2</version>
     2.9    <name>webidor server</name>
    2.10    <url>http://maven.apache.org</url>
    2.11    <repositories>
     3.1 --- a/webidor/src/main/java/cz/xelfi/quoridor/webidor/resources/BoardImage.java	Sat Sep 19 19:17:52 2009 +0200
     3.2 +++ b/webidor/src/main/java/cz/xelfi/quoridor/webidor/resources/BoardImage.java	Sat Sep 19 22:06:17 2009 +0200
     3.3 @@ -30,6 +30,7 @@
     3.4  import cz.xelfi.quoridor.Fence;
     3.5  import cz.xelfi.quoridor.Player;
     3.6  import java.awt.Color;
     3.7 +import java.awt.Font;
     3.8  import java.awt.Graphics2D;
     3.9  import java.awt.Image;
    3.10  import java.awt.Rectangle;
    3.11 @@ -91,6 +92,18 @@
    3.12              cnt++;
    3.13          }
    3.14  
    3.15 +        g.setColor(Color.BLACK);
    3.16 +        final Font f = new Font("Monospace", Font.BOLD, fifth * 2);
    3.17 +        g.setFont(f);
    3.18 +        for (int i = 0; i < 8; i++) {
    3.19 +            final char ch = (char) ('A' + i);
    3.20 +            g.drawString(Character.toString(ch), i * fieldSize + fieldSize - fifth, fifth + f.getSize() - f.getBaselineFor(ch));
    3.21 +        }
    3.22 +        for (int i = 0; i < 8; i++) {
    3.23 +            String s = "" + (8 - i);
    3.24 +            g.drawString(s, fifth, i * fieldSize + fieldSize - fifth + f.getSize() - f.getBaselineFor(s.charAt(0)));
    3.25 +        }
    3.26 +
    3.27          return img;
    3.28      }
    3.29  }