@Test (expectedExceptions = IllegalArgumentException.class) public void testOperationOnUndefinedDataSeries() { PlotAbstraction testPlot = new PlotView.Builder(PlotterPlot.class).build(); testPlot.addData("Undefined data set", System.currentTimeMillis(), 10.0); }
public void addData(Map<String, SortedMap<Long, Double>> dataForPlot) { for(Entry<String, SortedMap<Long, Double>> feedData : dataForPlot.entrySet()) { String feedID = feedData.getKey(); String dataSetNameLower = feedID.toLowerCase(); if (!isKnownDataSet(dataSetNameLower)) { throw new IllegalArgumentException("Attempting to set value for an unknown data set " + feedID); } if (getAxisOrientationSetting() != AxisOrientationSetting.Z_AXIS_AS_TIME) { Set<AbstractPlottingPackage> feedPlots = dataSetNameToSubGroupMap.get(dataSetNameLower); SortedMap<Long, Double> points = feedData.getValue(); for(AbstractPlottingPackage plot : feedPlots) { plot.addData(dataSetNameLower, points); } } else { for(AbstractPlottingPackage plot : subPlots) { if (plot.isKnownDataSet(feedID)) { plot.addData(dataSetNameLower, feedData.getValue()); } } } } }
PlotView extends PlotConfigurationDelegator implements PlotAbstraction { public void addData(Map<String, SortedMap<Long, Double>> dataForPlot) { for(Entry<String, SortedMap<Long, Double>> feedData : dataForPlot.entrySet()) { String feedID = feedData.getKey(); String dataSetNameLower = feedID.toLowerCase(); if (!isKnownDataSet(dataSetNameLower)) { throw new IllegalArgumentException("Attempting to set value for an unknown data set " + feedID); } if (getAxisOrientationSetting() != AxisOrientationSetting.Z_AXIS_AS_TIME) { Set<AbstractPlottingPackage> feedPlots = dataSetNameToSubGroupMap.get(dataSetNameLower); SortedMap<Long, Double> points = feedData.getValue(); for(AbstractPlottingPackage plot : feedPlots) { plot.addData(dataSetNameLower, points); } } else { for(AbstractPlottingPackage plot : subPlots) { if (plot.isKnownDataSet(feedID)) { plot.addData(dataSetNameLower, feedData.getValue()); } } } } } }
PlotView extends PlotConfigurationDelegator implements PlotAbstraction { public void addData(Map<String, SortedMap<Long, Double>> dataForPlot) { for(Entry<String, SortedMap<Long, Double>> feedData : dataForPlot.entrySet()) { String feedID = feedData.getKey(); String dataSetNameLower = feedID.toLowerCase(); if (!isKnownDataSet(dataSetNameLower)) { throw new IllegalArgumentException("Attempting to set value for an unknown data set " + feedID); } if (getAxisOrientationSetting() != AxisOrientationSetting.Z_AXIS_AS_TIME) { Set<AbstractPlottingPackage> feedPlots = dataSetNameToSubGroupMap.get(dataSetNameLower); SortedMap<Long, Double> points = feedData.getValue(); for(AbstractPlottingPackage plot : feedPlots) { plot.addData(dataSetNameLower, points); } } else { for(AbstractPlottingPackage plot : subPlots) { if (plot.isKnownDataSet(feedID)) { plot.addData(dataSetNameLower, feedData.getValue()); } } } } } private  PlotView(Builder builder); }
PlotView extends PlotConfigurationDelegator implements PlotAbstraction { public void addData(Map<String, SortedMap<Long, Double>> dataForPlot) { for(Entry<String, SortedMap<Long, Double>> feedData : dataForPlot.entrySet()) { String feedID = feedData.getKey(); String dataSetNameLower = feedID.toLowerCase(); if (!isKnownDataSet(dataSetNameLower)) { throw new IllegalArgumentException("Attempting to set value for an unknown data set " + feedID); } if (getAxisOrientationSetting() != AxisOrientationSetting.Z_AXIS_AS_TIME) { Set<AbstractPlottingPackage> feedPlots = dataSetNameToSubGroupMap.get(dataSetNameLower); SortedMap<Long, Double> points = feedData.getValue(); for(AbstractPlottingPackage plot : feedPlots) { plot.addData(dataSetNameLower, points); } } else { for(AbstractPlottingPackage plot : subPlots) { if (plot.isKnownDataSet(feedID)) { plot.addData(dataSetNameLower, feedData.getValue()); } } } } } private  PlotView(Builder builder); void setManifestation(PlotViewManifestation theManifestation); @Override JPanel getPlotPanel(); @Override void addDataSet(String dataSetName); @Override void addDataSet(String dataSetName, Color plottingColor); @Override void addDataSet(String dataSetName, String displayName); void addDataSet(int subGroupIndex, String dataSetName, String displayName); void addDataSet(int subGroupIndex, String dataSetName, AbstractLegendEntry legendEntry); void addPopupMenus(); List<Map<String, LineSettings>> getLineSettings(); void setLineSettings(
			List<Map<String, LineSettings>> lineSettings); @Override boolean isKnownDataSet(String setName); @Override void refreshDisplay(); void initialDataRequest(); @Override void updateLegend(String dataSetName, FeedProvider.RenderingInfo info); @Override LimitAlarmState getNonTimeMaxAlarmState(int subGroupIndex); @Override LimitAlarmState getNonTimeMinAlarmState(int subGroupIndex); @Override void showTimeSyncLine(GregorianCalendar time); @Override void removeTimeSyncLine(); @Override boolean isTimeSyncLineVisible(); @Override void initiateGlobalTimeSync(GregorianCalendar time); @Override void updateGlobalTimeSync(GregorianCalendar time); @Override void notifyGlobalTimeSyncFinished(); @Override boolean inTimeSyncMode(); @Override double getNonTimeMaxCurrentlyDisplayed(); @Override double getNonTimeMinCurrentlyDisplayed(); @Override String toString(); Pinnable getTimeAxisUserPin(); AbbreviatingPlotLabelingAlgorithm getPlotLabelingAlgorithm(); void setPlotLabelingAlgorithm(AbbreviatingPlotLabelingAlgorithm thePlotLabelingAlgorithm); @Override AbstractPlottingPackage returnPlottingPackage(); @Override void setCompressionEnabled(boolean compression); @Override boolean isCompressionEnabled(); @Override void requestPlotData(GregorianCalendar startTime, GregorianCalendar endTime); @Override void informUpdateDataEventStarted(); @Override void informUpdateFromFeedEventStarted(); @Override void informUpdateDataEventCompleted(); @Override void informUpdateFromFeedEventCompleted(); @Override long getCurrentMCTTime(); PlotViewManifestation getPlotUser(); @Override boolean plotMatchesSetting(PlotConfiguration settings); @Override void updateTimeAxis(PlotSubject subject, long startTime, long endTime); @Override void updateResetButtons(); @Override void clearAllDataFromPlot(); @Override Pinnable createPin(); @Override boolean isPinned(); @Override List<AbstractPlottingPackage> getSubPlots(); @Override Axis getTimeAxis(); void addData(Map<String, SortedMap<Long, Double>> dataForPlot); void addData(String feedID, long time, double value); void setPlotTimeAxis(AbstractAxis axis); AbstractAxis getPlotTimeAxis(); @Override void plotAxisChanged(PlotSubject subject, AbstractAxis axis); @Override void dataPlotted(); }
