Package javax.swing.event

Examples of javax.swing.event.ListSelectionEvent


        listenerList.remove(ListSelectionListener.class, l);
    }
    protected void fireListSelectionEvent(boolean isAdjusting) {
        EventListener[] listeners = listenerList.getListeners(ListSelectionListener.class);
        if (listeners != null && listeners.length > 0) {
            ListSelectionEvent event = new ListSelectionEvent(this, -1, -1, isAdjusting);
            for (int i = 0; i < listeners.length; i++) {
                ((ListSelectionListener) listeners[i]).valueChanged(event);
            }
        }
    }
View Full Code Here


        this.additionalText1.setBackground(new Color(230, 230, 230));
        this.additionalText2.setBackground(new Color(230, 230, 230));
        this.additionalCheck1.setSelected(true);
        this.additionalCheck2.setSelected(false);
        this.list.ensureIndexIsVisible(this.list.getSelectedIndex());
        this.valueChanged(new ListSelectionEvent(
                this.list,
                this.list.getSelectedIndex(),
                this.list.getSelectedIndex(),
                true));
    }
View Full Code Here

    }

    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

    }
    protected void fireSelectionValueChanged(int firstIndex, int lastIndex,
            boolean isAdjusting)
    {
        Object[] listeners = listenerList.getListenerList();
        ListSelectionEvent e = null;

        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == ListSelectionListener.class) {
                if (e == null) {
                    e = new ListSelectionEvent(this, firstIndex, lastIndex,
                            isAdjusting);
                }
                ((ListSelectionListener)listeners[i+1]).valueChanged(e);
            }
        }
View Full Code Here

    }
    protected void fireSelectionValueChanged(int firstIndex, int lastIndex,
            boolean isAdjusting)
    {
        Object[] listeners = listenerList.getListenerList();
        ListSelectionEvent e = null;

        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == ListSelectionListener.class) {
                if (e == null) {
                    e = new ListSelectionEvent(this, firstIndex, lastIndex,
                            isAdjusting);
                }
                ((ListSelectionListener)listeners[i+1]).valueChanged(e);
            }
        }
View Full Code Here

     * @see EventListenerList
     */
    private void fireValueChanged(int firstIndex, int lastIndex,
            boolean isAdjusting) {
        Object[] listeners = listenerList.getListenerList();
        ListSelectionEvent e = null;
        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == ListSelectionListener.class) {
                if (e == null) {
                    e = new ListSelectionEvent(this, firstIndex, lastIndex,
                            isAdjusting);
                }
                ((ListSelectionListener) listeners[i + 1]).valueChanged(e);
            }
        }
View Full Code Here

     * @see EventListenerList
     */
    private void fireValueChanged(int firstIndex, int lastIndex,
            boolean isAdjusting) {
        Object[] listeners = listenerList.getListenerList();
        ListSelectionEvent e = null;
        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == ListSelectionListener.class) {
                if (e == null) {
                    e = new ListSelectionEvent(this, firstIndex, lastIndex,
                            isAdjusting);
                }
                ((ListSelectionListener) listeners[i + 1]).valueChanged(e);
            }
        }
View Full Code Here

    }
    protected void fireSelectionValueChanged(int firstIndex, int lastIndex,
            boolean isAdjusting)
    {
        Object[] listeners = listenerList.getListenerList();
        ListSelectionEvent e = null;

        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == ListSelectionListener.class) {
                if (e == null) {
                    e = new ListSelectionEvent(this, firstIndex, lastIndex,
                            isAdjusting);
                }
                ((ListSelectionListener)listeners[i+1]).valueChanged(e);
            }
        }
View Full Code Here

     * @see EventListenerList
     */
    private void fireValueChanged(int firstIndex, int lastIndex,
            boolean isAdjusting) {
        Object[] listeners = listenerList.getListenerList();
        ListSelectionEvent e = null;
        for (int i = listeners.length - 2; i >= 0; i -= 2) {
            if (listeners[i] == ListSelectionListener.class) {
                if (e == null) {
                    e = new ListSelectionEvent(this, firstIndex, lastIndex,
                            isAdjusting);
                }
                ((ListSelectionListener) listeners[i + 1]).valueChanged(e);
            }
        }
View Full Code Here

        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

TOP

Related Classes of javax.swing.event.ListSelectionEvent

Copyright © 2018 www.massapicom. 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.