/** * Checks the current, previous, and next interval for consistency; and updates the intervals if * necessary. */ public void updateInterval() { IntervalItemPanel prev = m_parent.getPrevious(this); IntervalItemPanel next = m_parent.getNext(this); if (prev == null && next == null) { this.setLeftValue(null); this.setRightValue(null); this.setLeftOpen(true); this.setRightOpen(true); } else { repairPrev(getLeftValue(true)); repairNext(getRightValue(true)); } myRepaint(); }
private void repairPrev(final double value) { IntervalItemPanel prev = m_parent.getPrevious(this); if (prev != null) { if (prev.getRightValue(false) != value) { prev.setRightValue(value); if (prev.getLeftValue(false) > value) { prev.setLeftValue(value); } } if (prev.isRightOpen() == isLeftOpen()) { prev.setRightOpen(!isLeftOpen()); } } else { setLeftValue(null); setLeftOpen(true); } }