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

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

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

import java.util.ArrayList;
import java.util.List;

import us.ihmc.graphicsDescription.graphInterfaces.SelectedVariableHolder;
import us.ihmc.simulationconstructionset.gui.yoVariableSearch.YoVariablePanel;
import us.ihmc.simulationconstructionset.gui.yoVariableSearch.YoVariablePanelJPopupMenu;
import us.ihmc.yoVariables.registry.YoRegistry;
import us.ihmc.yoVariables.variable.YoVariable;

public class YoVariableRegistryVarPanel extends YoVariablePanel
{
   private static final long serialVersionUID = -9079475583549031191L;
   private final YoRegistry registry;

   public YoVariableRegistryVarPanel(YoRegistry registry, SelectedVariableHolder holder, YoVariablePanelJPopupMenu varPanelJPopupMenu)
   {
      super(registry.getName(), holder, varPanelJPopupMenu);
      this.registry = registry;
      clearAndSetUpTextFields();
   }

   @Override
   protected YoVariable getYoVariable(int index)
   {
      return registry.getVariable(index);
   }

   @Override
   protected List getAllYoVariablesCopy()
   {
      return new ArrayList<>(registry.getVariables());
   }

   @Override
   protected int getNumberOfYoVariables()
   {
      return registry.getNumberOfVariables();
   }

   @Override
   public YoVariable getYoVariable(String name)
   {
      return registry.findVariable(name);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy