All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pekinsoft.spi.MdiParentWindow Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (C) 2022 PekinSOFT Systems
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see .
 * 
 * *****************************************************************************
 *  Project    :   AppFramework
 *  Class      :   MdiParentWindow.java
 *  Author     :   Sean Carrick
 *  Created    :   Dec 31, 2022
 *  Modified   :   Dec 31, 2022
 *  
 *  Purpose: See class JavaDoc for explanation
 *  
 *  Revision History:
 *  
 *  WHEN          BY                   REASON
 *  ------------  -------------------  -----------------------------------------
 *  Dec 31, 2022  Sean Carrick         Initial creation.
 * *****************************************************************************
 */

package com.pekinsoft.spi;

import javax.swing.JInternalFrame;
import javax.swing.JMenu;
import javax.swing.JToolBar;

/**
 * The {@code MdiParentWindow}  interface provides functionality for negotiating
 * toolbars and menus between a {@link javax.swing.JInternalFrame JInternalFrame}
 * and its containing window. This way, a {@code JInternalFrame}  window may have
 * a toolbar and/or menu associated with it, but it will be displayed in the 
 * top-level window, instead of within itself.
 * 
 * A {@code JInternalFrame}  class could extend a {@link 
 * javax.swing.event.InternalFrameAdapter InternalFrameAdapter} and add the
 * toolbar and/or menu to the {@code MdiParentWindow}'s toolbar and/or menu bar
 * in the {@code activated} event, and remove them in the {@code deactivated}
 * event.
 * 
 * 
 * By having the main window of an {@code org.jdesktop.application.Application
 * Application} implement this interface, the {@code MdiParentWindow}  class may
 * be found via the {@link org.openide.util.Lookup Lookup} and used effectively.
 * 
 *
 * @author Sean Carrick <sean at pekinsoft dot com>
 * 
 * @version 1.3
 * @since 1.0
 */
public interface MdiParentWindow {
    
    /**
     * Add a {@link javax.swing.JMenu JMenu} to the {@code MdiParentWindow}'s
     * menu bar at the location determined by the {@code MdiParentWindow}.
     * 
     * If {@code menu}  is {@code null}, no exception is thrown and no action is taken.
     * 
     * 
     * @param menu the {@code JMenu}  to be added
     */
    public void addMenu(JMenu menu);
    
    /**
     * Add a {@link javax.swing.JToolBar JToolBar} to the {@code MdiParentWindow}'s
     * toolbar at the location determined by the {@code MdiParentWindow}.
     * 
     * if {@code toolBar}  is {@code null}, no exception is thrown and no action is
     * taken.
     * 
     * @param toolBar the {@code JToolBar}  to be added
     */
    public void addToolbar(JToolBar toolBar);
    
    /**
     * Remove a {@link javax.swing.JMenu JMenu} from the {@code MdiParentWindow}'s
     * menu bar.
     * 
     * If {@code menu} is {@code null}, or has not been previously added, no exception
     * is thrown and no action is taken.
     * 
     * @param menu the {@code JMenu}  to be removed
     */
    public void removeMenu(JMenu menu);
    
    /**
     * Remove a {@link javax.swing.JToolBar JToolBar} from the {@code MdiParentWindow}'s 
     * toolbar.
     * 
     * If {@code toolBar} is {@code null}, or has not be previously added, no exception
     * is thrown and no action is taken.
     * 
     * @param toolBar the {@code JToolBar}  to be removed
     */
    public void removeToolbar(JToolBar toolBar);
    
    /**
     * Shows a {@link javax.swing.JInternalFrame JInternalFrame} in this 
     * {@code MdiParentWindow}'s {@link javax.swing.JDesktopPane JDesktopPane}.
     * 
     * If {@code frame} is {@code null}, no exception is thrown and no action is taken.
     * 
     * @param frame the {@code JInternalFrame}  to be shown
     */
    public void show(JInternalFrame frame);
    
    /**
     * Closes a {@link javax.swing.JInternalFrame JInternalFrame} and removes it
     * from this {@code MdiParentWindow}'s {@link javax.swing.JDesktopPane
     * JDesktopPane}.
     * 
     * If {@code frame} is {@code null}, or has not been previously opened in this
     * window's {@code JDesktopPane}, no exception is thrown and no action is
     * taken.
     * 
     * @param frame the {@code JInternalFrame}  to be closed
     */
    public void close(JInternalFrame frame);
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy