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

COVERAGE SUMMARY FOR SOURCE FILE [DrawingAreaPanel.java]

nameclass, %method, %block, %line, %
DrawingAreaPanel.java100% (1/1)100% (5/5)100% (54/54)100% (16/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DrawingAreaPanel100% (1/1)100% (5/5)100% (54/54)100% (16/16)
DrawingAreaPanel (): void 100% (1/1)100% (9/9)100% (4/4)
DrawingAreaPanel (DrawingArea): void 100% (1/1)100% (31/31)100% (7/7)
attachArea (): void 100% (1/1)100% (6/6)100% (2/2)
detachArea (): void 100% (1/1)100% (5/5)100% (2/2)
getDrawingArea (): DrawingArea 100% (1/1)100% (3/3)100% (1/1)

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.view;
16 
17import java.awt.BorderLayout;
18 
19import javax.swing.JPanel;
20import javax.swing.JScrollPane;
21import javax.swing.JViewport;
22 
23public class DrawingAreaPanel extends JPanel implements DrawingAreaHolder
24{
25        // This constructor is used only for the fake empty area view
26        public DrawingAreaPanel()
27        {
28                _area = null;
29                _scroller = null;
30        }
31        
32        public DrawingAreaPanel(DrawingArea area)
33        {
34                super(new BorderLayout());
35                _area = area;
36                _scroller = new JScrollPane(_area);
37                // Improve scrolling performance
38                _scroller.getViewport().setScrollMode(JViewport.BACKINGSTORE_SCROLL_MODE);
39                _scroller.getViewport().setName("drawing-area-viewport");
40            add(_scroller, BorderLayout.CENTER);
41        }
42        
43        public DrawingArea getDrawingArea()
44        {
45                return _area;
46        }
47        
48        public void        attachArea()
49        {
50                _scroller.setViewportView(_area);
51        }
52        
53        public void        detachArea()
54        {
55                _scroller.setViewportView(null);
56        }
57        
58        private final DrawingArea        _area;
59        private final JScrollPane        _scroller;
60 
61}

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