X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Farchaeopteryx%2FNodeFrame.java;h=fd15af0ca4ed6c1a85efb24bd8023701da78202b;hb=a2e1b38bab7e593d79946c24e653776e6d796e00;hp=64236f4266ea13d1ce388b723427d8827554e6af;hpb=ccf4c584032d16ed0ed8d0678f01305887724f96;p=jalview.git diff --git a/forester/java/src/org/forester/archaeopteryx/NodeFrame.java b/forester/java/src/org/forester/archaeopteryx/NodeFrame.java index 64236f4..fd15af0 100644 --- a/forester/java/src/org/forester/archaeopteryx/NodeFrame.java +++ b/forester/java/src/org/forester/archaeopteryx/NodeFrame.java @@ -8,7 +8,7 @@ // and Howard Hughes Medical Institute // Copyright (C) 2003-2007 Ethalinda K.S. Cannon // All rights reserved -// +// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either @@ -18,13 +18,13 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. -// +// // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // // Contact: phylosoft @ gmail . com -// WWW: www.phylosoft.org/forester +// WWW: https://sites.google.com/site/cmzmasek/home/software/forester package org.forester.archaeopteryx; @@ -46,31 +46,37 @@ final class NodeFrame extends javax.swing.JFrame { NodeFrame( final PhylogenyNode n, final Phylogeny tree, final TreePanel tp, final int x ) { super( "Node " + ( ForesterUtil.isEmpty( n.getName() ) ? n.getId() : n.getName() ) ); _reepanel = tp; - setSize( Constants.NODE_FRAME_SIZE ); + setSize( AptxConstants.NODE_FRAME_SIZE ); _index = x; final Container contentPane = getContentPane(); - final NodePanel nodepanel = new NodePanel( n ); - contentPane.add( nodepanel, BorderLayout.CENTER ); + final NodePanel nodepanel = new NodePanel( n, this ); + contentPane.add( nodepanel ); addWindowListener( new WindowAdapter() { @Override public void windowClosing( final WindowEvent e ) { - remove(); // to release slot in array - dispose(); + close(); } } ); - setResizable( false ); + this.setLocationRelativeTo( tp ); + setResizable( true ); nodepanel.setVisible( true ); setVisible( true ); } + + void close() { + remove(); // to release slot in array + dispose(); + } + NodeFrame( final PhylogenyNode n, final Phylogeny tree, final TreePanel tp, final int x, final String dummy ) { super( "Editable Node " + ( ForesterUtil.isEmpty( n.getName() ) ? n.getId() : n.getName() ) ); _reepanel = tp; - setSize( Constants.NODE_FRAME_SIZE ); + setSize( AptxConstants.NODE_FRAME_SIZE ); _index = x; final Container contentPane = getContentPane(); - final NodeEditPanel nodepanel = new NodeEditPanel( n, tp ); + final NodeEditPanel nodepanel = new NodeEditPanel( n, tp, this ); contentPane.add( nodepanel, BorderLayout.CENTER ); addWindowListener( new WindowAdapter() { @@ -86,6 +92,7 @@ final class NodeFrame extends javax.swing.JFrame { dispose(); } } ); + this.setLocationRelativeTo( tp ); setResizable( false ); nodepanel.setVisible( true ); setVisible( true );