Example usage for org.apache.commons.collections15.map HashedMap HashedMap

List of usage examples for org.apache.commons.collections15.map HashedMap HashedMap

Introduction

In this page you can find the example usage for org.apache.commons.collections15.map HashedMap HashedMap.

Prototype

public HashedMap(Map<? extends K, ? extends V> map) 

Source Link

Document

Constructor copying elements from another map.

Usage

From source file:com.rapidminer.gui.new_plotter.templates.PlotterTemplate.java

/**
 * Standard constructor./*from w  w  w  . j  a va  2  s.  co  m*/
 */
public PlotterTemplate() {
    listOfDomainLines = new LinkedList<AxisParallelLineConfiguration>();
    rangeAxisCrosshairLinesMap = new HashedMap<String, List<AxisParallelLineConfiguration>>(40);
    domainAxisLinesListener = new AxisParallelLinesConfigurationListener() {

        @Override
        public void axisParallelLineConfigurationsChanged(AxisParallelLinesConfigurationChangeEvent e) {
            // domain axis crosshair handling
            if (e.getType().equals(AxisParallelLineConfigurationsChangeType.LINE_ADDED)) {
                if (!listOfDomainLines.contains(e.getLineConfiguration())) {
                    listOfDomainLines.add(e.getLineConfiguration());
                }
            } else if (e.getType().equals(AxisParallelLineConfigurationsChangeType.LINE_REMOVED)) {
                listOfDomainLines.remove(e.getLineConfiguration());
            }
        }
    };
    rangeAxisConfigListener = new RangeAxisConfigListener() {

        @Override
        public void rangeAxisConfigChanged(RangeAxisConfigChangeEvent e) {
            if (e.getConfigurationChangeType().equals(ConfigurationChangeType.RANGE_AXIS_CONFIG_CHANGE)) {
                AxisParallelLinesConfigurationChangeEvent crosshairChange = e.getCrosshairChange();
                if (crosshairChange != null) {
                    List<AxisParallelLineConfiguration> lineList = rangeAxisCrosshairLinesMap
                            .get(e.getSource().getLabel());
                    if (lineList == null) {
                        lineList = new LinkedList<AxisParallelLineConfiguration>();
                    }
                    if (crosshairChange.getType().equals(AxisParallelLineConfigurationsChangeType.LINE_ADDED)) {
                        if (!lineList.contains(crosshairChange.getLineConfiguration())) {
                            lineList.add(crosshairChange.getLineConfiguration());
                        }
                    } else if (crosshairChange.getType()
                            .equals(AxisParallelLineConfigurationsChangeType.LINE_REMOVED)) {
                        lineList.remove(crosshairChange.getLineConfiguration());
                    }
                    rangeAxisCrosshairLinesMap.put(e.getSource().getLabel(), lineList);
                }
            }
        }
    };
}