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

COVERAGE SUMMARY FOR SOURCE FILE [DrawingActionSender.java]

nameclass, %method, %block, %line, %
DrawingActionSender.java100% (2/2)100% (10/10)100% (78/78)100% (17/17)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class DrawingActionSender100% (1/1)100% (8/8)100% (55/55)100% (14/14)
DrawingActionSender (WhiteBoardUserService, ObjectTools): void 100% (1/1)100% (9/9)100% (4/4)
access$000 (DrawingActionSender): int 100% (1/1)100% (3/3)100% (1/1)
access$100 (DrawingActionSender): DrawingAction 100% (1/1)100% (3/3)100% (1/1)
access$200 (DrawingActionSender): ObjectTools 100% (1/1)100% (3/3)100% (1/1)
access$300 (DrawingActionSender): WhiteBoardUserService 100% (1/1)100% (3/3)100% (1/1)
send (DrawingAction, int, JComponent): void 100% (1/1)100% (13/13)100% (5/5)
sendDrawingAction (): Task 100% (1/1)100% (7/7)100% (1/1)
setContextHolder (ApplicationContextHolder): void 100% (1/1)100% (14/14)100% (3/3)
     
class DrawingActionSender$1100% (1/1)100% (2/2)100% (23/23)100% (3/3)
DrawingActionSender$1 (DrawingActionSender, HiveGuiApplicationMain): void 100% (1/1)100% (7/7)100% (1/1)
doInBackground (): Void 100% (1/1)100% (16/16)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 javax.swing.JComponent;
18 
19import org.jdesktop.application.Action;
20import org.jdesktop.application.Task;
21 
22import net.sourceforge.hiveboard.WhiteBoardUserService;
23import net.sourceforge.hiveboard.command.AbstractTask;
24import net.sourceforge.hiveboard.command.ActionHelper;
25import net.sourceforge.hivegui.application.ApplicationContextHolder;
26import net.sourceforge.hivegui.application.HiveGuiApplicationMain;
27import net.sourceforge.hiveutils.service.ObjectTools;
28 
29/**
30 * This command is used from full screen mode by the popup menu item to set the
31 * writer of the current board. It is instantiated once for each participant of
32 * the board.
33 *
34 * @author Jean-Francois Poilpret
35 */
36public class DrawingActionSender
37{
38        public DrawingActionSender(WhiteBoardUserService service, ObjectTools objectTools)
39        {
40                _service = service;
41                _objectTools = objectTools;
42        }
43        
44        public void        setContextHolder(ApplicationContextHolder holder)
45        {
46                _application = holder.getApplication();
47                _action = _application.getContext().getActionMap(this).get("sendDrawingAction");
48        }
49 
50        public void        send(DrawingAction drawAction, int where, JComponent area)
51        {
52                if (drawAction != null)
53                {
54                        _drawAction = drawAction;
55                        _where = where;
56                        ActionHelper.execute(_action, area);
57                }
58        }
59        
60        @Action(block = Task.BlockingScope.ACTION)
61        public Task sendDrawingAction()
62        {
63                return new AbstractTask(_application)
64                {
65                        @Override protected Void doInBackground() throws Exception
66                        {
67                                // Send the action to the server
68                                _service.draw(_where, _objectTools.serialize(_drawAction));
69                                return null;
70                        }
71                };
72        }
73 
74        private final WhiteBoardUserService        _service;
75        private final ObjectTools                        _objectTools;
76        private HiveGuiApplicationMain                _application;
77        private javax.swing.Action                        _action;
78        private DrawingAction                                _drawAction;
79        private int                                                        _where;
80}

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