Package diva.util

Examples of diva.util.Filter


     */
    public Iterator intersectingNodes(Rectangle2D r) {
        final GraphModel model = _controller.getGraphModel();
        ZList zlist = getGraphicsPane().getForegroundLayer().getFigures();
        Iterator i = zlist.getIntersectedFigures(r).figuresFromFront();
        Iterator j = new FilteredIterator(i, new Filter() {
            public boolean accept(Object o) {
                Figure f = (Figure) o;
                return (model.isNode(f.getUserObject()));
            }
        });
View Full Code Here


     * intersect the given rectangle.
     */
    public Iterator intersectingEdges(Rectangle2D r) {
        ZList zlist = getGraphicsPane().getForegroundLayer().getFigures();
        Iterator i = zlist.getIntersectedFigures(r).figuresFromFront();
        Iterator j = new FilteredIterator(i, new Filter() {
            public boolean accept(Object o) {
                return (o instanceof Connector);
            }
        });
        return new ProxyIterator(j) {
View Full Code Here

     * have the given element type.
     *
     *  @return an Iterator of XmlElements
     */
    public Iterator elements(final String type) {
        return new FilteredIterator(elements(), new Filter() {
            public boolean accept(Object o) {
                return ((XmlElement) o)._type.equals(type);
            }
        });
    }
View Full Code Here

     * Return the first child element of this element with the given type,
     * or null if there isn't one.
     */
    public XmlElement getElement(final String type) {
        return (XmlElement) IteratorUtilities.firstMatch(elements(),
                new Filter() {
                    public boolean accept(Object o) {
                        return ((XmlElement) o)._type.equals(type);
                    }
                });
    }
View Full Code Here

     * Return the first child element of this element with the given type
     * and name, or null if there isn't one.
     */
    public XmlElement getElement(final String type, final String name) {
        return (XmlElement) IteratorUtilities.firstMatch(elements(),
                new Filter() {
                    public boolean accept(Object o) {
                        XmlElement elt = (XmlElement) o;
                        return elt._type.equals(type)
                                && elt.getAttribute("name").equals(name);
                    }
View Full Code Here

        // inexplicable reason, are rendered in two different places!
        // The filter for the layout algorithm of the ports within this
        // entity. This returns true only if the candidate object is
        // an instance of Locatable and the semantic object associated
        // with it is an instance of Entity.
        Filter portFilter = new Filter() {
            public boolean accept(Object candidate) {
                GraphModel model = getController().getGraphModel();
                Object semanticObject = model.getSemanticObject(candidate);

                if (candidate instanceof Locatable
View Full Code Here

        // inexplicable reason, are rendered in two different places!
        // The filter for the layout algorithm of the ports within this
        // entity. This returns true only if the candidate object is
        // an instance of Locatable and the semantic object associated
        // with it is an instance of Entity.
        Filter portFilter = new Filter() {
            public boolean accept(Object candidate) {
                GraphModel model = getController().getGraphModel();
                Object semanticObject = model.getSemanticObject(candidate);

                if (candidate instanceof Locatable
View Full Code Here

     * @return An iterator over the hit figures.
     */
    public static Iterator pickIter(Iterator i, Rectangle2D region) {
        final Rectangle2D rl = region;

        return new FilteredIterator(i, new Filter() {
            Rectangle2D _region = rl;

            public boolean accept(Object o) {
                Figure f = (Figure) o;
                return f.hit(_region);
View Full Code Here

     *  point in the transform context of that container.
     */
    public void snapToSite(final FigureContainer container,
            final Rectangle2D hitRect) {
        //debug("SNAPPING TO SITE IN: " + container);
        Figure figure = container.pick(hitRect, new Filter() {
            public boolean accept(Object o) {
                // debug("checking = " + o);
                if (!(o instanceof Figure)) {
                    return false;
                }
View Full Code Here

TOP

Related Classes of diva.util.Filter

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.