EMMA Coverage Report (generated Wed Feb 13 07:49:24 ICT 2008)
[all classes][net.sourceforge.hiveboard.drawing]

COVERAGE SUMMARY FOR SOURCE FILE [TextDrawingAction.java]

nameclass, %method, %block, %line, %
TextDrawingAction.java100% (1/1)100% (3/3)100% (57/57)100% (16/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class TextDrawingAction100% (1/1)100% (3/3)100% (57/57)100% (16/16)
TextDrawingAction (int, int, String [], Font, Color, int): void 100% (1/1)100% (21/21)100% (8/8)
draw (Graphics2D): void 100% (1/1)100% (27/27)100% (5/5)
preDraw (Graphics2D): void 100% (1/1)100% (9/9)100% (3/3)

1//  Copyright 2004-2007 Jean-Francois Poilpret
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14 
15package net.sourceforge.hiveboard.drawing;
16 
17import java.awt.Color;
18import java.awt.Font;
19import java.awt.Graphics2D;
20 
21public class        TextDrawingAction
22        extends                AbstractGraphicsDrawingAction
23{
24        public TextDrawingAction(        int x, int y, String[] text,
25                                                                Font font, Color penColor,
26                                                                int height)
27        {
28                _x = x;
29                _y = y;
30                _text = text;
31                _font = font;
32                _penColor = penColor;
33                _height = height;
34        }
35 
36        @Override protected void        preDraw(Graphics2D graf)
37        {
38                graf.setColor(_penColor);
39                graf.setFont(_font);
40        }
41        
42        @Override protected void        draw(Graphics2D graf)
43        {
44                int y = _y;
45                for (int i = 0; i < _text.length; i++)
46                {
47                        graf.drawString(_text[i], _x, y);
48                        y += _height;
49                }
50        }
51        
52        final private int                _x;
53        final private int                _y;
54        final private String[]        _text;
55        final private Font                _font;
56        final private Color                _penColor;
57        final private int                _height;
58}

[all classes][net.sourceforge.hiveboard.drawing]
EMMA 2.0.5312 (C) Vladimir Roubtsov