2 // FORESTER -- software libraries and applications
3 // for evolutionary biology research and applications.
5 // Copyright (C) 2008-2009 Christian M. Zmasek
6 // Copyright (C) 2008-2009 Burnham Institute for Medical Research
7 // Copyright (C) 2000-2001 Washington University School of Medicine
8 // and Howard Hughes Medical Institute
9 // Copyright (C) 2003-2007 Ethalinda K.S. Cannon
10 // All rights reserved
12 // This library is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU Lesser General Public
14 // License as published by the Free Software Foundation; either
15 // version 2.1 of the License, or (at your option) any later version.
17 // This library is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 // Lesser General Public License for more details.
22 // You should have received a copy of the GNU Lesser General Public
23 // License along with this library; if not, write to the Free Software
24 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
26 // Contact: phylosoft @ gmail . com
27 // WWW: https://sites.google.com/site/cmzmasek/home/software/forester
29 package org.forester.archaeopteryx;
31 import java.awt.BorderLayout;
32 import java.util.ArrayList;
34 import javax.swing.JApplet;
36 final class MainPanelApplets extends MainPanel {
38 private static final long serialVersionUID = -7142615479464963140L;
39 private final JApplet _applet;
41 public MainPanelApplets( final Configuration configuration, final ArchaeopteryxE em_applet ) {
42 if ( configuration == null ) {
43 throw new IllegalArgumentException( "configuration is null" );
45 addComponentListener( this );
46 _configuration = configuration;
48 _treepanels = new ArrayList<TreePanel>();
51 _control_panel = new ControlPanel( this, configuration );
52 if ( !configuration.isHideControlPanelAndMenubar() ) {
53 add( _control_panel, BorderLayout.WEST );
55 setupTreeGraphic( configuration, getControlPanel() );
58 public MainPanelApplets( final Configuration configuration, final MainFrameApplet aaf ) {
59 if ( configuration == null ) {
60 throw new IllegalArgumentException( "configuration is null" );
62 addComponentListener( this );
63 _configuration = configuration;
65 _treepanels = new ArrayList<TreePanel>();
66 _applet = aaf.getApplet();
68 _control_panel = new ControlPanel( this, configuration );
69 add( _control_panel, BorderLayout.WEST );
70 setupTreeGraphic( configuration, getControlPanel() );
74 public Options getOptions() {
75 if ( _mainframe != null ) {
76 return _mainframe.getOptions();
79 return ( ( ArchaeopteryxE ) _applet ).getOptions();
87 MainFrameApplet getAppletFrame() {
88 return ( MainFrameApplet ) _mainframe;