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

COVERAGE SUMMARY FOR SOURCE FILE [BoardListPanel.java]

nameclass, %method, %block, %line, %
BoardListPanel.java100% (2/2)100% (5/5)100% (82/82)100% (17/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class BoardListPanel100% (1/1)100% (3/3)100% (53/53)100% (10/10)
BoardListPanel (BeanTable, Channel): void 100% (1/1)100% (47/47)100% (9/9)
access$000 (BoardListPanel): BoardListModel 100% (1/1)100% (3/3)100% (1/1)
access$100 (BoardListPanel): BeanTable 100% (1/1)100% (3/3)100% (1/1)
     
class BoardListPanel$1100% (1/1)100% (2/2)100% (29/29)100% (7/7)
BoardListPanel$1 (BoardListPanel): void 100% (1/1)100% (6/6)100% (1/1)
push (DrawingAreaHolder): void 100% (1/1)100% (23/23)100% (6/6)

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;
21 
22import net.sourceforge.hiveboard.Board;
23import net.sourceforge.hiveboard.docking.Views;
24import net.sourceforge.hiveboard.event.EventsPriorities;
25import net.sourceforge.hiveevents.Channel;
26import net.sourceforge.hiveevents.PersistentConsumer;
27import net.sourceforge.hivegui.table.BeanTable;
28 
29public class BoardListPanel extends JPanel
30{
31        public BoardListPanel(        BeanTable<Board>                                        tblBoards,
32                                                        final Channel<DrawingAreaHolder>        selectedBoardImageChannel)
33        {
34                setLayout(new BorderLayout());
35                _tblBoards = tblBoards;
36                _tblBoards.setName(Views.BOARDS_LIST.id() + "-table");
37                _boardsModel = (BoardListModel) _tblBoards.getDataListModel();
38 
39                // Listen to changes in list of board image areas
40                int priority = EventsPriorities.SELECTED_IMAGE_GUI_REFRESH;
41                selectedBoardImageChannel.registerPushConsumer(
42                                                                priority, new PersistentConsumer<DrawingAreaHolder>()
43                {
44                        public void        push(DrawingAreaHolder holder)
45                        {
46                                if (holder != null)
47                                {
48                                        int id = holder.getDrawingArea().getBoardImageModel().getBoard().getId();
49                                        // Find board with this id
50                                        int index = _boardsModel.findBoard(id);
51                                        if (index >= 0)
52                                        {
53                                                _tblBoards.setRowSelectionInterval(index, index);
54                                        }
55                                }
56                        }
57                });
58 
59            add(new JScrollPane(_tblBoards), BorderLayout.CENTER);
60        }
61 
62        final private BeanTable<Board>        _tblBoards;
63        final private BoardListModel        _boardsModel;
64}

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