EMMA Coverage Report (generated Tue Feb 12 22:23:49 ICT 2008)
[all classes][net.sourceforge.hivegui.docking]

COVERAGE SUMMARY FOR SOURCE FILE [CursorTrackGhostPreview.java]

nameclass, %method, %block, %line, %
CursorTrackGhostPreview.java0%   (0/1)0%   (0/3)0%   (0/33)0%   (0/7)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CursorTrackGhostPreview0%   (0/1)0%   (0/3)0%   (0/33)0%   (0/7)
CursorTrackGhostPreview (): void 0%   (0/1)0%   (0/8)0%   (0/2)
createPreviewPolygon (Component, DockingPort, Dockable, String, Component, Ma... 0%   (0/1)0%   (0/19)0%   (0/3)
setContextHolder (ApplicationContextHolder): void 0%   (0/1)0%   (0/6)0%   (0/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.hivegui.docking;
16 
17import java.awt.Component;
18import java.awt.Polygon;
19import java.util.Map;
20 
21import org.flexdock.docking.Dockable;
22import org.flexdock.docking.DockingPort;
23import org.flexdock.docking.drag.effects.DragPreview;
24import org.flexdock.docking.drag.preview.GhostPreview;
25 
26import net.sourceforge.hivegui.application.ApplicationContextHolder;
27 
28public class CursorTrackGhostPreview
29        extends                GhostPreview 
30        implements        DragPreview
31{
32        public void        setContextHolder(ApplicationContextHolder holder)
33        {
34                _tracker.setContext(holder.getContext());
35        }
36        
37        @Override public Polygon createPreviewPolygon(        Component        dockable, 
38                                                                                                        DockingPort        port, 
39                                                                                                        Dockable        hover, 
40                                                                                                        String                targetRegion, 
41                                                                                                        Component        paintingTarget, 
42                                                                                                        Map                        dragInfo)
43        {
44                if (!_tracker.trackCursor(dockable, port, targetRegion, paintingTarget))
45                {
46                        return null;
47                }
48                else
49                {
50                        return super.createPreviewPolygon(        dockable,
51                                                                                                port,
52                                                                                                hover,
53                                                                                                targetRegion,
54                                                                                                paintingTarget,
55                                                                                                dragInfo);
56                }
57        }
58 
59        private final CursorTracker        _tracker = new CursorTracker();
60}

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