use of com.tagtraum.perf.gcviewer.view.ModelChartImpl in project GCViewer by chewiebug.
the class GCDocumentController method addGCResource.
public void addGCResource(GCModelLoader loader, ViewMenuController viewMenuController) {
ChartPanelView chartPanelView = new ChartPanelView(gcDocument.getPreferences(), loader.getGcResource());
((ModelChartImpl) chartPanelView.getModelChart()).addPropertyChangeListener(viewMenuController);
((ModelChartImpl) chartPanelView.getModelChart()).addTimeOffsetChangeListener(new TimeOffsetPanelController(gcDocument));
gcDocument.addChartPanelView(chartPanelView);
loader.addPropertyChangeListener(this);
loader.addPropertyChangeListener(chartPanelView.getModelLoaderView());
}
use of com.tagtraum.perf.gcviewer.view.ModelChartImpl in project GCViewer by chewiebug.
the class ModelChartImplTest method shouldShowOrNotDateStampAccordingToModelAndSettings.
@Theory
public void shouldShowOrNotDateStampAccordingToModelAndSettings(TestCase testCase) throws Exception {
//given
ModelChartImpl modelChart = new ModelChartImpl();
GCPreferences preferences = new GCPreferences();
GCModel gcModel = Mockito.mock(GCModel.class);
Mockito.when(gcModel.hasDateStamp()).thenReturn(testCase.hasDateStamp());
Mockito.when(gcModel.getFirstDateStamp()).thenReturn(ZonedDateTime.now());
Mockito.when(gcModel.getPause()).thenReturn(new DoubleData());
preferences.setShowDateStamp(testCase.isShowDateStamp());
//when
modelChart.setModel(gcModel, preferences);
//then
assertThat(modelChart.isShowDateStamp(), equalTo(testCase.isExpectedShowDateStamp()));
}
Aggregations