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

COVERAGE SUMMARY FOR SOURCE FILE [ScreenModeTool.java]

nameclass, %method, %block, %line, %
ScreenModeTool.java100% (2/2)100% (5/5)100% (50/50)100% (13/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ScreenModeTool100% (1/1)100% (3/3)100% (34/34)100% (10/10)
ScreenModeTool (Action, Channel): void 100% (1/1)100% (20/20)100% (6/6)
access$000 (ScreenModeTool): Action 100% (1/1)100% (3/3)100% (1/1)
initActions (ActionMap): void 100% (1/1)100% (11/11)100% (3/3)
     
class ScreenModeTool$1100% (1/1)100% (2/2)100% (16/16)100% (3/3)
ScreenModeTool$1 (ScreenModeTool): void 100% (1/1)100% (6/6)100% (1/1)
push (DrawingAreaHolder): void 100% (1/1)100% (10/10)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.Action;
18import javax.swing.ActionMap;
19 
20import net.sourceforge.hiveboard.event.EventsPriorities;
21import net.sourceforge.hiveboard.view.DrawingAreaHolder;
22import net.sourceforge.hiveevents.Channel;
23import net.sourceforge.hiveevents.PersistentConsumer;
24 
25public class ScreenModeTool extends AbstractPushButtonTool
26{
27        public ScreenModeTool(        Action                                                switchModeCommand, 
28                                                        Channel<DrawingAreaHolder>        boardImageChannel)
29        {
30                _switchModeCommand = switchModeCommand;
31                // Automatic enabling depending on existence of an open board
32                _switchModeCommand.setEnabled(false);
33                int priority = EventsPriorities.SELECTED_IMAGE_GUI_REFRESH;
34                boardImageChannel.registerPushConsumer(
35                                        priority, new PersistentConsumer<DrawingAreaHolder>()
36                {
37                        public void        push(DrawingAreaHolder holder)
38                        {
39                                _switchModeCommand.setEnabled(holder != null);
40                        }
41                });
42        }
43 
44        @Override protected void initActions(ActionMap map)
45        {
46                _button.putClientProperty(ToolHandler.NOT_TOOL_CLIENT_PROPERTY, "");
47                _button.setAction(_switchModeCommand);
48        }
49        
50        private final Action        _switchModeCommand;
51}

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