Examples of Placemark


Examples of org.jdesktop.wonderland.modules.placemarks.api.common.Placemark

            ColorRGBA backColor = dialog.getBackgroundColor();
            ColorRGBA textColor = dialog.getTextColor();
            String imageURL = dialog.getImageURL();
            String message = dialog.getMessage();

            Placemark placemark = new Placemark(name, url, x, y, z, angle, backColor, textColor,
                    imageURL, message);
            try {
                PlacemarkUtils.addUserPlacemark(placemark);
            } catch (Exception excp) {
                LOGGER.log(Level.WARNING, "Unable to add " + name + " to " +
View Full Code Here

Examples of org.jdesktop.wonderland.modules.placemarks.api.common.Placemark

        int row = placemarksTable.getSelectedRow();
        if (row == -1) {
            return;
        }
        String name = (String) placemarksTableModel.getValueAt(row, 0);
        Placemark placemark = placemarksTableModel.getPlacemark(row);

        try {
            PlacemarkUtils.removeUserPlacemark(name);
        } catch (Exception excp) {
            LOGGER.log(Level.WARNING, "Unable to remove " + name + " from " +
View Full Code Here

Examples of org.jdesktop.wonderland.modules.placemarks.api.common.Placemark

        // and display a dialog with the values filled in.
        int row = placemarksTable.getSelectedRow();
        if (row == -1) {
            return;
        }
        Placemark placemark = placemarksTableModel.getPlacemark(row);

        // Display a dialog with the values in the Placemark. And if we wish
        // to update the values, then re-add the placemark. (Re-adding the
        // placemark should have the effect of updating its values.
        AddEditPlacemarkJDialog dialog = new AddEditPlacemarkJDialog(
                this, true, placemark, placemarkSet);
        dialog.setTitle(BUNDLE.getString("Edit_Placemark"));
        dialog.setLocationRelativeTo(this);
        dialog.pack();
        dialog.setVisible(true);

        if (dialog.getReturnStatus() == AddEditPlacemarkJDialog.RET_OK) {
            // First remove the old placemark.
            String oldName = placemark.getName();
            try {
                PlacemarkUtils.removeUserPlacemark(oldName);
            } catch (Exception excp) {
                LOGGER.log(Level.WARNING, "Unable to remove " + oldName +
                        " from " + " user's placemarks", excp);
                return;
            }

            // Tell the client-side registry of placemarks that a new one has
            // been added
            registry.unregisterPlacemark(placemark, PlacemarkType.USER);

            // Create a new placemark with the new information.
            String name = dialog.getPlacemarkName();
            String url = dialog.getServerURL();
            float x = dialog.getLocationX();
            float y = dialog.getLocationY();
            float z = dialog.getLocationZ();
            float angle = dialog.getLookAtAngle();
            ColorRGBA backColor = dialog.getBackgroundColor();
            ColorRGBA textColor = dialog.getTextColor();
            String imageURL = dialog.getImageURL();
            String message = dialog.getMessage();
            Placemark newPlacemark = new Placemark(name, url, x, y, z, angle, backColor, textColor,
                    imageURL, message);

            try {
                PlacemarkUtils.addUserPlacemark(newPlacemark);
            } catch (Exception excp) {
View Full Code Here

Examples of org.jdesktop.wonderland.modules.placemarks.api.common.Placemark

        /**
         * @inheritDoc()
         */
        public Object getValueAt(int rowIndex, int columnIndex) {
            Placemark item = placemarkList.get(rowIndex);
            switch (columnIndex) {
                case 0:
                    return item.getName();
                case 1:
                    return item.getUrl();
                case 2:
                    return "(" + df.format(item.getX()) + ", " + df.format(item.getY()) + ", " +
                            df.format(item.getZ()) + ")";
                case 3:
                    String value = BUNDLE.getString("Look_Angle_Value");
                    return MessageFormat.format(value, df.format(item.getAngle()));
                default:
                    return "";
            }
        }
View Full Code Here

Examples of org.jdesktop.wonderland.modules.placemarks.api.common.Placemark

            @Override
            public Component getListCellRendererComponent(JList list,
                    Object value, int index, boolean isSelected,
                    boolean cellHasFocus)
            {
                Placemark placemark = (Placemark) value;

                if (placemark == null) {
                    return separator;
                }
               
                return super.getListCellRendererComponent(list,
                        placemark.getName(), index, isSelected, cellHasFocus);
            }
        });
       
        cspp = new CoverScreenPropertyPanel();
        cspp.getImageTf().getDocument().addDocumentListener(listener);
View Full Code Here

Examples of org.jdesktop.wonderland.modules.placemarks.api.common.Placemark

        // update list of placemarks
        PlacemarkRegistry reg = PlacemarkRegistryFactory.getInstance();
       
        List<Placemark> allPlacemarks = new ArrayList<Placemark>();
        Placemark firstEntry = new Placemark("Select Placemark", null, 0, 0, 0, 0);
        allPlacemarks.add(firstEntry);
       
        // separator
        allPlacemarks.add(null);
       
View Full Code Here

Examples of org.jdesktop.wonderland.modules.placemarks.api.common.Placemark

        lookDirectionSpinner.setEnabled(false);
    }//GEN-LAST:event_placemarkRadioButtonActionPerformed

    private void placemarkCBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_placemarkCBActionPerformed
        // TODO add your handling code here:
        Placemark pm = (Placemark) placemarkCB.getSelectedItem();

        if (pm == null) {
            LOGGER.warning("null placemark selected!");
            return;
        }

        // set values
        urlTF.setText(pm.getUrl());
  xSpinnerModel.setValue(pm.getX());
  ySpinnerModel.setValue(pm.getY());
  zSpinnerModel.setValue(pm.getZ());
        // convert angle properly
//  lookDirectionSpinnerModel.setValue((float) Math.toDegrees(pm.getAngle()));
        lookDirectionSpinnerModel.setValue(pm.getAngle());
    }//GEN-LAST:event_placemarkCBActionPerformed
View Full Code Here

Examples of org.jdesktop.wonderland.modules.placemarks.api.common.Placemark

            public void actionPerformed(ActionEvent e) {
                JFrame frame = JmeClientMain.getFrame().getFrame();

                // Form a placemark with the current position about the avatar's
                // location.
                Placemark placemark = getCurrentPlacemark(sessionManager);

                // Fetch the list of known USER Placemark names
                PlacemarkRegistry registry =
                        PlacemarkRegistryFactory.getInstance();
                Set<Placemark> placemarkSet =
                        registry.getAllPlacemarks(PlacemarkType.USER);

                // Display a dialog with the values in the Placemark. And if we
                // wish to update the values, then re-add the placemark.
                // (Re-adding the placemark should have the effect of updating
                // its values.
                AddEditPlacemarkJDialog dialog = new AddEditPlacemarkJDialog(
                        frame, true, placemark, placemarkSet);
                dialog.setTitle(BUNDLE.getString("Add_Placemark"));
                dialog.setLocationRelativeTo(frame);
                dialog.pack();
                dialog.setVisible(true);

                if (dialog.getReturnStatus() ==
                        AddEditPlacemarkJDialog.RET_OK) {
                    // Create a new placemark with the new information.
                    String name = dialog.getPlacemarkName();
                    String url = dialog.getServerURL();
                    float x = dialog.getLocationX();
                    float y = dialog.getLocationY();
                    float z = dialog.getLocationZ();
                    float angle = dialog.getLookAtAngle();
                    ColorRGBA backColor = dialog.getBackgroundColor();
                    ColorRGBA textColor = dialog.getTextColor();
                    String imageURL = dialog.getImageURL();
                    String message = dialog.getMessage();
                    Placemark newPlacemark = new Placemark(name, url, x, y, z, angle,
                            backColor, textColor, imageURL, message);

                    try {
                        PlacemarkUtils.addUserPlacemark(newPlacemark);
                    } catch (Exception excp) {
                        LOGGER.log(Level.WARNING, "Unable to add " + name +
                                " to user's placemarks", excp);
                        return;
                    }

                    // Tell the client-side registry of placemarks that a new
                    // one has been added
                    registry.registerPlacemark(newPlacemark, PlacemarkType.USER);
                }
            }
        });

        // Menu item to take avatar to starting location
        startingLocationMI = new JMenuItem(BUNDLE.getString("Starting_Location"));
        startingLocationMI.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
               
                Vector3f position = new Vector3f();
                Quaternion look = new Quaternion();

                String prop = System.getProperty("Placemark.CoverScreen");
                if(prop == null) {
                    prop="";
                }
                if(!prop.equalsIgnoreCase("off")) {
                    if(!(ClientContextJME.getViewManager()
                            .getPrimaryViewCell().getWorldTransform().getTranslation(null).x==position.x &&
                            ClientContextJME.getViewManager()
                            .getPrimaryViewCell().getWorldTransform().getTranslation(null).z==position.z)) {

                        Placemark pl = new Placemark("", sessionManager.getServerURL()
                                , position.x, position.y, position.z, 0);
                        if(systemPlacemarkMenuItems!=null && systemPlacemarkMenuItems.keySet()!=null) {
                            Iterator<Placemark> sysItr = systemPlacemarkMenuItems.keySet().iterator();
                            while(sysItr.hasNext()) {
                                Placemark p = sysItr.next();
                               
                                if(p.getX()==0 && p.getZ()==0) {
                                    pl = p;
                                }
                            }
                        }
                       
View Full Code Here

Examples of org.jdesktop.wonderland.modules.placemarks.api.common.Placemark

        float dotProduct = v1.dot(v2);
        Vector3f crossProduct = v1.cross(v2);
        float lookAngle = (float) Math.atan2(normal.dot(crossProduct), dotProduct);
        lookAngle = (float) Math.toDegrees(lookAngle);

        return new Placemark("", url, x, y, z, lookAngle);
    }
View Full Code Here

Examples of org.jdesktop.wonderland.modules.placemarks.api.common.Placemark

        String name = request.getParameter("name");

        // Fetch the PlacemarkList from the /system/placemarks/placemarks.xml
        // file.
        PlacemarkList placemarkList = getPlacemarkList();
        Placemark placemark = placemarkList.getPlacemark(name);

        // Remove the placemark given the name. It should exist. If not, then
        // the HTML list will get reloaded anyway. Write back to the placemarks.xml
        // file
        placemarkList.removePlacemark(name);
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.