@Test public void testPlotMatchSettings(){ PlotConfiguration plotSettings = new PlotSettings(); PlotConfiguration otherPlotSettings = new PlotSettings(); otherPlotSettings.setMinTime(plotSettings.getMinTime()); otherPlotSettings.setMaxTime(plotSettings.getMaxTime()); PlotView basePlot = new PlotView.Builder(PlotterPlot.class).plotSettings(otherPlotSettings).build(); Assert.assertTrue(basePlot.plotMatchesSetting(plotSettings)); plotSettings.setAxisOrientationSetting(AxisOrientationSetting.Y_AXIS_AS_TIME); Assert.assertFalse(basePlot.plotMatchesSetting(plotSettings)); plotSettings.setAxisOrientationSetting(AxisOrientationSetting.X_AXIS_AS_TIME); plotSettings.setXAxisMaximumLocation(XAxisMaximumLocationSetting.MAXIMUM_AT_LEFT); Assert.assertFalse(basePlot.plotMatchesSetting(plotSettings)); plotSettings.setXAxisMaximumLocation(XAxisMaximumLocationSetting.MAXIMUM_AT_RIGHT); plotSettings.setTimeAxisSubsequentSetting(TimeAxisSubsequentBoundsSetting.SCRUNCH); Assert.assertFalse(basePlot.plotMatchesSetting(plotSettings)); plotSettings.setTimeAxisSubsequentSetting(TimeAxisSubsequentBoundsSetting.JUMP); plotSettings.setNonTimeAxisSubsequentMinSetting(NonTimeAxisSubsequentBoundsSetting.FIXED); Assert.assertFalse(basePlot.plotMatchesSetting(plotSettings)); plotSettings.setNonTimeAxisSubsequentMinSetting(PlotConstants.DEFAULT_NON_TIME_AXIS_MIN_SUBSEQUENT_SETTING); plotSettings.setNonTimeAxisSubsequentMaxSetting(NonTimeAxisSubsequentBoundsSetting.FIXED); Assert.assertFalse(basePlot.plotMatchesSetting(plotSettings)); plotSettings.setNonTimeAxisSubsequentMaxSetting(PlotConstants.DEFAULT_NON_TIME_AXIS_MIN_SUBSEQUENT_SETTING); plotSettings.setMaxTime(basePlot.getMaxTime()+10); Assert.assertFalse(basePlot.plotMatchesSetting(plotSettings)); plotSettings.setMaxTime(basePlot.getMaxTime()); plotSettings.setMinTime(basePlot.getMinTime() + 10); Assert.assertFalse(basePlot.plotMatchesSetting(plotSettings)); plotSettings.setMinTime(basePlot.getMinTime()); plotSettings.setMaxNonTime(PlotConstants.DEFAULT_NON_TIME_AXIS_MAX_VALUE + 1); Assert.assertFalse(basePlot.plotMatchesSetting(plotSettings)); plotSettings.setMaxNonTime(PlotConstants.DEFAULT_NON_TIME_AXIS_MAX_VALUE); plotSettings.setMinNonTime(PlotConstants.DEFAULT_NON_TIME_AXIS_MIN_VALUE + 1); Assert.assertFalse(basePlot.plotMatchesSetting(plotSettings)); plotSettings.setMinNonTime(PlotConstants.DEFAULT_NON_TIME_AXIS_MIN_VALUE); plotSettings.setTimePadding(PlotConstants.DEFAULT_TIME_AXIS_PADDING + 1); Assert.assertFalse(basePlot.plotMatchesSetting(plotSettings)); plotSettings.setTimePadding(PlotConstants.DEFAULT_TIME_AXIS_PADDING); plotSettings.setNonTimeMaxPadding(PlotConstants.DEFAULT_NON_TIME_AXIS_PADDING_MAX + 1); Assert.assertFalse(basePlot.plotMatchesSetting(plotSettings)); plotSettings.setNonTimeMaxPadding(PlotConstants.DEFAULT_NON_TIME_AXIS_PADDING_MAX); plotSettings.setNonTimeMinPadding(PlotConstants.DEFAULT_NON_TIME_AXIS_PADDING_MIN+ 1); Assert.assertFalse(basePlot.plotMatchesSetting(plotSettings)); plotSettings.setNonTimeMinPadding(PlotConstants.DEFAULT_NON_TIME_AXIS_PADDING_MIN); plotSettings.setYAxisMaximumLocation(YAxisMaximumLocationSetting.MAXIMUM_AT_BOTTOM); Assert.assertFalse(basePlot.plotMatchesSetting(plotSettings)); plotSettings.setYAxisMaximumLocation(PlotConstants.DEFAULT_Y_AXIS_MAX_LOCATION_SETTING); Assert.assertTrue(basePlot.plotMatchesSetting(plotSettings)); }
@Override public boolean plotMatchesSetting(PlotConfiguration settings) { if (settings.getOrdinalPositionForStackedPlots() != this.getOrdinalPositionForStackedPlots()) return false; if (settings.getPinTimeAxis() != getPinTimeAxis()) return false; if (settings.getAxisOrientationSetting() != this.getAxisOrientationSetting()) return false; if (settings.getMaxDependent() != getMaxDependent()) return false; if (settings.getMaxNonTime() != getMaxNonTime()) return false; if (settings.getMaxTime() != getMaxTime()) return false; if (settings.getMinDependent() != getMinDependent()) return false; if (settings.getMinNonTime() != getMinNonTime()) return false; if (settings.getMinTime() != getMinTime()) return false; if (settings.getNonTimeAxisSubsequentMaxSetting() != getNonTimeAxisSubsequentMaxSetting()) return false; if (settings.getNonTimeAxisSubsequentMinSetting() != getNonTimeAxisSubsequentMinSetting()) return false; if (settings.getNonTimeMaxPadding() != getNonTimeMaxPadding()) return false; if (settings.getNonTimeMinPadding() != getNonTimeMinPadding()) return false; if (!settings.getPlotLineConnectionType().equals(getPlotLineConnectionType())) return false; if (!settings.getTimeAxisSubsequentSetting().equals(getTimeAxisSubsequentSetting())) return false; if (settings.getTimePadding() != getTimePadding()) return false; if (settings.getXAxisMaximumLocation() != getXAxisMaximumLocation()) return false; if (settings.getYAxisMaximumLocation() != getYAxisMaximumLocation()) return false; if (settings.getPlotLineDraw().drawLine() != getPlotLineDraw().drawLine()) return false; if (settings.getPlotLineDraw().drawMarkers() != getPlotLineDraw().drawMarkers()) return false; return true; }
PlotView extends PlotConfigurationDelegator implements PlotAbstraction { @Override public boolean plotMatchesSetting(PlotConfiguration settings) { if (settings.getOrdinalPositionForStackedPlots() != this.getOrdinalPositionForStackedPlots()) return false; if (settings.getPinTimeAxis() != getPinTimeAxis()) return false; if (settings.getAxisOrientationSetting() != this.getAxisOrientationSetting()) return false; if (settings.getMaxDependent() != getMaxDependent()) return false; if (settings.getMaxNonTime() != getMaxNonTime()) return false; if (settings.getMaxTime() != getMaxTime()) return false; if (settings.getMinDependent() != getMinDependent()) return false; if (settings.getMinNonTime() != getMinNonTime()) return false; if (settings.getMinTime() != getMinTime()) return false; if (settings.getNonTimeAxisSubsequentMaxSetting() != getNonTimeAxisSubsequentMaxSetting()) return false; if (settings.getNonTimeAxisSubsequentMinSetting() != getNonTimeAxisSubsequentMinSetting()) return false; if (settings.getNonTimeMaxPadding() != getNonTimeMaxPadding()) return false; if (settings.getNonTimeMinPadding() != getNonTimeMinPadding()) return false; if (!settings.getPlotLineConnectionType().equals(getPlotLineConnectionType())) return false; if (!settings.getTimeAxisSubsequentSetting().equals(getTimeAxisSubsequentSetting())) return false; if (settings.getTimePadding() != getTimePadding()) return false; if (settings.getXAxisMaximumLocation() != getXAxisMaximumLocation()) return false; if (settings.getYAxisMaximumLocation() != getYAxisMaximumLocation()) return false; if (settings.getPlotLineDraw().drawLine() != getPlotLineDraw().drawLine()) return false; if (settings.getPlotLineDraw().drawMarkers() != getPlotLineDraw().drawMarkers()) return false; return true; } }
PlotView extends PlotConfigurationDelegator implements PlotAbstraction { @Override public boolean plotMatchesSetting(PlotConfiguration settings) { if (settings.getOrdinalPositionForStackedPlots() != this.getOrdinalPositionForStackedPlots()) return false; if (settings.getPinTimeAxis() != getPinTimeAxis()) return false; if (settings.getAxisOrientationSetting() != this.getAxisOrientationSetting()) return false; if (settings.getMaxDependent() != getMaxDependent()) return false; if (settings.getMaxNonTime() != getMaxNonTime()) return false; if (settings.getMaxTime() != getMaxTime()) return false; if (settings.getMinDependent() != getMinDependent()) return false; if (settings.getMinNonTime() != getMinNonTime()) return false; if (settings.getMinTime() != getMinTime()) return false; if (settings.getNonTimeAxisSubsequentMaxSetting() != getNonTimeAxisSubsequentMaxSetting()) return false; if (settings.getNonTimeAxisSubsequentMinSetting() != getNonTimeAxisSubsequentMinSetting()) return false; if (settings.getNonTimeMaxPadding() != getNonTimeMaxPadding()) return false; if (settings.getNonTimeMinPadding() != getNonTimeMinPadding()) return false; if (!settings.getPlotLineConnectionType().equals(getPlotLineConnectionType())) return false; if (!settings.getTimeAxisSubsequentSetting().equals(getTimeAxisSubsequentSetting())) return false; if (settings.getTimePadding() != getTimePadding()) return false; if (settings.getXAxisMaximumLocation() != getXAxisMaximumLocation()) return false; if (settings.getYAxisMaximumLocation() != getYAxisMaximumLocation()) return false; if (settings.getPlotLineDraw().drawLine() != getPlotLineDraw().drawLine()) return false; if (settings.getPlotLineDraw().drawMarkers() != getPlotLineDraw().drawMarkers()) return false; return true; } private  PlotView(Builder builder); }
PlotView extends PlotConfigurationDelegator implements PlotAbstraction { @Override public boolean plotMatchesSetting(PlotConfiguration settings) { if (settings.getOrdinalPositionForStackedPlots() != this.getOrdinalPositionForStackedPlots()) return false; if (settings.getPinTimeAxis() != getPinTimeAxis()) return false; if (settings.getAxisOrientationSetting() != this.getAxisOrientationSetting()) return false; if (settings.getMaxDependent() != getMaxDependent()) return false; if (settings.getMaxNonTime() != getMaxNonTime()) return false; if (settings.getMaxTime() != getMaxTime()) return false; if (settings.getMinDependent() != getMinDependent()) return false; if (settings.getMinNonTime() != getMinNonTime()) return false; if (settings.getMinTime() != getMinTime()) return false; if (settings.getNonTimeAxisSubsequentMaxSetting() != getNonTimeAxisSubsequentMaxSetting()) return false; if (settings.getNonTimeAxisSubsequentMinSetting() != getNonTimeAxisSubsequentMinSetting()) return false; if (settings.getNonTimeMaxPadding() != getNonTimeMaxPadding()) return false; if (settings.getNonTimeMinPadding() != getNonTimeMinPadding()) return false; if (!settings.getPlotLineConnectionType().equals(getPlotLineConnectionType())) return false; if (!settings.getTimeAxisSubsequentSetting().equals(getTimeAxisSubsequentSetting())) return false; if (settings.getTimePadding() != getTimePadding()) return false; if (settings.getXAxisMaximumLocation() != getXAxisMaximumLocation()) return false; if (settings.getYAxisMaximumLocation() != getYAxisMaximumLocation()) return false; if (settings.getPlotLineDraw().drawLine() != getPlotLineDraw().drawLine()) return false; if (settings.getPlotLineDraw().drawMarkers() != getPlotLineDraw().drawMarkers()) return false; return true; } 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 { @Override public boolean plotMatchesSetting(PlotConfiguration settings) { if (settings.getOrdinalPositionForStackedPlots() != this.getOrdinalPositionForStackedPlots()) return false; if (settings.getPinTimeAxis() != getPinTimeAxis()) return false; if (settings.getAxisOrientationSetting() != this.getAxisOrientationSetting()) return false; if (settings.getMaxDependent() != getMaxDependent()) return false; if (settings.getMaxNonTime() != getMaxNonTime()) return false; if (settings.getMaxTime() != getMaxTime()) return false; if (settings.getMinDependent() != getMinDependent()) return false; if (settings.getMinNonTime() != getMinNonTime()) return false; if (settings.getMinTime() != getMinTime()) return false; if (settings.getNonTimeAxisSubsequentMaxSetting() != getNonTimeAxisSubsequentMaxSetting()) return false; if (settings.getNonTimeAxisSubsequentMinSetting() != getNonTimeAxisSubsequentMinSetting()) return false; if (settings.getNonTimeMaxPadding() != getNonTimeMaxPadding()) return false; if (settings.getNonTimeMinPadding() != getNonTimeMinPadding()) return false; if (!settings.getPlotLineConnectionType().equals(getPlotLineConnectionType())) return false; if (!settings.getTimeAxisSubsequentSetting().equals(getTimeAxisSubsequentSetting())) return false; if (settings.getTimePadding() != getTimePadding()) return false; if (settings.getXAxisMaximumLocation() != getXAxisMaximumLocation()) return false; if (settings.getYAxisMaximumLocation() != getYAxisMaximumLocation()) return false; if (settings.getPlotLineDraw().drawLine() != getPlotLineDraw().drawLine()) return false; if (settings.getPlotLineDraw().drawMarkers() != getPlotLineDraw().drawMarkers()) return false; return true; } 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; }