Revision: 4897
Author:
abhishek...@wishtreetech.com
Date: Tue Sep 23 05:22:54 2014 UTC
Log: New features like CoverScree, New Interactions for Cell
https://code.google.com/p/openwonderland/source/detail?r=4897
Added:
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/CoverScreen.form
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/CoverScreen.java
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/CoverScreenDialog.form
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/CoverScreenDialog.java
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/CoverScreenListener.java
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/CoverScreenPropertyPanel.form
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/CoverScreenPropertyPanel.java
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/resources/loading.gif
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/common/CoverScreenData.java
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/common/GoToCoverScreenInfo.java
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/common/LoginCoverScreenInfo.java
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/CoverScreen.form
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/CoverScreen.java
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/CoverScreenData.java
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/CoverScreenListener.java
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/CoverScreenPropertyPanel.form
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/CoverScreenPropertyPanel.java
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/GoToCoverScreenInfo.java
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/resources/loading.gif
/trunk/modules/world/avatarbase/src/classes/org/jdesktop/wonderland/modules/avatarbase/common/cell/NameTagComponentClientState.java
/trunk/modules/world/avatarbase/src/classes/org/jdesktop/wonderland/modules/avatarbase/common/cell/NameTagComponentServerState.java
/trunk/modules/world/avatarbase/src/classes/org/jdesktop/wonderland/modules/avatarbase/common/cell/messages/NameTagMessage.java
/trunk/modules/world/cell-editor/nbproject/desktop.ini
/trunk/modules/world/cell-editor/nbproject/ide-file-targets.xml
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/CellHighlightManager.java
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/MouseCursorManager.java
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/MouseCursorPlugin.java
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/NewInteractionComponent.java
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/resources/cursor1.png
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/resources/cursor2.png
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/resources/cursor3.png
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/resources/cursor4.png
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/resources/cursor5.png
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/resources/cursor6.png
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/resources/cursor7.png
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/common
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/common/NewInteractionComponentClientState.java
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/common/NewInteractionComponentServerState.java
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/server
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/server/NewInteractionComponentMO.java
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/client/CoverScreen.form
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/client/CoverScreen.java
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/client/CoverScreenListener.java
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/client/CoverScreenPropertyPanel.form
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/client/CoverScreenPropertyPanel.java
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/client/resources/loading.gif
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/common/CoverScreenData.java
Modified:
/trunk/core/nbproject/project.xml
/trunk/modules/foundation/placemarks-api/build.xml
/trunk/modules/foundation/placemarks-api/nbproject/project.xml
/trunk/modules/foundation/placemarks-api/src/classes/org/jdesktop/wonderland/modules/placemarks/api/common/Placemark.java
/trunk/modules/tools/placemarks/build.xml
/trunk/modules/tools/placemarks/nbproject/project.xml
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/AddEditPlacemarkJDialog.form
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/AddEditPlacemarkJDialog.java
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/EditPlacemarksJFrame.form
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/EditPlacemarksJFrame.java
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/PlacemarkComponentProperties.form
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/PlacemarkComponentProperties.java
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/PlacemarkPlugin.java
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/PlacemarkUtils.java
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/resources/Bundle.properties
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/resources/Bundle_de.properties
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/resources/Bundle_el.properties
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/resources/Bundle_es.properties
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/resources/Bundle_fr.properties
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/resources/Bundle_zh_CN.properties
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/common/PlacemarkComponentServerState.java
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/server/PlacemarkComponentMO.java
/trunk/modules/tools/user-list/build.xml
/trunk/modules/tools/user-list/my.module.properties
/trunk/modules/tools/user-list/nbproject/project.xml
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/HUDTabbedPanel.form
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/HUDTabbedPanel.java
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/UserListClientPlugin.java
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/UserListPresenterManager.java
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/presenters/WonderlandUserListPresenter.java
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/views/WonderlandUserListView.form
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/views/WonderlandUserListView.java
/trunk/modules/world/avatarbase/build.xml
/trunk/modules/world/avatarbase/nbproject/project.xml
/trunk/modules/world/avatarbase/src/classes/org/jdesktop/wonderland/modules/avatarbase/client/jme/cellrenderer/AvatarImiJME.java
/trunk/modules/world/avatarbase/src/classes/org/jdesktop/wonderland/modules/avatarbase/client/jme/cellrenderer/NameTagComponent.java
/trunk/modules/world/avatarbase/src/classes/org/jdesktop/wonderland/modules/avatarbase/server/cell/NameTagComponentMO.java
/trunk/modules/world/cell-editor/build.xml
/trunk/modules/world/cell-editor/nbproject/project.xml
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/BasicJPanel.form
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/BasicJPanel.java
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/CellPhysicsPropertiesComponentFactory.java
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/CellPropertiesJFrame.form
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/CellPropertiesJFrame.java
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/PaletteClientPlugin.java
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/resources/Bundle.properties
/trunk/modules/world/portal/build.xml
/trunk/modules/world/portal/my.module.properties
/trunk/modules/world/portal/nbproject/project.xml
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/client/PortalComponent.java
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/client/PortalComponentProperties.form
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/client/PortalComponentProperties.java
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/common/PortalComponentClientState.java
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/common/PortalComponentServerState.java
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/server/PortalComponentMO.java
=======================================
--- /dev/null
+++
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/CoverScreen.form
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.5" maxVersion="1.8"
type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+ <Properties>
+ <Property name="background" type="java.awt.Color"
editor="org.netbeans.beaninfo.editors.ColorEditor">
+ <Color blue="0" green="0" red="0" type="rgb"/>
+ </Property>
+ <Property name="opaque" type="boolean" value="false"/>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer"
value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName"
type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean"
value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode"
type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean"
value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget"
type="java.lang.Integer" value="1"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle"
type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean"
value="false"/>
+ <AuxValue name="FormSettings_variablesModifier"
type="java.lang.Integer" value="2"/>
+ <AuxValue name="designerSize" type="java.awt.Dimension"
value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,57,0,0,2,112"/>
+ </AuxValues>
+
+ <Layout
class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="jPanel1">
+ <Properties>
+ <Property name="opaque" type="boolean" value="false"/>
+ </Properties>
+ <Constraints>
+ <Constraint
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"
value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="Center"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout
class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ </Container>
+ </SubComponents>
+</Form>
=======================================
--- /dev/null
+++
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/CoverScreen.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,218 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.placemarks.client;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+import java.awt.font.FontRenderContext;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.imageio.ImageIO;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import org.jdesktop.wonderland.client.cell.asset.AssetUtils;
+import
org.jdesktop.wonderland.modules.contentrepo.client.ContentRepository;
+import
org.jdesktop.wonderland.modules.contentrepo.client.ContentRepositoryRegistry;
+import
org.jdesktop.wonderland.modules.contentrepo.common.ContentCollection;
+import org.jdesktop.wonderland.modules.contentrepo.common.ContentResource;
+import static
org.jdesktop.wonderland.modules.placemarks.client.PlacemarkUtils.serverSessionManager;
+import org.jdesktop.wonderland.modules.placemarks.common.CoverScreenData;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+public class CoverScreen extends javax.swing.JPanel {
+
+ private CoverScreenData coverScreenData=null;
+ private JLabel closeIcon = null;
+ private CoverScreenMainPanel csp = null;
+ private int i=0;
+ private Image img = null;
+
+ /**
+ * Creates new form CoverScreen
+ */
+ public CoverScreen(CoverScreenData coverScreenData,Dimension dim) {
+ this.coverScreenData = coverScreenData;
+ initComponents();
+ csp = new CoverScreenMainPanel();
+ csp.addComponentListener(new ComponentAdapter() {
+
+ public void componentResized(ComponentEvent e) {
+ Insets insets = ((JPanel)e.getComponent()).getInsets();
+ Dimension size = closeIcon.getPreferredSize();
+ closeIcon.setBounds((int)
(((JPanel)e.getComponent()).getPreferredSize().getWidth()-size.width) +
insets.left, insets.top,
+ size.width, size.height);
+ }
+
+ });
+ csp.setLayout(null);
+ closeIcon = new JLabel();
+ csp.setPreferredSize(dim.getSize());
+ closeIcon.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
+ closeIcon.setLocation(100, 100);
+
+ closeIcon.setHorizontalAlignment(JLabel.RIGHT);
+ closeIcon.setPreferredSize(new Dimension(10, 17));
+ closeIcon.setText("X");
+ closeIcon.setOpaque(true);
+ if(coverScreenData!=null) {
+ float[] comps = coverScreenData
+ .getBackgroundColor().getColorArray();
+ csp.setBackground(new Color(comps[0],comps[1],comps[2]));
+ }
+
+ csp.add(closeIcon);
+ Insets insets = csp.getInsets();
+ Dimension size = closeIcon.getPreferredSize();
+ closeIcon.setBounds((int)
(csp.getPreferredSize().getWidth()-size.width) + insets.left, insets.top,
+ size.width, size.height);
+ jPanel1.add(csp, BorderLayout.CENTER);
+ setPreferredSize(null);
+ if(coverScreenData.getImageURL()!=null &&
+ (!coverScreenData.getImageURL().equals(""))) {
+ try {
+ img = csp.scaleImage(AssetUtils
+ .getAssetURL(coverScreenData.getImageURL()),(int)dim.getSize().getWidth()
+ ,(int)dim.getSize().getHeight());
+ } catch (MalformedURLException ex) {
+
Logger.getLogger(CoverScreen.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+
+ }
+
+ public JLabel getCloseComponent() {
+ return closeIcon;
+ }
+
+ private class CoverScreenMainPanel extends JPanel {
+ ImageIcon ii=null;
+
+ private Image scaleImage(URL imageURL,int width, int height) {
+ try {
+ Image scaledBimg = null;
+ ContentRepositoryRegistry registry =
ContentRepositoryRegistry.getInstance();
+ ContentRepository cr =
registry.getRepository(serverSessionManager);
+ String[] urls = imageURL.toString().split("/");
+ String fname = urls[urls.length-1];
+ String userName = urls[3];
+ ContentCollection user = cr.getUserRoot(userName);
+
+ ContentResource res = (ContentResource)
user.getChild(fname);
+
+ BufferedImage bimg = ImageIO.read(res.getInputStream());
+ if(bimg.getWidth()>width || bimg.getHeight()>height) {
+ if(bimg.getWidth()>width && bimg.getHeight()>height) {
+ if(bimg.getWidth()-width>bimg.getHeight()-height) {
+ float nw = width;
+ float nh =
(width*bimg.getHeight())/bimg.getWidth();
+ scaledBimg = bimg.getScaledInstance((int)nw,
(int)nh,BufferedImage.SCALE_SMOOTH);
+ //scaledBimg.getGraphics().drawImage(bimg, 0,
0, null);
+ } else {
+ float nh = height;
+ float nw =
(height*bimg.getWidth())/bimg.getHeight();
+ scaledBimg = bimg.getScaledInstance((int)nw,
(int)nh,BufferedImage.SCALE_SMOOTH);
+ //scaledBimg.getGraphics().drawImage(bimg, 0,
0, null);
+ }
+ } else if(bimg.getWidth()>width) {
+ float nw = width;
+ float nh =
(width*bimg.getHeight())/bimg.getWidth();
+ scaledBimg = bimg.getScaledInstance((int)nw,
(int)nh,BufferedImage.SCALE_SMOOTH);
+ } else if(bimg.getHeight()>height) {
+ float nh = height;
+ float nw =
(height*bimg.getWidth())/bimg.getHeight();
+ scaledBimg = bimg.getScaledInstance((int)nw,
(int)nh,BufferedImage.SCALE_SMOOTH);
+ }
+ } else {
+ scaledBimg = bimg;
+ }
+ return scaledBimg;
+ } catch (Exception ex) {
+ ex.printStackTrace();
+
Logger.getLogger(CoverScreen.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ return null;
+ }
+
+ @Override
+ public void paintComponent(Graphics g) {
+
+ super.paintComponent(g);
+ if(coverScreenData!=null) {
+ Graphics2D g2d = (Graphics2D) g;
+ if(coverScreenData.getImageURL()!=null &&
+ (!coverScreenData.getImageURL().equals(""))) {
+
+ try {
+ g2d.drawImage(img,
(getWidth()/2)-(img.getWidth(null)/2)
+ , (getHeight()/2)-(img.getHeight(null)/2),
this);
+ } catch (Exception ex) {
+
Logger.getLogger(CoverScreen.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+ Image img = new ImageIcon(getClass()
+ .getResource("/org/jdesktop/wonderland/modules/placemarks/client/resources/loading.gif")).getImage();
+
+ g2d.drawImage(img, (getWidth()/2)-(img.getWidth(null)/2),
(getHeight()/2)-(img.getHeight(null)/2)
+ , this);
+ float[] comps = coverScreenData
+ .getTextColor().getColorArray();
+ g2d.setColor(new Color(comps[0],comps[1],comps[2]));
+ Font font = new Font("Arial", Font.BOLD,20);
+ FontRenderContext frc1 = new FontRenderContext(null, true,
true);
+ Rectangle2D rec =
font.getStringBounds(coverScreenData.getMessage(), frc1);
+ int w = (int) (rec.getWidth());
+ int h = (int) (rec.getHeight());
+ g2d.setFont(font);
+ g2d.drawString(coverScreenData.getMessage()
+ , (getWidth()/2)-(w/2), getHeight()-(h)+10 );
+ }
+ Insets insets = getInsets();
+ Dimension size = closeIcon.getPreferredSize();
+ closeIcon.setBounds((int) (getWidth()-size.width) +
insets.left, insets.top,
+ size.width, size.height);
+ }
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the
form.
+ * WARNING: Do NOT modify this code. The content of this method is
always
+ * regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed" desc="Generated
Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jPanel1 = new javax.swing.JPanel();
+
+ setBackground(new java.awt.Color(0, 0, 0));
+ setOpaque(false);
+ setLayout(new java.awt.BorderLayout());
+
+ jPanel1.setOpaque(false);
+ jPanel1.setLayout(new java.awt.BorderLayout());
+ add(jPanel1, java.awt.BorderLayout.CENTER);
+ }// </editor-fold>//GEN-END:initComponents
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JPanel jPanel1;
+ // End of variables declaration//GEN-END:variables
+}
=======================================
--- /dev/null
+++
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/CoverScreenDialog.form
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.5" maxVersion="1.8"
type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
+ <Properties>
+ <Property name="defaultCloseOperation" type="int" value="2"/>
+ </Properties>
+ <SyntheticProperties>
+ <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
+ <SyntheticProperty name="generateCenter" type="boolean" value="false"/>
+ </SyntheticProperties>
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer"
value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName"
type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean"
value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode"
type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean"
value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget"
type="java.lang.Integer" value="1"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle"
type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean"
value="false"/>
+ <AuxValue name="FormSettings_variablesModifier"
type="java.lang.Integer" value="2"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="jPanel2" alignment="1" max="32767"
attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace min="-2" pref="6" max="-2" attributes="0"/>
+ <Component id="jPanel2" max="32767" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="jPanel2">
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" attributes="0">
+ <Group type="103" groupAlignment="1"
attributes="0">
+ <Component id="jLabel2" max="32767"
attributes="0"/>
+ <Group type="102" attributes="0">
+ <Component id="jButton1" min="-2"
max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="applyBut" min="-2"
max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="saveCloseBut" min="-2"
max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ <EmptySpace min="-2" pref="14" max="-2"
attributes="0"/>
+ </Group>
+ <Group type="102" attributes="0">
+ <Component id="propertyTab" max="32767"
attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="propertyTab" min="-2" pref="185" max="-2"
attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="saveCloseBut" alignment="3" min="-2"
max="-2" attributes="0"/>
+ <Component id="jButton1" alignment="3" min="-2"
max="-2" attributes="0"/>
+ <Component id="applyBut" alignment="3" min="-2"
max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="jLabel2" pref="78" max="32767"
attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JButton" name="jButton1">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Cancel"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed"
listener="java.awt.event.ActionListener"
parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="saveCloseBut">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Save
& Close"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed"
listener="java.awt.event.ActionListener"
parameters="java.awt.event.ActionEvent"
handler="saveCloseButActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="applyBut">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Apply"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed"
listener="java.awt.event.ActionListener"
parameters="java.awt.event.ActionEvent" handler="applyButActionPerformed"/>
+ </Events>
+ </Component>
+ <Container class="javax.swing.JTabbedPane" name="propertyTab">
+ <Events>
+ <EventHandler event="stateChanged"
listener="javax.swing.event.ChangeListener"
parameters="javax.swing.event.ChangeEvent"
handler="propertyTabStateChanged"/>
+ </Events>
+
+ <Layout
class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
+ </Container>
+ <Component class="javax.swing.JLabel" name="jLabel2">
+ <Properties>
+ <Property name="foreground" type="java.awt.Color"
editor="org.netbeans.beaninfo.editors.ColorEditor">
+ <Color blue="33" green="33" red="33" type="rgb"/>
+ </Property>
+ <Property name="text" type="java.lang.String"
editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
+ <Connection
code=""<html><body><i><b>NOTE :
</b>Cover screens are "
 + "displayed while objects
are loading. Use this dialog to "
 + "edit Login and
Go-To-User cover screens. Edit portal and "
 + "placemark
cover screens using the portal and placemark "
 +
"property sheets in the Object Editor
window.</i></body></html>"" type="code"/>
+ </Property>
+ <Property name="border" type="javax.swing.border.Border"
editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border
info="org.netbeans.modules.form.compat2.border.MatteColorBorderInfo">
+ <MatteColorBorder bottom="0" left="0" right="0" top="2">
+ <Color PropertyName="color" blue="66" green="66"
red="66" type="rgb"/>
+ </MatteColorBorder>
+ </Border>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension"
editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[390, 86]"/>
+ </Property>
+ </Properties>
+ </Component>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+</Form>
=======================================
--- /dev/null
+++
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/CoverScreenDialog.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,550 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.placemarks.client;
+
+import com.jme.renderer.ColorRGBA;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.io.File;
+import java.io.IOException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.imageio.ImageIO;
+import javax.swing.JTabbedPane;
+import javax.swing.event.DocumentEvent;
+import javax.swing.event.DocumentListener;
+import org.jdesktop.wonderland.client.login.LoginManager;
+import org.jdesktop.wonderland.client.login.ServerSessionManager;
+import
org.jdesktop.wonderland.modules.contentrepo.client.ContentRepository;
+import
org.jdesktop.wonderland.modules.contentrepo.client.ContentRepositoryRegistry;
+import
org.jdesktop.wonderland.modules.contentrepo.common.ContentCollection;
+import org.jdesktop.wonderland.modules.contentrepo.common.ContentNode;
+import
org.jdesktop.wonderland.modules.contentrepo.common.ContentRepositoryException;
+import org.jdesktop.wonderland.modules.contentrepo.common.ContentResource;
+import static
org.jdesktop.wonderland.modules.placemarks.client.AddEditPlacemarkJDialog.RET_CANCEL;
+import static
org.jdesktop.wonderland.modules.placemarks.client.AddEditPlacemarkJDialog.RET_OK;
+import
org.jdesktop.wonderland.modules.placemarks.common.GoToCoverScreenInfo;
+import
org.jdesktop.wonderland.modules.placemarks.common.LoginCoverScreenInfo;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+public class CoverScreenDialog extends javax.swing.JDialog {
+
+ private int returnStatus = RET_CANCEL;
+
+ private CoverScreenPropertyPanel loginPropertyPanel = null;
+ private CoverScreenPropertyPanel goToPropertyPanel = null;
+
+ private ColorRGBA origLoginBackgroundColor = ColorRGBA.black;
+ private ColorRGBA origLoginTextColor = ColorRGBA.white;
+ private String origLoginImageURL = "";
+ private String origLoginMessage = "Teleporting. Please Wait...";
+
+ private ColorRGBA origGoToBackgroundColor = ColorRGBA.black;
+ private ColorRGBA origGoToTextColor = ColorRGBA.white;
+ private String origGoToImageURL = "";
+ private String origGoToMessage = "Teleporting. Please Wait...";
+ private static ContentCollection grpusrRepo = null;
+
+ LoginCoverScreenInfo loginInfo = null;
+ GoToCoverScreenInfo goToInfo = null;
+
+ /**
+ * Creates new form CoverScreenDialog
+ */
+ public CoverScreenDialog(java.awt.Frame parent, boolean modal) {
+ super(parent, modal);
+ initComponents();
+
+ loginPropertyPanel = new CoverScreenPropertyPanel();
+ goToPropertyPanel = new CoverScreenPropertyPanel();
+
+ propertyTab.addTab("<html><body><b>After Login</b></body></html>",
loginPropertyPanel);
+ propertyTab.addTab("<html><body><b>After
Go-To-User</b></body></html>", goToPropertyPanel);
+
+ loginPropertyPanel.getTitleCoverScreen().setVisible(false);
+ goToPropertyPanel.getTitleCoverScreen().setVisible(false);
+ loginPropertyPanel.getTitleCoverScreen().setOpaque(false);
+ goToPropertyPanel.getTitleCoverScreen().setOpaque(false);
+
+ saveCloseBut.setEnabled(false);
+ applyBut.setEnabled(false);
+
+
loginPropertyPanel.getBackColorPanel().addPropertyChangeListener(new
CoverScreenPropertyChangeListener());
+
loginPropertyPanel.getTextColorPanel().addPropertyChangeListener(new
CoverScreenPropertyChangeListener());
+
goToPropertyPanel.getBackColorPanel().addPropertyChangeListener(new
CoverScreenPropertyChangeListener());
+
goToPropertyPanel.getTextColorPanel().addPropertyChangeListener(new
CoverScreenPropertyChangeListener());
+
loginPropertyPanel.getMessageTf().getDocument().addDocumentListener(new
CoverScreenPropertyDocumentListener());
+
loginPropertyPanel.getImageTf().getDocument().addDocumentListener(new
CoverScreenPropertyDocumentListener());
+
goToPropertyPanel.getMessageTf().getDocument().addDocumentListener(new
CoverScreenPropertyDocumentListener());
+
goToPropertyPanel.getImageTf().getDocument().addDocumentListener(new
CoverScreenPropertyDocumentListener());
+ }
+ private static ContentCollection
getSystemContentRepository(ServerSessionManager serverSessionManager)
+ throws ContentRepositoryException {
+
+ ContentRepositoryRegistry registry =
ContentRepositoryRegistry.getInstance();
+ ContentRepository cr =
registry.getRepository(serverSessionManager);
+ return cr.getSystemRoot();
+ }
+ private static ContentCollection getGroupUsersRepo() {
+ try {
+ if(grpusrRepo == null) {
+ ContentCollection collection =
getSystemContentRepository(LoginManager.getPrimary());
+ ContentCollection grps = (ContentCollection)
collection.getParent().getChild("groups");
+ if(grps==null) {
+ grps = (ContentCollection)
collection.getParent().createChild("groups", ContentNode.Type.COLLECTION);
+ }
+ ContentCollection grpusrs = (ContentCollection)
grps.getChild("users");
+ if(grpusrs == null) {
+ grpusrs = (ContentCollection)
grps.createChild("users", ContentNode.Type.COLLECTION);
+ }
+ grpusrRepo = grpusrs;
+ return grpusrs;
+ } else {
+ return grpusrRepo;
+ }
+ } catch (ContentRepositoryException ex) {
+
Logger.getLogger(CoverScreenDialog.class.getName()).log(Level.SEVERE, null,
ex);
+ }
+ return null;
+ }
+
+ private void populateOrigValues() {
+
+ if(loginInfo==null)
+ loginInfo =
PlacemarkUtils.getLoginCoverScreenInfo(getGroupUsersRepo());
+ if(goToInfo==null)
+ goToInfo =
PlacemarkUtils.getGoToCoverScreenInfo(getGroupUsersRepo());
+
+ if(loginInfo==null) {
+ loginInfo = new LoginCoverScreenInfo();
+ }
+ if(goToInfo==null) {
+ goToInfo = new GoToCoverScreenInfo();
+ }
+ if(loginInfo==null) {
+ loginInfo = new LoginCoverScreenInfo();
+ }
+ if(goToInfo==null) {
+ goToInfo = new GoToCoverScreenInfo();
+ }
+
+ loginPropertyPanel.setBackColor(loginInfo.getBackgroundColor());
+ loginPropertyPanel.setTextColor(loginInfo.getTextColor());
+ loginPropertyPanel.setImageURL(loginInfo.getImageURL());
+ loginPropertyPanel.setMessage(loginInfo.getMessage());
+
+ goToPropertyPanel.setBackColor(goToInfo.getBackgroundColor());
+ goToPropertyPanel.setTextColor(goToInfo.getTextColor());
+ goToPropertyPanel.setImageURL(goToInfo.getImageURL());
+ goToPropertyPanel.setMessage(goToInfo.getMessage());
+
+ origLoginBackgroundColor = loginInfo.getBackgroundColor();
+ origLoginImageURL = loginInfo.getImageURL();
+ origLoginMessage = loginInfo.getMessage();
+ origLoginMessage = loginInfo.getMessage();
+
+ origGoToBackgroundColor = goToInfo.getBackgroundColor();
+ origGoToImageURL = goToInfo.getImageURL();
+ origGoToMessage = goToInfo.getMessage();
+ origGoToMessage = goToInfo.getMessage();
+
+ }
+
+ private class CoverScreenPropertyChangeListener implements
PropertyChangeListener {
+
+ public void propertyChange(PropertyChangeEvent evt) {
+ checkDirty();
+ }
+
+ }
+ private class CoverScreenPropertyDocumentListener implements
DocumentListener {
+
+ public void insertUpdate(DocumentEvent e) {
+ checkDirty();
+ }
+
+ public void removeUpdate(DocumentEvent e) {
+ checkDirty();
+ }
+
+ public void changedUpdate(DocumentEvent e) {
+ checkDirty();
+ }
+
+ }
+
+ private boolean checkDirty() {
+ boolean isdirty = false;
+ if(propertyTab.getSelectedIndex()==0) {
+
if(!origLoginBackgroundColor.equals(loginPropertyPanel.getBackColor())) {
+ isdirty = true;
+ }
+
if(!origLoginTextColor.equals(loginPropertyPanel.getTextColor())) {
+ isdirty = true;
+ }
+ if(!origLoginMessage.equals(loginPropertyPanel.getMessage())) {
+ isdirty = true;
+ }
+
if(!origLoginImageURL.equals(loginPropertyPanel.getImageURL())) {
+ isdirty = true;
+ }
+ } else {
+
if(!origGoToBackgroundColor.equals(goToPropertyPanel.getBackColor())) {
+ isdirty = true;
+ }
+
if(!origGoToTextColor.equals(goToPropertyPanel.getTextColor())) {
+ isdirty = true;
+ }
+ if(!origGoToMessage.equals(goToPropertyPanel.getMessage())) {
+ isdirty = true;
+ }
+ if(!origGoToImageURL.equals(goToPropertyPanel.getImageURL())) {
+ isdirty = true;
+ }
+ }
+
+ if(isdirty) {
+ saveCloseBut.setEnabled(true);
+ applyBut.setEnabled(true);
+ } else {
+ saveCloseBut.setEnabled(false);
+ applyBut.setEnabled(false);
+ }
+
+ return isdirty;
+ }
+
+ public CoverScreenPropertyPanel getGoToPropertyPanel() {
+ return goToPropertyPanel;
+ }
+
+ public CoverScreenPropertyPanel getLoginPropertyPanel() {
+ return loginPropertyPanel;
+ }
+
+ public JTabbedPane getPropertyTab() {
+ return propertyTab;
+ }
+
+ public CoverScreenPropertyPanel getActiveTabPanel () {
+ CoverScreenPropertyPanel csp = (CoverScreenPropertyPanel)
propertyTab.getSelectedComponent();
+ return csp;
+ }
+
+ private void doClose(int retStatus) {
+ returnStatus = retStatus;
+ setVisible(false);
+ dispose();
+ }
+
+ /**
+ * @return the return status of this dialog - one of RET_OK or
RET_CANCEL
+ */
+ public int getReturnStatus() {
+ return returnStatus;
+ }
+
+ private String uploadImage(File image) {
+
+ Image scaledBimg = null;
+ File temp=null;
+ try {
+ temp = File.createTempFile("Temp_Image",
image.getName().split("\\.")[1]);
+ } catch (IOException ex) {
+
Logger.getLogger(PlacemarkComponentProperties.class.getName()).log(Level.SEVERE,
null, ex);
+ }
+ try {
+ BufferedImage bimg = ImageIO.read(image);
+
+ if(bimg.getWidth()>800 || bimg.getHeight()>600) {
+ if(bimg.getWidth()>800 && bimg.getHeight()>600) {
+ if(bimg.getWidth()-800>bimg.getHeight()-600) {
+ float nw = 800;
+ float nh = (800*bimg.getHeight())/bimg.getWidth();
+ scaledBimg = bimg.getScaledInstance((int)nw,
(int)nh,BufferedImage.SCALE_SMOOTH);
+ //scaledBimg.getGraphics().drawImage(bimg, 0, 0,
null);
+ } else {
+ float nh = 600;
+ float nw = (600*bimg.getWidth())/bimg.getHeight();
+ scaledBimg = bimg.getScaledInstance((int)nw,
(int)nh,BufferedImage.SCALE_SMOOTH);
+ //scaledBimg.getGraphics().drawImage(bimg, 0, 0,
null);
+ }
+ } else if(bimg.getWidth()>800) {
+ float nw = 800;
+ float nh = (800*bimg.getHeight())/bimg.getWidth();
+ scaledBimg = bimg.getScaledInstance((int)nw,
(int)nh,BufferedImage.SCALE_SMOOTH);
+ } else if(bimg.getHeight()>600) {
+ float nh = 600;
+ float nw = (600*bimg.getWidth())/bimg.getHeight();
+ scaledBimg = bimg.getScaledInstance((int)nw,
(int)nh,BufferedImage.SCALE_SMOOTH);
+ }
+ } else {
+ scaledBimg = bimg;
+ }
+ BufferedImage new_bimg = new
BufferedImage(scaledBimg.getWidth(null),
+ scaledBimg.getHeight(null),
BufferedImage.SCALE_SMOOTH);
+ new_bimg.getGraphics().drawImage(scaledBimg, 0, 0, null);
+ ImageIO.write(new_bimg, image.getName().split("\\.")[1], temp);
+ } catch (IOException ex) {
+
Logger.getLogger(PlacemarkComponentProperties.class.getName()).log(Level.SEVERE,
null, ex);
+ }
+
+ String uri = "";
+ ContentRepositoryRegistry registry =
ContentRepositoryRegistry.getInstance();
+ ContentRepository repo =
registry.getRepository(LoginManager.getPrimary());
+ try {
+ ContentCollection c = repo.getUserRoot();
+ try {
+ /*
+ * Remove file if it exists.
+ */
+ ContentResource r = (ContentResource)
c.removeChild(image.getName());
+ } catch (Exception e) {
+ }
+
+ ContentResource r = (ContentResource) c.createChild(
+ image.getName(), ContentNode.Type.RESOURCE);
+ try {
+
+ r.put(image);
+
+ uri = "wlcontent:/"+r.getPath();
+ } catch (IOException ex) {
+
Logger.getLogger(PlacemarkComponentProperties.class.getName()).log(Level.SEVERE,
null, ex);
+ }
+ } catch (ContentRepositoryException ex) {
+
Logger.getLogger(PlacemarkComponentProperties.class.getName()).log(Level.SEVERE,
null, ex);
+ }
+ return uri;
+
+ }
+
+ private void save() {
+ if(propertyTab.getSelectedIndex()==0) {
+ CoverScreenPropertyPanel login = (CoverScreenPropertyPanel)
getActiveTabPanel();
+ LoginCoverScreenInfo info = new LoginCoverScreenInfo();
+ info.setBackgroundColor(login.getBackColor());
+ File image = login.getImage();
+ String uri=login.getImageURL();
+ if(image!=null) {
+ uri = uploadImage(image);
+ }
+ loginPropertyPanel.setImageURL(uri);
+ info.setImageURL(uri);
+ info.setMessage(login.getMessage());
+ info.setTextColor(login.getTextColor());
+
+ PlacemarkUtils.setLoginCoverScreenInfo(info);
+ } else {
+ GoToCoverScreenInfo info = new GoToCoverScreenInfo();
+ CoverScreenPropertyPanel goTo = (CoverScreenPropertyPanel)
getActiveTabPanel();
+ info.setBackgroundColor(goTo.getBackColor());
+ String uri=goTo.getImageURL();
+ File image = goTo.getImage();
+ if(image!=null) {
+ uri = uploadImage(image);
+ }
+ goToPropertyPanel.setImageURL(uri);
+ info.setImageURL(uri);
+ info.setMessage(goTo.getMessage());
+ info.setTextColor(goTo.getTextColor());
+
+
PlacemarkUtils.setGoToCoverScreenInfo(info,LoginManager.getPrimary());
+ }
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the
form.
+ * WARNING: Do NOT modify this code. The content of this method is
always
+ * regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed" desc="Generated
Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jPanel2 = new javax.swing.JPanel();
+ jButton1 = new javax.swing.JButton();
+ saveCloseBut = new javax.swing.JButton();
+ applyBut = new javax.swing.JButton();
+ propertyTab = new javax.swing.JTabbedPane();
+ jLabel2 = new javax.swing.JLabel();
+
+
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+ jButton1.setText("Cancel");
+ jButton1.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButton1ActionPerformed(evt);
+ }
+ });
+
+ saveCloseBut.setText("Save & Close");
+ saveCloseBut.addActionListener(new java.awt.event.ActionListener()
{
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ saveCloseButActionPerformed(evt);
+ }
+ });
+
+ applyBut.setText("Apply");
+ applyBut.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ applyButActionPerformed(evt);
+ }
+ });
+
+ propertyTab.addChangeListener(new
javax.swing.event.ChangeListener() {
+ public void stateChanged(javax.swing.event.ChangeEvent evt) {
+ propertyTabStateChanged(evt);
+ }
+ });
+
+ jLabel2.setForeground(new java.awt.Color(51, 51, 51));
+ jLabel2.setText("<html><body><i><b>NOTE : </b>Cover screens are "
+ + "displayed while objects are loading. Use this dialog to "
+ + "edit Login and Go-To-User cover screens. Edit portal and "
+ + "placemark cover screens using the portal and placemark "
+ + "property sheets in the Object Editor
window.</i></body></html>");
+ jLabel2.setBorder(javax.swing.BorderFactory.createMatteBorder(2,
0, 0, 0, new java.awt.Color(102, 102, 102)));
+ jLabel2.setPreferredSize(new java.awt.Dimension(390, 86));
+
+ javax.swing.GroupLayout jPanel2Layout = new
javax.swing.GroupLayout(jPanel2);
+ jPanel2.setLayout(jPanel2Layout);
+ jPanel2Layout.setHorizontalGroup(
+
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel2Layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel2Layout.createSequentialGroup()
+ .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
+ .addComponent(jLabel2,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
+ .addGroup(jPanel2Layout.createSequentialGroup()
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
+ .addComponent(jButton1)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(applyBut)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(saveCloseBut)))
+ .addGap(14, 14, 14))
+ .addGroup(jPanel2Layout.createSequentialGroup()
+ .addComponent(propertyTab)
+ .addContainerGap())))
+ );
+ jPanel2Layout.setVerticalGroup(
+
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(jPanel2Layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(propertyTab,
javax.swing.GroupLayout.PREFERRED_SIZE, 185,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(saveCloseBut)
+ .addComponent(jButton1)
+ .addComponent(applyBut))
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jLabel2,
javax.swing.GroupLayout.DEFAULT_SIZE, 78, Short.MAX_VALUE)
+ .addContainerGap())
+ );
+
+ javax.swing.GroupLayout layout = new
javax.swing.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(
+
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addComponent(jPanel2,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
+ );
+ layout.setVerticalGroup(
+
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addGap(6, 6, 6)
+ .addComponent(jPanel2,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
+ .addContainerGap())
+ );
+
+ pack();
+ }// </editor-fold>//GEN-END:initComponents
+
+ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_jButton1ActionPerformed
+ // TODO add your handling code here:
+ doClose(RET_CANCEL);
+ }//GEN-LAST:event_jButton1ActionPerformed
+
+ private void saveCloseButActionPerformed(java.awt.event.ActionEvent
evt) {//GEN-FIRST:event_saveCloseButActionPerformed
+ // TODO add your handling code here:
+ save();
+ loginInfo = null;
+ goToInfo = null;
+ populateOrigValues();
+ checkDirty();
+ doClose(RET_OK);
+ }//GEN-LAST:event_saveCloseButActionPerformed
+
+ private void propertyTabStateChanged(javax.swing.event.ChangeEvent
evt) {//GEN-FIRST:event_propertyTabStateChanged
+ // TODO add your handling code here:
+ populateOrigValues();
+ checkDirty();
+ }//GEN-LAST:event_propertyTabStateChanged
+
+ private void applyButActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_applyButActionPerformed
+ // TODO add your handling code here:
+ save();
+ loginInfo = null;
+ goToInfo = null;
+ populateOrigValues();
+ checkDirty();
+ }//GEN-LAST:event_applyButActionPerformed
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String args[]) {
+ /* Set the Nimbus look and feel */
+ //<editor-fold defaultstate="collapsed" desc=" Look and feel
setting code (optional) ">
+ /* If Nimbus (introduced in Java SE 6) is not available, stay with
the default look and feel.
+ * For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
+ */
+ try {
+ for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
+ if ("Nimbus".equals(info.getName())) {
+
javax.swing.UIManager.setLookAndFeel(info.getClassName());
+ break;
+ }
+ }
+ } catch (ClassNotFoundException ex) {
+
java.util.logging.Logger.getLogger(CoverScreenDialog.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
+ } catch (InstantiationException ex) {
+
java.util.logging.Logger.getLogger(CoverScreenDialog.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
+ } catch (IllegalAccessException ex) {
+
java.util.logging.Logger.getLogger(CoverScreenDialog.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
+ } catch (javax.swing.UnsupportedLookAndFeelException ex) {
+
java.util.logging.Logger.getLogger(CoverScreenDialog.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
+ }
+ //</editor-fold>
+
+ /* Create and display the dialog */
+ java.awt.EventQueue.invokeLater(new Runnable() {
+ public void run() {
+ CoverScreenDialog dialog = new CoverScreenDialog(new
javax.swing.JFrame(), true);
+ dialog.addWindowListener(new
java.awt.event.WindowAdapter() {
+ @Override
+ public void windowClosing(java.awt.event.WindowEvent
e) {
+ System.exit(0);
+ }
+ });
+ dialog.setVisible(true);
+ }
+ });
+ }
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton applyBut;
+ private javax.swing.JButton jButton1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JPanel jPanel2;
+ private javax.swing.JTabbedPane propertyTab;
+ private javax.swing.JButton saveCloseBut;
+ // End of variables declaration//GEN-END:variables
+}
=======================================
--- /dev/null
+++
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/CoverScreenListener.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,216 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+package org.jdesktop.wonderland.modules.placemarks.client;
+
+import com.jme.math.Vector3f;
+import java.awt.Canvas;
+import java.awt.Component;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.logging.Logger;
+import javax.swing.JDialog;
+import javax.swing.SwingUtilities;
+import org.jdesktop.wonderland.client.cell.Cell;
+import org.jdesktop.wonderland.client.cell.CellStatusChangeListener;
+import org.jdesktop.wonderland.client.jme.ClientContextJME;
+import org.jdesktop.wonderland.client.jme.JmeClientMain;
+import org.jdesktop.wonderland.client.jme.MainFrame;
+import org.jdesktop.wonderland.client.login.ServerSessionManager;
+import org.jdesktop.wonderland.common.cell.CellStatus;
+import org.jdesktop.wonderland.modules.placemarks.api.common.Placemark;
+import org.jdesktop.wonderland.modules.placemarks.common.CoverScreenData;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+public class CoverScreenListener implements CellStatusChangeListener {
+
+ private static final Logger LOGGER
+ = Logger.getLogger(CoverScreenListener.class.getName());
+
+ private int flg = 1;
+ private Collection<Cell> rootCells = new ArrayList<Cell>();
+ private CellStatusChangeListener csl;
+ private ScheduledExecutorService exec = null;
+ private ScheduledExecutorService exec_cellStatus = null;
+ private JDialog dialog = null;
+ private Vector3f goalPos = new Vector3f();
+ int lock = 0;
+
+ public CoverScreenListener(final Placemark placemark, final
ServerSessionManager sessionManager,
+ Vector3f goalPosP, String from, CoverScreenData csd) {
+ if (goalPosP == null) {
+ if (System.getProperty("x") == null || System.getProperty("y")
== null
+ || System.getProperty("z") == null) {
+ goalPosP = new Vector3f(0, 0, 0);
+ } else {
+ goalPosP = new
Vector3f(Float.parseFloat(System.getProperty("x")),
Float.parseFloat(System.getProperty("y")),
Float.parseFloat(System.getProperty("z")));
+ }
+ }
+ this.goalPos = goalPosP;
+
+ Vector3f fromLoc = null;
+ try {
+ fromLoc = ClientContextJME.getViewManager()
+ .getPrimaryViewCell().getWorldTransform().getTranslation(null);
+ } catch (Exception e) {
+ }
+ Vector3f toLoc = goalPos;
+ if (fromLoc != null && goalPos != null && Math.abs((fromLoc.x) -
(toLoc.x)) <= 150
+ && Math.abs((fromLoc.y) - (toLoc.y)) <= 150
+ && Math.abs((fromLoc.z) - (toLoc.z)) <= 150) {
+ //Cover Screen not needed
+ } else {
+ //attach cover screen
+ final MainFrame mainFrame = JmeClientMain.getFrame();
+ final Canvas canvas = mainFrame.getCanvas();
+ final CoverScreen coverScreenPanel = new CoverScreen(csd,
canvas.getSize());
+
+ try {
+
+ //show cover screen in JDialog over the canvas panel
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ dialog = new
JDialog(mainFrame.getFrame(), "Child", false);
+
+
coverScreenPanel.setPreferredSize(canvas.getSize());
+ dialog.setSize(canvas.getSize().width,
canvas.getSize().height);
+ dialog.setLocation(canvas.getLocationOnScreen().x,
canvas.getLocationOnScreen().y);
+
+ mainFrame.getFrame().addComponentListener(new
ComponentAdapter() {
+ private void doChange() {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ if (dialog != null &&
dialog.isVisible()) {
+ Component cs =
dialog.getComponent(0);
+ Canvas canvas =
mainFrame.getCanvas();
+
cs.setPreferredSize(canvas.getSize());
+
dialog.setSize(canvas.getSize().width, canvas.getSize().height);
+
dialog.setLocation(canvas.getLocationOnScreen().x,
canvas.getLocationOnScreen().y);
+ dialog.pack();
+ dialog.setVisible(true);
+ }
+ }
+ });
+ }
+
+ public void componentResized(ComponentEvent e)
{
+ doChange();
+ }
+
+ public void componentMoved(ComponentEvent e) {
+ doChange();
+ }
+ });
+ dialog.getRootPane().setOpaque(false);
+ dialog.add(coverScreenPanel);
+
+ dialog.setUndecorated(true);
+ dialog.pack();
+ dialog.setVisible(true);
+ }
+ });
+
+ //Listener for the close icon
+ coverScreenPanel.getCloseComponent().addMouseListener(new
MouseAdapter() {
+ public void mouseClicked(MouseEvent e) {
+ if (exec_cellStatus != null) {
+ exec_cellStatus.shutdown();
+ exec_cellStatus = null;
+ }
+ if (exec != null) {
+ exec.shutdown();
+ exec = null;
+ }
+ if (dialog != null) {
+ dialog.dispose();
+ }
+ }
+ });
+
ClientContextJME.getCellManager().addCellStatusChangeListener(this);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+ }
+
+ private synchronized boolean checkIfAllCellsLoaded(Collection<Cell>
rootCells, int level, boolean log) {
+
+ Iterator<Cell> itr = rootCells.iterator();
+ while (itr.hasNext()) {
+ Cell c = itr.next();
+ if (log) {
+ for (int i = 0; i < level; i++) {
+ System.out.print(" ");
+ }
+ System.out.println(" " + c.getName() + " - " +
c.getStatus());
+ }
+ List<Cell> childs = c.getChildren();
+ if (!c.getStatus().equals(CellStatus.VISIBLE)) {
+ return false;
+ }
+ if (childs.size() != 0) {
+ if (!checkIfAllCellsLoaded(childs, level + 1, log)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ public synchronized void cellStatusChanged(final Cell cell, CellStatus
status) {
+ try {
+ if (status.equals(CellStatus.VISIBLE)
+ && (Math.abs(goalPos.x -
cell.getWorldTransform().getTranslation(null).x) <= 150
+ && Math.abs(goalPos.y -
cell.getWorldTransform().getTranslation(null).y) <= 150
+ && Math.abs(goalPos.z -
cell.getWorldTransform().getTranslation(null).z) <= 150)) {
+
+ if (flg == 1) {
+ csl = this;
+ exec_cellStatus =
Executors.newSingleThreadScheduledExecutor();
+ exec_cellStatus.scheduleAtFixedRate(new Runnable() {
+ @Override
+ public synchronized void run() {
+ try {
+ rootCells =
cell.getCellCache().getRootCells();
+ if (rootCells.size() == 1) {
+
+ exec_cellStatus.awaitTermination(5,
TimeUnit.SECONDS);
+
+ }
+ if (checkIfAllCellsLoaded(rootCells, 0,
false)) {
+ exec_cellStatus.awaitTermination(3,
TimeUnit.SECONDS);
+ if (checkIfAllCellsLoaded(rootCells,
0, false)) {
+ if (dialog != null) {
+
checkIfAllCellsLoaded(rootCells, 0, true);
+ dialog.dispose();
+ }
+ exec_cellStatus.shutdown();
+ exec_cellStatus = null;
+
ClientContextJME.getCellManager().removeCellStatusChangeListener(csl);
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }, 0, 3, TimeUnit.SECONDS);
+ flg++;
+ }
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
=======================================
--- /dev/null
+++
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/CoverScreenPropertyPanel.form
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.5" maxVersion="1.8"
type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+ <NonVisualComponents>
+ <Component class="javax.swing.JFileChooser" name="fileChooser">
+ <Properties>
+ <Property name="dialogTitle" type="java.lang.String" value="Select
Image"/>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_CreateCodeCustom"
type="java.lang.String" value="new javax.swing.JFileChooser(){
}"/>
+ <AuxValue name="JavaCodeGenerator_InitCodePost"
type="java.lang.String" value="fileChooser.addChoosableFileFilter(new

 FileNameExtensionFilter("Image
File","jpeg","JPEG"
 ,"bmp","BMP","jpg","JPG","gif","GIF"));
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);"/>
+ </AuxValues>
+ </Component>
+ </NonVisualComponents>
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer"
value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName"
type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean"
value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode"
type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean"
value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget"
type="java.lang.Integer" value="1"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle"
type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean"
value="false"/>
+ <AuxValue name="FormSettings_variablesModifier"
type="java.lang.Integer" value="2"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" max="-2" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="jLabel4" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace type="unrelated" max="-2"
attributes="0"/>
+ <Component id="txtMessage" max="32767"
attributes="0"/>
+ </Group>
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="jLabel1" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace type="unrelated" max="-2"
attributes="0"/>
+ <Component id="pnlBackColor" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace type="separate" max="-2" attributes="0"/>
+ <Component id="jLabel2" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace type="unrelated" max="-2"
attributes="0"/>
+ <Component id="pnlTextColor" min="-2" max="-2"
attributes="0"/>
+ </Group>
+ <Component id="titleCoverScreen" alignment="0" min="-2"
max="-2" attributes="0"/>
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="jLabel3" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace type="unrelated" max="-2"
attributes="0"/>
+ <Component id="txtImage" min="-2" pref="127"
max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="btnImage" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="jButton1" min="-2" max="-2"
attributes="0"/>
+ </Group>
+ </Group>
+ <EmptySpace max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="1" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="titleCoverScreen" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace type="unrelated" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="1" max="-2" attributes="0">
+ <Component id="jLabel2" max="32767" attributes="0"/>
+ <Component id="pnlTextColor" alignment="0" max="32767"
attributes="0"/>
+ <Component id="pnlBackColor" alignment="0" max="32767"
attributes="0"/>
+ <Component id="jLabel1" alignment="0" min="-2" pref="29"
max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace type="separate" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="jLabel3" alignment="3" min="-2" max="-2"
attributes="0"/>
+ <Component id="txtImage" alignment="3" min="-2" max="-2"
attributes="0"/>
+ <Component id="btnImage" alignment="3" min="-2" max="-2"
attributes="0"/>
+ <Component id="jButton1" alignment="3" min="-2" max="-2"
attributes="0"/>
+ </Group>
+ <EmptySpace type="separate" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="jLabel4" alignment="3" min="-2" max="-2"
attributes="0"/>
+ <Component id="txtMessage" alignment="3" min="-2"
max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="jLabel1">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Background
Color : "/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel2">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Text
Color : "/>
+ </Properties>
+ </Component>
+ <Container class="javax.swing.JPanel" name="pnlBackColor">
+ <Properties>
+ <Property name="background" type="java.awt.Color"
editor="org.netbeans.beaninfo.editors.ColorEditor">
+ <Color blue="0" green="0" red="0" type="rgb"/>
+ </Property>
+ <Property name="border" type="javax.swing.border.Border"
editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border
info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
+ <LineBorder/>
+ </Border>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension"
editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[29, 29]"/>
+ </Property>
+ </Properties>
+ <Events>
+ <EventHandler event="mouseClicked"
listener="java.awt.event.MouseListener"
parameters="java.awt.event.MouseEvent" handler="pnlBackColorMouseClicked"/>
+ </Events>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_ListenersCodePost"
type="java.lang.String"
value="pnlBackColor.setName("pnlBackColor");"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="27" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlTextColor">
+ <Properties>
+ <Property name="background" type="java.awt.Color"
editor="org.netbeans.beaninfo.editors.ColorEditor">
+ <Color blue="ff" green="ff" red="ff" type="rgb"/>
+ </Property>
+ <Property name="border" type="javax.swing.border.Border"
editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border
info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
+ <LineBorder/>
+ </Border>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension"
editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[29, 29]"/>
+ </Property>
+ </Properties>
+ <Events>
+ <EventHandler event="mouseClicked"
listener="java.awt.event.MouseListener"
parameters="java.awt.event.MouseEvent" handler="pnlTextColorMouseClicked"/>
+ </Events>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_ListenersCodePost"
type="java.lang.String"
value="pnlTextColor.setName("pnlTextColor");"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="27" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ </Container>
+ <Component class="javax.swing.JLabel" name="jLabel3">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Image
(Optional) : "/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="txtImage">
+ <Events>
+ <EventHandler event="actionPerformed"
listener="java.awt.event.ActionListener"
parameters="java.awt.event.ActionEvent" handler="txtImageActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="btnImage">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Choose
Image"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed"
listener="java.awt.event.ActionListener"
parameters="java.awt.event.ActionEvent" handler="btnImageActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel4">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Message : "/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="txtMessage">
+ </Component>
+ <Component class="javax.swing.JLabel" name="titleCoverScreen">
+ <Properties>
+ <Property name="font" type="java.awt.Font"
editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Tahoma" size="12" style="1"/>
+ </Property>
+ <Property name="text" type="java.lang.String" value="Cover
Screen"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JButton" name="jButton1">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Clear"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed"
listener="java.awt.event.ActionListener"
parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+</Form>
=======================================
--- /dev/null
+++
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/CoverScreenPropertyPanel.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,330 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.placemarks.client;
+
+import com.jme.renderer.ColorRGBA;
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.io.File;
+import javax.swing.JColorChooser;
+import javax.swing.JDialog;
+import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.filechooser.FileNameExtensionFilter;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+public class CoverScreenPropertyPanel extends javax.swing.JPanel {
+
+ private ColorRGBA newBackColor;
+ private ColorRGBA newTextColor;
+ private File image=null;
+
+ CoverScreenPropertyPanel() {
+ initComponents();
+ fileChooser.setAcceptAllFileFilterUsed(false);
+ txtImage.setEditable(false);
+ }
+
+ private void openFileChooser() {
+ int returnVal = fileChooser.showOpenDialog(this);
+ if (returnVal == JFileChooser.APPROVE_OPTION) {
+ File file = fileChooser.getSelectedFile();
+ try {
+ image = file;
+ txtImage.setText(file.getAbsolutePath());
+ } catch (Exception ex) {
+ }
+ }
+ }
+
+ private void openColorChooser(final MouseEvent evt) {
+ final JColorChooser chooser = new JColorChooser();
+ JDialog dialog = JColorChooser.createDialog(this, "Select color",
true
+ , chooser, new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
if(((JPanel)evt.getSource()).getName().equalsIgnoreCase("pnlBackColor")) {
+ Color newCol = chooser.getColor();
+ float[] comps = new float[3];
+ comps = newCol.getComponents(null);
+ newBackColor = new
ColorRGBA(comps[0],comps[1],comps[2],newCol.getTransparency());
+ pnlBackColor.setBackground(newCol);
+
+ } else {
+ Color newCol = chooser.getColor();
+ float[] comps = new float[3];
+ comps = newCol.getComponents(null);
+ newCol.getComponents(comps);
+ newTextColor = new
ColorRGBA(comps[0],comps[1],comps[2],newCol.getTransparency());
+ pnlTextColor.setBackground(newCol);
+
+ }
+ }
+ },null);
+ dialog.setVisible(true);
+ }
+
+ public ColorRGBA getBackColor() {
+ return newBackColor;
+ }
+
+ public void setBackColor(ColorRGBA backColor) {
+ float[] comps = new float[3];
+ comps = backColor.getColorArray();
+ newBackColor=backColor;
+ pnlBackColor.setBackground(new Color(comps[0],comps[1],comps[2]));
+ }
+
+ public ColorRGBA getTextColor() {
+ return newTextColor;
+ }
+
+ public void setTextColor(ColorRGBA textColor) {
+ float[] comps = new float[3];
+ comps = textColor.getColorArray();
+ newTextColor=textColor;
+ pnlTextColor.setBackground(new Color(comps[0],comps[1],comps[2]));
+ }
+
+ public File getImage() {
+ return image;
+ }
+
+ public String getMessage() {
+ return txtMessage.getText();
+ }
+
+ public void setMessage(String message) {
+ txtMessage.setText(message);
+ }
+
+ public String getImageURL() {
+ return txtImage.getText();
+ }
+
+ public void setImageURL(String imageURL) {
+ txtImage.setText(imageURL);
+ }
+
+ public JTextField getMessageTf() {
+ return txtMessage;
+ }
+ public JTextField getImageTf() {
+ return txtImage;
+ }
+ public JPanel getBackColorPanel() {
+ return pnlBackColor;
+ }
+ public JPanel getTextColorPanel() {
+ return pnlTextColor;
+ }
+
+ public JLabel getTitleCoverScreen() {
+ return titleCoverScreen;
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the
form.
+ * WARNING: Do NOT modify this code. The content of this method is
always
+ * regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed" desc="Generated
Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ fileChooser = new javax.swing.JFileChooser(){
+ };
+ jLabel1 = new javax.swing.JLabel();
+ jLabel2 = new javax.swing.JLabel();
+ pnlBackColor = new javax.swing.JPanel();
+ pnlTextColor = new javax.swing.JPanel();
+ jLabel3 = new javax.swing.JLabel();
+ txtImage = new javax.swing.JTextField();
+ btnImage = new javax.swing.JButton();
+ jLabel4 = new javax.swing.JLabel();
+ txtMessage = new javax.swing.JTextField();
+ titleCoverScreen = new javax.swing.JLabel();
+ jButton1 = new javax.swing.JButton();
+
+ fileChooser.setDialogTitle("Select Image");
+ fileChooser.addChoosableFileFilter(new
+ FileNameExtensionFilter("Image File","jpeg","JPEG"
+ ,"bmp","BMP","jpg","JPG","gif","GIF"));
+ fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
+
+ jLabel1.setText("Background Color : ");
+
+ jLabel2.setText("Text Color : ");
+
+ pnlBackColor.setBackground(new java.awt.Color(0, 0, 0));
+
pnlBackColor.setBorder(javax.swing.BorderFactory.createLineBorder(new
java.awt.Color(0, 0, 0)));
+ pnlBackColor.setPreferredSize(new java.awt.Dimension(29, 29));
+ pnlBackColor.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseClicked(java.awt.event.MouseEvent evt) {
+ pnlBackColorMouseClicked(evt);
+ }
+ });
+ pnlBackColor.setName("pnlBackColor");
+
+ javax.swing.GroupLayout pnlBackColorLayout = new
javax.swing.GroupLayout(pnlBackColor);
+ pnlBackColor.setLayout(pnlBackColorLayout);
+ pnlBackColorLayout.setHorizontalGroup(
+
pnlBackColorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 27, Short.MAX_VALUE)
+ );
+ pnlBackColorLayout.setVerticalGroup(
+
pnlBackColorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 0, Short.MAX_VALUE)
+ );
+
+ pnlTextColor.setBackground(new java.awt.Color(255, 255, 255));
+
pnlTextColor.setBorder(javax.swing.BorderFactory.createLineBorder(new
java.awt.Color(0, 0, 0)));
+ pnlTextColor.setPreferredSize(new java.awt.Dimension(29, 29));
+ pnlTextColor.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseClicked(java.awt.event.MouseEvent evt) {
+ pnlTextColorMouseClicked(evt);
+ }
+ });
+ pnlTextColor.setName("pnlTextColor");
+
+ javax.swing.GroupLayout pnlTextColorLayout = new
javax.swing.GroupLayout(pnlTextColor);
+ pnlTextColor.setLayout(pnlTextColorLayout);
+ pnlTextColorLayout.setHorizontalGroup(
+
pnlTextColorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 27, Short.MAX_VALUE)
+ );
+ pnlTextColorLayout.setVerticalGroup(
+
pnlTextColorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 0, Short.MAX_VALUE)
+ );
+
+ jLabel3.setText("Image (Optional) : ");
+
+ txtImage.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ txtImageActionPerformed(evt);
+ }
+ });
+
+ btnImage.setText("Choose Image");
+ btnImage.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnImageActionPerformed(evt);
+ }
+ });
+
+ jLabel4.setText("Message : ");
+
+ titleCoverScreen.setFont(new java.awt.Font("Tahoma", 1, 12)); //
NOI18N
+ titleCoverScreen.setText("Cover Screen");
+
+ jButton1.setText("Clear");
+ jButton1.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButton1ActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel4)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(txtMessage))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel1)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(pnlBackColor,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(18, 18, 18)
+ .addComponent(jLabel2)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(pnlTextColor,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addComponent(titleCoverScreen)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel3)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(txtImage,
javax.swing.GroupLayout.PREFERRED_SIZE, 127,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(btnImage)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jButton1)))
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
+ );
+ layout.setVerticalGroup(
+
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(titleCoverScreen)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
false)
+ .addComponent(jLabel2,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
+ .addComponent(pnlTextColor,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
+ .addComponent(pnlBackColor,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
+ .addComponent(jLabel1,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.PREFERRED_SIZE, 29,
javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGap(18, 18, 18)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jLabel3)
+ .addComponent(txtImage,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(btnImage)
+ .addComponent(jButton1))
+ .addGap(18, 18, 18)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jLabel4)
+ .addComponent(txtMessage,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addContainerGap())
+ );
+ }// </editor-fold>//GEN-END:initComponents
+
+ private void pnlTextColorMouseClicked(java.awt.event.MouseEvent evt)
{//GEN-FIRST:event_pnlTextColorMouseClicked
+ // TODO add your handling code here:
+ openColorChooser(evt);
+ }//GEN-LAST:event_pnlTextColorMouseClicked
+
+ private void pnlBackColorMouseClicked(java.awt.event.MouseEvent evt)
{//GEN-FIRST:event_pnlBackColorMouseClicked
+ // TODO add your handling code here:
+ openColorChooser(evt);
+ }//GEN-LAST:event_pnlBackColorMouseClicked
+
+ private void txtImageActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_txtImageActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_txtImageActionPerformed
+
+ private void btnImageActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_btnImageActionPerformed
+ // TODO add your handling code here:
+ openFileChooser();
+ }//GEN-LAST:event_btnImageActionPerformed
+
+ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_jButton1ActionPerformed
+ // TODO add your handling code here:
+ txtImage.setText("");
+ image = null;
+ }//GEN-LAST:event_jButton1ActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton btnImage;
+ private javax.swing.JFileChooser fileChooser;
+ private javax.swing.JButton jButton1;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel3;
+ private javax.swing.JLabel jLabel4;
+ private javax.swing.JPanel pnlBackColor;
+ private javax.swing.JPanel pnlTextColor;
+ private javax.swing.JLabel titleCoverScreen;
+ private javax.swing.JTextField txtImage;
+ private javax.swing.JTextField txtMessage;
+ // End of variables declaration//GEN-END:variables
+}
=======================================
--- /dev/null
+++
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/client/resources/loading.gif
Tue Sep 23 05:22:54 2014 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/common/CoverScreenData.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.placemarks.common;
+
+import com.jme.renderer.ColorRGBA;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+public class CoverScreenData {
+ private ColorRGBA backgroundColor=ColorRGBA.black;
+ private ColorRGBA textColor=ColorRGBA.white;
+ private String imageURL="";
+ private String message="Teleporting. Please Wait...";
+
+ public CoverScreenData(ColorRGBA backgroundColor, ColorRGBA textColor,
String imageURL, String message) {
+ this.backgroundColor = backgroundColor;
+ this.textColor =textColor;
+ this.imageURL = imageURL;
+ this.message = message;
+ }
+
+ public CoverScreenData() {
+
+ }
+
+ public ColorRGBA getBackgroundColor() {
+ return backgroundColor;
+ }
+
+ public void setBackgroundColor(ColorRGBA backgroundColor) {
+ this.backgroundColor = backgroundColor;
+ }
+
+ public ColorRGBA getTextColor() {
+ return textColor;
+ }
+
+ public void setTextColor(ColorRGBA textColor) {
+ this.textColor = textColor;
+ }
+
+ public String getImageURL() {
+ return imageURL;
+ }
+
+ public void setImageURL(String imageURL) {
+ this.imageURL = imageURL;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+}
=======================================
--- /dev/null
+++
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/common/GoToCoverScreenInfo.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,112 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.placemarks.common;
+
+import com.jme.renderer.ColorRGBA;
+import java.io.Reader;
+import java.io.Serializable;
+import java.io.Writer;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+@XmlRootElement(name="goto-cover-screen")
+public class GoToCoverScreenInfo extends CoverScreenData implements
Serializable{
+
+ private ColorRGBA backgroundColor=ColorRGBA.black;
+ private ColorRGBA textColor=ColorRGBA.white;
+ private String imageURL="";
+ private String message="Teleporting. Please Wait...";
+
+ /* The JAXB content to (de)serialize to/from XML */
+ private static JAXBContext jaxbContext = null;
+ static {
+ try {
+ jaxbContext =
JAXBContext.newInstance(GoToCoverScreenInfo.class);
+ } catch (javax.xml.bind.JAXBException excp) {
+ excp.printStackTrace();
+ }
+ }
+
+ public GoToCoverScreenInfo(ColorRGBA backgroundColor, ColorRGBA
textColor, String imageURL, String message) {
+ this.backgroundColor = backgroundColor;
+ this.textColor =textColor;
+ this.imageURL = imageURL;
+ this.message = message;
+ }
+
+ public GoToCoverScreenInfo() {
+
+ }
+
+ public ColorRGBA getBackgroundColor() {
+ return backgroundColor;
+ }
+
+ public void setBackgroundColor(ColorRGBA backgroundColor) {
+ this.backgroundColor = backgroundColor;
+ }
+
+ public ColorRGBA getTextColor() {
+ return textColor;
+ }
+
+ public void setTextColor(ColorRGBA textColor) {
+ this.textColor = textColor;
+ }
+
+ public String getImageURL() {
+ return imageURL;
+ }
+
+ public void setImageURL(String imageURL) {
+ this.imageURL = imageURL;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ /**
+ * Takes the input reader of the XML file and instantiates an instance
of
+ * the GoToCoverScreenInfo class
+ * <p>
+ * @param r The input reader of the version XML file
+ * @throw ClassCastException If the input file does not map to
PlacemarkList
+ * @throw JAXBException Upon error reading the XML file
+ */
+ public static GoToCoverScreenInfo decode(Reader r) throws
JAXBException {
+ // Unmarshall the XML into a PlacemarkList class
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ GoToCoverScreenInfo goToCoverScreenInfo =
(GoToCoverScreenInfo)unmarshaller.unmarshal(r);
+
+ return goToCoverScreenInfo;
+ }
+
+ /**
+ * Writes the GoToCoverScreenInfo class to an output writer.
+ * <p>
+ * @param w The output writer to write to
+ * @throw JAXBException Upon error writing the XML file
+ */
+ public void encode(Writer w) throws JAXBException {
+
+ // Marshall the GoToCoverScreenInfo class into XML
+ Marshaller marshaller = jaxbContext.createMarshaller();
+ marshaller.setProperty("jaxb.formatted.output", true);
+ marshaller.marshal(this, w);
+ }
+
+}
=======================================
--- /dev/null
+++
/trunk/modules/tools/placemarks/src/classes/org/jdesktop/wonderland/modules/placemarks/common/LoginCoverScreenInfo.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,111 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.placemarks.common;
+
+import com.jme.renderer.ColorRGBA;
+import java.io.Reader;
+import java.io.Serializable;
+import java.io.Writer;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+@XmlRootElement(name="login-cover-screen")
+public class LoginCoverScreenInfo implements Serializable {
+ private ColorRGBA backgroundColor=ColorRGBA.black;
+ private ColorRGBA textColor=ColorRGBA.white;
+ private String imageURL="";
+ private String message="Teleporting. Please Wait...";
+
+ /* The JAXB content to (de)serialize to/from XML */
+ private static JAXBContext jaxbContext = null;
+ static {
+ try {
+ jaxbContext =
JAXBContext.newInstance(LoginCoverScreenInfo.class);
+ } catch (javax.xml.bind.JAXBException excp) {
+ excp.printStackTrace();
+ }
+ }
+
+ public LoginCoverScreenInfo(ColorRGBA backgroundColor, ColorRGBA
textColor, String imageURL, String message) {
+ this.backgroundColor = backgroundColor;
+ this.textColor =textColor;
+ this.imageURL = imageURL;
+ this.message = message;
+ }
+
+ public LoginCoverScreenInfo() {
+
+ }
+
+ public ColorRGBA getBackgroundColor() {
+ return backgroundColor;
+ }
+
+ public void setBackgroundColor(ColorRGBA backgroundColor) {
+ this.backgroundColor = backgroundColor;
+ }
+
+ public ColorRGBA getTextColor() {
+ return textColor;
+ }
+
+ public void setTextColor(ColorRGBA textColor) {
+ this.textColor = textColor;
+ }
+
+ public String getImageURL() {
+ return imageURL;
+ }
+
+ public void setImageURL(String imageURL) {
+ this.imageURL = imageURL;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ /**
+ * Takes the input reader of the XML file and instantiates an instance
of
+ * the LoginCoverScreenInfo class
+ * <p>
+ * @param r The input reader of the version XML file
+ * @throw ClassCastException If the input file does not map to
PlacemarkList
+ * @throw JAXBException Upon error reading the XML file
+ */
+ public static LoginCoverScreenInfo decode(Reader r) throws
JAXBException {
+ // Unmarshall the XML into a PlacemarkList class
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ LoginCoverScreenInfo loginCoverScreenInfo =
(LoginCoverScreenInfo)unmarshaller.unmarshal(r);
+
+ return loginCoverScreenInfo;
+ }
+
+ /**
+ * Writes the LoginCoverScreenInfo class to an output writer.
+ * <p>
+ * @param w The output writer to write to
+ * @throw JAXBException Upon error writing the XML file
+ */
+ public void encode(Writer w) throws JAXBException {
+
+ // Marshall the LoginCoverScreenInfo class into XML
+ Marshaller marshaller = jaxbContext.createMarshaller();
+ marshaller.setProperty("jaxb.formatted.output", true);
+ marshaller.marshal(this, w);
+ }
+
+}
=======================================
--- /dev/null
+++
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/CoverScreen.form
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.5" maxVersion="1.8"
type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+ <Properties>
+ <Property name="background" type="java.awt.Color"
editor="org.netbeans.beaninfo.editors.ColorEditor">
+ <Color blue="0" green="0" red="0" type="rgb"/>
+ </Property>
+ <Property name="opaque" type="boolean" value="false"/>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer"
value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName"
type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean"
value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode"
type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean"
value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget"
type="java.lang.Integer" value="1"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle"
type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean"
value="false"/>
+ <AuxValue name="FormSettings_variablesModifier"
type="java.lang.Integer" value="2"/>
+ <AuxValue name="designerSize" type="java.awt.Dimension"
value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,57,0,0,2,112"/>
+ </AuxValues>
+
+ <Layout
class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="jPanel1">
+ <Properties>
+ <Property name="opaque" type="boolean" value="false"/>
+ </Properties>
+ <Constraints>
+ <Constraint
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"
value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="Center"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout
class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ </Container>
+ </SubComponents>
+</Form>
=======================================
--- /dev/null
+++
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/CoverScreen.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,218 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.userlist.client;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
+import java.awt.font.FontRenderContext;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.imageio.ImageIO;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import org.jdesktop.wonderland.client.cell.asset.AssetUtils;
+import org.jdesktop.wonderland.client.login.LoginManager;
+import
org.jdesktop.wonderland.modules.contentrepo.client.ContentRepository;
+import
org.jdesktop.wonderland.modules.contentrepo.client.ContentRepositoryRegistry;
+import
org.jdesktop.wonderland.modules.contentrepo.common.ContentCollection;
+import org.jdesktop.wonderland.modules.contentrepo.common.ContentResource;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+public class CoverScreen extends javax.swing.JPanel {
+
+ private CoverScreenData coverScreenData=null;
+ private JLabel closeIcon = null;
+ private CoverScreenMainPanel csp = null;
+ private int i=0;
+ private Image img = null;
+
+ /**
+ * Creates new form CoverScreen
+ */
+ public CoverScreen(CoverScreenData coverScreenData,Dimension dim) {
+ this.coverScreenData = coverScreenData;
+ initComponents();
+ csp = new CoverScreenMainPanel();
+ csp.addComponentListener(new ComponentAdapter() {
+
+ public void componentResized(ComponentEvent e) {
+ Insets insets = ((JPanel)e.getComponent()).getInsets();
+ Dimension size = closeIcon.getPreferredSize();
+ closeIcon.setBounds((int)
(((JPanel)e.getComponent()).getPreferredSize().getWidth()-size.width) +
insets.left, insets.top,
+ size.width, size.height);
+ }
+
+ });
+ csp.setLayout(null);
+ closeIcon = new JLabel();
+ csp.setPreferredSize(dim.getSize());
+ closeIcon.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
+ closeIcon.setLocation(100, 100);
+
+ closeIcon.setHorizontalAlignment(JLabel.RIGHT);
+ closeIcon.setPreferredSize(new Dimension(10, 17));
+ closeIcon.setText("X");
+ closeIcon.setOpaque(true);
+ if(coverScreenData!=null) {
+ float[] comps = coverScreenData
+ .getBackgroundColor().getColorArray();
+ csp.setBackground(new Color(comps[0],comps[1],comps[2]));
+ }
+
+ csp.add(closeIcon);
+ Insets insets = csp.getInsets();
+ Dimension size = closeIcon.getPreferredSize();
+ closeIcon.setBounds((int)
(csp.getPreferredSize().getWidth()-size.width) + insets.left, insets.top,
+ size.width, size.height);
+ jPanel1.add(csp, BorderLayout.CENTER);
+ setPreferredSize(null);
+
+ if(coverScreenData.getImageURL()!=null &&
+ (!coverScreenData.getImageURL().equals(""))) {
+ try {
+ img = csp.scaleImage(AssetUtils
+ .getAssetURL(coverScreenData.getImageURL()),(int)dim.getSize().getWidth()
+ ,(int)dim.getSize().getHeight());
+ } catch (MalformedURLException ex) {
+
Logger.getLogger(CoverScreen.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+
+ }
+
+ public JLabel getCloseComponent() {
+ return closeIcon;
+ }
+
+ private class CoverScreenMainPanel extends JPanel {
+ ImageIcon ii=null;
+
+ private Image scaleImage(URL imageURL,int width, int height) {
+ try {
+ Image scaledBimg = null;
+ ContentRepositoryRegistry registry =
ContentRepositoryRegistry.getInstance();
+ ContentRepository cr =
registry.getRepository(LoginManager.getPrimary());
+ String[] urls = imageURL.toString().split("/");
+ String fname = urls[urls.length-1];
+ String userName = urls[3];
+ ContentCollection user = cr.getUserRoot(userName);
+
+ ContentResource res = (ContentResource)
user.getChild(fname);
+
+ BufferedImage bimg = ImageIO.read(res.getInputStream());
+ if(bimg.getWidth()>width || bimg.getHeight()>height) {
+ if(bimg.getWidth()>width && bimg.getHeight()>height) {
+ if(bimg.getWidth()-width>bimg.getHeight()-height) {
+ float nw = width;
+ float nh =
(width*bimg.getHeight())/bimg.getWidth();
+ scaledBimg = bimg.getScaledInstance((int)nw,
(int)nh,BufferedImage.SCALE_SMOOTH);
+ //scaledBimg.getGraphics().drawImage(bimg, 0,
0, null);
+ } else {
+ float nh = height;
+ float nw =
(height*bimg.getWidth())/bimg.getHeight();
+ scaledBimg = bimg.getScaledInstance((int)nw,
(int)nh,BufferedImage.SCALE_SMOOTH);
+ //scaledBimg.getGraphics().drawImage(bimg, 0,
0, null);
+ }
+ } else if(bimg.getWidth()>width) {
+ float nw = width;
+ float nh =
(width*bimg.getHeight())/bimg.getWidth();
+ scaledBimg = bimg.getScaledInstance((int)nw,
(int)nh,BufferedImage.SCALE_SMOOTH);
+ } else if(bimg.getHeight()>height) {
+ float nh = height;
+ float nw =
(height*bimg.getWidth())/bimg.getHeight();
+ scaledBimg = bimg.getScaledInstance((int)nw,
(int)nh,BufferedImage.SCALE_SMOOTH);
+ }
+ } else {
+ scaledBimg = bimg;
+ }
+ return scaledBimg;
+ } catch (Exception ex) {
+ ex.printStackTrace();
+
Logger.getLogger(CoverScreen.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ return null;
+ }
+
+ @Override
+ public void paintComponent(Graphics g) {
+
+ super.paintComponent(g);
+ if(coverScreenData!=null) {
+ Graphics2D g2d = (Graphics2D) g;
+ if(coverScreenData.getImageURL()!=null &&
+ (!coverScreenData.getImageURL().equals(""))) {
+
+ try {
+ g2d.drawImage(img,
(getWidth()/2)-(img.getWidth(null)/2)
+ , (getHeight()/2)-(img.getHeight(null)/2),
this);
+ } catch (Exception ex) {
+
Logger.getLogger(CoverScreen.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+ Image img = new ImageIcon(getClass()
+ .getResource("/org/jdesktop/wonderland/modules/placemarks/client/resources/loading.gif")).getImage();
+
+ g2d.drawImage(img, (getWidth()/2)-(img.getWidth(null)/2),
(getHeight()/2)-(img.getHeight(null)/2)
+ , this);
+ float[] comps = coverScreenData
+ .getTextColor().getColorArray();
+ g2d.setColor(new Color(comps[0],comps[1],comps[2]));
+ Font font = new Font("Arial", Font.BOLD,20);
+ FontRenderContext frc1 = new FontRenderContext(null, true,
true);
+ Rectangle2D rec =
font.getStringBounds(coverScreenData.getMessage(), frc1);
+ int w = (int) (rec.getWidth());
+ int h = (int) (rec.getHeight());
+ g2d.setFont(font);
+ g2d.drawString(coverScreenData.getMessage()
+ , (getWidth()/2)-(w/2), getHeight()-(h)+10 );
+ }
+ Insets insets = getInsets();
+ Dimension size = closeIcon.getPreferredSize();
+ closeIcon.setBounds((int) (getWidth()-size.width) +
insets.left, insets.top,
+ size.width, size.height);
+ }
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the
form.
+ * WARNING: Do NOT modify this code. The content of this method is
always
+ * regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed" desc="Generated
Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jPanel1 = new javax.swing.JPanel();
+
+ setBackground(new java.awt.Color(0, 0, 0));
+ setOpaque(false);
+ setLayout(new java.awt.BorderLayout());
+
+ jPanel1.setOpaque(false);
+ jPanel1.setLayout(new java.awt.BorderLayout());
+ add(jPanel1, java.awt.BorderLayout.CENTER);
+ }// </editor-fold>//GEN-END:initComponents
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JPanel jPanel1;
+ // End of variables declaration//GEN-END:variables
+}
=======================================
--- /dev/null
+++
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/CoverScreenData.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.userlist.client;
+
+import com.jme.renderer.ColorRGBA;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+public class CoverScreenData {
+ private ColorRGBA backgroundColor=ColorRGBA.black;
+ private ColorRGBA textColor=ColorRGBA.white;
+ private String imageURL="";
+ private String message="Teleporting. Please Wait...";
+
+ public CoverScreenData(ColorRGBA backgroundColor, ColorRGBA textColor,
String imageURL, String message) {
+ this.backgroundColor = backgroundColor;
+ this.textColor =textColor;
+ this.imageURL = imageURL;
+ this.message = message;
+ }
+
+ public CoverScreenData() {
+
+ }
+
+ public ColorRGBA getBackgroundColor() {
+ return backgroundColor;
+ }
+
+ public void setBackgroundColor(ColorRGBA backgroundColor) {
+ this.backgroundColor = backgroundColor;
+ }
+
+ public ColorRGBA getTextColor() {
+ return textColor;
+ }
+
+ public void setTextColor(ColorRGBA textColor) {
+ this.textColor = textColor;
+ }
+
+ public String getImageURL() {
+ return imageURL;
+ }
+
+ public void setImageURL(String imageURL) {
+ this.imageURL = imageURL;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+}
=======================================
--- /dev/null
+++
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/CoverScreenListener.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,194 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.userlist.client;
+
+import com.jme.math.Vector3f;
+import java.awt.Canvas;
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.SwingUtilities;
+import org.jdesktop.wonderland.client.cell.Cell;
+import org.jdesktop.wonderland.client.cell.CellStatusChangeListener;
+import org.jdesktop.wonderland.client.jme.ClientContextJME;
+import org.jdesktop.wonderland.client.jme.JmeClientMain;
+import org.jdesktop.wonderland.client.jme.MainFrame;
+import org.jdesktop.wonderland.common.cell.CellStatus;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+public class CoverScreenListener implements CellStatusChangeListener{
+
+ private int flg=1;
+ private Collection<Cell> rootCells = new ArrayList<Cell>();
+ private CellStatusChangeListener csl=null;
+ private ScheduledExecutorService exec=null;
+ private CellStatus cs=null;
+ private ScheduledExecutorService exec_cellStatus = null;
+ private JDialog dialog=null;
+
+ public CoverScreenListener(final Vector3f goalPos,final
CoverScreenData csd) {
+ Vector3f fromLoc = ClientContextJME.getViewManager()
+ .getPrimaryViewCell().getWorldTransform().getTranslation(null);
+ Vector3f toLoc = goalPos;
+ if(Math.abs((fromLoc.x)-(toLoc.x))<=150 &&
+ Math.abs((fromLoc.y)-(toLoc.y))<=150 &&
+ Math.abs((fromLoc.z)-(toLoc.z))<=150) {
+ //Cover Screen not needed
+ } else {
+ //attach cover screen
+ final MainFrame mainFrame = JmeClientMain.getFrame();
+ final Canvas canvas = mainFrame.getCanvas();
+ final CoverScreen coverScreenPanel = new
CoverScreen(csd,canvas.getSize());
+
+ try {
+ //show cover screen in JDialog over the canvas panel
+ SwingUtilities.invokeLater(new Runnable() {
+
+ public void run() {
+ dialog = new
JDialog(mainFrame.getFrame(), "Child", false);
+
coverScreenPanel.setPreferredSize(canvas.getSize());
+ dialog.setSize(canvas.getSize().width
+ ,canvas.getSize().height);
+ dialog.setLocation(canvas.getLocationOnScreen().x
+ ,canvas.getLocationOnScreen().y);
+ JButton button = new JButton("Button");
+ button.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ dialog.dispose();
+ }
+ });
+ mainFrame.getFrame().addComponentListener(new
ComponentAdapter() {
+
+ private void doChange() {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ if (dialog != null &&
dialog.isVisible()) {
+ Component cs =
dialog.getComponent(0);
+ Canvas canvas =
mainFrame.getCanvas();
+
cs.setPreferredSize(canvas.getSize());
+
dialog.setSize(canvas.getSize().width, canvas.getSize().height);
+
dialog.setLocation(canvas.getLocationOnScreen().x,
canvas.getLocationOnScreen().y);
+ dialog.pack();
+ dialog.setVisible(true);
+ }
+ }
+ });
+ }
+
+ public void componentResized(ComponentEvent e)
{
+ doChange();
+ }
+
+ public void componentMoved(ComponentEvent e) {
+ doChange();
+ }
+
+ });
+ dialog.getRootPane().setOpaque(false);
+ dialog.add(coverScreenPanel);
+
+ dialog.setUndecorated(true);
+ dialog.pack();
+ dialog.setVisible(true);
+ }
+ });
+ //Listener for the close icon
+ coverScreenPanel.getCloseComponent().addMouseListener(new
MouseAdapter() {
+ public void mouseClicked(MouseEvent e) {
+ if(exec_cellStatus!=null) {
+ exec_cellStatus.shutdown();
+ exec_cellStatus=null;
+ }
+ if(exec!=null) {
+ exec.shutdown();
+ exec=null;
+ }
+ if(dialog!=null ) {
+ dialog.dispose();
+ }
+ }
+
+ });
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
ClientContextJME.getCellManager().addCellStatusChangeListener(this);
+ }
+ }
+
+ private boolean checkIfAllCellsLoaded(Collection<Cell> rootCells,int
level) {
+
+ Iterator<Cell> itr = rootCells.iterator();
+ while(itr.hasNext()) {
+ Cell c = itr.next();
+ List<Cell> childs = c.getChildren();
+ if(!c.getStatus().equals(CellStatus.VISIBLE)) {
+ return false;
+ }
+ if(childs.size()!=0) {
+ if(!checkIfAllCellsLoaded(childs,level+1)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ public void cellStatusChanged(final Cell cell, CellStatus status) {
+
+ if(status.equals(CellStatus.VISIBLE)) {
+ if(flg==1) {
+ if(exec!=null) {
+ exec.shutdown();
+ }
+ csl = this;
+ exec_cellStatus =
Executors.newSingleThreadScheduledExecutor();
+ exec_cellStatus.scheduleAtFixedRate(new Runnable() {
+ @Override
+ public void run() {
+
+ rootCells = cell.getCellCache().getRootCells();
+ if(rootCells.size()==1) {
+ try {
+ exec_cellStatus.awaitTermination(20,
TimeUnit.SECONDS);
+ } catch (InterruptedException ex) {
+
Logger.getLogger(CoverScreenListener.class.getName()).log(Level.SEVERE,
null, ex);
+ }
+ rootCells = cell.getCellCache().getRootCells();
+ }
+ if(checkIfAllCellsLoaded(rootCells,0)) {
+ if(dialog!=null) {
+ dialog.dispose();
+ }
+ exec_cellStatus.shutdown();
+ exec_cellStatus=null;
+
ClientContextJME.getCellManager().removeCellStatusChangeListener(csl);
+ }
+ }
+ }, 0, 3, TimeUnit.SECONDS);
+ }
+ flg++;
+ }
+ }
+}
=======================================
--- /dev/null
+++
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/CoverScreenPropertyPanel.form
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.5" maxVersion="1.8"
type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+ <NonVisualComponents>
+ <Component class="javax.swing.JFileChooser" name="fileChooser">
+ <Properties>
+ <Property name="dialogTitle" type="java.lang.String" value="Select
Image"/>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_CreateCodeCustom"
type="java.lang.String" value="new javax.swing.JFileChooser(){
}"/>
+ <AuxValue name="JavaCodeGenerator_InitCodePost"
type="java.lang.String" value="fileChooser.addChoosableFileFilter(new

 FileNameExtensionFilter("Image
File","jpeg","JPEG"
 ,"bmp","BMP","jpg","JPG","gif","GIF"));
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);"/>
+ </AuxValues>
+ </Component>
+ </NonVisualComponents>
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer"
value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName"
type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean"
value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode"
type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean"
value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget"
type="java.lang.Integer" value="1"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle"
type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean"
value="false"/>
+ <AuxValue name="FormSettings_variablesModifier"
type="java.lang.Integer" value="2"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" max="-2" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="jLabel4" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace type="unrelated" max="-2"
attributes="0"/>
+ <Component id="txtMessage" max="32767"
attributes="0"/>
+ </Group>
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="jLabel1" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace type="unrelated" max="-2"
attributes="0"/>
+ <Component id="pnlBackColor" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace type="separate" max="-2" attributes="0"/>
+ <Component id="jLabel2" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace type="unrelated" max="-2"
attributes="0"/>
+ <Component id="pnlTextColor" min="-2" max="-2"
attributes="0"/>
+ </Group>
+ <Component id="jLabel5" alignment="0" min="-2" max="-2"
attributes="0"/>
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="jLabel3" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace type="unrelated" max="-2"
attributes="0"/>
+ <Component id="txtImage" min="-2" pref="127"
max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="btnImage" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="jButton1" min="-2" max="-2"
attributes="0"/>
+ </Group>
+ </Group>
+ <EmptySpace max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="1" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="jLabel5" min="-2" max="-2" attributes="0"/>
+ <EmptySpace type="unrelated" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="1" max="-2" attributes="0">
+ <Component id="jLabel2" max="32767" attributes="0"/>
+ <Component id="pnlTextColor" alignment="0" max="32767"
attributes="0"/>
+ <Component id="pnlBackColor" alignment="0" max="32767"
attributes="0"/>
+ <Component id="jLabel1" alignment="0" min="-2" pref="29"
max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace type="separate" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="jLabel3" alignment="3" min="-2" max="-2"
attributes="0"/>
+ <Component id="txtImage" alignment="3" min="-2" max="-2"
attributes="0"/>
+ <Component id="btnImage" alignment="3" min="-2" max="-2"
attributes="0"/>
+ <Component id="jButton1" alignment="3" min="-2" max="-2"
attributes="0"/>
+ </Group>
+ <EmptySpace type="separate" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="jLabel4" alignment="3" min="-2" max="-2"
attributes="0"/>
+ <Component id="txtMessage" alignment="3" min="-2"
max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="jLabel1">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Background
Color : "/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel2">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Text
Color : "/>
+ </Properties>
+ </Component>
+ <Container class="javax.swing.JPanel" name="pnlBackColor">
+ <Properties>
+ <Property name="background" type="java.awt.Color"
editor="org.netbeans.beaninfo.editors.ColorEditor">
+ <Color blue="0" green="0" red="0" type="rgb"/>
+ </Property>
+ <Property name="border" type="javax.swing.border.Border"
editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border
info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
+ <LineBorder/>
+ </Border>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension"
editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[29, 29]"/>
+ </Property>
+ </Properties>
+ <Events>
+ <EventHandler event="mouseClicked"
listener="java.awt.event.MouseListener"
parameters="java.awt.event.MouseEvent" handler="pnlBackColorMouseClicked"/>
+ </Events>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_ListenersCodePost"
type="java.lang.String"
value="pnlBackColor.setName("pnlBackColor");"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="27" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlTextColor">
+ <Properties>
+ <Property name="background" type="java.awt.Color"
editor="org.netbeans.beaninfo.editors.ColorEditor">
+ <Color blue="ff" green="ff" red="ff" type="rgb"/>
+ </Property>
+ <Property name="border" type="javax.swing.border.Border"
editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border
info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
+ <LineBorder/>
+ </Border>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension"
editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[29, 29]"/>
+ </Property>
+ </Properties>
+ <Events>
+ <EventHandler event="mouseClicked"
listener="java.awt.event.MouseListener"
parameters="java.awt.event.MouseEvent" handler="pnlTextColorMouseClicked"/>
+ </Events>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_ListenersCodePost"
type="java.lang.String"
value="pnlTextColor.setName("pnlTextColor");"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="27" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ </Container>
+ <Component class="javax.swing.JLabel" name="jLabel3">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Image
(Optional) : "/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="txtImage">
+ <Events>
+ <EventHandler event="actionPerformed"
listener="java.awt.event.ActionListener"
parameters="java.awt.event.ActionEvent" handler="txtImageActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="btnImage">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Choose
Image"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed"
listener="java.awt.event.ActionListener"
parameters="java.awt.event.ActionEvent" handler="btnImageActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel4">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Message : "/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="txtMessage">
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel5">
+ <Properties>
+ <Property name="font" type="java.awt.Font"
editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Tahoma" size="12" style="1"/>
+ </Property>
+ <Property name="text" type="java.lang.String" value="Cover
Screen"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JButton" name="jButton1">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Clear"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed"
listener="java.awt.event.ActionListener"
parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+</Form>
=======================================
--- /dev/null
+++
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/CoverScreenPropertyPanel.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,324 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.userlist.client;
+
+import com.jme.renderer.ColorRGBA;
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.io.File;
+import javax.swing.JColorChooser;
+import javax.swing.JDialog;
+import javax.swing.JFileChooser;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.filechooser.FileNameExtensionFilter;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+public class CoverScreenPropertyPanel extends javax.swing.JPanel {
+
+
+ ColorRGBA newBackColor;
+ ColorRGBA newTextColor;
+ File image=null;
+
+ CoverScreenPropertyPanel() {
+ initComponents();
+ fileChooser.setAcceptAllFileFilterUsed(false);
+ txtImage.setEditable(false);
+ }
+
+ private void openFileChooser() {
+ int returnVal = fileChooser.showOpenDialog(this);
+ if (returnVal == JFileChooser.APPROVE_OPTION) {
+ File file = fileChooser.getSelectedFile();
+ try {
+ image = file;
+ txtImage.setText(file.getAbsolutePath());
+ } catch (Exception ex) {
+ }
+ }
+ }
+
+ private void openColorChooser(final MouseEvent evt) {
+ final JColorChooser chooser = new JColorChooser();
+ JDialog dialog = JColorChooser.createDialog(this, "Select color",
true
+ , chooser, new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
if(((JPanel)evt.getSource()).getName().equalsIgnoreCase("pnlBackColor")) {
+ Color newCol = chooser.getColor();
+ float[] comps = new float[3];
+ comps = newCol.getComponents(null);
+ newBackColor = new
ColorRGBA(comps[0],comps[1],comps[2],newCol.getTransparency());
+ pnlBackColor.setBackground(newCol);
+
+ } else {
+ Color newCol = chooser.getColor();
+ float[] comps = new float[3];
+ comps = newCol.getComponents(null);
+ newCol.getComponents(comps);
+ newTextColor = new
ColorRGBA(comps[0],comps[1],comps[2],newCol.getTransparency());
+ pnlTextColor.setBackground(newCol);
+ }
+ }
+ },null);
+ dialog.setVisible(true);
+ }
+
+ public ColorRGBA getBackColor() {
+ return newBackColor;
+ }
+
+ public void setBackColor(ColorRGBA backColor) {
+ float[] comps = new float[3];
+ comps = backColor.getColorArray();
+ newBackColor=backColor;
+ pnlBackColor.setBackground(new Color(comps[0],comps[1],comps[2]));
+ }
+
+ public ColorRGBA getTextColor() {
+ return newTextColor;
+ }
+
+ public void setTextColor(ColorRGBA textColor) {
+ float[] comps = new float[3];
+ comps = textColor.getColorArray();
+ newTextColor=textColor;
+ pnlTextColor.setBackground(new Color(comps[0],comps[1],comps[2]));
+ }
+
+ public File getImage() {
+ return image;
+ }
+
+ public String getMessage() {
+ return txtMessage.getText();
+ }
+
+ public void setMessage(String message) {
+ txtMessage.setText(message);
+ }
+
+ public String getImageURL() {
+ return txtImage.getText();
+ }
+
+ public void setImageURL(String imageURL) {
+ txtImage.setText(imageURL);
+ }
+
+ public JTextField getMessageTf() {
+ return txtMessage;
+ }
+ public JTextField getImageTf() {
+ return txtImage;
+ }
+ public JPanel getBackColorPanel() {
+ return pnlBackColor;
+ }
+ public JPanel getTextColorPanel() {
+ return pnlTextColor;
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the
form.
+ * WARNING: Do NOT modify this code. The content of this method is
always
+ * regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed" desc="Generated
Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ fileChooser = new javax.swing.JFileChooser(){
+ };
+ jLabel1 = new javax.swing.JLabel();
+ jLabel2 = new javax.swing.JLabel();
+ pnlBackColor = new javax.swing.JPanel();
+ pnlTextColor = new javax.swing.JPanel();
+ jLabel3 = new javax.swing.JLabel();
+ txtImage = new javax.swing.JTextField();
+ btnImage = new javax.swing.JButton();
+ jLabel4 = new javax.swing.JLabel();
+ txtMessage = new javax.swing.JTextField();
+ jLabel5 = new javax.swing.JLabel();
+ jButton1 = new javax.swing.JButton();
+
+ fileChooser.setDialogTitle("Select Image");
+ fileChooser.addChoosableFileFilter(new
+ FileNameExtensionFilter("Image File","jpeg","JPEG"
+ ,"bmp","BMP","jpg","JPG","gif","GIF"));
+ fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
+
+ jLabel1.setText("Background Color : ");
+
+ jLabel2.setText("Text Color : ");
+
+ pnlBackColor.setBackground(new java.awt.Color(0, 0, 0));
+
pnlBackColor.setBorder(javax.swing.BorderFactory.createLineBorder(new
java.awt.Color(0, 0, 0)));
+ pnlBackColor.setPreferredSize(new java.awt.Dimension(29, 29));
+ pnlBackColor.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseClicked(java.awt.event.MouseEvent evt) {
+ pnlBackColorMouseClicked(evt);
+ }
+ });
+ pnlBackColor.setName("pnlBackColor");
+
+ javax.swing.GroupLayout pnlBackColorLayout = new
javax.swing.GroupLayout(pnlBackColor);
+ pnlBackColor.setLayout(pnlBackColorLayout);
+ pnlBackColorLayout.setHorizontalGroup(
+
pnlBackColorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 27, Short.MAX_VALUE)
+ );
+ pnlBackColorLayout.setVerticalGroup(
+
pnlBackColorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 0, Short.MAX_VALUE)
+ );
+
+ pnlTextColor.setBackground(new java.awt.Color(255, 255, 255));
+
pnlTextColor.setBorder(javax.swing.BorderFactory.createLineBorder(new
java.awt.Color(0, 0, 0)));
+ pnlTextColor.setPreferredSize(new java.awt.Dimension(29, 29));
+ pnlTextColor.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseClicked(java.awt.event.MouseEvent evt) {
+ pnlTextColorMouseClicked(evt);
+ }
+ });
+ pnlTextColor.setName("pnlTextColor");
+
+ javax.swing.GroupLayout pnlTextColorLayout = new
javax.swing.GroupLayout(pnlTextColor);
+ pnlTextColor.setLayout(pnlTextColorLayout);
+ pnlTextColorLayout.setHorizontalGroup(
+
pnlTextColorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 27, Short.MAX_VALUE)
+ );
+ pnlTextColorLayout.setVerticalGroup(
+
pnlTextColorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 0, Short.MAX_VALUE)
+ );
+
+ jLabel3.setText("Image (Optional) : ");
+
+ txtImage.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ txtImageActionPerformed(evt);
+ }
+ });
+
+ btnImage.setText("Choose Image");
+ btnImage.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnImageActionPerformed(evt);
+ }
+ });
+
+ jLabel4.setText("Message : ");
+
+ jLabel5.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
+ jLabel5.setText("Cover Screen");
+
+ jButton1.setText("Clear");
+ jButton1.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButton1ActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel4)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(txtMessage))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel1)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(pnlBackColor,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(18, 18, 18)
+ .addComponent(jLabel2)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(pnlTextColor,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addComponent(jLabel5)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel3)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(txtImage,
javax.swing.GroupLayout.PREFERRED_SIZE, 127,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(btnImage)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jButton1)))
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
+ );
+ layout.setVerticalGroup(
+
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel5)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
false)
+ .addComponent(jLabel2,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
+ .addComponent(pnlTextColor,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
+ .addComponent(pnlBackColor,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
+ .addComponent(jLabel1,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.PREFERRED_SIZE, 29,
javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGap(18, 18, 18)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jLabel3)
+ .addComponent(txtImage,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(btnImage)
+ .addComponent(jButton1))
+ .addGap(18, 18, 18)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jLabel4)
+ .addComponent(txtMessage,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addContainerGap())
+ );
+ }// </editor-fold>//GEN-END:initComponents
+
+ private void pnlTextColorMouseClicked(java.awt.event.MouseEvent evt)
{//GEN-FIRST:event_pnlTextColorMouseClicked
+ // TODO add your handling code here:
+ openColorChooser(evt);
+ }//GEN-LAST:event_pnlTextColorMouseClicked
+
+ private void pnlBackColorMouseClicked(java.awt.event.MouseEvent evt)
{//GEN-FIRST:event_pnlBackColorMouseClicked
+ // TODO add your handling code here:
+ openColorChooser(evt);
+ }//GEN-LAST:event_pnlBackColorMouseClicked
+
+ private void txtImageActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_txtImageActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_txtImageActionPerformed
+
+ private void btnImageActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_btnImageActionPerformed
+ // TODO add your handling code here:
+ openFileChooser();
+ }//GEN-LAST:event_btnImageActionPerformed
+
+ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_jButton1ActionPerformed
+ // TODO add your handling code here:
+ txtImage.setText("");
+ }//GEN-LAST:event_jButton1ActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton btnImage;
+ private javax.swing.JFileChooser fileChooser;
+ private javax.swing.JButton jButton1;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel3;
+ private javax.swing.JLabel jLabel4;
+ private javax.swing.JLabel jLabel5;
+ private javax.swing.JPanel pnlBackColor;
+ private javax.swing.JPanel pnlTextColor;
+ private javax.swing.JTextField txtImage;
+ private javax.swing.JTextField txtMessage;
+ // End of variables declaration//GEN-END:variables
+}
=======================================
--- /dev/null
+++
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/GoToCoverScreenInfo.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,112 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.userlist.client;
+
+import com.jme.renderer.ColorRGBA;
+import java.io.Reader;
+import java.io.Serializable;
+import java.io.Writer;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+@XmlRootElement(name="goto-cover-screen")
+public class GoToCoverScreenInfo extends CoverScreenData implements
Serializable{
+
+ private ColorRGBA backgroundColor=ColorRGBA.black;
+ private ColorRGBA textColor=ColorRGBA.white;
+ private String imageURL="";
+ private String message="Teleporting. Please Wait...";
+
+ /* The JAXB content to (de)serialize to/from XML */
+ private static JAXBContext jaxbContext = null;
+ static {
+ try {
+ jaxbContext =
JAXBContext.newInstance(GoToCoverScreenInfo.class);
+ } catch (javax.xml.bind.JAXBException excp) {
+ excp.printStackTrace();
+ }
+ }
+
+ public GoToCoverScreenInfo(ColorRGBA backgroundColor, ColorRGBA
textColor, String imageURL, String message) {
+ this.backgroundColor = backgroundColor;
+ this.textColor =textColor;
+ this.imageURL = imageURL;
+ this.message = message;
+ }
+
+ public GoToCoverScreenInfo() {
+
+ }
+
+ public ColorRGBA getBackgroundColor() {
+ return backgroundColor;
+ }
+
+ public void setBackgroundColor(ColorRGBA backgroundColor) {
+ this.backgroundColor = backgroundColor;
+ }
+
+ public ColorRGBA getTextColor() {
+ return textColor;
+ }
+
+ public void setTextColor(ColorRGBA textColor) {
+ this.textColor = textColor;
+ }
+
+ public String getImageURL() {
+ return imageURL;
+ }
+
+ public void setImageURL(String imageURL) {
+ this.imageURL = imageURL;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ /**
+ * Takes the input reader of the XML file and instantiates an instance
of
+ * the GoToCoverScreenInfo class
+ * <p>
+ * @param r The input reader of the version XML file
+ * @throw ClassCastException If the input file does not map to
PlacemarkList
+ * @throw JAXBException Upon error reading the XML file
+ */
+ public static GoToCoverScreenInfo decode(Reader r) throws
JAXBException {
+ // Unmarshall the XML into a PlacemarkList class
+ Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
+ GoToCoverScreenInfo goToCoverScreenInfo =
(GoToCoverScreenInfo)unmarshaller.unmarshal(r);
+
+ return goToCoverScreenInfo;
+ }
+
+ /**
+ * Writes the GoToCoverScreenInfo class to an output writer.
+ * <p>
+ * @param w The output writer to write to
+ * @throw JAXBException Upon error writing the XML file
+ */
+ public void encode(Writer w) throws JAXBException {
+
+ // Marshall the GoToCoverScreenInfo class into XML
+ Marshaller marshaller = jaxbContext.createMarshaller();
+ marshaller.setProperty("jaxb.formatted.output", true);
+ marshaller.marshal(this, w);
+ }
+
+}
=======================================
--- /dev/null
+++
/trunk/modules/tools/user-list/src/classes/org/jdesktop/wonderland/modules/userlist/client/resources/loading.gif
Tue Sep 23 05:22:54 2014 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/trunk/modules/world/avatarbase/src/classes/org/jdesktop/wonderland/modules/avatarbase/common/cell/NameTagComponentClientState.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,24 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+package org.jdesktop.wonderland.modules.avatarbase.common.cell;
+
+import org.jdesktop.wonderland.common.cell.state.CellComponentClientState;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+public class NameTagComponentClientState extends CellComponentClientState {
+
+ private boolean isMuted;
+
+ public boolean isIsMuted() {
+ return isMuted;
+ }
+
+ public void setIsMuted(boolean isMuted) {
+ this.isMuted = isMuted;
+ }
+
+}
=======================================
--- /dev/null
+++
/trunk/modules/world/avatarbase/src/classes/org/jdesktop/wonderland/modules/avatarbase/common/cell/NameTagComponentServerState.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+package org.jdesktop.wonderland.modules.avatarbase.common.cell;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import org.jdesktop.wonderland.common.cell.state.CellComponentServerState;
+import org.jdesktop.wonderland.common.cell.state.annotation.ServerState;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+
+@ServerState
+@XmlRootElement(name="name-tag-component")
+public class NameTagComponentServerState extends CellComponentServerState {
+
+ private boolean isMuted;
+
+ public boolean isIsMuted() {
+ return isMuted;
+ }
+
+ public void setIsMuted(boolean isMuted) {
+ this.isMuted = isMuted;
+ }
+
+ /**
+ * Get the class name of the server CellComponentMO to instantiate
+ */
+ @Override
+ public String getServerComponentClassName() {
+
return "org.jdesktop.wonderland.modules.avatarbase.server.cell.NameTagComponentMO";
+ }
+
+}
=======================================
--- /dev/null
+++
/trunk/modules/world/avatarbase/src/classes/org/jdesktop/wonderland/modules/avatarbase/common/cell/messages/NameTagMessage.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+package org.jdesktop.wonderland.modules.avatarbase.common.cell.messages;
+
+import org.jdesktop.wonderland.common.cell.messages.CellMessage;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+public class NameTagMessage extends CellMessage {
+
+ private boolean isMute;
+ private String username;
+
+ public boolean isIsMute() {
+ return isMute;
+ }
+
+ public void setIsMute(boolean isMute) {
+ this.isMute = isMute;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+}
=======================================
--- /dev/null
+++ /trunk/modules/world/cell-editor/nbproject/desktop.ini Tue Sep 23
05:22:54 2014 UTC
@@ -0,0 +1,5 @@
+[.ShellClassInfo]
+InfoTip=This folder is shared online.
+IconFile=C:\Program Files\Google\Drive\googledrivesync.exe
+IconIndex=12
+
=======================================
--- /dev/null
+++ /trunk/modules/world/cell-editor/nbproject/ide-file-targets.xml Tue Sep
23 05:22:54 2014 UTC
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project basedir=".." name="wonderland-celleditor-module-IDE">
+ <!-- TODO: edit the following target according to your needs -->
+ <!-- (more info:
http://www.netbeans.org/kb/articles/freeform-config.html#runsingle) -->
+ <target name="run-selected-file-in-classes">
+ <fail unless="run.class">Must set property 'run.class'</fail>
+ <java classname="${run.class}" failonerror="true" fork="true">
+ <classpath>
+ <pathelement
path="../../../lib/jaxb/jaxb-api.jar;../../../lib/jaxb/jsr173_1.0_api.jar;../../../web/utils/dist/wonderland-web-utils.jar;../../../web/runner/dist/wonderland-runner-core.jar;../../../core/build/lib/wonderland-client.jar;../../../core/build/lib/wonderland-common.jar;../../../core/build/lib/wonderland-server.jar;../../../core/ext/jme20/target/jme-audio.jar;../../../core/ext/jme20/target/jme-awt.jar;../../../core/ext/jme20/target/jme-collada.jar;../../../core/ext/jme20/target/jme-editors.jar;../../../core/ext/jme20/target/jme-effects.jar;../../../core/ext/jme20/target/jme-font.jar;../../../core/ext/jme20/target/jme-gamestates.jar;../../../core/ext/jme20/target/jme-model.jar;../../../core/ext/jme20/target/jme-scene.jar;../../../core/ext/jme20/target/jme-swt.jar;../../../core/ext/jme20/target/jme-terrain.jar;../../../core/ext/jme20/target/jme-xml.jar;../../../core/ext/jme20/target/jme.jar;../../../core/ext/common/mtgame.jar;../../../core/ext/sgs/sgs-0.9.6-r4193/lib/sgs.jar;../../../core/ext/sgs/sgs-client-0.9.6-r4193/lib/mina-core-1.1.jar;../../../core/ext/sgs/sgs-client-0.9.6-r4193/lib/sgs-client.jar;../../../core/ext/sgs/sgs-client-0.9.6-r4193/lib/slf4j-api-1.4.0.jar;../../../core/ext/sgs/sgs-client-0.9.6-r4193/lib/slf4j-jdk14-1.4.0.jar;../../../core/ext/common/swing-layout-1.0.jar;../../foundation/security/build/lib/client/security-client.jar;lib/jimi.jar"/>
+ </classpath>
+ </java>
+ </target>
+</project>
=======================================
--- /dev/null
+++
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/CellHighlightManager.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,93 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.celleditor.client;
+
+import com.jme.math.Vector3f;
+import com.jme.renderer.ColorRGBA;
+import com.jme.scene.Geometry;
+import com.jme.scene.Spatial;
+import java.util.logging.Logger;
+import org.jdesktop.mtgame.Entity;
+import org.jdesktop.mtgame.RenderComponent;
+import org.jdesktop.wonderland.client.cell.Cell;
+import org.jdesktop.wonderland.client.input.Event;
+import org.jdesktop.wonderland.client.input.EventClassListener;
+import org.jdesktop.wonderland.client.jme.ClientContextJME;
+import org.jdesktop.wonderland.client.jme.cellrenderer.CellRendererJME;
+import
org.jdesktop.wonderland.client.jme.utils.traverser.ProcessNodeInterface;
+import org.jdesktop.wonderland.client.jme.utils.traverser.TreeScan;
+import org.jdesktop.wonderland.client.scenemanager.event.EnterExitEvent;
+
+/**
+ * manages the highlighting effect of cell
+ *
+ * @author Abhishek Upadhyay
+ */
+public class CellHighlightManager extends EventClassListener {
+
+ private static Logger LOGGER =
+ Logger.getLogger(CellHighlightManager.class.getName());
+ public ColorRGBA GLOW_COLOR = new ColorRGBA(ColorRGBA.yellow);
+ private static final Vector3f GLOW_SCALE = new Vector3f(1.1f, 1.1f,
1.1f);
+
+ @Override
+ public Class[] eventClassesToConsume() {
+ return new Class[]{
+ EnterExitEvent.class};
+
+ }
+
+ @Override
+ public void commitEvent(Event event) {
+
+ EnterExitEvent eeEvent = (EnterExitEvent) event;
+ Entity e = eeEvent.getPrimaryEntity();
+ Cell cell = eeEvent.getCellForEntity(e);
+
+ if (cell != null) {
+ if (eeEvent.isEnter()) {
+ highlightCell(cell, true, GLOW_COLOR);
+ } else {
+ highlightCell(cell, false, GLOW_COLOR);
+ }
+ }
+
+ }
+
+ /**
+ * We assume this is called on the MT-Game render thread
+ *
+ * @param cell
+ * @param highlight
+ * @param color
+ */
+ public void highlightCell(final Cell cell, final boolean highlight,
final ColorRGBA color) {
+ CellRendererJME r = (CellRendererJME)
cell.getCellRenderer(Cell.RendererType.RENDERER_JME);
+ Entity entity = r.getEntity();
+ RenderComponent rc = entity.getComponent(RenderComponent.class);
+
+ //check if object has Navigate-To capability
+ final NewInteractionComponent hc =
cell.getComponent(NewInteractionComponent.class);
+ if (hc != null && hc.isHighlightEnable()) {
+ if (rc == null) {
+ return;
+ }
+ TreeScan.findNode(rc.getSceneRoot(), Geometry.class, new
ProcessNodeInterface() {
+ public boolean processNode(final Spatial s) {
+ s.setGlowEnabled(highlight);
+ float comps[] =
hc.getHighlightColor().getColorComponents(null);
+ ColorRGBA newcolor = new ColorRGBA((float) comps[0],
+ (float) comps[1],
+ (float) comps[2],
+ hc.getHighlightColor().getTransparency());
+ s.setGlowScale(GLOW_SCALE);
+ s.setGlowColor(newcolor);
+ ClientContextJME.getWorldManager().addToUpdateList(s);
+ return true;
+ }
+ }, false, false);
+ }
+ }
+}
=======================================
--- /dev/null
+++
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/MouseCursorManager.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,124 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.celleditor.client;
+
+import java.awt.Cursor;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.Toolkit;
+import java.net.MalformedURLException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.SwingUtilities;
+import org.jdesktop.mtgame.Entity;
+import org.jdesktop.wonderland.client.cell.Cell;
+import org.jdesktop.wonderland.client.cell.asset.AssetUtils;
+import org.jdesktop.wonderland.client.input.Event;
+import org.jdesktop.wonderland.client.input.EventClassListener;
+import org.jdesktop.wonderland.client.jme.JmeClientMain;
+import org.jdesktop.wonderland.client.scenemanager.event.EnterExitEvent;
+
+/**
+ *
+ * manages the cursor for an object hover effect
+ *
+ * @author Abhishek Upadhyay
+ */
+public class MouseCursorManager extends EventClassListener {
+
+ private boolean enableGlobalCursor = false;
+ private Image globalCursor = null;
+
+ public MouseCursorManager() {
+ }
+
+ @Override
+ public Class[] eventClassesToConsume() {
+ return new Class[]{EnterExitEvent.class};
+ }
+
+ @Override
+ public void commitEvent(Event event) {
+ EnterExitEvent eee = (EnterExitEvent) event;
+ Entity entity = eee.getPrimaryEntity();
+ Cell cell = EnterExitEvent.getCellForEntity(entity);
+
+ if (eee.isEnter()) {
+ enter(cell);
+ } else {
+ exit(cell);
+ }
+ }
+
+ private void enter(Cell cell) {
+ if (enableGlobalCursor) {
+ changeCursor(globalCursor);
+ } else {
+ if (cell != null) {
+ NewInteractionComponent nic =
cell.getComponent(NewInteractionComponent.class);
+ if (nic != null && nic.isCursorEnable()) {
+ if (!nic.getCursorFilePath().equals("")) {
+ changeCursor(nic.getCursorFilePath());
+ }
+ }
+ }
+ }
+ }
+
+ private void exit(Cell cell) {
+ JmeClientMain.getFrame().getCanvas().setCursor(new
Cursor(Cursor.DEFAULT_CURSOR));
+ }
+
+ private void changeCursor(String cursorFilePath) {
+ Image img = null;
+ Cursor cur = null;
+ if (cursorFilePath.contains("wlcontent://")) {
+ try {
+ img = Toolkit.getDefaultToolkit().createImage(AssetUtils
+ .getAssetURL(cursorFilePath));
+ cur = Toolkit.getDefaultToolkit().createCustomCursor(img,
new Point(0, 0), "new");
+ } catch (MalformedURLException ex) {
+
Logger.getLogger(MouseCursorManager.class.getName()).log(Level.SEVERE,
null, ex);
+ }
+ } else {
+ img = Toolkit.getDefaultToolkit().createImage(getClass()
+ .getResource(cursorFilePath));
+ cur = Toolkit.getDefaultToolkit().createCustomCursor(img, new
Point(0, 0), "new");
+ }
+ final Cursor cursor = cur;
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ JmeClientMain.getFrame().getCanvas().setCursor(cursor);
+ }
+ });
+ }
+
+ private void changeCursor(Image image) {
+ if (image != null) {
+ final Cursor cursor =
Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(0,
0), "new");
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ JmeClientMain.getFrame().getCanvas().setCursor(cursor);
+ }
+ });
+ }
+ }
+
+ public boolean isEnableGlobalCursor() {
+ return enableGlobalCursor;
+ }
+
+ public void enableGlobalCursor() {
+ this.enableGlobalCursor = true;
+ }
+
+ public void disableGlobalCursor() {
+ this.enableGlobalCursor = false;
+ }
+
+ public void setGlobalCursor(Image cursor) {
+ this.globalCursor = cursor;
+ }
+}
=======================================
--- /dev/null
+++
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/MouseCursorPlugin.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,46 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.celleditor.client;
+
+import org.jdesktop.wonderland.client.BaseClientPlugin;
+import org.jdesktop.wonderland.client.jme.ClientContextJME;
+import org.jdesktop.wonderland.client.login.ServerSessionManager;
+import org.jdesktop.wonderland.common.annotation.Plugin;
+
+/**
+ *
+ * plugin for the mouse cursor change
+ *
+ * @author Abhishek Upadhyay
+ */
+@Plugin
+public class MouseCursorPlugin extends BaseClientPlugin {
+
+ private static CellHighlightManager cellEnterExitManager = null;
+ private static MouseCursorManager mouseCursorManager = null;
+
+ @Override
+ public void initialize(ServerSessionManager loginInfo) {
+ cellEnterExitManager = new CellHighlightManager();
+ mouseCursorManager = new MouseCursorManager();
+ super.initialize(loginInfo);
+ }
+
+ @Override
+ protected void activate() {
+
ClientContextJME.getInputManager().addGlobalEventListener(cellEnterExitManager);
+
ClientContextJME.getInputManager().addGlobalEventListener(mouseCursorManager);
+ }
+
+ @Override
+ protected void deactivate() {
+
ClientContextJME.getInputManager().removeGlobalEventListener(cellEnterExitManager);
+
ClientContextJME.getInputManager().addGlobalEventListener(mouseCursorManager);
+ }
+
+ public static MouseCursorManager getMouseCursorManager() {
+ return mouseCursorManager;
+ }
+}
=======================================
--- /dev/null
+++
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/NewInteractionComponent.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,66 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.celleditor.client;
+
+import java.awt.Color;
+import org.jdesktop.wonderland.client.cell.Cell;
+import org.jdesktop.wonderland.client.cell.CellComponent;
+import org.jdesktop.wonderland.common.cell.state.CellComponentClientState;
+import
org.jdesktop.wonderland.modules.celleditor.common.NewInteractionComponentClientState;
+
+/**
+ *
+ * client side class for new interactions
+ *
+ * @author Abhishek Upadhyay
+ */
+public class NewInteractionComponent extends CellComponent {
+
+ private boolean highlightEnable = false;
+ private float red = 1;
+ private float green = 1;
+ private float blue = 0;
+ private boolean cursorEnable = false;
+ private boolean standardCursor = true;
+ private String cursorFilePath = "";
+
+ public NewInteractionComponent(Cell cell) {
+ super(cell);
+ }
+
+ @Override
+ public void setClientState(CellComponentClientState state) {
+ highlightEnable = ((NewInteractionComponentClientState)
state).isHighlightEnable();
+ red = ((NewInteractionComponentClientState) state).getRed();
+ green = ((NewInteractionComponentClientState) state).getGreen();
+ blue = ((NewInteractionComponentClientState) state).getBlue();
+ cursorEnable = ((NewInteractionComponentClientState)
state).isCursorEnable();
+ cursorFilePath = ((NewInteractionComponentClientState)
state).getCursorFilePath();
+ standardCursor = ((NewInteractionComponentClientState)
state).isStandardCursor();
+
+ super.setClientState(state);
+
+ }
+
+ public boolean isHighlightEnable() {
+ return highlightEnable;
+ }
+
+ public Color getHighlightColor() {
+ return new Color(red, green, blue);
+ }
+
+ public boolean isCursorEnable() {
+ return cursorEnable;
+ }
+
+ public boolean isStandardCursor() {
+ return standardCursor;
+ }
+
+ public String getCursorFilePath() {
+ return cursorFilePath;
+ }
+}
=======================================
--- /dev/null
+++
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/resources/cursor1.png
Tue Sep 23 05:22:54 2014 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/resources/cursor2.png
Tue Sep 23 05:22:54 2014 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/resources/cursor3.png
Tue Sep 23 05:22:54 2014 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/resources/cursor4.png
Tue Sep 23 05:22:54 2014 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/resources/cursor5.png
Tue Sep 23 05:22:54 2014 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/resources/cursor6.png
Tue Sep 23 05:22:54 2014 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/client/resources/cursor7.png
Tue Sep 23 05:22:54 2014 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/common/NewInteractionComponentClientState.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.celleditor.common;
+
+import org.jdesktop.wonderland.common.cell.state.CellComponentClientState;
+
+/**
+ * client state for new interactions
+ *
+ * @author Abhishek Upadhyay
+ */
+public class NewInteractionComponentClientState extends
CellComponentClientState {
+
+ private boolean highlightEnable = false;
+ private float red = 1;
+ private float green = 1;
+ private float blue = 0;
+ private boolean cursorEnable = false;
+ private boolean standardCursor = true;
+ private String cursorFilePath = "";
+
+ public boolean isHighlightEnable() {
+ return highlightEnable;
+ }
+
+ public void setHighlightEnable(boolean highlightEnable) {
+ this.highlightEnable = highlightEnable;
+ }
+
+ public float getRed() {
+ return red;
+ }
+
+ public void setRed(float red) {
+ this.red = red;
+ }
+
+ public float getGreen() {
+ return green;
+ }
+
+ public void setGreen(float green) {
+ this.green = green;
+ }
+
+ public float getBlue() {
+ return blue;
+ }
+
+ public void setBlue(float blue) {
+ this.blue = blue;
+ }
+
+ public boolean isCursorEnable() {
+ return cursorEnable;
+ }
+
+ public void setCursorEnable(boolean cursorEnable) {
+ this.cursorEnable = cursorEnable;
+ }
+
+ public boolean isStandardCursor() {
+ return standardCursor;
+ }
+
+ public void setStandardCursor(boolean standardCursor) {
+ this.standardCursor = standardCursor;
+ }
+
+ public String getCursorFilePath() {
+ return cursorFilePath;
+ }
+
+ public void setCursorFilePath(String cursorFilePath) {
+ this.cursorFilePath = cursorFilePath;
+ }
+}
=======================================
--- /dev/null
+++
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/common/NewInteractionComponentServerState.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,98 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.celleditor.common;
+
+import java.io.Serializable;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import org.jdesktop.wonderland.common.cell.state.CellComponentServerState;
+import org.jdesktop.wonderland.common.cell.state.annotation.ServerState;
+
+/**
+ * server state for new interactions
+ *
+ * @author Abhishek Upadhyay
+ */
+@XmlRootElement(name = "new-interaction-component")
+@ServerState
+public class NewInteractionComponentServerState extends
CellComponentServerState
+ implements Serializable {
+
+ private boolean highlightEnable = false;
+ private float red = 1;
+ private float green = 1;
+ private float blue = 0;
+ private boolean cursorEnable = false;
+ private boolean standardCursor = true;
+ private String cursorFilePath = "";
+
+ @XmlElement
+ public boolean isHighlightEnable() {
+ return highlightEnable;
+ }
+
+ public void setHighlightEnable(boolean highlightEnable) {
+ this.highlightEnable = highlightEnable;
+ }
+
+ @XmlElement
+ public float getRed() {
+ return red;
+ }
+
+ public void setRed(float red) {
+ this.red = red;
+ }
+
+ @XmlElement
+ public float getGreen() {
+ return green;
+ }
+
+ public void setGreen(float green) {
+ this.green = green;
+ }
+
+ @XmlElement
+ public float getBlue() {
+ return blue;
+ }
+
+ public void setBlue(float blue) {
+ this.blue = blue;
+ }
+
+ @XmlElement
+ public boolean isCursorEnable() {
+ return cursorEnable;
+ }
+
+ public void setCursorEnable(boolean cursorEnable) {
+ this.cursorEnable = cursorEnable;
+ }
+
+ @XmlElement
+ public boolean isStandardCursor() {
+ return standardCursor;
+ }
+
+ public void setStandardCursor(boolean standardCursor) {
+ this.standardCursor = standardCursor;
+ }
+
+ @XmlElement
+ public String getCursorFilePath() {
+ return cursorFilePath;
+ }
+
+ public void setCursorFilePath(String cursorFilePath) {
+ this.cursorFilePath = cursorFilePath;
+ }
+
+ @Override
+ public String getServerComponentClassName() {
+
return "org.jdesktop.wonderland.modules.celleditor.server.NewInteractionComponentMO";
+ }
+}
=======================================
--- /dev/null
+++
/trunk/modules/world/cell-editor/src/classes/org/jdesktop/wonderland/modules/celleditor/server/NewInteractionComponentMO.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.celleditor.server;
+
+import org.jdesktop.wonderland.common.cell.ClientCapabilities;
+import org.jdesktop.wonderland.common.cell.state.CellComponentClientState;
+import org.jdesktop.wonderland.common.cell.state.CellComponentServerState;
+import
org.jdesktop.wonderland.modules.celleditor.common.NewInteractionComponentClientState;
+import
org.jdesktop.wonderland.modules.celleditor.common.NewInteractionComponentServerState;
+import org.jdesktop.wonderland.server.cell.CellComponentMO;
+import org.jdesktop.wonderland.server.cell.CellMO;
+import org.jdesktop.wonderland.server.comms.WonderlandClientID;
+
+/**
+ * server side class for new interactions
+ *
+ * @author Abhishek Upadhyay
+ */
+public class NewInteractionComponentMO extends CellComponentMO {
+
+ private boolean highlightEnable = false;
+ private float red = 1;
+ private float green = 1;
+ private float blue = 0;
+ private boolean cursorEnable = false;
+ private boolean standardCursor = true;
+ private String cursorFilePath = "";
+
+ public NewInteractionComponentMO(CellMO cell) {
+ super(cell);
+ }
+
+ @Override
+ public CellComponentClientState
getClientState(CellComponentClientState state,
+ WonderlandClientID clientID,
+ ClientCapabilities capabilities) {
+ if (state == null) {
+ state = new NewInteractionComponentClientState();
+ }
+
+ ((NewInteractionComponentClientState)
state).setHighlightEnable(highlightEnable);
+ ((NewInteractionComponentClientState) state).setRed(red);
+ ((NewInteractionComponentClientState) state).setGreen(green);
+ ((NewInteractionComponentClientState) state).setBlue(blue);
+ ((NewInteractionComponentClientState)
state).setCursorEnable(cursorEnable);
+ ((NewInteractionComponentClientState)
state).setCursorFilePath(cursorFilePath);
+ ((NewInteractionComponentClientState)
state).setStandardCursor(standardCursor);
+
+ return super.getClientState(state, clientID, capabilities);
+ }
+
+ @Override
+ public CellComponentServerState
getServerState(CellComponentServerState state) {
+ if (state == null) {
+ state = new NewInteractionComponentServerState();
+ }
+
+ ((NewInteractionComponentServerState)
state).setHighlightEnable(highlightEnable);
+ ((NewInteractionComponentServerState) state).setRed(red);
+ ((NewInteractionComponentServerState) state).setGreen(green);
+ ((NewInteractionComponentServerState) state).setBlue(blue);
+ ((NewInteractionComponentServerState)
state).setCursorEnable(cursorEnable);
+ ((NewInteractionComponentServerState)
state).setCursorFilePath(cursorFilePath);
+ ((NewInteractionComponentServerState)
state).setStandardCursor(standardCursor);
+
+ return super.getServerState(state);
+ }
+
+ @Override
+ public void setServerState(CellComponentServerState state) {
+
+ highlightEnable = ((NewInteractionComponentServerState)
state).isHighlightEnable();
+ red = ((NewInteractionComponentServerState) state).getRed();
+ green = ((NewInteractionComponentServerState) state).getGreen();
+ blue = ((NewInteractionComponentServerState) state).getBlue();
+ cursorEnable = ((NewInteractionComponentServerState)
state).isCursorEnable();
+ standardCursor = ((NewInteractionComponentServerState)
state).isStandardCursor();
+ cursorFilePath = ((NewInteractionComponentServerState)
state).getCursorFilePath();
+
+ super.setServerState(state);
+ }
+
+ @Override
+ protected String getClientClass() {
+
return "org.jdesktop.wonderland.modules.celleditor.client.NewInteractionComponent";
+ }
+}
=======================================
--- /dev/null
+++
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/client/CoverScreen.form
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.5" maxVersion="1.8"
type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+ <Properties>
+ <Property name="background" type="java.awt.Color"
editor="org.netbeans.beaninfo.editors.ColorEditor">
+ <Color blue="0" green="0" red="0" type="rgb"/>
+ </Property>
+ <Property name="opaque" type="boolean" value="false"/>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer"
value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName"
type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean"
value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode"
type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean"
value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget"
type="java.lang.Integer" value="1"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle"
type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean"
value="false"/>
+ <AuxValue name="FormSettings_variablesModifier"
type="java.lang.Integer" value="2"/>
+ <AuxValue name="designerSize" type="java.awt.Dimension"
value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,57,0,0,2,112"/>
+ </AuxValues>
+
+ <Layout
class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="jPanel1">
+ <Properties>
+ <Property name="opaque" type="boolean" value="false"/>
+ </Properties>
+ <Constraints>
+ <Constraint
layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"
value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="Center"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout
class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ </Container>
+ </SubComponents>
+</Form>
=======================================
--- /dev/null
+++
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/client/CoverScreen.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,215 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.portal.client;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.Insets;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.awt.font.FontRenderContext;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.imageio.ImageIO;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import org.jdesktop.wonderland.client.cell.asset.AssetUtils;
+import org.jdesktop.wonderland.client.login.LoginManager;
+import
org.jdesktop.wonderland.modules.contentrepo.client.ContentRepository;
+import
org.jdesktop.wonderland.modules.contentrepo.client.ContentRepositoryRegistry;
+import
org.jdesktop.wonderland.modules.contentrepo.common.ContentCollection;
+import org.jdesktop.wonderland.modules.contentrepo.common.ContentResource;
+import org.jdesktop.wonderland.modules.portal.common.CoverScreenData;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+public class CoverScreen extends javax.swing.JPanel {
+
+ private CoverScreenData coverScreenData=null;
+ private JLabel closeIcon = null;
+ private CoverScreenMainPanel csp = null;
+ private int i=0;
+ private Image img = null;
+
+ /**
+ * Creates new form CoverScreen
+ */
+ public CoverScreen(CoverScreenData coverScreenData,Dimension dim) {
+ this.coverScreenData = coverScreenData;
+ initComponents();
+ csp = new CoverScreenMainPanel();
+ csp.addComponentListener(new ComponentAdapter() {
+
+ public void componentResized(ComponentEvent e) {
+ Insets insets = ((JPanel)e.getComponent()).getInsets();
+ Dimension size = closeIcon.getPreferredSize();
+ closeIcon.setBounds((int)
(((JPanel)e.getComponent()).getPreferredSize().getWidth()-size.width) +
insets.left, insets.top,
+ size.width, size.height);
+ }
+
+ });
+ csp.setLayout(null);
+ closeIcon = new JLabel();
+ csp.setPreferredSize(dim.getSize());
+ closeIcon.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
+ closeIcon.setLocation(100, 100);
+
+ closeIcon.setHorizontalAlignment(JLabel.RIGHT);
+ closeIcon.setPreferredSize(new Dimension(10, 17));
+ closeIcon.setText("X");
+ closeIcon.setOpaque(true);
+ if(coverScreenData!=null) {
+ float[] comps = coverScreenData
+ .getBackgroundColor().getColorArray();
+ csp.setBackground(new Color(comps[0],comps[1],comps[2]));
+ }
+ csp.add(closeIcon);
+ Insets insets = csp.getInsets();
+ Dimension size = closeIcon.getPreferredSize();
+ closeIcon.setBounds((int)
(csp.getPreferredSize().getWidth()-size.width) + insets.left, insets.top,
+ size.width, size.height);
+ jPanel1.add(csp, BorderLayout.CENTER);
+ setPreferredSize(null);
+ if(coverScreenData.getImageURL()!=null &&
+ (!coverScreenData.getImageURL().equals(""))) {
+ try {
+ img = csp.scaleImage(AssetUtils
+ .getAssetURL(coverScreenData.getImageURL()),(int)dim.getSize().getWidth()
+ ,(int)dim.getSize().getHeight());
+ } catch (MalformedURLException ex) {
+
Logger.getLogger(CoverScreen.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+ }
+
+ public JLabel getCloseComponent() {
+ return closeIcon;
+ }
+
+ private class CoverScreenMainPanel extends JPanel {
+ ImageIcon ii=null;
+
+ private Image scaleImage(URL imageURL,int width, int height) {
+ try {
+ Image scaledBimg = null;
+ ContentRepositoryRegistry registry =
ContentRepositoryRegistry.getInstance();
+ ContentRepository cr =
registry.getRepository(LoginManager.getPrimary());
+ String[] urls = imageURL.toString().split("/");
+ String fname = urls[urls.length-1];
+ String userName = urls[3];
+ ContentCollection user = cr.getUserRoot(userName);
+
+ ContentResource res = (ContentResource)
user.getChild(fname);
+
+ BufferedImage bimg = ImageIO.read(res.getInputStream());
+ if(bimg.getWidth()>width || bimg.getHeight()>height) {
+ if(bimg.getWidth()>width && bimg.getHeight()>height) {
+ if(bimg.getWidth()-width>bimg.getHeight()-height) {
+ float nw = width;
+ float nh =
(width*bimg.getHeight())/bimg.getWidth();
+ scaledBimg = bimg.getScaledInstance((int)nw,
(int)nh,BufferedImage.SCALE_SMOOTH);
+ //scaledBimg.getGraphics().drawImage(bimg, 0,
0, null);
+ } else {
+ float nh = height;
+ float nw =
(height*bimg.getWidth())/bimg.getHeight();
+ scaledBimg = bimg.getScaledInstance((int)nw,
(int)nh,BufferedImage.SCALE_SMOOTH);
+ //scaledBimg.getGraphics().drawImage(bimg, 0,
0, null);
+ }
+ } else if(bimg.getWidth()>width) {
+ float nw = width;
+ float nh =
(width*bimg.getHeight())/bimg.getWidth();
+ scaledBimg = bimg.getScaledInstance((int)nw,
(int)nh,BufferedImage.SCALE_SMOOTH);
+ } else if(bimg.getHeight()>height) {
+ float nh = height;
+ float nw =
(height*bimg.getWidth())/bimg.getHeight();
+ scaledBimg = bimg.getScaledInstance((int)nw,
(int)nh,BufferedImage.SCALE_SMOOTH);
+ }
+ } else {
+ scaledBimg = bimg;
+ }
+ return scaledBimg;
+ } catch (Exception ex) {
+ ex.printStackTrace();
+
Logger.getLogger(CoverScreen.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ return null;
+ }
+
+ @Override
+ public void paintComponent(Graphics g) {
+
+ super.paintComponent(g);
+ if(coverScreenData!=null) {
+ Graphics2D g2d = (Graphics2D) g;
+ if(coverScreenData.getImageURL()!=null &&
+ (!coverScreenData.getImageURL().equals(""))) {
+
+ try {
+ g2d.drawImage(img,
(getWidth()/2)-(img.getWidth(null)/2)
+ , (getHeight()/2)-(img.getHeight(null)/2),
this);
+ } catch (Exception ex) {
+
Logger.getLogger(CoverScreen.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }
+ Image img = new ImageIcon(getClass()
+ .getResource("/org/jdesktop/wonderland/modules/placemarks/client/resources/loading.gif")).getImage();
+
+ g2d.drawImage(img, (getWidth()/2)-(img.getWidth(null)/2),
(getHeight()/2)-(img.getHeight(null)/2)
+ , this);
+ float[] comps = coverScreenData
+ .getTextColor().getColorArray();
+ g2d.setColor(new Color(comps[0],comps[1],comps[2]));
+ Font font = new Font("Arial", Font.BOLD,20);
+ FontRenderContext frc1 = new FontRenderContext(null, true,
true);
+ Rectangle2D rec =
font.getStringBounds(coverScreenData.getMessage(), frc1);
+ int w = (int) (rec.getWidth());
+ int h = (int) (rec.getHeight());
+ g2d.setFont(font);
+ g2d.drawString(coverScreenData.getMessage()
+ , (getWidth()/2)-(w/2), getHeight()-(h)+10 );
+ }
+ Insets insets = getInsets();
+ Dimension size = closeIcon.getPreferredSize();
+ closeIcon.setBounds((int) (getWidth()-size.width) +
insets.left, insets.top,
+ size.width, size.height);
+ }
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the
form.
+ * WARNING: Do NOT modify this code. The content of this method is
always
+ * regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed" desc="Generated
Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ jPanel1 = new javax.swing.JPanel();
+
+ setBackground(new java.awt.Color(0, 0, 0));
+ setOpaque(false);
+ setLayout(new java.awt.BorderLayout());
+
+ jPanel1.setOpaque(false);
+ jPanel1.setLayout(new java.awt.BorderLayout());
+ add(jPanel1, java.awt.BorderLayout.CENTER);
+ }// </editor-fold>//GEN-END:initComponents
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JPanel jPanel1;
+ // End of variables declaration//GEN-END:variables
+}
=======================================
--- /dev/null
+++
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/client/CoverScreenListener.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,199 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.portal.client;
+
+import com.jme.math.Vector3f;
+import java.awt.Canvas;
+import java.awt.Component;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.JDialog;
+import javax.swing.SwingUtilities;
+import org.jdesktop.wonderland.client.cell.Cell;
+import org.jdesktop.wonderland.client.cell.CellStatusChangeListener;
+import org.jdesktop.wonderland.client.jme.ClientContextJME;
+import org.jdesktop.wonderland.client.jme.JmeClientMain;
+import org.jdesktop.wonderland.client.jme.MainFrame;
+import org.jdesktop.wonderland.common.cell.CellStatus;
+import org.jdesktop.wonderland.modules.portal.common.CoverScreenData;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+public class CoverScreenListener implements CellStatusChangeListener{
+
+ private int flg=1;
+ private Collection<Cell> rootCells = new ArrayList<Cell>();
+ private CellStatusChangeListener csl=null;
+ private ScheduledExecutorService exec=null;
+ private ScheduledExecutorService exec_cellStatus = null;
+ private JDialog dialog=null;
+
+ public CoverScreenListener(final Vector3f goalPos,final
CoverScreenData csd) {
+ Vector3f fromLoc = ClientContextJME.getViewManager()
+ .getPrimaryViewCell().getWorldTransform().getTranslation(null);
+ Vector3f toLoc = goalPos;
+ if(Math.abs((fromLoc.x)-(toLoc.x))<=150 &&
+ Math.abs((fromLoc.y)-(toLoc.y))<=150 &&
+ Math.abs((fromLoc.z)-(toLoc.z))<=150) {
+ //Cover Screen not needed
+ } else {
+ //attach cover screen
+ final MainFrame mainFrame = JmeClientMain.getFrame();
+ final Canvas canvas = mainFrame.getCanvas();
+ final CoverScreen coverScreenPanel = new
CoverScreen(csd,canvas.getSize());
+
+ try {
+ //show cover screen in JDialog over the canvas panel
+ SwingUtilities.invokeLater(new Runnable() {
+
+ public void run() {
+ dialog = new
JDialog(mainFrame.getFrame(), "Child", false);
+
coverScreenPanel.setPreferredSize(canvas.getSize());
+ dialog.setSize(canvas.getSize().width
+ ,canvas.getSize().height);
+ dialog.setLocation(canvas.getLocationOnScreen().x
+ ,canvas.getLocationOnScreen().y);
+
+ mainFrame.getFrame().addComponentListener(new
ComponentAdapter() {
+
+ private void doChange() {
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ if (dialog != null &&
dialog.isVisible()) {
+ Component cs =
dialog.getComponent(0);
+ Canvas canvas =
mainFrame.getCanvas();
+
cs.setPreferredSize(canvas.getSize());
+
dialog.setSize(canvas.getSize().width, canvas.getSize().height);
+
dialog.setLocation(canvas.getLocationOnScreen().x,
canvas.getLocationOnScreen().y);
+ dialog.pack();
+ dialog.setVisible(true);
+ }
+ }
+ });
+ }
+
+ public void componentResized(ComponentEvent e)
{
+ doChange();
+ }
+
+ public void componentMoved(ComponentEvent e) {
+ doChange();
+ }
+
+ });
+ dialog.getRootPane().setOpaque(false);
+ dialog.add(coverScreenPanel);
+ dialog.setUndecorated(true);
+ dialog.pack();
+ dialog.setVisible(true);
+ }
+ });
+
+ //Listener for the close icon
+ coverScreenPanel.getCloseComponent().addMouseListener(new
MouseAdapter() {
+ public void mouseClicked(MouseEvent e) {
+ if(exec_cellStatus!=null) {
+ exec_cellStatus.shutdown();
+ exec_cellStatus=null;
+ }
+ if(exec!=null) {
+ exec.shutdown();
+ exec=null;
+ }
+ if(dialog!=null ) {
+ dialog.dispose();
+ }
+ }
+ });
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
ClientContextJME.getCellManager().addCellStatusChangeListener(this);
+ }
+ }
+
+ private synchronized boolean checkIfAllCellsLoaded(Collection<Cell>
rootCells,int level,boolean log) {
+
+ Iterator<Cell> itr = rootCells.iterator();
+ while(itr.hasNext()) {
+
+ Cell c = itr.next();
+ if(log) {
+ for(int i=0; i<level; i++)
+ System.out.print(" ");
+ System.out.println(" "+c.getName()+" - "+c.getStatus());
+ }
+ List<Cell> childs = c.getChildren();
+ if(!c.getStatus().equals(CellStatus.VISIBLE)) {
+ return false;
+ }
+ if(childs.size()!=0) {
+ if(!checkIfAllCellsLoaded(childs,level+1,log)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ public void cellStatusChanged(final Cell cell, CellStatus status) {
+
+ if(status.equals(CellStatus.VISIBLE)) {
+ if(flg==1) {
+ if(exec!=null) {
+ exec.shutdown();
+ }
+ csl = this;
+ exec_cellStatus =
Executors.newSingleThreadScheduledExecutor();
+ exec_cellStatus.scheduleAtFixedRate(new Runnable() {
+ @Override
+ public void run() {
+
+ rootCells = cell.getCellCache().getRootCells();
+ if(rootCells.size()==1) {
+ try {
+ exec_cellStatus.awaitTermination(20,
TimeUnit.SECONDS);
+ } catch (InterruptedException ex) {
+
Logger.getLogger(CoverScreenListener.class.getName()).log(Level.SEVERE,
null, ex);
+ }
+ rootCells = cell.getCellCache().getRootCells();
+ }
+ if(checkIfAllCellsLoaded(rootCells,0,false)) {
+
+ try {
+ exec_cellStatus.awaitTermination(3,
TimeUnit.SECONDS);
+
if(checkIfAllCellsLoaded(rootCells,0,false)){
+ if(dialog!=null) {
+
checkIfAllCellsLoaded(rootCells,0,true);
+ dialog.dispose();
+ }
+ exec_cellStatus.shutdown();
+ exec_cellStatus=null;
+
ClientContextJME.getCellManager().removeCellStatusChangeListener(csl);
+ }
+ } catch (Exception ex) {
+
Logger.getLogger(CoverScreenListener.class.getName()).log(Level.SEVERE,
null, ex);
+ }
+ }
+ }
+ }, 0, 3, TimeUnit.SECONDS);
+ }
+ flg++;
+ }
+ }
+}
=======================================
--- /dev/null
+++
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/client/CoverScreenPropertyPanel.form
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<Form version="1.5" maxVersion="1.8"
type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
+ <NonVisualComponents>
+ <Component class="javax.swing.JFileChooser" name="fileChooser">
+ <Properties>
+ <Property name="dialogTitle" type="java.lang.String" value="Select
Image"/>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_CreateCodeCustom"
type="java.lang.String" value="new javax.swing.JFileChooser(){
}"/>
+ <AuxValue name="JavaCodeGenerator_InitCodePost"
type="java.lang.String" value="fileChooser.addChoosableFileFilter(new

 FileNameExtensionFilter("Image
File","jpeg","JPEG"
 ,"bmp","BMP","jpg","JPG","gif","GIF"));
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);"/>
+ </AuxValues>
+ </Component>
+ </NonVisualComponents>
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer"
value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName"
type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean"
value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode"
type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean"
value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget"
type="java.lang.Integer" value="1"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle"
type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean"
value="false"/>
+ <AuxValue name="FormSettings_variablesModifier"
type="java.lang.Integer" value="2"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" max="-2" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="jLabel4" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace type="unrelated" max="-2"
attributes="0"/>
+ <Component id="txtMessage" max="32767"
attributes="0"/>
+ </Group>
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="jLabel1" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace type="unrelated" max="-2"
attributes="0"/>
+ <Component id="pnlBackColor" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace type="separate" max="-2" attributes="0"/>
+ <Component id="jLabel2" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace type="unrelated" max="-2"
attributes="0"/>
+ <Component id="pnlTextColor" min="-2" max="-2"
attributes="0"/>
+ </Group>
+ <Component id="jLabel5" alignment="0" min="-2" max="-2"
attributes="0"/>
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="jLabel3" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace type="unrelated" max="-2"
attributes="0"/>
+ <Component id="txtImage" min="-2" pref="127"
max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="btnImage" min="-2" max="-2"
attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="jButton1" min="-2" max="-2"
attributes="0"/>
+ </Group>
+ </Group>
+ <EmptySpace max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="1" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="jLabel5" min="-2" max="-2" attributes="0"/>
+ <EmptySpace type="unrelated" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="1" max="-2" attributes="0">
+ <Component id="jLabel2" max="32767" attributes="0"/>
+ <Component id="pnlTextColor" alignment="0" max="32767"
attributes="0"/>
+ <Component id="pnlBackColor" alignment="0" max="32767"
attributes="0"/>
+ <Component id="jLabel1" alignment="0" min="-2" pref="29"
max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace type="separate" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="jLabel3" alignment="3" min="-2" max="-2"
attributes="0"/>
+ <Component id="txtImage" alignment="3" min="-2" max="-2"
attributes="0"/>
+ <Component id="btnImage" alignment="3" min="-2" max="-2"
attributes="0"/>
+ <Component id="jButton1" alignment="3" min="-2" max="-2"
attributes="0"/>
+ </Group>
+ <EmptySpace type="separate" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="jLabel4" alignment="3" min="-2" max="-2"
attributes="0"/>
+ <Component id="txtMessage" alignment="3" min="-2"
max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="jLabel1">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Background
Color : "/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel2">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Text
Color : "/>
+ </Properties>
+ </Component>
+ <Container class="javax.swing.JPanel" name="pnlBackColor">
+ <Properties>
+ <Property name="background" type="java.awt.Color"
editor="org.netbeans.beaninfo.editors.ColorEditor">
+ <Color blue="0" green="0" red="0" type="rgb"/>
+ </Property>
+ <Property name="border" type="javax.swing.border.Border"
editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border
info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
+ <LineBorder/>
+ </Border>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension"
editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[29, 29]"/>
+ </Property>
+ </Properties>
+ <Events>
+ <EventHandler event="mouseClicked"
listener="java.awt.event.MouseListener"
parameters="java.awt.event.MouseEvent" handler="pnlBackColorMouseClicked"/>
+ </Events>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_ListenersCodePost"
type="java.lang.String"
value="pnlBackColor.setName("pnlBackColor");"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="27" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlTextColor">
+ <Properties>
+ <Property name="background" type="java.awt.Color"
editor="org.netbeans.beaninfo.editors.ColorEditor">
+ <Color blue="ff" green="ff" red="ff" type="rgb"/>
+ </Property>
+ <Property name="border" type="javax.swing.border.Border"
editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border
info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
+ <LineBorder/>
+ </Border>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension"
editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[29, 29]"/>
+ </Property>
+ </Properties>
+ <Events>
+ <EventHandler event="mouseClicked"
listener="java.awt.event.MouseListener"
parameters="java.awt.event.MouseEvent" handler="pnlTextColorMouseClicked"/>
+ </Events>
+ <AuxValues>
+ <AuxValue name="JavaCodeGenerator_ListenersCodePost"
type="java.lang.String"
value="pnlTextColor.setName("pnlTextColor");"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="27" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ </Container>
+ <Component class="javax.swing.JLabel" name="jLabel3">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Image
(Optional) : "/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="txtImage">
+ <Events>
+ <EventHandler event="actionPerformed"
listener="java.awt.event.ActionListener"
parameters="java.awt.event.ActionEvent" handler="txtImageActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="btnImage">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Choose
Image"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed"
listener="java.awt.event.ActionListener"
parameters="java.awt.event.ActionEvent" handler="btnImageActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel4">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Message : "/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="txtMessage">
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel5">
+ <Properties>
+ <Property name="font" type="java.awt.Font"
editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Tahoma" size="12" style="1"/>
+ </Property>
+ <Property name="text" type="java.lang.String" value="Cover
Screen"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JButton" name="jButton1">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Clear"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed"
listener="java.awt.event.ActionListener"
parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+</Form>
=======================================
--- /dev/null
+++
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/client/CoverScreenPropertyPanel.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,324 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.portal.client;
+
+import com.jme.renderer.ColorRGBA;
+import java.awt.Color;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.io.File;
+import javax.swing.JColorChooser;
+import javax.swing.JDialog;
+import javax.swing.JFileChooser;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.filechooser.FileNameExtensionFilter;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+public class CoverScreenPropertyPanel extends javax.swing.JPanel {
+
+ private ColorRGBA newBackColor;
+ private ColorRGBA newTextColor;
+ private File image=null;
+
+ CoverScreenPropertyPanel() {
+ initComponents();
+ fileChooser.setAcceptAllFileFilterUsed(false);
+ txtImage.setEditable(false);
+ }
+
+ private void openFileChooser() {
+ int returnVal = fileChooser.showOpenDialog(this);
+ if (returnVal == JFileChooser.APPROVE_OPTION) {
+ File file = fileChooser.getSelectedFile();
+ try {
+ image = file;
+ txtImage.setText(file.getAbsolutePath());
+ } catch (Exception ex) {
+ }
+ }
+ }
+
+ private void openColorChooser(final MouseEvent evt) {
+ final JColorChooser chooser = new JColorChooser();
+ JDialog dialog = JColorChooser.createDialog(this, "Select color",
true
+ , chooser, new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+
+
if(((JPanel)evt.getSource()).getName().equalsIgnoreCase("pnlBackColor")) {
+ Color newCol = chooser.getColor();
+ float[] comps = new float[3];
+ comps = newCol.getComponents(null);
+ newBackColor = new
ColorRGBA(comps[0],comps[1],comps[2],newCol.getTransparency());
+ pnlBackColor.setBackground(newCol);
+
+ } else {
+ Color newCol = chooser.getColor();
+ float[] comps = new float[3];
+ comps = newCol.getComponents(null);
+ newCol.getComponents(comps);
+ newTextColor = new
ColorRGBA(comps[0],comps[1],comps[2],newCol.getTransparency());
+ pnlTextColor.setBackground(newCol);
+ }
+ }
+ },null);
+ dialog.setVisible(true);
+ }
+
+ public ColorRGBA getBackColor() {
+ return newBackColor;
+ }
+
+ public void setBackColor(ColorRGBA backColor) {
+ float[] comps = new float[3];
+ comps = backColor.getColorArray();
+ newBackColor=backColor;
+ pnlBackColor.setBackground(new Color(comps[0],comps[1],comps[2]));
+ }
+
+ public ColorRGBA getTextColor() {
+ return newTextColor;
+ }
+
+ public void setTextColor(ColorRGBA textColor) {
+ float[] comps = new float[3];
+ comps = textColor.getColorArray();
+ newTextColor=textColor;
+ pnlTextColor.setBackground(new Color(comps[0],comps[1],comps[2]));
+ }
+
+ public File getImage() {
+ return image;
+ }
+
+ public String getMessage() {
+ return txtMessage.getText();
+ }
+
+ public void setMessage(String message) {
+ txtMessage.setText(message);
+ }
+
+ public String getImageURL() {
+ return txtImage.getText();
+ }
+
+ public void setImageURL(String imageURL) {
+ txtImage.setText(imageURL);
+ }
+
+ public JTextField getMessageTf() {
+ return txtMessage;
+ }
+ public JTextField getImageTf() {
+ return txtImage;
+ }
+ public JPanel getBackColorPanel() {
+ return pnlBackColor;
+ }
+ public JPanel getTextColorPanel() {
+ return pnlTextColor;
+ }
+
+ /**
+ * This method is called from within the constructor to initialize the
form.
+ * WARNING: Do NOT modify this code. The content of this method is
always
+ * regenerated by the Form Editor.
+ */
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed" desc="Generated
Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ fileChooser = new javax.swing.JFileChooser(){
+ };
+ jLabel1 = new javax.swing.JLabel();
+ jLabel2 = new javax.swing.JLabel();
+ pnlBackColor = new javax.swing.JPanel();
+ pnlTextColor = new javax.swing.JPanel();
+ jLabel3 = new javax.swing.JLabel();
+ txtImage = new javax.swing.JTextField();
+ btnImage = new javax.swing.JButton();
+ jLabel4 = new javax.swing.JLabel();
+ txtMessage = new javax.swing.JTextField();
+ jLabel5 = new javax.swing.JLabel();
+ jButton1 = new javax.swing.JButton();
+
+ fileChooser.setDialogTitle("Select Image");
+ fileChooser.addChoosableFileFilter(new
+ FileNameExtensionFilter("Image File","jpeg","JPEG"
+ ,"bmp","BMP","jpg","JPG","gif","GIF"));
+ fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
+
+ jLabel1.setText("Background Color : ");
+
+ jLabel2.setText("Text Color : ");
+
+ pnlBackColor.setBackground(new java.awt.Color(0, 0, 0));
+
pnlBackColor.setBorder(javax.swing.BorderFactory.createLineBorder(new
java.awt.Color(0, 0, 0)));
+ pnlBackColor.setPreferredSize(new java.awt.Dimension(29, 29));
+ pnlBackColor.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseClicked(java.awt.event.MouseEvent evt) {
+ pnlBackColorMouseClicked(evt);
+ }
+ });
+ pnlBackColor.setName("pnlBackColor");
+
+ javax.swing.GroupLayout pnlBackColorLayout = new
javax.swing.GroupLayout(pnlBackColor);
+ pnlBackColor.setLayout(pnlBackColorLayout);
+ pnlBackColorLayout.setHorizontalGroup(
+
pnlBackColorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 27, Short.MAX_VALUE)
+ );
+ pnlBackColorLayout.setVerticalGroup(
+
pnlBackColorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 0, Short.MAX_VALUE)
+ );
+
+ pnlTextColor.setBackground(new java.awt.Color(255, 255, 255));
+
pnlTextColor.setBorder(javax.swing.BorderFactory.createLineBorder(new
java.awt.Color(0, 0, 0)));
+ pnlTextColor.setPreferredSize(new java.awt.Dimension(29, 29));
+ pnlTextColor.addMouseListener(new java.awt.event.MouseAdapter() {
+ public void mouseClicked(java.awt.event.MouseEvent evt) {
+ pnlTextColorMouseClicked(evt);
+ }
+ });
+ pnlTextColor.setName("pnlTextColor");
+
+ javax.swing.GroupLayout pnlTextColorLayout = new
javax.swing.GroupLayout(pnlTextColor);
+ pnlTextColor.setLayout(pnlTextColorLayout);
+ pnlTextColorLayout.setHorizontalGroup(
+
pnlTextColorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 27, Short.MAX_VALUE)
+ );
+ pnlTextColorLayout.setVerticalGroup(
+
pnlTextColorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGap(0, 0, Short.MAX_VALUE)
+ );
+
+ jLabel3.setText("Image (Optional) : ");
+
+ txtImage.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ txtImageActionPerformed(evt);
+ }
+ });
+
+ btnImage.setText("Choose Image");
+ btnImage.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnImageActionPerformed(evt);
+ }
+ });
+
+ jLabel4.setText("Message : ");
+
+ jLabel5.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
+ jLabel5.setText("Cover Screen");
+
+ jButton1.setText("Clear");
+ jButton1.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ jButton1ActionPerformed(evt);
+ }
+ });
+
+ javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
+ this.setLayout(layout);
+ layout.setHorizontalGroup(
+
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(layout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel4)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(txtMessage))
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel1)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(pnlBackColor,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGap(18, 18, 18)
+ .addComponent(jLabel2)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(pnlTextColor,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addComponent(jLabel5)
+ .addGroup(layout.createSequentialGroup()
+ .addComponent(jLabel3)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(txtImage,
javax.swing.GroupLayout.PREFERRED_SIZE, 127,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(btnImage)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(jButton1)))
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
+ );
+ layout.setVerticalGroup(
+
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
+ .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(jLabel5)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING,
false)
+ .addComponent(jLabel2,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
+ .addComponent(pnlTextColor,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
+ .addComponent(pnlBackColor,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
+ .addComponent(jLabel1,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.PREFERRED_SIZE, 29,
javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addGap(18, 18, 18)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jLabel3)
+ .addComponent(txtImage,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(btnImage)
+ .addComponent(jButton1))
+ .addGap(18, 18, 18)
+ .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
+ .addComponent(jLabel4)
+ .addComponent(txtMessage,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addContainerGap())
+ );
+ }// </editor-fold>//GEN-END:initComponents
+
+ private void pnlTextColorMouseClicked(java.awt.event.MouseEvent evt)
{//GEN-FIRST:event_pnlTextColorMouseClicked
+ // TODO add your handling code here:
+ openColorChooser(evt);
+ }//GEN-LAST:event_pnlTextColorMouseClicked
+
+ private void pnlBackColorMouseClicked(java.awt.event.MouseEvent evt)
{//GEN-FIRST:event_pnlBackColorMouseClicked
+ // TODO add your handling code here:
+ openColorChooser(evt);
+ }//GEN-LAST:event_pnlBackColorMouseClicked
+
+ private void txtImageActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_txtImageActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_txtImageActionPerformed
+
+ private void btnImageActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_btnImageActionPerformed
+ // TODO add your handling code here:
+ openFileChooser();
+ }//GEN-LAST:event_btnImageActionPerformed
+
+ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)
{//GEN-FIRST:event_jButton1ActionPerformed
+ // TODO add your handling code here:
+ txtImage.setText("");
+ }//GEN-LAST:event_jButton1ActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton btnImage;
+ private javax.swing.JFileChooser fileChooser;
+ private javax.swing.JButton jButton1;
+ private javax.swing.JLabel jLabel1;
+ private javax.swing.JLabel jLabel2;
+ private javax.swing.JLabel jLabel3;
+ private javax.swing.JLabel jLabel4;
+ private javax.swing.JLabel jLabel5;
+ private javax.swing.JPanel pnlBackColor;
+ private javax.swing.JPanel pnlTextColor;
+ private javax.swing.JTextField txtImage;
+ private javax.swing.JTextField txtMessage;
+ // End of variables declaration//GEN-END:variables
+}
=======================================
--- /dev/null
+++
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/client/resources/loading.gif
Tue Sep 23 05:22:54 2014 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/trunk/modules/world/portal/src/classes/org/jdesktop/wonderland/modules/portal/common/CoverScreenData.java
Tue Sep 23 05:22:54 2014 UTC
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2014, WonderBuilders, Inc., All Rights Reserved
+ */
+
+package org.jdesktop.wonderland.modules.portal.common;
+
+import com.jme.renderer.ColorRGBA;
+
+/**
+ *
+ * @author Abhishek Upadhyay
+ */
+public class CoverScreenData {
+ private ColorRGBA backgroundColor=ColorRGBA.black;
+ private ColorRGBA textColor=ColorRGBA.white;
+ private String imageURL="";
+ private String message="Teleporting. Please Wait...";
+
+ public CoverScreenData(ColorRGBA backgroundColor, ColorRGBA textColor,
String imageURL, String message) {
+ this.backgroundColor = backgroundColor;
+ this.textColor =textColor;
+ this.imageURL = imageURL;
+ this.message = message;
+ }
+
+ public ColorRGBA getBackgroundColor() {
+ return backgroundColor;
+ }
+
+ public void setBackgroundColor(ColorRGBA backgroundColor) {
+ this.backgroundColor = backgroundColor;
+ }
+
+ public ColorRGBA getTextColor() {
+ return textColor;
+ }
+
+ public void setTextColor(ColorRGBA textColor) {
+ this.textColor = textColor;
+ }
+
+ public String getImageURL() {
+ return imageURL;
+ }
+
+ public void setImageURL(String imageURL) {
+ this.imageURL = imageURL;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+}
=======================================
--- /trunk/core/nbproject/project.xml Tue Jan 5 16:34:56 2010 UTC
+++ /trunk/core/nbproject/project.xml Tue Sep 23 05:22:54 2014 UTC
@@ -113,7 +113,7 @@
<java-data
xmlns="
http://www.netbeans.org/ns/freeform-project-java/2">
<compilation-unit>
<package-root>src/classes</package-root>
- <classpath
mode="compile">ext/sgs/sgs-client-0.9.10/lib/sgs-client.jar:ext/sgs/sgs-client-0.9.10/lib/sgs-shared-1.3.jar:ext/sgs/sgs-server-dist-0.9.10/lib/sgs-server-api-0.9.10.jar:ext/sgs/sgs-server-dist-0.9.10/lib/sgs-server-0.9.10.jar:ext/sgs/sgs-server-dist-0.9.10/lib/sgs-server-internal-api-0.9.10.jar:ext/common/swing-layout-1.0.jar:ext/common/mtgame.jar:ext/jme20/target/jme-audio.jar:ext/jme20/target/jme-awt.jar:ext/jme20/target/jme-collada.jar:ext/jme20/target/jme-editors.jar:ext/jme20/target/jme-effects.jar:ext/jme20/target/jme-font.jar:ext/jme20/target/jme-gamestates.jar:ext/jme20/target/jme-model.jar:ext/jme20/target/jme-scene.jar:ext/jme20/target/jme-swt.jar:ext/jme20/target/jme-terrain.jar:ext/jme20/target/jme-xml.jar:ext/jme20/target/jme.jar:../lib/jaxb/activation.jar:../lib/jaxb/jaxb-api.jar:../lib/jaxb/jaxb-impl.jar:../lib/jaxb/jaxb-xjc.jar:../lib/jaxb/jaxb1-impl.jar:../lib/jaxb/jsr173_1.0_api.jar:ext/common/Scenario.jar:ext/common/javolution.jar:ext/common/stun.jar:ext/common/scannotation-1.0.2.jar:ext/macosx/jars/gluegen-rt.jar:ext/macosx/jars/jogl.jar:ext/common/looks-2.2.2.jar:ext/common/trident.jar</classpath>
+ <classpath
mode="compile">ext/sgs/sgs-client-0.9.10/lib/sgs-client.jar;ext/sgs/sgs-client-0.9.10/lib/sgs-shared-1.3.jar;ext/sgs/sgs-server-dist-0.9.10/lib/sgs-server-api-0.9.10.jar;ext/sgs/sgs-server-dist-0.9.10/lib/sgs-server-0.9.10.jar;ext/sgs/sgs-server-dist-0.9.10/lib/sgs-server-internal-api-0.9.10.jar;ext/common/swing-layout-1.0.jar;ext/common/mtgame.jar;ext/jme20/target/jme-audio.jar;ext/jme20/target/jme-awt.jar;ext/jme20/target/jme-collada.jar;ext/jme20/target/jme-editors.jar;ext/jme20/target/jme-effects.jar;ext/jme20/target/jme-font.jar;ext/jme20/target/jme-gamestates.jar;ext/jme20/target/jme-model.jar;ext/jme20/target/jme-scene.jar;ext/jme20/target/jme-swt.jar;ext/jme20/target/jme-terrain.jar;ext/jme20/target/jme-xml.jar;ext/jme20/target/jme.jar;../lib/jaxb/activation.jar;../lib/jaxb/jaxb-api.jar;../lib/jaxb/jaxb-impl.jar;../lib/jaxb/jaxb-xjc.jar;../lib/jaxb/jaxb1-impl.jar;../lib/jaxb/jsr173_1.0_api.jar;ext/common/Scenario.jar;ext/common/javolution.jar;ext/common/stun.jar;ext/common/scannotation-1.0.2.jar;ext/macosx/jars/gluegen-rt.jar;ext/macosx/jars/jogl.jar;ext/common/looks-2.2.2.jar;ext/common/trident.jar;ext/common/vecmath.jar;ext/sgs/sgs-server-dist-0.9.10/lib/sgs-shared-1.7.jar</classpath>
<built-to>build/lib/wonderland-client.jar</built-to>
<built-to>build/lib/wonderland-common.jar</built-to>
<built-to>build/lib/wonderland-server.jar</built-to>
=======================================
--- /trunk/modules/foundation/placemarks-api/build.xml Mon Jan 25 19:19:57
2010 UTC
+++ /trunk/modules/foundation/placemarks-api/build.xml Tue Sep 23 05:22:54
2014 UTC
@@ -18,7 +18,7 @@
<target name="dist" depends="build">
<mkdir dir="${module.dist.dir}"/>
- <module name="placemarks-api" majorVersion="0" minorVersion="5"
jarfile="${module.dist.dir}/${module.jarname}.jar"
+ <module name="placemarks-api" majorVersion="0" minorVersion="6"
jarfile="${module.dist.dir}/${module.jarname}.jar"
builddir="${build.dir}">
<client>
=======================================
--- /trunk/modules/foundation/placemarks-api/nbproject/project.xml Tue Oct
6 01:23:16 2009 UTC
+++ /trunk/modules/foundation/placemarks-api/nbproject/project.xml Tue Sep
23 05:22:54 2014 UTC
@@ -44,11 +44,18 @@
<source-file>
<location>build.xml</location>
</source-file>
+ <source-file>
+ <location>my.module.properties</location>
+ </source-file>
</items>
<context-menu>
<ide-action name="build"/>
<ide-action name="rebuild"/>
<ide-action name="clean"/>
+ <action>
+ <label>Deploy Module</label>
+ <target>deploy</target>
+ </action>
</context-menu>
</view>
<subprojects/>
=======================================
***Additional files exist in this changeset.***