@Test public void testTimeCurrentMatchesPlot() { PlotSettingsAxisGroupTester axisGroup = new PlotSettingsAxisGroupTester(true); axisGroup.reset(settings, true); axisGroup.updateFrom(view); JLabel min = (JLabel) axisGroup.getControl(false, BoundOption.CURRENT, true); JLabel max = (JLabel) axisGroup.getControl(true , BoundOption.CURRENT, true); Assert.assertEquals(min.getText().replaceAll("[\\(\\)]", ""), "001/00:00:01 1969"); Assert.assertEquals(max.getText().replaceAll("[\\(\\)]", ""), "001/00:00:31 1969"); }
public void updateFrom(PlotViewManifestation view) { if (temporal) { minControls.updateCurrent(getActualMinimum(view)); maxControls.updateCurrent(getActualMaximum(view)); minControls.updateAuto((double) view.getCurrentMCTTime()); maxControls.updateAuto(getValue(minControls) + spanControls.getSpanValue()); if (!maxControls.auto.isSelected()) { spanControls.setSpanValue(getValue(maxControls) - getValue(minControls)); } } else { minControls.currentValue.setValue(getActualMinimum(view)); maxControls.currentValue.setValue(getActualMaximum(view)); } }
PlotSettingsAxisGroup extends PlotSettingsPanel implements ActionListener { public void updateFrom(PlotViewManifestation view) { if (temporal) { minControls.updateCurrent(getActualMinimum(view)); maxControls.updateCurrent(getActualMaximum(view)); minControls.updateAuto((double) view.getCurrentMCTTime()); maxControls.updateAuto(getValue(minControls) + spanControls.getSpanValue()); if (!maxControls.auto.isSelected()) { spanControls.setSpanValue(getValue(maxControls) - getValue(minControls)); } } else { minControls.currentValue.setValue(getActualMinimum(view)); maxControls.currentValue.setValue(getActualMaximum(view)); } } }
PlotSettingsAxisGroup extends PlotSettingsPanel implements ActionListener { public void updateFrom(PlotViewManifestation view) { if (temporal) { minControls.updateCurrent(getActualMinimum(view)); maxControls.updateCurrent(getActualMaximum(view)); minControls.updateAuto((double) view.getCurrentMCTTime()); maxControls.updateAuto(getValue(minControls) + spanControls.getSpanValue()); if (!maxControls.auto.isSelected()) { spanControls.setSpanValue(getValue(maxControls) - getValue(minControls)); } } else { minControls.currentValue.setValue(getActualMinimum(view)); maxControls.currentValue.setValue(getActualMaximum(view)); } } PlotSettingsAxisGroup(boolean temporal); }
PlotSettingsAxisGroup extends PlotSettingsPanel implements ActionListener { public void updateFrom(PlotViewManifestation view) { if (temporal) { minControls.updateCurrent(getActualMinimum(view)); maxControls.updateCurrent(getActualMaximum(view)); minControls.updateAuto((double) view.getCurrentMCTTime()); maxControls.updateAuto(getValue(minControls) + spanControls.getSpanValue()); if (!maxControls.auto.isSelected()) { spanControls.setSpanValue(getValue(maxControls) - getValue(minControls)); } } else { minControls.currentValue.setValue(getActualMinimum(view)); maxControls.currentValue.setValue(getActualMaximum(view)); } } PlotSettingsAxisGroup(boolean temporal); JPanel getMinControls(); JPanel getMaxControls(); JPanel getSpanControls(); String getMinText(); String getMaxText(); String getTitle(); void setTitle(String title); @Override void setName(String name); abstract void setBounds(PlotConfiguration settings, double min, double max); abstract double getBoundMinimum(PlotConfiguration settings); abstract double getBoundMaximum(PlotConfiguration settings); abstract double getActualMinimum(PlotViewManifestation view); abstract double getActualMaximum(PlotViewManifestation view); void updateFrom(PlotViewManifestation view); }
PlotSettingsAxisGroup extends PlotSettingsPanel implements ActionListener { public void updateFrom(PlotViewManifestation view) { if (temporal) { minControls.updateCurrent(getActualMinimum(view)); maxControls.updateCurrent(getActualMaximum(view)); minControls.updateAuto((double) view.getCurrentMCTTime()); maxControls.updateAuto(getValue(minControls) + spanControls.getSpanValue()); if (!maxControls.auto.isSelected()) { spanControls.setSpanValue(getValue(maxControls) - getValue(minControls)); } } else { minControls.currentValue.setValue(getActualMinimum(view)); maxControls.currentValue.setValue(getActualMaximum(view)); } } PlotSettingsAxisGroup(boolean temporal); JPanel getMinControls(); JPanel getMaxControls(); JPanel getSpanControls(); String getMinText(); String getMaxText(); String getTitle(); void setTitle(String title); @Override void setName(String name); abstract void setBounds(PlotConfiguration settings, double min, double max); abstract double getBoundMinimum(PlotConfiguration settings); abstract double getBoundMaximum(PlotConfiguration settings); abstract double getActualMinimum(PlotViewManifestation view); abstract double getActualMaximum(PlotViewManifestation view); void updateFrom(PlotViewManifestation view);  }