// 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
// 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;
final class ColorSchemeChooser extends JDialog implements ActionListener {
- private static final long serialVersionUID = 6150960100859081126L;
- private final TreeColorSet _colorset;
- private final JComboBox _selector;
- private final JPanel _color_panel;
- private final JPanel _color_labels[];
- private final JButton _ok_btn;
- private final JButton _cancel_btn;
- private final MainPanel _main_panel;
- private final int _prev_selected_scheme;
- private int _selected_scheme;
+ private static final long serialVersionUID = 6150960100859081126L;
+ private final TreeColorSet _colorset;
+ private final JComboBox<String> _selector;
+ private final JPanel _color_panel;
+ private final JPanel _color_labels[];
+ private final JButton _ok_btn;
+ private final JButton _cancel_btn;
+ private final MainPanel _main_panel;
+ private final int _prev_selected_scheme;
+ private int _selected_scheme;
ColorSchemeChooser( final MainPanel parent, final TreeColorSet colorset ) {
setName( "Color Scheme Chooser" );
for( final String element : TreeColorSet.SCHEME_NAMES ) {
list.add( element );
}
- _selector = new JComboBox( list );
+ _selector = new JComboBox<String>( list );
_selector.setMaximumRowCount( list.size() );
_selector.getModel().addListDataListener( new ListDataListener() {
+ @Override
public void contentsChanged( final ListDataEvent e ) {
final int selection = _selector.getSelectedIndex();
changeDialogColors( selection );
}
+ @Override
public void intervalAdded( final ListDataEvent e ) {
// Not needed.
}
+ @Override
public void intervalRemoved( final ListDataEvent e ) {
// Not needed.
}
_ok_btn = new JButton( "OK" );
_ok_btn.addActionListener( new ActionListener() {
+ @Override
public void actionPerformed( final ActionEvent e ) {
ok();
}
_cancel_btn = new JButton( "Cancel" );
_cancel_btn.addActionListener( new ActionListener() {
+ @Override
public void actionPerformed( final ActionEvent e ) {
cancel();
}
setCurrentColor( colorset.getCurrentColorScheme() );
}
+ @Override
public void actionPerformed( final ActionEvent e ) {
// Not needed.
}