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

COVERAGE SUMMARY FOR SOURCE FILE [AbstractPenFreeDrawingAction.java]

nameclass, %method, %block, %line, %
AbstractPenFreeDrawingAction.java100% (1/1)100% (2/2)100% (77/77)100% (16/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AbstractPenFreeDrawingAction100% (1/1)100% (2/2)100% (77/77)100% (16/16)
AbstractPenFreeDrawingAction (int [], int []): void 100% (1/1)100% (67/67)100% (14/14)
draw (Graphics2D): void 100% (1/1)100% (10/10)100% (2/2)

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.Graphics2D;
18import java.awt.Rectangle;
19 
20abstract public class AbstractPenFreeDrawingAction extends AbstractGraphicsDrawingAction
21{
22        protected AbstractPenFreeDrawingAction(int[] x, int[] y)
23        {
24                _x = x;
25                _y = y;
26                // Calculate area refreshed
27                int minX = Integer.MAX_VALUE;
28                int minY = Integer.MAX_VALUE;
29                int maxX = Integer.MIN_VALUE;
30                int maxY = Integer.MIN_VALUE;
31                for (int i = 0; i < _x.length; i++)
32                {
33                        minX = Math.min(minX, _x[i]);
34                        maxX = Math.max(maxX, _x[i]);
35                        minY = Math.min(minY, _y[i]);
36                        maxY = Math.max(maxY, _y[i]);
37                }
38                
39                _area = new Rectangle(minX, minY, maxX - minX, maxY - minY);
40        }
41 
42        @Override protected void        draw(Graphics2D graf)
43        {
44                graf.drawPolyline(_x, _y, _x.length);
45        }
46        
47        final private int[]        _x;
48        final private int[]        _y;
49}

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