[4] | 1 | /* |
---|
| 2 | * This program is free software; you can redistribute it and/or modify |
---|
| 3 | * it under the terms of the GNU General Public License as published by |
---|
| 4 | * the Free Software Foundation; either version 2 of the License, or |
---|
| 5 | * (at your option) any later version. |
---|
| 6 | * |
---|
| 7 | * This program is distributed in the hope that it will be useful, |
---|
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 10 | * GNU General Public License for more details. |
---|
| 11 | * |
---|
| 12 | * You should have received a copy of the GNU General Public License |
---|
| 13 | * along with this program; if not, write to the Free Software |
---|
| 14 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
| 15 | */ |
---|
| 16 | |
---|
| 17 | /* |
---|
| 18 | * MainMenuExtension.java |
---|
| 19 | * Copyright (C) 2007 University of Waikato, Hamilton, New Zealand |
---|
| 20 | */ |
---|
| 21 | |
---|
| 22 | package weka.gui; |
---|
| 23 | |
---|
| 24 | import java.awt.Component; |
---|
| 25 | import java.awt.event.ActionListener; |
---|
| 26 | |
---|
| 27 | import javax.swing.JFrame; |
---|
| 28 | |
---|
| 29 | /** |
---|
| 30 | * Classes implementing this interface will be displayed in the "Extensions" |
---|
| 31 | * menu in the main GUI of Weka. |
---|
| 32 | * |
---|
| 33 | * @author fracpete (fracpete at waikato dot ac dot nz) |
---|
| 34 | * @version $Revision: 1.1 $ |
---|
| 35 | */ |
---|
| 36 | public interface MainMenuExtension { |
---|
| 37 | |
---|
| 38 | /** |
---|
| 39 | * Returns the name of the submenu. If there is no submenu necessary then |
---|
| 40 | * the return value is null. |
---|
| 41 | * |
---|
| 42 | * @return the title of the submenu or null if no submenu |
---|
| 43 | */ |
---|
| 44 | public String getSubmenuTitle(); |
---|
| 45 | |
---|
| 46 | /** |
---|
| 47 | * Returns the name of the menu item. |
---|
| 48 | * |
---|
| 49 | * @return the name of the menu item. |
---|
| 50 | */ |
---|
| 51 | public String getMenuTitle(); |
---|
| 52 | |
---|
| 53 | /** |
---|
| 54 | * If the extension has a custom ActionListener for the menu item, then it |
---|
| 55 | * must be returned here. Having a custom <code>ActionListener</code> also |
---|
| 56 | * means that the component handles any frame by itself. |
---|
| 57 | * |
---|
| 58 | * @param owner the owner of potential dialogs |
---|
| 59 | * @return a custom ActionListener, can be null |
---|
| 60 | * @see #fillFrame(Component) |
---|
| 61 | */ |
---|
| 62 | public ActionListener getActionListener(JFrame owner); |
---|
| 63 | |
---|
| 64 | /** |
---|
| 65 | * Fills the frame with life, like adding components, window listeners, |
---|
| 66 | * setting size, location, etc. The frame object can be either derived from |
---|
| 67 | * <code>JFrame</code> or from <code>JInternalFrame</code>. This method is |
---|
| 68 | * only called in case <code>getActionListener()</code> returns null. |
---|
| 69 | * |
---|
| 70 | * @param frame the frame object to embed components, etc. |
---|
| 71 | * @see #getActionListener(JFrame) |
---|
| 72 | * @see javax.swing.JFrame |
---|
| 73 | * @see javax.swing.JInternalFrame |
---|
| 74 | */ |
---|
| 75 | public void fillFrame(Component frame); |
---|
| 76 | } |
---|