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

us.ihmc.simulationconstructionset.gui.YoGraphicMenuManager Maven / Gradle / Ivy

There is a newer version: 0.25.2
Show newest version
package us.ihmc.simulationconstructionset.gui;

import javax.swing.JMenu;
import javax.swing.JMenuItem;

import us.ihmc.simulationconstructionset.gui.tools.MultiButtonSelectionDeselectionAction;

public class YoGraphicMenuManager
{
   private JMenu jMenu;
   private MultiButtonSelectionDeselectionAction hideAllGraphicObjects;

   public YoGraphicMenuManager()
   {
      EventDispatchThreadHelper.invokeAndWait(new Runnable()
      {
         @Override
         public void run()
         {
            jMenu = new JMenu("Graphics");
            hideAllGraphicObjects = new MultiButtonSelectionDeselectionAction("Hide All");
            JMenuItem hideAllButton = new JMenuItem(hideAllGraphicObjects);
            hideAllGraphicObjects.setShowHideAllMenuItem(hideAllButton, "Show All", "Hide All");
            jMenu.add(hideAllButton);
         }
      });
   }

   public JMenu getjMenu()
   {
      return jMenu;
   }

   public void setjMenu(JMenu jMenu)
   {
      this.jMenu = jMenu;
   }

   public void hideAllGraphics()
   {
      hideAllGraphicObjects.hideAllGraphics();
   }

   public void addCheckBox(YoGraphicCheckBoxMenuItem checkBox)
   {
      jMenu.add(checkBox);
      hideAllGraphicObjects.addButton(checkBox);
   }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy