|
From: <tre...@us...> - 2007-09-17 22:39:47
|
Revision: 409
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=409&view=rev
Author: trevorolio
Date: 2007-09-17 15:39:50 -0700 (Mon, 17 Sep 2007)
Log Message:
-----------
A handy test window for the body editor applet
Added Paths:
-----------
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java
Added: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java (rev 0)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java 2007-09-17 22:39:50 UTC (rev 409)
@@ -0,0 +1,155 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+
+package com.ogoglio.client.test;
+
+import java.applet.AppletContext;
+import java.applet.AppletStub;
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.HashMap;
+
+import com.ogoglio.bodyeditor.BodyEditorApplet;
+import com.ogoglio.client.WebAPIAuthenticator;
+import com.ogoglio.client.WebAPIClientWire;
+import com.ogoglio.client.WebAPIDescriptor;
+import com.ogoglio.util.ArgumentUtils;
+import com.ogoglio.util.PropStorage;
+
+public class BodyAppletTestWindow extends Frame {
+
+ Dimension appDimension = new Dimension(500, 500);
+
+ public BodyEditorApplet applet = null;
+
+ EnvironmentStub clientStub1 = null;
+
+ URI serviceURI = null;
+
+ public BodyAppletTestWindow(URI serviceURI, String authCookie, Dimension appDimension, boolean decorated) {
+ ArgumentUtils.assertNotNull(appDimension);
+ this.appDimension = appDimension;
+ ArgumentUtils.assertNotNull(serviceURI);
+ this.serviceURI = serviceURI;
+
+ setLayout(new BorderLayout());
+ setSize(appDimension);
+ setLocation(30, 50);
+ setResizable(false);
+ if (!decorated) {
+ this.setUndecorated(true);
+ }
+ HashMap parameters1 = new HashMap();
+ parameters1.put("loginCookie", authCookie);
+ parameters1.put("serviceURI", serviceURI.toString());
+
+ clientStub1 = new EnvironmentStub(parameters1);
+ applet = new BodyEditorApplet();
+ applet.setStub(clientStub1);
+ add(applet, BorderLayout.CENTER);
+ }
+
+ private class EnvironmentStub implements AppletStub {
+
+ HashMap parameters = null;
+
+ public EnvironmentStub(HashMap parameters) {
+ this.parameters = parameters;
+ }
+
+ public void appletResize(int width, int height) {
+ }
+
+ public AppletContext getAppletContext() {
+ return null;
+ }
+
+ public URL getCodeBase() {
+ try {
+ return serviceURI.toURL();
+ } catch (MalformedURLException e) {
+ throw new IllegalStateException("Could not convert serviceURI to URL: " + serviceURI);
+ }
+ }
+
+ public URL getDocumentBase() {
+ try {
+ return serviceURI.toURL();
+ } catch (MalformedURLException e) {
+ throw new IllegalStateException("Could not convert serviceURI to URL: " + serviceURI);
+ }
+ }
+
+ public String getParameter(String name) {
+ return (String) parameters.get(name);
+ }
+
+ public boolean isActive() {
+ return true;
+ }
+
+ }
+
+ public void start() {
+ applet.init();
+ applet.start();
+ }
+
+ public void cleanup(){
+ applet.destroy();
+ }
+
+ public static void main(String[] args) {
+ GraphicsEnvironment graphicsEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
+ GraphicsDevice device = graphicsEnv.getDefaultScreenDevice();
+ Dimension dim = new Dimension(1024, 800);
+ boolean fullScreen = args.length > 0 && "fullscreen".equals(args[0]);
+ if (fullScreen) {
+ dim = new Dimension(device.getDisplayMode().getWidth(), device.getDisplayMode().getWidth());
+ }
+ String serviceURI=null;
+ String loginCookie=null;
+ try {
+ PropStorage ps=new PropStorage();
+ ps.loadPropertySet(PropStorage.BASIC_PROPS);
+ serviceURI = ps.getKeyFromSet(PropStorage.BASIC_PROPS, "ogoglio.baseUrl");
+ ps.loadPropertySet(PropStorage.BOOTSTRAP_PROPS);
+ WebAPIAuthenticator authenticator = new WebAPIAuthenticator(new WebAPIClientWire(), new WebAPIDescriptor(new URI(serviceURI)), ps.getKeyFromSet(PropStorage.BOOTSTRAP_PROPS, "bootstrapUser"), ps.getKeyFromSet(PropStorage.BOOTSTRAP_PROPS, "bootstrapUserPW"));
+ loginCookie = authenticator.getAuthCookie();
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+
+ try {
+ BodyAppletTestWindow test = new BodyAppletTestWindow(new URI(serviceURI), loginCookie, dim, fullScreen);
+ test.setVisible(true);
+ if (fullScreen) {
+ device.setFullScreenWindow(test);
+ }
+ test.start();
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-09-18 22:45:43
|
Revision: 426
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=426&view=rev
Author: trevorolio
Date: 2007-09-18 15:45:40 -0700 (Tue, 18 Sep 2007)
Log Message:
-----------
Now you can select your height from the body editor applet.
Modified Paths:
--------------
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java
Modified: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java 2007-09-18 22:45:34 UTC (rev 425)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java 2007-09-18 22:45:40 UTC (rev 426)
@@ -34,7 +34,7 @@
public class BodyAppletTestWindow extends Frame {
- Dimension appDimension = new Dimension(500, 520);
+ Dimension appDimension = new Dimension(800, 620);
public BodyEditorApplet applet = null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-10-15 19:10:27
|
Revision: 502
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=502&view=rev
Author: trevorolio
Date: 2007-10-15 12:10:23 -0700 (Mon, 15 Oct 2007)
Log Message:
-----------
Switched the body editor applet to just show the 3D, with editing functions exposed to the page via LiveConnect.
Made body.html use the new functions to display morph controls, animation triggers, and a save button.
Hopefully we will avoid future use of applets for any 2D controls.
Modified Paths:
--------------
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java
Modified: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java 2007-10-15 19:10:20 UTC (rev 501)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java 2007-10-15 19:10:23 UTC (rev 502)
@@ -34,7 +34,7 @@
public class BodyAppletTestWindow extends Frame {
- Dimension appDimension = new Dimension(800, 620);
+ Dimension appDimension = new Dimension(300, 420);
public BodyEditorApplet applet = null;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-12-30 23:25:54
|
Revision: 653
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=653&view=rev
Author: trevorolio
Date: 2007-12-30 15:15:18 -0800 (Sun, 30 Dec 2007)
Log Message:
-----------
Added the ability to update the account photo using the body editor
Modified Paths:
--------------
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java
Modified: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java 2007-12-30 23:15:10 UTC (rev 652)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BodyAppletTestWindow.java 2007-12-30 23:15:18 UTC (rev 653)
@@ -17,8 +17,11 @@
import java.applet.AppletContext;
import java.applet.AppletStub;
import java.awt.BorderLayout;
+import java.awt.Button;
import java.awt.Dimension;
import java.awt.Frame;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
@@ -34,8 +37,7 @@
public class BodyAppletTestWindow extends Frame {
- Dimension appDimension = new Dimension(300, 420);
-
+ Dimension appDimension = new Dimension(300, 460);
public BodyEditorApplet applet = null;
EnvironmentStub clientStub1 = null;
@@ -50,7 +52,7 @@
setLayout(new BorderLayout());
setSize(appDimension);
- setLocation(30, 50);
+ setLocation(200, 50);
setResizable(false);
HashMap parameters1 = new HashMap();
@@ -61,6 +63,14 @@
applet = new BodyEditorApplet();
applet.setStub(clientStub1);
add(applet, BorderLayout.CENTER);
+
+ Button snapshotButton = new Button("Save Snaphot");
+ snapshotButton.addActionListener(new ActionListener(){
+ public void actionPerformed(ActionEvent event) {
+ applet.saveAccountPhoto();
+ }
+ });
+ add(snapshotButton, BorderLayout.SOUTH);
}
private class EnvironmentStub implements AppletStub {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|