
org.eclipse.draw2d.AbstractImageFigure Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of draw2d-swt Show documentation
Show all versions of draw2d-swt Show documentation
NetXMS fork of Draw2D for SWT
The newest version!
/*******************************************************************************
* Copyright (c) 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.draw2d;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* Abstract implementation of the image figure. Implements attaching/detaching
* mechanism for ImageChangedListener
*
* @author aboyko
* @since 3.6
*/
public abstract class AbstractImageFigure extends Figure implements
IImageFigure {
private List imageListeners = new ArrayList();
public final void addImageChangedListener(ImageChangedListener listener) {
if (listener == null) {
throw new IllegalArgumentException();
}
imageListeners.add(listener);
}
public final void removeImageChangedListener(ImageChangedListener listener) {
if (listener == null) {
throw new IllegalArgumentException();
}
imageListeners.remove(listener);
}
protected final void notifyImageChanged() {
for (Iterator itr = imageListeners.iterator(); itr.hasNext();) {
((ImageChangedListener) itr.next()).imageChanged();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy