| 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 |   | 
| 15 | package net.sourceforge.hiveboard.docking; | 
| 16 |   | 
| 17 | import org.flexdock.docking.DockingConstants; | 
| 18 | import org.flexdock.perspective.LayoutSequence; | 
| 19 |   | 
| 20 | import net.sourceforge.hiveboard.main.HiveBoardInitializer; | 
| 21 | import net.sourceforge.hivegui.docking.AbstractPerspectiveFactory; | 
| 22 | import net.sourceforge.hivegui.docking.EmptyableViewport; | 
| 23 |   | 
| 24 | public class HiveBoardPerspectiveFactory extends AbstractPerspectiveFactory | 
| 25 | { | 
| 26 |         static final private String        DEFAULT_DESCRIPTION = "HiveBoard default docking perspective"; | 
| 27 |         static final private String        TEST_DESCRIPTION = "HiveBoard GUI tests docking perspective"; | 
| 28 |   | 
| 29 |         public HiveBoardPerspectiveFactory() | 
| 30 |         { | 
| 31 |                 super(        DEFAULT_DESCRIPTION, | 
| 32 |                                 HiveBoardInitializer.TEST_PERSPECTIVE, TEST_DESCRIPTION); | 
| 33 |         } | 
| 34 |          | 
| 35 |         // CSOFF: MagicNumberCheck | 
| 36 |         @Override protected void initLayout(String persistentId, LayoutSequence seq) | 
| 37 |         { | 
| 38 |                 if (HiveBoardInitializer.TEST_PERSPECTIVE.equals(persistentId)) | 
| 39 |                 { | 
| 40 |                         seq.add(EmptyableViewport.EMPTY_VIEW_ID); | 
| 41 |                         seq.add(Views.BOARDS_LIST.name(), EmptyableViewport.EMPTY_VIEW_ID,  | 
| 42 |                                         DockingConstants.WEST_REGION, 0.33f); | 
| 43 |                         seq.add(Views.BOARD_DETAIL.name(), Views.BOARDS_LIST.name(),  | 
| 44 |                                         DockingConstants.SOUTH_REGION, 0.17f); | 
| 45 |                         seq.add(Views.PARTICIPANTS_LIST.name(), Views.BOARD_DETAIL.name(),  | 
| 46 |                                         DockingConstants.SOUTH_REGION, 0.25f); | 
| 47 |                         seq.add(Views.ACCOUNTS_LIST.name(), Views.PARTICIPANTS_LIST.name(),  | 
| 48 |                                         DockingConstants.SOUTH_REGION, 0.33f); | 
| 49 |                         seq.add(Views.ACCOUNT_DETAIL.name(), Views.ACCOUNTS_LIST.name(),  | 
| 50 |                                         DockingConstants.SOUTH_REGION, 0.4f); | 
| 51 |                         seq.add(Views.COMMENTS_LIST.name(), EmptyableViewport.EMPTY_VIEW_ID,  | 
| 52 |                                         DockingConstants.SOUTH_REGION, 0.67f); | 
| 53 |                         seq.add(Views.NOTIFICATIONS_LIST.name(), Views.COMMENTS_LIST.name(),  | 
| 54 |                                         DockingConstants.SOUTH_REGION, 0.5f); | 
| 55 |                 } | 
| 56 |                 else | 
| 57 |                 { | 
| 58 |                         seq.add(EmptyableViewport.EMPTY_VIEW_ID); | 
| 59 |                         seq.add(Views.COMMENTS_LIST.name(), EmptyableViewport.EMPTY_VIEW_ID,  | 
| 60 |                                         DockingConstants.SOUTH_REGION, 0.67f); | 
| 61 |                         seq.add(Views.NOTIFICATIONS_LIST.name(), Views.COMMENTS_LIST.name(),  | 
| 62 |                                         DockingConstants.SOUTH_REGION, 0.5f); | 
| 63 |                         seq.add(Views.BOARDS_LIST.name(), EmptyableViewport.EMPTY_VIEW_ID,  | 
| 64 |                                         DockingConstants.WEST_REGION, 0.33f); | 
| 65 |                         seq.add(Views.BOARD_DETAIL.name(), Views.BOARDS_LIST.name(),  | 
| 66 |                                         DockingConstants.CENTER_REGION, 1.0f); | 
| 67 |                         seq.add(Views.PARTICIPANTS_LIST.name(), Views.BOARD_DETAIL.name(),  | 
| 68 |                                         DockingConstants.CENTER_REGION, 1.0f); | 
| 69 |                         seq.add(Views.ACCOUNTS_LIST.name(), Views.PARTICIPANTS_LIST.name(),  | 
| 70 |                                         DockingConstants.SOUTH_REGION, 0.5f); | 
| 71 |                         seq.add(Views.ACCOUNT_DETAIL.name(), Views.ACCOUNTS_LIST.name(),  | 
| 72 |                                         DockingConstants.CENTER_REGION, 1.0f); | 
| 73 |                 } | 
| 74 |         } | 
| 75 |         // CSON: MagicNumberCheck | 
| 76 | } |