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

COVERAGE SUMMARY FOR SOURCE FILE [EraserTool.java]

nameclass, %method, %block, %line, %
EraserTool.java100% (1/1)100% (5/5)100% (35/35)100% (9/9)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class EraserTool100% (1/1)100% (5/5)100% (35/35)100% (9/9)
<static initializer> 100% (1/1)100% (3/3)100% (1/1)
EraserTool (): void 100% (1/1)100% (3/3)100% (1/1)
createAction (int [], int []): DrawingAction 100% (1/1)100% (9/9)100% (1/1)
initResources (ResourceMap): void 100% (1/1)100% (12/12)100% (3/3)
preDraw (Graphics2D): void 100% (1/1)100% (8/8)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;
20 
21import org.jdesktop.application.ResourceMap;
22 
23public class EraserTool extends AbstractPenFreeTool
24{
25        @Override protected void initResources(ResourceMap map)
26        {
27                super.initResources(map);
28                //#### Later should define a custom Stroke according to the cursor shape
29                _stroke = new BasicStroke(DEFAULT_SIZE, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
30        }
31 
32        @Override protected void preDraw(Graphics2D graf)
33        {
34                graf.setColor(BOARD_COLOR);
35                graf.setStroke(_stroke);
36        }
37 
38        @Override protected DrawingAction createAction(int[] x, int[] y)
39        {
40                return new PenFreeDrawingAction(x, y, BOARD_COLOR, _stroke);
41        }
42        
43        static final private Color        BOARD_COLOR = Color.WHITE;
44        static final private float        DEFAULT_SIZE = 25.0f;
45        private BasicStroke                        _stroke;
46}

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