コード例 #1
0
 /**
  * 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();
 }
コード例 #2
0
 private void repairNext(final double value) {
   IntervalItemPanel next = m_parent.getNext(this);
   if (next != null) {
     if (next.getLeftValue(false) != value) {
       next.setLeftValue(value);
       if (next.getRightValue(false) < value) {
         next.setRightValue(value);
       }
     }
     if (next.isLeftOpen() == isRightOpen()) {
       next.setLeftOpen(!isRightOpen());
     }
   } else {
     setRightValue(null);
     setRightOpen(true);
   }
 }