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.
* BSD-style license. See DSOL License.
* @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