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

COVERAGE SUMMARY FOR SOURCE FILE [HiveBoardDockingStrategy.java]

nameclass, %method, %block, %line, %
HiveBoardDockingStrategy.java100% (1/1)100% (4/4)100% (47/47)100% (15/15)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class HiveBoardDockingStrategy100% (1/1)100% (4/4)100% (47/47)100% (15/15)
HiveBoardDockingStrategy (Channel): void 100% (1/1)100% (6/6)100% (3/3)
createSplitPaneImpl (DockingPort, String): JSplitPane 100% (1/1)100% (16/16)100% (4/4)
createViewportImpl (): EmptyableViewport 100% (1/1)100% (4/4)100% (1/1)
viewChanged (View): void 100% (1/1)100% (21/21)100% (7/7)

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.docking;
16 
17import javax.swing.JSplitPane;
18 
19import org.flexdock.docking.DockingPort;
20import org.flexdock.view.View;
21import org.jvnet.substance.SubstanceLookAndFeel;
22import org.jvnet.substance.grip.NullGripPainter;
23 
24import net.sourceforge.hiveboard.view.DrawingAreaHolder;
25import net.sourceforge.hiveevents.Channel;
26import net.sourceforge.hivegui.docking.EmptyableViewport;
27import net.sourceforge.hivegui.docking.EmptyableViewportDockingStrategy;
28 
29public class HiveBoardDockingStrategy extends EmptyableViewportDockingStrategy
30{
31        public HiveBoardDockingStrategy(Channel<DrawingAreaHolder> selectedBoardImageChannel)
32        {
33                _selectedBoardImageChannel = selectedBoardImageChannel;
34        }
35 
36        @Override protected JSplitPane createSplitPaneImpl(DockingPort base, String region)
37        {
38                JSplitPane split = super.createSplitPaneImpl(base, region);
39                split.setContinuousLayout(true);
40                split.putClientProperty(SubstanceLookAndFeel.GRIP_PAINTER, new NullGripPainter());
41                return split;
42        }
43 
44        @Override protected EmptyableViewport createViewportImpl()
45        {
46                return new HiveBoardViewport();
47        }
48 
49        @Override protected void viewChanged(View view)
50        {
51                if (view != null)
52                {
53                        DrawingAreaHolder area = (DrawingAreaHolder) view.getContentPane();
54                        if (area != null && area.getDrawingArea() != null)
55                        {
56                                _selectedBoardImageChannel.push(area);
57                        }
58                        else
59                        {
60                                _selectedBoardImageChannel.push(null);
61                        }
62                }
63        }
64 
65        private final Channel<DrawingAreaHolder>        _selectedBoardImageChannel;
66}

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