There are 13 code examples for javax.swing.event.EventListenerList.
The API names are highlighted below.
You can use
button
to vote the code example(s) you like. The best code example will be ranked first next time. Thanks a lot for your feedback.
Project Name: jFreeChart Package: org.jfree.chart
Source Code: JFreeChart.java (Click to view .java file)
Method Code:
/**
* Clones the object, and takes care of listeners.
* Note: caller shall register its own listeners on cloned graph.
* @return A clone.
* @throws CloneNotSupportedException if the chart is not cloneable.
*/
public Object clone() throws CloneNotSupportedException {
JFreeChart chart=(JFreeChart)super.clone();
chart.renderingHints=(RenderingHints)this.renderingHints.clone();
if (this.title != null) {
chart.title=(TextTitle)this.title.clone();
chart.title.addChangeListener(chart);
}
chart.subtitles=new ArrayList();
for (int i=0; i < getSubtitleCount(); i++) {
Title subtitle=(Title)getSubtitle(i).clone();
chart.subtitles.add(subtitle);
subtitle.addChangeListener(chart);
}
if (this.plot != null) {
chart.plot=(Plot)this.plot.clone();
chart.plot.addChangeListener(chart);
}
chart.progressListeners=new EventListenerList();
chart.changeListeners=new EventListenerList();
return chart;
}
Project Name: jFreeChart Package: org.jfree.chart
Source Code: ChartPanel.java (Click to view .java file)
Method Code:
/**
* Provides serialization support.
* @param stream the input stream.
* @throws IOException if there is an I/O error.
* @throws ClassNotFoundException if there is a classpath problem.
*/
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.zoomFillPaint=SerialUtilities.readPaint(stream);
this.zoomOutlinePaint=SerialUtilities.readPaint(stream);
this.chartMouseListeners=new EventListenerList();
if (this.chart != null) {
this.chart.addChangeListener(this);
}
}
Project Name: jFreeChart Package: org.jfree.chart.annotations
Source Code: AbstractAnnotation.java (Click to view .java file)
Method Code:
/**
* Restores a serialized object.
* @param stream the input stream.
* @throws IOException if there is an I/O problem.
* @throws ClassNotFoundException if there is a problem loading a class.
*/
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.listenerList=new EventListenerList();
}
Project Name: jFreeChart Package: org.jfree.chart.axis
Source Code: Axis.java (Click to view .java file)
Method Code:
/**
* Provides serialization support.
* @param stream the input stream.
* @throws IOException if there is an I/O error.
* @throws ClassNotFoundException if there is a classpath problem.
*/
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.labelPaint=SerialUtilities.readPaint(stream);
this.tickLabelPaint=SerialUtilities.readPaint(stream);
this.axisLineStroke=SerialUtilities.readStroke(stream);
this.axisLinePaint=SerialUtilities.readPaint(stream);
this.tickMarkStroke=SerialUtilities.readStroke(stream);
this.tickMarkPaint=SerialUtilities.readPaint(stream);
this.listenerList=new EventListenerList();
}
Project Name: jFreeChart Package: org.jfree.chart.panel
Source Code: AbstractOverlay.java (Click to view .java file)
Method Code:
/**
* Sends a {@link ChartChangeEvent} to all registered listeners.
* @param event information about the event that triggered the
* notification.
*/
protected void notifyListeners(OverlayChangeEvent event){
Object[] listeners=this.changeListeners.getListenerList();
for (int i=listeners.length - 2; i >= 0; i-=2) {
if (listeners[i] == OverlayChangeListener.class) {
((OverlayChangeListener)listeners[i + 1]).overlayChanged(event);
}
}
}
Project Name: jFreeChart Package: org.jfree.chart.plot
Source Code: Plot.java (Click to view .java file)
Method Code:
/**
* Provides serialization support.
* @param stream the input stream.
* @throws IOException if there is an I/O error.
* @throws ClassNotFoundException if there is a classpath problem.
*/
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.noDataMessagePaint=SerialUtilities.readPaint(stream);
this.outlineStroke=SerialUtilities.readStroke(stream);
this.outlinePaint=SerialUtilities.readPaint(stream);
this.backgroundPaint=SerialUtilities.readPaint(stream);
this.listenerList=new EventListenerList();
}
Project Name: jFreeChart Package: org.jfree.chart.plot
Source Code: Marker.java (Click to view .java file)
Method Code:
/**
* Provides serialization support.
* @param stream the input stream.
* @throws IOException if there is an I/O error.
* @throws ClassNotFoundException if there is a classpath problem.
*/
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.paint=SerialUtilities.readPaint(stream);
this.stroke=SerialUtilities.readStroke(stream);
this.outlinePaint=SerialUtilities.readPaint(stream);
this.outlineStroke=SerialUtilities.readStroke(stream);
this.labelPaint=SerialUtilities.readPaint(stream);
this.listenerList=new EventListenerList();
}
Project Name: jFreeChart Package: org.jfree.chart.plot.dial
Source Code: AbstractDialLayer.java (Click to view .java file)
Method Code:
/**
* Provides serialization support.
* @param stream the input stream.
* @throws IOException if there is an I/O error.
* @throws ClassNotFoundException if there is a classpath problem.
*/
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.listenerList=new EventListenerList();
}
Project Name: jFreeChart Package: org.jfree.chart.renderer
Source Code: AbstractRenderer.java (Click to view .java file)
Method Code:
/**
* Provides serialization support.
* @param stream the input stream.
* @throws IOException if there is an I/O error.
* @throws ClassNotFoundException if there is a classpath problem.
*/
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.paint=SerialUtilities.readPaint(stream);
this.basePaint=SerialUtilities.readPaint(stream);
this.fillPaint=SerialUtilities.readPaint(stream);
this.baseFillPaint=SerialUtilities.readPaint(stream);
this.outlinePaint=SerialUtilities.readPaint(stream);
this.baseOutlinePaint=SerialUtilities.readPaint(stream);
this.stroke=SerialUtilities.readStroke(stream);
this.baseStroke=SerialUtilities.readStroke(stream);
this.outlineStroke=SerialUtilities.readStroke(stream);
this.baseOutlineStroke=SerialUtilities.readStroke(stream);
this.shape=SerialUtilities.readShape(stream);
this.baseShape=SerialUtilities.readShape(stream);
this.itemLabelPaint=SerialUtilities.readPaint(stream);
this.baseItemLabelPaint=SerialUtilities.readPaint(stream);
this.baseLegendShape=SerialUtilities.readShape(stream);
this.baseLegendTextPaint=SerialUtilities.readPaint(stream);
this.listenerList=new EventListenerList();
}
Project Name: jFreeChart Package: org.jfree.chart.title
Source Code: Title.java (Click to view .java file)
Method Code:
/**
* Provides serialization support.
* @param stream the input stream.
* @throws IOException if there is an I/O error.
* @throws ClassNotFoundException if there is a classpath problem.
*/
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.listenerList=new EventListenerList();
}
Project Name: jFreeChart Package: org.jfree.data.general
Source Code: AbstractDataset.java (Click to view .java file)
Method Code:
/**
* Restores a serialized object.
* @param stream the input stream.
* @throws IOException if there is an I/O problem.
* @throws ClassNotFoundException if there is a problem loading a class.
*/
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
stream.defaultReadObject();
this.listenerList=new EventListenerList();
stream.registerValidation(this,10);
}
Project Name: jFreeChart Package: org.jfree.data.general
Source Code: Series.java (Click to view .java file)
Method Code:
/**
* Sends a change event to all registered listeners.
* @param event contains information about the event that triggered the
* notification.
*/
protected void notifyListeners(SeriesChangeEvent event){
Object[] listenerList=this.listeners.getListenerList();
for (int i=listenerList.length - 2; i >= 0; i-=2) {
if (listenerList[i] == SeriesChangeListener.class) {
((SeriesChangeListener)listenerList[i + 1]).seriesChanged(event);
}
}
}
Project Name: vfsjfilechooser Package: net.sf.vfsjfilechooser
Source Code: VFSJFileChooser.java (Click to view .java file)
Method Code:
/**
* Notifies all listeners that have registered interest for
* notification on this event type. The event instance
* is lazily created using the <code>command</code> parameter.
* @see EventListenerList
*/
protected void fireActionPerformed(String command){
Object[] listeners=listenerList.getListenerList();
long mostRecentEventTime=EventQueue.getMostRecentEventTime();
int modifiers=0;
AWTEvent currentEvent=EventQueue.getCurrentEvent();
if (currentEvent instanceof InputEvent) {
modifiers=((InputEvent)currentEvent).getModifiers();
}
else if (currentEvent instanceof ActionEvent) {
modifiers=((ActionEvent)currentEvent).getModifiers();
}
ActionEvent e=null;
for (int i=listeners.length - 2; i >= 0; i-=2) {
if (listeners[i] == ActionListener.class) {
if (e == null) {
e=new ActionEvent(this,ActionEvent.ACTION_PERFORMED,command,mostRecentEventTime,modifiers);
}
((ActionListener)listeners[i + 1]).actionPerformed(e);
}
}
}