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

COVERAGE SUMMARY FOR SOURCE FILE [AbstractPerspectiveFactory.java]

nameclass, %method, %block, %line, %
AbstractPerspectiveFactory.java0%   (0/1)0%   (0/2)0%   (0/62)0%   (0/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class AbstractPerspectiveFactory0%   (0/1)0%   (0/2)0%   (0/62)0%   (0/13)
AbstractPerspectiveFactory (String, String []): void 0%   (0/1)0%   (0/36)0%   (0/6)
getPerspective (String): Perspective 0%   (0/1)0%   (0/26)0%   (0/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.hivegui.docking;
16 
17import java.util.HashMap;
18import java.util.Map;
19 
20import org.flexdock.perspective.LayoutSequence;
21import org.flexdock.perspective.Perspective;
22import org.flexdock.perspective.PerspectiveFactory;
23 
24import net.sourceforge.hivegui.application.FlexdockApplicationInitializer;
25 
26public abstract class AbstractPerspectiveFactory implements PerspectiveFactory
27{
28        protected AbstractPerspectiveFactory(        String                defaultDescription, 
29                                                                                        String...        idsAndDescriptions)
30        {
31                _perspectives = new HashMap<String, String>();
32                _perspectives.put(        FlexdockApplicationInitializer.DEFAULT_PERSPECTIVE, 
33                                                        defaultDescription);
34                for (int i = 0; i < idsAndDescriptions.length - 1; i += 2)
35                {
36                        _perspectives.put(idsAndDescriptions[i], idsAndDescriptions[i + 1]);
37                }
38        }
39        
40        public Perspective getPerspective(String persistentId)
41        {
42                String description = _perspectives.get(persistentId);
43                if (description == null)
44                {
45                        return null;
46                }
47                Perspective perspective = new Perspective(persistentId, description);
48                LayoutSequence seq = perspective.getInitialSequence(true);
49                initLayout(persistentId, seq);
50                return perspective;
51        }
52 
53        abstract protected void initLayout(String persistentId, LayoutSequence seq);
54 
55        private final Map<String, String>        _perspectives;
56}

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