package nl.tudelft.simulation.introspection.mapping; import java.awt.Color; import java.util.Collection; import java.util.HashSet; import java.util.Set; import javax.swing.JComponent; import nl.tudelft.simulation.introspection.gui.ExpandButton; /** * A default implementation of the {see CellPresentationConfiguration} interface. Editors and renders are provided for * the JComponent, Color and Font classes. Furthermore, a special editor is provided for the ExpandButton class, to * implement the pop-up behaviour of the {see nl.tudelft.simulation.introspection.gui.ExpandButton}. *
* Copyright (c) 2002-2018 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. * @author Niels Lang. */ public class DefaultConfiguration implements CellPresentationConfiguration { /** the defaultConfiguation. */ private static DefaultConfiguration defaultConfig; static { defaultConfig = new DefaultConfiguration(); defaultConfig.addRenderer(JComponent.class, SwingCellRenderer.class); defaultConfig.addRenderer(Object.class, MyDefaultRenderer.class); defaultConfig.addRenderer(Object[].class, ArrayRenderer.class); defaultConfig.addRenderer(Collection.class, CollectionRenderer.class); defaultConfig.addRenderer(Color.class, MyColorRenderer.class); defaultConfig.addEditor(Color.class, MyColorEditor.class); defaultConfig.addEditor(JComponent.class, SwingCellEditor.class); defaultConfig.addEditor(Object.class, MyDefaultEditor.class); defaultConfig.addEditor(ExpandButton.class, ExpandButtonEditor.class); } /** the renderers. */ private Set