Examples of HUDComponent


Examples of org.jdesktop.wonderland.client.hud.HUDComponent

     */
    private HUDComponent createTextChatHUD() {

        // Create a new HUD Panel. It still isn't visible.
        HUD mainHUD = HUDManagerFactory.getHUDManager().getHUD("main");
        HUDComponent hudComponent = mainHUD.createComponent(chatContainerPane);
        hudComponent.setIcon(new ImageIcon(getClass().getResource(
                "/org/jdesktop/wonderland/modules/textchat/client/resources/" +
                "UserListChatText32x32.png")));
        hudComponent.setPreferredLocation(Layout.SOUTHWEST);
        mainHUD.addComponent(hudComponent);

        return hudComponent;
    }
View Full Code Here

Examples of org.jdesktop.wonderland.client.hud.HUDComponent

        for (AddHUDPanel addHUDPanel : addHUDPanelList) {
            if (addHUDPanel == this) {
                continue;
            }

            HUDComponent hudComponent = addHUDPanel.getHUDComponent();

            Point p = hudComponent.getLocation();

            //System.out.println("x " + x + " y " + y + " Location " + p + " width " + addHUDComponent.getWidth());

            if (p.getX() >= x) {
                x = (int) (p.getX() + hudComponent.getWidth());
                y = (int) p.getY();
            }
        }

        addHUDComponent.setLocation(x, y);
View Full Code Here

Examples of org.jdesktop.wonderland.client.hud.HUDComponent

                ((JToolTip) component).getTipText().isEmpty()))
        {
            return null;
        }

        HUDComponent hc = new HUDPopup2D((JComponent) component, this, x, y);
        hc.setDecoratable(false);

        hud.addComponent(hc);
        hc.setVisible(true);

        return hc;
    }
View Full Code Here

Examples of org.jdesktop.wonderland.client.hud.HUDComponent

    private SortedSet getOverlappers(HUDComponent a) {
        SortedSet overlappers = null;
        Iterator<HUDComponent> iter = hudViewMap.keySet().iterator();
        while (iter.hasNext()) {
            HUDComponent candidate = iter.next();
            if (overlaps(a, candidate)) {
                if (overlappers == null) {
                    overlappers = Collections.synchronizedSortedSet(new TreeSet(new HUDComponentComparator()));
                }
                overlappers.add(candidate);
View Full Code Here

Examples of org.jdesktop.wonderland.client.hud.HUDComponent

    public static final class HUDComponentComparator implements Comparator, Serializable {

        public int compare(Object o1, Object o2) {
            int r = 0;
            if ((o1 instanceof HUDComponent) && (o2 instanceof HUDComponent)) {
                HUDComponent c1 = (HUDComponent) o1;
                HUDComponent c2 = (HUDComponent) o2;

                if (c1.getX() < c2.getX()) {
                    r = -1;
                } else if (c1.getX() == c2.getX()) {
                    r = 0;
                } else if (c1.getX() > c2.getX()) {
                    r = 1;
                }
            } else {
                throw new ClassCastException();
            }
View Full Code Here

Examples of org.jdesktop.wonderland.client.hud.HUDComponent

            logger.finest("mouse dragged to: " + e.getPoint());
        }

        HUDView2D view = (HUDView2D) e.getSource();
        if (view instanceof HUDView2D) {
            HUDComponent hudComponent = hudViewMap.get(view);
            if (hudComponent != null) {
                if (!dragging) {
                    dragX = e.getX();
                    dragY = e.getY();
                    dragging = true;
                }

                // calculate new location of HUD component
                Point location = hudComponent.getLocation();
                float xDelta = WonderlandHUD.HUD_SCALE.x * (float) (e.getX() - dragX);
                float yDelta = WonderlandHUD.HUD_SCALE.y * (float) (e.getY() - dragY);
                location.setLocation(location.getX() + xDelta, location.getY() - yDelta);

                // move the HUD component
                hudComponent.setLocation(location);
                //System.err.println("--- setting location to: " + location);
                dragX = e.getX();
                dragY = e.getY();
            }
        }
View Full Code Here

Examples of org.jdesktop.wonderland.client.hud.HUDComponent

    public View2D createView (Window2D window) {

        // Don't ever show frame headers in the HUD
        if (window instanceof WindowSwingHeader) return null;

        HUDComponent component = mainHUD.createComponent(window);
        component.setName(app.getName());
        component.setPreferredLocation(Layout.CENTER);

        // Maintain an association between components and their windows.
        // Note: it would be nice of the HUD could do this but its tricky.
        hudComponents.put(component, window);

        component.addEventListener(new HUDEventListener() {
            public void HUDObjectChanged(HUDEvent e) {
                if (e.getEventType().equals(HUDEvent.HUDEventType.CLOSED)) {
                    HUDComponent comp = (HUDComponent)e.getObject();
                    if (mainHUD != null) {
                        mainHUD.removeComponent(comp);
                    }
                    Window2D compWindow = hudComponents.get(comp);
                    hudComponents.remove(comp);
View Full Code Here

Examples of org.jdesktop.wonderland.client.hud.HUDComponent

            // this is an icon on the icon HUD
            super.removeComponent(component);
        } else {
            // this is a component on the window HUD
            // remove the icon from the icon HUD
            HUDComponent icon = hudIconMap.get(component);
            hud.removeComponent(icon);
        }
    }
View Full Code Here

Examples of org.jdesktop.wonderland.client.hud.HUDComponent

        if (!hudStateMap.containsKey(component)) {
            // show the window component
            component.setMaximized();

            // hide the icon component
            HUDComponent icon = hudIconMap.get(component);
            if (icon != null) {
                icon.setVisible(false);
            }
        }
    }
View Full Code Here

Examples of org.jdesktop.wonderland.client.hud.HUDComponent

        AddHUDPanel addPanel = new AddHUDPanel(
                this, session, presenceInfo, presenceInfo, Mode.INITIATE);

        HUD mainHUD = HUDManagerFactory.getHUDManager().getHUD("main");

        final HUDComponent addComponent = mainHUD.createComponent(addPanel);
        addPanel.setHUDComponent(addComponent);
        addComponent.setPreferredLocation(Layout.CENTER);
        addComponent.setName(BUNDLE.getString("Voice_Chat"));
        addComponent.setIcon(voiceChatIcon);
        mainHUD.addComponent(addComponent);
        addComponent.addEventListener(new HUDEventListener() {

            public void HUDObjectChanged(HUDEvent e) {
                if (e.getEventType().equals(HUDEventType.DISAPPEARED)) {
                }
            }
        });

        PropertyChangeListener plistener = new PropertyChangeListener() {

            public void propertyChange(PropertyChangeEvent pe) {
                String propName = pe.getPropertyName();
                if (propName.equals("ok") || propName.equals("cancel")) {
                    addComponent.setVisible(false);
                }
            }
        };
        addPanel.addPropertyChangeListener(plistener);
        addComponent.setVisible(true);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.