Examples of ListSelectionEvent


Examples of javax.swing.event.ListSelectionEvent

        assertEquals(TestTableColumnModelListener.SELECTION_CHANGED, listener.getEventType());
        assertEquals(model.getSelectionModel(), listener.getEvent().getSource());
        assertEquals(1, ((ListSelectionEvent) listener.getEvent()).getFirstIndex());
        assertEquals(2, ((ListSelectionEvent) listener.getEvent()).getLastIndex());
        listener.reset();
        ListSelectionEvent event = new ListSelectionEvent("source", 4, 7, true);
        model.valueChanged(event);
        assertTrue(listener.eventOccured());
        assertEquals(TestTableColumnModelListener.SELECTION_CHANGED, listener.getEventType());
        assertEquals("source", listener.getEvent().getSource());
        assertEquals(4, ((ListSelectionEvent) listener.getEvent()).getFirstIndex());
View Full Code Here

Examples of javax.swing.event.ListSelectionEvent

        assertEquals(TestTableColumnModelListener.SELECTION_CHANGED, listener.getEventType());
        assertEquals(model.getSelectionModel(), listener.getEvent().getSource());
        assertEquals(1, ((ListSelectionEvent) listener.getEvent()).getFirstIndex());
        assertEquals(2, ((ListSelectionEvent) listener.getEvent()).getLastIndex());
        listener.reset();
        ListSelectionEvent event = new ListSelectionEvent("source", 4, 7, true);
        model.valueChanged(event);
        assertTrue(listener.eventOccured());
        assertEquals(TestTableColumnModelListener.SELECTION_CHANGED, listener.getEventType());
        assertEquals("source", listener.getEvent().getSource());
        assertEquals(4, ((ListSelectionEvent) listener.getEvent()).getFirstIndex());
View Full Code Here

Examples of javax.swing.event.ListSelectionEvent

    selectListeners.remove(listener);
  }

  protected void notifySelection(int index) {
    if (selectListeners.size() > 0) {
      ListSelectionEvent e = new ListSelectionEvent(this, index, index, false);
      for (int i=0; i<selectListeners.size(); i++)
        ((ListSelectionListener)selectListeners.get(i)).valueChanged(e);
    }
  }
View Full Code Here

Examples of javax.swing.event.ListSelectionEvent

    protected void fireValueChanged(int firstIndex, int lastIndex) {
        fireValueChanged(firstIndex, lastIndex, getValueIsAdjusting());
    }

    protected void fireValueChanged(int firstIndex, int lastIndex, boolean isAdjusting) {
        fireListSelectionEvent(new ListSelectionEvent(this, firstIndex, lastIndex, isAdjusting));
    }
View Full Code Here

Examples of javax.swing.event.ListSelectionEvent

    protected ListSelectionModel createSelectionModel() {
        return new DefaultListSelectionModel();
    }

    protected void fireSelectionValueChanged(final int firstIndex, final int lastIndex, final boolean isAdjusting) {
        ListSelectionEvent event = new ListSelectionEvent(this, firstIndex, lastIndex, isAdjusting);
        ListSelectionListener[] listeners = getListSelectionListeners();
        for (int i = 0; i < listeners.length; i++) {
            listeners[i].valueChanged(event);
        }
    }
View Full Code Here

Examples of javax.swing.event.ListSelectionEvent

    protected ListSelectionModel createSelectionModel() {
        return new DefaultListSelectionModel();
    }

    protected void fireSelectionValueChanged(final int firstIndex, final int lastIndex, final boolean isAdjusting) {
        ListSelectionEvent event = new ListSelectionEvent(this, firstIndex, lastIndex, isAdjusting);
        ListSelectionListener[] listeners = getListSelectionListeners();
        for (int i = 0; i < listeners.length; i++) {
            listeners[i].valueChanged(event);
        }
    }
View Full Code Here

Examples of javax.swing.event.ListSelectionEvent

    protected ListSelectionModel createSelectionModel() {
        return new DefaultListSelectionModel();
    }

    protected void fireSelectionValueChanged(final int firstIndex, final int lastIndex, final boolean isAdjusting) {
        ListSelectionEvent event = new ListSelectionEvent(this, firstIndex, lastIndex, isAdjusting);
        ListSelectionListener[] listeners = getListSelectionListeners();
        for (int i = 0; i < listeners.length; i++) {
            listeners[i].valueChanged(event);
        }
    }
View Full Code Here

Examples of javax.swing.event.ListSelectionEvent

    }

    private void checkSingleEvent(final TestListener listener, final int beginIndex,
            final int endIndex, final boolean isAdjusting) {
        assertEquals(1, listener.getEvents().size());
        ListSelectionEvent event = listener.getEvents().get(0);
        assertEquals(model, event.getSource());
        assertEquals(beginIndex, event.getFirstIndex());
        assertEquals(endIndex, event.getLastIndex());
        assertEquals(isAdjusting, event.getValueIsAdjusting());
    }
View Full Code Here

Examples of javax.swing.event.ListSelectionEvent

      this.selectionModel.removeListSelectionListener(this);
    }
    Object old = this.selectionModel;
    this.selectionModel = selectionModel;
    this.selectionModel.addListSelectionListener(this);
    valueChanged(new ListSelectionEvent(selectionModel, 0, boxes.size(), false));
    firePropertyChange("selectionModel", old, selectionModel);
  }
View Full Code Here

Examples of javax.swing.event.ListSelectionEvent

      this.view = view;
    }

    @Override
    public void valueChanged(ListSelectionEvent e) {
      ListSelectionEvent selEv =
          new ListSelectionEvent(view, e.getFirstIndex(), e.getLastIndex(),
              e.getValueIsAdjusting());
      for (ListSelectionListener listener : listeners) {
        listener.valueChanged(selEv);
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.