package nl.tudelft.simulation.naming.context; import javax.naming.NamingException; import javax.naming.event.EventContext; import javax.swing.tree.DefaultTreeModel; /** * The ContextTreeModel defines the inner structure of the context. *
* Copyright (c) 2002-2019 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See * for project information https://simulation.tudelft.nl. The DSOL * project is distributed under a three-clause BSD-style license, which can be found at * * https://simulation.tudelft.nl/dsol/3.0/license.html. *
* @author Peter Jacobs * @author Alexander Verbraeck */ public class ContextTreeModel extends DefaultTreeModel { /** The default serial version UID for serializable classes. */ private static final long serialVersionUID = 1L; /** * constructs a new ContextTreeModel. * @param context EventContext; the context * @throws NamingException on failure */ public ContextTreeModel(final EventContext context) throws NamingException { this(context, null, true); } /** * constructs a new ContextTreeModel. * @param context EventContext; the context * @param displayClasses Class<?>[]; the set of classes to display as children * @param displayFields boolean; should we display them? * @throws NamingException on failure */ public ContextTreeModel(final EventContext context, final Class>[] displayClasses, final boolean displayFields) throws NamingException { super(null); this.setRoot(new ContextNode(this, "/", context, displayClasses, displayFields)); } /** {@inheritDoc} */ @Override protected void fireTreeStructureChanged(final Object arg0, final Object[] arg1, final int[] arg2, final Object[] arg3) { super.fireTreeStructureChanged(arg0, arg1, arg2, arg3); } }