| Line | Hits | Source |
|---|---|---|
| 1 | /* | |
| 2 | * Copyright (c) 2005, the JUNG Project and the Regents of the University of | |
| 3 | * California All rights reserved. | |
| 4 | * | |
| 5 | * This software is open-source under the BSD license; see either "license.txt" | |
| 6 | * or http://jung.sourceforge.net/license.txt for a description. | |
| 7 | * | |
| 8 | * | |
| 9 | * Created on Apr 2, 2005 | |
| 10 | */ | |
| 11 | package edu.uci.ics.jung.visualization; | |
| 12 | ||
| 13 | import java.awt.event.ItemEvent; | |
| 14 | import java.awt.event.ItemListener; | |
| 15 | ||
| 16 | import javax.swing.event.EventListenerList; | |
| 17 | ||
| 18 | /** | |
| 19 | * An abstract class to support ItemEvents for PickedState | |
| 20 | * | |
| 21 | * @author Tom Nelson | |
| 22 | */ | |
| 23 | 0 | public abstract class AbstractPickedState implements PickedState { |
| 24 | ||
| 25 | 0 | protected EventListenerList listenerList = new EventListenerList(); |
| 26 | ||
| 27 | public void addItemListener(ItemListener l) { | |
| 28 | 0 | listenerList.add(ItemListener.class, l); |
| 29 | ||
| 30 | 0 | } |
| 31 | ||
| 32 | public void removeItemListener(ItemListener l) { | |
| 33 | 0 | listenerList.remove(ItemListener.class, l); |
| 34 | 0 | } |
| 35 | ||
| 36 | protected void fireItemStateChanged(ItemEvent e) { | |
| 37 | 0 | Object[] listeners = listenerList.getListenerList(); |
| 38 | 0 | for ( int i = listeners.length-2; i>=0; i-=2 ) { |
| 39 | 0 | if ( listeners[i]==ItemListener.class ) { |
| 40 | 0 | ((ItemListener)listeners[i+1]).itemStateChanged(e); |
| 41 | } | |
| 42 | } | |
| 43 | 0 | } |
| 44 | } |
|
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |