    001package org.vishia.gral.awt;
    002
    003import java.awt.Component;
    004import java.awt.Composite;
    005import java.awt.Frame;
    006import java.awt.Menu;
    007import java.awt.MenuBar;
    008import java.awt.MenuItem;
    009import java.awt.PopupMenu;
    010
    011import org.vishia.gral.base.GralMenu;
    012import org.vishia.gral.base.GralWidget;
    013import org.vishia.gral.base.GralMng;
    014import org.vishia.gral.ifc.GralUserAction;
    015
    016public class AwtMenu extends GralMenu._GraphicImpl
    017{
    018
    019  private final Menu menuAwt;
    020
    021  private final MenuBar menuBar;
    022
    023  public AwtMenu(GralWidget widgg, Component parent, GralMng mng)
    024  {
    025    new GralMenu().super(widgg);
    026    menuBar = null;
    027    menuAwt = new PopupMenu("test");
    028    MenuItem item = new MenuItem("Test1");
    029    menuAwt.add(item);
    030    MenuItem item2 = new MenuItem("Test2");
    031    menuAwt.add(item2);
    032  }
    033
    034  public AwtMenu(GralWidget widgg, Frame window, GralMng mng)
    035  {
    036    new GralMenu().super(widgg);
    037    menuAwt = null;
    038    menuBar = new MenuBar();
    039    window.setMenuBar(menuBar);
    040  }
    041
    042
    043
    044  /**Creates the implementation for a menu node or entry.
    045   * @param oParentMenu return value of {@link #getMenuImpl()} or the {@link GralMenu.MenuEntry#menuImpl}, that is a menu node.
    046   * @param gralEntry The entry in the menu tree
    047   */
    048  @Override public void _implMenuItem(Object oParentMenu, GralMenu.MenuEntry gralEntry)
    049  { assert(gralEntry.menuImpl ==null);
    050    Menu parentMenu = (Menu) oParentMenu;
    051    //TODO
    052  }
    053
    054
    055
    056
    057  @Override
    058  public void setVisible(){
    059    //menuAwt.setVisible(true);
    060  }
    061
    062
    063  @Override public Menu getMenuImpl(){ return menuAwt; }
    064
    065
    066
    067}