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

COVERAGE SUMMARY FOR SOURCE FILE [ParticipantListPanel.java]

nameclass, %method, %block, %line, %
ParticipantListPanel.java100% (2/2)100% (5/5)100% (106/106)100% (25/25)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ParticipantListPanel100% (1/1)100% (3/3)100% (95/95)100% (22/22)
ParticipantListPanel (ObjectBuilder, Channel, BeanTable): void 100% (1/1)100% (56/56)100% (12/12)
access$000 (ParticipantListPanel, Board): void 100% (1/1)100% (4/4)100% (1/1)
updateModel (Board): void 100% (1/1)100% (35/35)100% (9/9)
     
class ParticipantListPanel$1100% (1/1)100% (2/2)100% (11/11)100% (3/3)
ParticipantListPanel$1 (ParticipantListPanel): void 100% (1/1)100% (6/6)100% (1/1)
push (Board): void 100% (1/1)100% (5/5)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.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.hiveboard.util.Participant;
26import net.sourceforge.hiveevents.Channel;
27import net.sourceforge.hiveevents.PersistentConsumer;
28import net.sourceforge.hivegui.table.BeanTable;
29import net.sourceforge.hivegui.table.DataListModel;
30import net.sourceforge.hiveutils.service.ObjectBuilder;
31 
32public class ParticipantListPanel extends JPanel
33{
34        public ParticipantListPanel(ObjectBuilder                        builder,
35                                                                Channel<Board>                        selectedBoardChannel,
36                                                                BeanTable<Participant>        tblParticipants)
37        {
38                setLayout(new BorderLayout());
39                _builder = builder;
40                _tblParticipants = tblParticipants;
41                _tblParticipants.setName(Views.PARTICIPANTS_LIST.id() + "-table");
42                _emptyModel = _tblParticipants.getDataListModel();
43                _participantsModel = _emptyModel;
44 
45                // Listen to changes in the current Selected Board (not necessarily drawing)
46                int priority = EventsPriorities.SELECTED_BOARD_GUI_REFRESH;
47                selectedBoardChannel.registerPushConsumer(priority, new PersistentConsumer<Board>()
48                {
49                        public void        push(Board board)
50                        {
51                                updateModel(board);
52                        }
53                });
54 
55            add(new JScrollPane(_tblParticipants), BorderLayout.CENTER);
56        }
57 
58        private void        updateModel(Board board)
59        {
60                if (_board == board)
61                {
62                        return;
63                }
64                _board = board;
65                if (board != null)
66                {
67                        _participantsModel = _builder.create("ParticipantListModel", _board);
68                }
69                else
70                {
71                        _participantsModel = _emptyModel;
72                }
73                _tblParticipants.setDataListModel(_participantsModel);
74        }
75 
76        final private ObjectBuilder                                        _builder;
77        final private BeanTable<Participant>                _tblParticipants;
78        final private DataListModel<Participant>        _emptyModel;
79        private DataListModel<Participant>                        _participantsModel;
80        private Board                                                                _board = null;
81}

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