001/* 002 * Copyright (c) 2010 The Regents of the University of California. 003 * All rights reserved. 004 * 005 * '$Author: aschultz $' 006 * '$Date: 2010-12-23 19:01:04 +0000 (Thu, 23 Dec 2010) $' 007 * '$Revision: 26600 $' 008 * 009 * Permission is hereby granted, without written agreement and without 010 * license or royalty fees, to use, copy, modify, and distribute this 011 * software and its documentation for any purpose, provided that the above 012 * copyright notice and the following two paragraphs appear in all copies 013 * of this software. 014 * 015 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY 016 * FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES 017 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 018 * THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF 019 * SUCH DAMAGE. 020 * 021 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, 022 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 023 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE 024 * PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 025 * CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 026 * ENHANCEMENTS, OR MODIFICATIONS. 027 * 028 */ 029 030package org.kepler.gui; 031 032import java.awt.Container; 033import java.util.List; 034 035import ptolemy.actor.gui.TableauFrame; 036 037/** 038 * This interface is to be implemented by anyone wanting to add a view to the 039 * Kepler. The ViewPaneFactory generates instances of ViewPane. 040 * 041 * @author Aaron Schultz 042 */ 043public interface ViewPane { 044 045 /** 046 * Initialization of the view should be done at some point after the 047 * constructor is called. The setParentFrame() method is called by the 048 * factory before calling initializeView(). This also allows for more easily 049 * adding new functions to this interface later on. 050 * 051 * @throws Exception 052 */ 053 public abstract void initializeView() throws Exception; 054 055 /** 056 * This method should return the name of the view which is used to label the 057 * view in the View selection list. 058 */ 059 public abstract String getViewName(); 060 061 /** 062 * This method must return the TableauFrame this view is associated with. 063 */ 064 public abstract TableauFrame getParentFrame(); 065 066 /** 067 * This method sets the TableauFrame this view is associated with. 068 */ 069 public abstract void setParentFrame(TableauFrame parent); 070 071 /** 072 * This method must return true if the supplied location name matches the 073 * name of one of the supported ViewPaneLocations for this ViewPane. 074 */ 075 public abstract boolean hasLocation(String locationName); 076 077 /** 078 * This method is used to add a TabPane to the ViewPane specifying the 079 * location in which the TabPane should be placed. 080 */ 081 public abstract void addTabPane(TabPane tabPane, ViewPaneLocation location) 082 throws Exception; 083 084 /** 085 * This method must return the Container that represents the specified 086 * ViewPaneLocation. 087 * 088 * @param location 089 */ 090 public abstract Container getLocationContainer(String locationName) 091 throws Exception; 092 093 /** 094 * Look up the tab by the given name 095 * @param tabName 096 * * @throws Exception 097 */ 098 public abstract List<TabPane> getTabPanes(String tabName) 099 throws Exception; 100 101 102 103}