Class VariableTreePanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class VariableTreePanel extends JPanel
Tree of the variables of a solution with a filter (Redmine #62), used by the management and the input dialog. The variables are grouped by the part of the name before the first dot (component, resource, CURRENT); names without dot are the solution variables. The tooltip shows data type, unit and description. A variable is taken over by double click or dragged as text.
Author:
Andreas Enders, Claude (Anthropic), co-author
See Also:
  • Constructor Details

    • VariableTreePanel

      public VariableTreePanel(Map<String, net.simplace.sim.util.FWSimVariable<?>> aVariables, boolean aDragEnabled, Function<String,String> aDragText, Consumer<String> aOnDoubleClick, String aTitle)
      Creates the panel.
      Parameters:
      aVariables - the variables by name
      aDragEnabled - whether variables can be dragged
      aDragText - text dragged for a variable name, e.g. n -> "${" + n + "}"
      aOnDoubleClick - called with the variable name on double click, may be null
      aTitle - border title
  • Method Details

    • setFilter

      public void setFilter(String aFilter)
      Parameters:
      aFilter - filter text (case insensitive part of the name)
    • getSelectedVariable

      public String getSelectedVariable()
      Returns:
      the name of the selected variable, or null if a group or nothing is selected