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

COVERAGE SUMMARY FOR SOURCE FILE [OvalDrawingAction.java]

nameclass, %method, %block, %line, %
OvalDrawingAction.java100% (1/1)100% (3/3)100% (95/95)100% (15/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class OvalDrawingAction100% (1/1)100% (3/3)100% (95/95)100% (15/15)
OvalDrawingAction (int, int, int, int, Color, BasicStroke): void 100% (1/1)100% (74/74)100% (10/10)
draw (Graphics2D): void 100% (1/1)100% (11/11)100% (2/2)
preDraw (Graphics2D): void 100% (1/1)100% (10/10)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.BasicStroke;
18import java.awt.Color;
19import java.awt.Graphics2D;
20import java.awt.Rectangle;
21 
22public class        OvalDrawingAction
23        extends                AbstractGraphicsDrawingAction
24{
25        public OvalDrawingAction(        int x1, int y1, int x2, int y2, 
26                                                                Color penColor, BasicStroke stroke)
27        {
28                _x = Math.min(x1, x2);
29                _width = Math.abs(x2 - x1);
30                _y = Math.min(y1, y2);
31                _height = Math.abs(y2 - y1);
32                _penColor = penColor;
33                _stroke = new StrokeHelper(stroke);
34 
35                int width = (int) (stroke.getLineWidth() * 2.0 + 1.0);
36                _area = new Rectangle(        _x - width,
37                                                                _y - width,
38                                                                _x + _width + 2 * width,
39                                                                _y + _height + 2 * width);
40        }
41 
42        @Override protected void        preDraw(Graphics2D graf)
43        {
44                graf.setColor(_penColor);
45                graf.setStroke(_stroke.getStroke());
46        }
47        
48        @Override protected void        draw(Graphics2D graf)
49        {
50                graf.drawOval(_x, _y, _width, _height);
51        }
52        
53        final private int                        _x;
54        final private int                        _y;
55        final private int                        _width;
56        final private int                        _height;
57        final private Color                        _penColor;
58        final private StrokeHelper        _stroke;
59}

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