1 /* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.ide.eclipse.gltrace; 18 19 import com.android.ide.eclipse.gltrace.views.FrameSummaryView; 20 import com.android.ide.eclipse.gltrace.views.StateView; 21 import com.android.ide.eclipse.gltrace.views.detail.DetailsView; 22 23 import org.eclipse.ui.IFolderLayout; 24 import org.eclipse.ui.IPageLayout; 25 import org.eclipse.ui.IPerspectiveFactory; 26 27 public class GLTracePerspective implements IPerspectiveFactory { 28 private static final String STATE_FOLDER_ID = "stateFolder"; //$NON-NLS-1$ 29 private static final String FB_FOLDER_ID = "fbFolder"; //$NON-NLS-1$ 30 private static final String TEXTURE_VIEW_FOLDER_ID = "textureViewFolder"; //$NON-NLS-1$ 31 32 @Override createInitialLayout(IPageLayout layout)33 public void createInitialLayout(IPageLayout layout) { 34 // Create a 3 column layout 35 // The first column contains the function trace in an editor. 36 // The second column contains the GL State View. 37 // The third column contains the texture view and the top and the framebuffer at the bottom. 38 39 // Add the OpenGL state view to the right of the editor 40 IFolderLayout column2 = layout.createFolder(STATE_FOLDER_ID, IPageLayout.RIGHT, 0.65f, 41 layout.getEditorArea()); 42 column2.addView(StateView.ID); 43 44 // Add the Texture View in the 3rd column 45 IFolderLayout column3 = layout.createFolder(FB_FOLDER_ID, IPageLayout.RIGHT, 0.6f, 46 STATE_FOLDER_ID); 47 column3.addView(DetailsView.ID); 48 49 // Add the OpenGL Framebuffer view below the texture view (bottom of 3rd column) 50 IFolderLayout column3bottom = layout.createFolder(TEXTURE_VIEW_FOLDER_ID, 51 IPageLayout.BOTTOM, 52 0.5f, 53 FB_FOLDER_ID); 54 column3bottom.addView(FrameSummaryView.ID); 55 } 56 } 57