
org.eclipse.draw2d.ExclusionSearch Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of draw2d-rwt Show documentation
Show all versions of draw2d-rwt Show documentation
NetXMS fork of Draw2D for RAP
The newest version!
/*******************************************************************************
* Copyright (c) 2000, 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.Collection;
/**
* A TreeSearch
that excludes figures contained in a
* {@link java.util.Collection}.
*
* @author hudsonr
* @since 2.1
*/
public class ExclusionSearch implements TreeSearch {
private final Collection c;
/**
* Constructs an Exclusion search using the given collection.
*
* @param collection
* the exclusion set
*/
public ExclusionSearch(Collection collection) {
this.c = collection;
}
/**
* @see org.eclipse.draw2d.TreeSearch#accept(IFigure)
*/
public boolean accept(IFigure figure) {
// Prune is called before accept, so there is no reason to check the
// collection again.
return true;
}
/**
* Returns true
if the figure is a member of the Collection.
*
* @see org.eclipse.draw2d.TreeSearch#prune(IFigure)
*/
public boolean prune(IFigure f) {
return c.contains(f);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy