Package java.util

Examples of java.util.LinkedList


     *        entries into this collection.
     * @return a List of description Strings for the given list of
     *         names.
     */
    public List composeDescription(List list) {
        LinkedList ll = new LinkedList();

        Iterator it = list.iterator();
        while (it.hasNext()) {
            Object obj = it.next();
            if (obj instanceof String) {
                String des = getDescription((String) obj);
                if (des != null) {
                    ll.add(des);
                }
            }
        }
        return ll;
    }
View Full Code Here


    /**
     * Get the List of IconPartCollections that have been added.
     */
    protected List getCollections() {
        if (collections == null) {
            collections = new LinkedList();
        }
        return collections;
    }
View Full Code Here

        setGraphic(oml);
    }

    public List getEditables() {
        if (editables == null) {
            editables = new LinkedList();
        }
        return editables;
    }
View Full Code Here

            }

            // The ordered list is for temporarily holding points for
            // the current segment as they are placed in the right
            // order.
            LinkedList orderedList = new LinkedList();
            // Everything in the lastSegmentCrossingList has already
            // be ordered relative to what's already been searched, so
            // we can just add them now to place the new points around
            // them accordingly. Also, the lastSegmentCrossingList
            // holds BoundaryCrossing objects, and the collection
            // passed into this function doesn't have those yet.
            orderedList.addAll(lastSegmentCrossingList);
            // Clear out the lastSegmetnCrossingList, we'll replenish
            // it with the ordered list at the end, so it will be
            // ready for the next cycle.
            lastSegmentCrossingList.clear();

            for (Iterator it = c.iterator(); it.hasNext();) {
                Geo current = (Geo) it.next();
                double curDist = start.distance(current);
                // We just assume that crossing point is going into
                // the current region, we'll check later to make sure.
                BoundaryCrossing currentBC = new BoundaryCrossing(current, region, true);

                int lastCheckedIndex = 0;
                BoundaryCrossing lastChecked = null;

                for (Iterator it2 = orderedList.iterator(); it2.hasNext(); lastCheckedIndex++) {
                    lastChecked = (BoundaryCrossing) it2.next();
                    if (curDist < start.distance(lastChecked.geo)) {
                        break;
                    } else {
                        lastChecked = null;
                    }
                }

                if (lastChecked != null) {
                    orderedList.add(lastCheckedIndex, currentBC);
                } else {
                    orderedList.add(currentBC);
                }
            }

            boolean goinin = !Intersection.isPointInPolygon(start,
                    region.getPoints());
            for (Iterator it = orderedList.iterator(); it.hasNext();) {
                BoundaryCrossing bc = (BoundaryCrossing) it.next();

                boolean sameRegion = (bc.in == region);

                if (sameRegion) {
View Full Code Here

    /**
     * Create an empty MenuList.
     */
    public MenuList() {
        menus = new LinkedList();
    }
View Full Code Here

        if (Debug.debugging("layerspanel")) {
            Debug.output("LayersPanel.setLayers() with " + layers.length
                    + " layers.");
        }

        LinkedList panes = getPanes();
        int separatorOffset = 0;
        if (backgroundLayerSeparator != null
                && panes.contains(backgroundLayerSeparator)) {
            separatorOffset = 1;
        }

        if (panes.size() - separatorOffset != layers.length) {
            // if the panel hasn't been created yet, or if someone has
            // changed the layers on us, rebuild the panel.
            createPanel(layers);
            return;
        }

        int i = 0;
        Iterator it = panes.iterator();
        while (it.hasNext() && i < layers.length) {
            LayerPane pane = (LayerPane) it.next();

            if (pane == backgroundLayerSeparator) {
                continue;
View Full Code Here

            } else {
                // If we haven't seen the LayerHandler yet, add the
                // PlugInLayer to a list that we can use later when
                // the LayerHandler is found.
                if (orphanGraphicLoaderPlugIns == null) {
                    orphanGraphicLoaderPlugIns = new LinkedList();
                }
                orphanGraphicLoaderPlugIns.add(pl);
            }
        }
    }
View Full Code Here

        // wanted.
    }

    protected LinkedList getPanes() {
        if (panes == null) {
            panes = new LinkedList();
        }
        return panes;
    }
View Full Code Here

        if (bg == null) {
            bg = new ButtonGroup();
        }

        LinkedList panes = new LinkedList();
        LinkedList backgroundPanes = new LinkedList();

        // populate the arrays of CheckBoxes and strings used to fill
        // the JPanel for the panes
        for (int i = 0; i < layers.length; i++) {
            Layer layer = layers[i];
            if (layer == null) {
                Debug.output("LayersPanel caught null layer, " + i + " out of "
                        + layers.length);
                continue;
            }

            LayerPane lpane = (LayerPane) paneLookUp.get(layer);

            if (lpane == null) {
                if (Debug.debugging("layercontrol")) {
                    Debug.output("LayersPanel: Creating LayerPane for "
                            + layer.getName());
                }
                lpane = createLayerPaneForLayer(layer, layerHandler, bg);
                lpane.addPropertyChangeListener(LayerSelectedCmd, this);
                lpane.addPropertyChangeListener(LayerDeselectedCmd, this);
                paneLookUp.put(layer, lpane);
            } else {
                // In case this has been modified elsewhere...
                lpane.setLayerOn(layer.isVisible());
            }

            if (layer.getAddAsBackground() && backgroundLayerSeparator != null) {
                backgroundPanes.add(lpane);
            } else {
                panes.add(lpane);

                gridbag.setConstraints(lpane, c);
                panesPanel.add(lpane);
            }
        }

        if (backgroundPanes.size() != 0) {
            if (Debug.debugging("layerspanel")) {
                Debug.output("Adding BackgroundLayerSeparator");
            }
            panes.add(backgroundLayerSeparator);
            gridbag.setConstraints(backgroundLayerSeparator, c);
            panesPanel.add(backgroundLayerSeparator);
            panes.addAll(backgroundPanes);

            Iterator it = backgroundPanes.iterator();
            while (it.hasNext()) {
                LayerPane lp = (LayerPane) it.next();
                gridbag.setConstraints(lp, c);
                panesPanel.add(lp);
            }
View Full Code Here

                System.gc();
            }
            return;
        }

        LinkedList panes = getPanes();
        int row = panes.indexOf(lp);

        boolean boundary = false;
        int bls_row = -1;
        if (backgroundLayerSeparator != null) {
            bls_row = panes.indexOf(backgroundLayerSeparator);
            boundary = bufferedBoundary;
        }

        if (command.equals(LayerTopCmd)) {
            // Move layer selected layer to top
            panes.remove(lp);
            if (boundary && bls_row > 0 && row > bls_row + 1) {
                // If the backgroundLayerSeparator is more than one
                // above it, move to just below it on the first top
                // command.
                panes.add(bls_row + 1, lp);
            } else {
                panes.addFirst(lp);
            }

            rejiggerMapLayers();
        } else if (command.equals(LayerBottomCmd)) {
            // Move layer selected layer to bottom
            panes.remove(lp);

            if (boundary && bls_row > 0 && row < bls_row - 1) {
                // If the backgroundLayerSeparator is more than one
                // below it, move to just above it on the first top
                // command.
                panes.add(bls_row - 1, lp);
            } else {
                panes.addLast(lp);
            }

            rejiggerMapLayers();
        } else if (command.equals(LayerUpCmd)) {
            // Move layer selected layer up one
            if (row <= 0)
                return;
            panes.remove(row);
            panes.add(row - 1, lp);
            rejiggerMapLayers();
        } else if (command.equals(LayerDownCmd)) {
            // Move layer selected layer up one
            if (row < 0 || row == panes.size() - 1)
                return;
            panes.remove(row);
            panes.add(row + 1, lp);
            rejiggerMapLayers();
        } else if (command.equals(LayerRemoveCmd)) {

            if (layerHandler == null || !lp.getLayer().removeConfirmed()) {
                return;
View Full Code Here

TOP

Related Classes of java.util.LinkedList

Copyright © 2015 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.