001/* 002 * Copyright (c) 2012 The Regents of the University of California. 003 * All rights reserved. 004 * 005 * '$Author: crawl $' 006 * '$Date: 2015-08-24 22:44:14 +0000 (Mon, 24 Aug 2015) $' 007 * '$Revision: 33630 $' 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 */ 029package org.kepler.gui.controller; 030 031import org.kepler.gui.TabbedLookInsideAction; 032 033import diva.graph.GraphController; 034import diva.graph.JGraph; 035import diva.gui.GUIUtilities; 036import ptolemy.actor.gui.Configuration; 037import ptolemy.vergil.actor.ActorInstanceController; 038 039/** An actor controller that provides an action to open actors in a tab. 040 * 041 * @author Daniel Crawl 042 * @version $Id: TabbedActorController.java 33630 2015-08-24 22:44:14Z crawl $ 043 */ 044public class TabbedActorController extends ActorInstanceController { 045 046 public TabbedActorController(GraphController controller) { 047 super(controller); 048 //System.out.println("new TabbedCompositeActorController for graph controller " + controller); 049 } 050 051 public TabbedActorController(GraphController controller, 052 Access access) { 053 super(controller, access); 054 //System.out.println("new TabbedCompositeActorController for graph controller " + controller); 055 } 056 057 /** 058 * Add hot keys to the actions in the given JGraph. It would be better that 059 * this method was added higher in the hierarchy. Now most controllers 060 * 061 * @param jgraph 062 * The JGraph to which hot keys are to be added. 063 */ 064 @Override 065 public void addHotKeys(JGraph jgraph) { 066 super.addHotKeys(jgraph); 067 GUIUtilities.addHotKey(jgraph, _openInTabAction); 068 } 069 070 @Override 071 public void setConfiguration(Configuration configuration) { 072 super.setConfiguration(configuration); 073 _openInTabAction.setConfiguration(configuration); 074 } 075 076 protected TabbedLookInsideAction _openInTabAction = 077 new TabbedLookInsideAction("Open Actor in Tab"); 078}