예제 #1
0
 public void intervalRemoved(ListDataEvent e) {
   if (e.getIndex0() != e.getIndex1()) {
     throw new IllegalStateException(
         "Unexpected behavior from Category " + d_category + ": list removals not one-by-one.");
   }
   fireTreeNodeRemoved(d_category, e.getIndex0());
 }
예제 #2
0
 public void intervalRemoved(ListDataEvent e) {
   /* Sync the SelectionModel with the DataModel.
    */
   ListSelectionModel listSelectionModel = _list.getCheckBoxListSelectionModel();
   if (listSelectionModel != null) {
     listSelectionModel.removeIndexInterval(e.getIndex0(), e.getIndex1());
   }
 }
예제 #3
0
    public void intervalAdded(ListDataEvent e) {
      int minIndex = Math.min(e.getIndex0(), e.getIndex1());
      int maxIndex = Math.max(e.getIndex0(), e.getIndex1());

      /* Sync the SelectionModel with the DataModel.
       */

      ListSelectionModel listSelectionModel = _list.getCheckBoxListSelectionModel();
      if (listSelectionModel != null) {
        listSelectionModel.insertIndexInterval(minIndex, maxIndex - minIndex + 1, true);
      }
    }
예제 #4
0
  /**
   * Sent when the contents of the list has changed in a way that's too complex to characterize with
   * the previous methods. Index0 and index1 bracket the change.
   *
   * @param e a ListDataEvent encapuslating the event information
   */
  public void contentsChanged(ListDataEvent e) {
    if (e.getSource() != list_model) {
      return;
    }
    System.out.println("Debug: CustomTableModel: ListDataEvent received");

    syncData();
  }
예제 #5
0
    public void contentsChanged(ListDataEvent evt) {

      /* Contrary to API documentation, this is called when the selection
       * on a ComboBoxModel is changed. */
      if (evt.getSource() == colChooser_) {
        Object item = colChooser_.getSelectedItem();
        if (item instanceof ColumnData) {
          columnSelected((ColumnData) item);
        }
      } else if (evt.getSource() == convChooser_) {
        ColumnConverter conv = (ColumnConverter) convChooser_.getSelectedItem();
        if (conv != null) {
          converterSelected(conv);
        }
      } else {
        assert false;
      }
    }
예제 #6
0
 /**
  * Notifies all the {@link ListDataListener} that the data changed
  *
  * @param event
  */
 private void notifyListeners(ListDataEvent event) {
   switch (event.getType()) {
     case ListDataEvent.CONTENTS_CHANGED:
       for (ListDataListener listener : dataListeners) {
         listener.contentsChanged(event);
       }
     case ListDataEvent.INTERVAL_ADDED:
       for (ListDataListener listener : dataListeners) {
         listener.intervalAdded(event);
       }
     case ListDataEvent.INTERVAL_REMOVED:
       for (ListDataListener listener : dataListeners) {
         listener.intervalRemoved(event);
       }
   }
 }
예제 #7
0
  private void fireListEvent(ListDataEvent lde) {
    if (listeners == null) {
      return;
    }

    for (Iterator it = listeners.iterator(); it.hasNext(); ) {
      ListDataListener listener = (ListDataListener) it.next();

      switch (lde.getType()) {
        case ListDataEvent.INTERVAL_ADDED:
          listener.intervalAdded(lde);
          break;
        case ListDataEvent.INTERVAL_REMOVED:
          listener.intervalRemoved(lde);
          break;
        case ListDataEvent.CONTENTS_CHANGED:
          listener.contentsChanged(lde);
          break;
      }
    }
  }
예제 #8
0
 public void intervalRemoved(ListDataEvent e) {
   dataChanged((ListModel) e.getSource());
 }
예제 #9
0
 public void contentsChanged(ListDataEvent e) {
   dataChanged((ListModel) e.getSource());
 }
예제 #10
0
 public void intervalRemoved(ListDataEvent e) {
   log.append("intervalRemoved: " + e.getIndex0() + ", " + e.getIndex1() + newline);
   log.setCaretPosition(log.getDocument().getLength());
 }
예제 #11
0
 public void contentsChanged(ListDataEvent e) {
   log.append("contentsChanged: " + e.getIndex0() + ", " + e.getIndex1() + newline);
   log.setCaretPosition(log.getDocument().getLength());
 }
 @Override
 public void contentsChanged(ListDataEvent e) {
   fireContentsChanged(this, e.getIndex0(), e.getIndex1());
 }
 @Override
 public void intervalRemoved(ListDataEvent e) {
   fireIntervalRemoved(this, e.getIndex0(), e.getIndex1());
 }
 private static void assertEvent(
     String description, int eventType, int index0, int index1, ListDataEvent event) {
   assertEquals("Type: " + description, eventType, event.getType());
   assertEquals("Index0: " + description, index0, event.getIndex0());
   assertEquals("Index1: " + description, index1, event.getIndex1());
 }
 public void intervalAdded(ListDataEvent e) {
   fireIntervalAdded(this, e.getIndex0(), e.getIndex1());
 }