PlotView extends PlotConfigurationDelegator implements PlotAbstraction { public void addData(Map<String, SortedMap<Long, Double>> dataForPlot) { for(Entry<String, SortedMap<Long, Double>> feedData : dataForPlot.entrySet()) { String feedID = feedData.getKey(); String dataSetNameLower = feedID.toLowerCase(); if (!isKnownDataSet(dataSetNameLower)) { throw new IllegalArgumentException("Attempting to set value for an unknown data set " + feedID); } if (getAxisOrientationSetting() != AxisOrientationSetting.Z_AXIS_AS_TIME) { Set<AbstractPlottingPackage> feedPlots = dataSetNameToSubGroupMap.get(dataSetNameLower); SortedMap<Long, Double> points = feedData.getValue(); for(AbstractPlottingPackage plot : feedPlots) { plot.addData(dataSetNameLower, points); } } else { for(AbstractPlottingPackage plot : subPlots) { if (plot.isKnownDataSet(feedID)) { plot.addData(dataSetNameLower, feedData.getValue()); } } } } } private  PlotView(Builder builder); void setManifestation(PlotViewManifestation theManifestation); @Override JPanel getPlotPanel(); @Override void addDataSet(String dataSetName); @Override void addDataSet(String dataSetName, Color plottingColor); @Override void addDataSet(String dataSetName, String displayName); void addDataSet(int subGroupIndex, String dataSetName, String displayName); void addDataSet(int subGroupIndex, String dataSetName, AbstractLegendEntry legendEntry); void addPopupMenus(); List<Map<String, LineSettings>> getLineSettings(); void setLineSettings(
			List<Map<String, LineSettings>> lineSettings); @Override boolean isKnownDataSet(String setName); @Override void refreshDisplay(); void initialDataRequest(); @Override void updateLegend(String dataSetName, FeedProvider.RenderingInfo info); @Override LimitAlarmState getNonTimeMaxAlarmState(int subGroupIndex); @Override LimitAlarmState getNonTimeMinAlarmState(int subGroupIndex); @Override void showTimeSyncLine(GregorianCalendar time); @Override void removeTimeSyncLine(); @Override boolean isTimeSyncLineVisible(); @Override void initiateGlobalTimeSync(GregorianCalendar time); @Override void updateGlobalTimeSync(GregorianCalendar time); @Override void notifyGlobalTimeSyncFinished(); @Override boolean inTimeSyncMode(); @Override double getNonTimeMaxCurrentlyDisplayed(); @Override double getNonTimeMinCurrentlyDisplayed(); @Override String toString(); Pinnable getTimeAxisUserPin(); AbbreviatingPlotLabelingAlgorithm getPlotLabelingAlgorithm(); void setPlotLabelingAlgorithm(AbbreviatingPlotLabelingAlgorithm thePlotLabelingAlgorithm); @Override AbstractPlottingPackage returnPlottingPackage(); @Override void setCompressionEnabled(boolean compression); @Override boolean isCompressionEnabled(); @Override void requestPlotData(GregorianCalendar startTime, GregorianCalendar endTime); @Override void informUpdateDataEventStarted(); @Override void informUpdateFromFeedEventStarted(); @Override void informUpdateDataEventCompleted(); @Override void informUpdateFromFeedEventCompleted(); @Override long getCurrentMCTTime(); PlotViewManifestation getPlotUser(); @Override boolean plotMatchesSetting(PlotConfiguration settings); @Override void updateTimeAxis(PlotSubject subject, long startTime, long endTime); @Override void updateResetButtons(); @Override void clearAllDataFromPlot(); @Override Pinnable createPin(); @Override boolean isPinned(); @Override List<AbstractPlottingPackage> getSubPlots(); @Override Axis getTimeAxis(); void addData(Map<String, SortedMap<Long, Double>> dataForPlot); void addData(String feedID, long time, double value); void setPlotTimeAxis(AbstractAxis axis); AbstractAxis getPlotTimeAxis(); @Override void plotAxisChanged(PlotSubject subject, AbstractAxis axis); @Override void dataPlotted(); public List<AbstractPlottingPackage> subPlots; public Map<String, Set<AbstractPlottingPackage>> dataSetNameToSubGroupMap; public Map<String, String> dataSetNameToDisplayMap; }