001package org.vishia.gral.ifc;
002
003import java.io.Closeable;
004import java.util.Map;
005
006import org.vishia.gral.area9.GuiCallingArgs;
007import org.vishia.gral.base.GralMng;
008import org.vishia.gral.cfg.GralCfgData;
009import org.vishia.msgDispatch.LogMessage;
010
011
012
013/**This interface plugs an user application to the basic GUI application. 
014 * <br><br>
015 * <br>Superinterface Closeable</b>: On close of the application some threads should be finished
016 * or channels should be closed. 
017 * */ 
018public interface GralPlugUser_ifc extends Closeable
019{
020
021  /**Version, history and license.
022   * <ul>
023   * <li>2011-06-00 Hartmut created
024   * </ul>
025   * 
026   * <b>Copyright/Copyleft</b>:<br>
027   * For this source the LGPL Lesser General Public License,
028   * published by the Free Software Foundation is valid.
029   * It means:
030   * <ol>
031   * <li> You can use this source without any restriction for any desired purpose.
032   * <li> You can redistribute copies of this source to everybody.
033   * <li> Every user of this source, also the user of redistribute copies
034   *    with or without payment, must accept this license for further using.
035   * <li> But the LPGL is not appropriate for a whole software product,
036   *    if this source is only a part of them. It means, the user
037   *    must publish this part of source,
038   *    but doesn't need to publish the whole source of the own product.
039   * <li> You can study and modify (improve) this source
040   *    for own using or for redistribution, but you have to license the
041   *    modified sources likewise under this LGPL Lesser General Public License.
042   *    You mustn't delete this Copyright/Copyleft inscription in this source file.
043   * </ol>
044   * If you intent to use this source without publishing its usage, you can get
045   * a second license subscribing a special contract with the author. 
046   * 
047   * @author Hartmut Schorrig = hartmut.schorrig@vishia.de
048   */
049  public static final int version = 20120303;
050
051  //void init(LogMessage log);
052  
053  /**This is the first routine that will be called for the plugin. 
054   * Note that the constructor is parameterless because the plugin may be instantiated by reflection access
055   * This routine will be called by {@link org.vishia.gral.area9.GuiCfg#userInit()} or any of its derivation 
056   * in the constructor of {@link org.vishia.gral.area9.GuiCfg#GuiCfg(org.vishia.gral.area9.GuiCallingArgs, org.vishia.gral.area9.GralArea9MainCmd, GralPlugUser2Gral_ifc)} 
057   * in the main thread, not in the graphic thread.
058   * @param plugUser2Gui Access from the plugin to the Gui main implementation. It is offer to use.
059   * @param gralMng
060   * @param dataReplacement info about alias for some data paths, application-specific. See {@link GralCfgData#dataReplace}
061   * @param log
062   */
063  void init(GralPlugUser2Gral_ifc plugUser2Gui, GralMng gralMng, Map<String, String> dataReplacement, GuiCallingArgs args, LogMessage log);
064
065  
066  void registerMethods(org.vishia.gral.ifc.GralMngBuild_ifc guiMng);
067  
068  /**This method is called if the view is changed. 
069   * @param sTitle title of a window or panel.
070   * @param cmd any command. TODO what.
071   */
072  void changedView(String sTitle, int cmd);
073
074  
075  /**This routine can be implemented to add some graphic elements to the gui, including special windows.
076   * @param gralMng
077   */
078  void initGui(GralMng gralMng);
079  
080  /**This routine can be implemented to add some specific menu entries.
081   * @param wind The main window access
082   */
083  void addGuiMenu(GralWindow_ifc wind);
084  
085
086}