|
From: <tre...@us...> - 2007-10-02 02:28:40
|
Revision: 468
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=468&view=rev
Author: trevorolio
Date: 2007-10-01 19:28:44 -0700 (Mon, 01 Oct 2007)
Log Message:
-----------
THIS CHECKIN REQUIRES A DB DROP
Introducing a new world of user configurable body settings. Ditched the old BodyRecord and created three new record types:
BodyDataRecords: hold information about the wadges of data which make up a body's base (e.g. mesh, morphs, textures...)
BodyConfigurationRecords: a user level representation of a body configuration, with a display name and a set of...
BodySettingRecords: morph interpolation values for a given body configuration (e.g. height, 0.9 or chin width, 0.2)
Halfway through documentifying and RESTifying these records. I can smell the day when this is autogenerated from annotated classes.
Modified Paths:
--------------
maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
Modified: maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-10-02 02:28:41 UTC (rev 467)
+++ maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-10-02 02:28:44 UTC (rev 468)
@@ -51,7 +51,6 @@
import com.ogoglio.client.WebAPIClient;
import com.ogoglio.client.WebAPIClientWire;
import com.ogoglio.client.WebAPIDescriptor;
-import com.ogoglio.client.model.Body;
import com.ogoglio.client.model.BodyDataProvider;
import com.ogoglio.client.model.Space;
import com.ogoglio.client.model.TemplateDataProvider;
@@ -63,8 +62,8 @@
import com.ogoglio.viewer.j3d.J3DDataManager;
import com.ogoglio.viewer.j3d.J3DUniverse;
import com.ogoglio.viewer.j3d.J3DUserRenderable;
+import com.ogoglio.viewer.j3d.body.SkinLoader;
import com.ogoglio.xml.AccountDocument;
-import com.ogoglio.xml.BodyDocument;
public class BodyEditorApplet extends Applet {
@@ -74,8 +73,6 @@
private AccountDocument accountDoc = null;
- private BodyDocument bodyDoc = null;
-
private WestPanel westPanel = null;
private BodyPanel bodyPanel = new BodyPanel();
@@ -98,16 +95,12 @@
private class SpacelessUser extends User {
public SpacelessUser(String username) {
- super(new Space(new SpacelessContext(), 1, "Space", "nobody", false, 0), username, new Transform3D(), 1);
+ super(new Space(new SpacelessContext(), 1, "Space", "nobody", false, 0), username, new Transform3D());
}
}
private class SpacelessContext implements Context {
- public BodyDocument getBodyDocument(String username, long bodyID) throws IOException {
- return new BodyDocument(bodyID, username, "Body", 1, 1, 1, 1, 1, false, 2, 1);
- }
-
public InputStream getPageContentStream(long thingID, long pageID) {
return null;
}
@@ -202,23 +195,16 @@
private class WestPanel extends Panel {
Dimension dimension = new Dimension(150, 300);
- HeightPanel heightPanel = new HeightPanel();
-
public WestPanel() {
setPreferredSize(dimension);
setMinimumSize(dimension);
setLayout(new FlowLayout(FlowLayout.CENTER, 0, 5));
setBackground(Color.WHITE);
- add(heightPanel);
}
}
- private BodyDocument bodyToDoc(Body body) {
- return new BodyDocument(body.getBodyID(), user.getUsername(), "Body", body.getHair(), body.getEyes(), body.getNose(), body.getMouth(), body.getFace(), body.isMale(), body.getHeight(), body.getGirth());
- }
-
private class TexturePanel extends Panel {
Dimension dimension = new Dimension(80, 35);
@@ -230,53 +216,7 @@
}
}
- private class HeightPanel extends Panel implements ChangeListener {
- Dimension dimension = new Dimension(150, 150);
- JSlider slider = new JSlider(JSlider.VERTICAL, 150, 210, 200);
-
- public HeightPanel() {
-
- setPreferredSize(dimension);
- setMinimumSize(dimension);
- setLayout(new BorderLayout());
- setBackground(Color.WHITE);
-
- JLabel heightLabel = new JLabel("height:");
- heightLabel.setBackground(Color.WHITE);
- JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER));
- panel.setBackground(Color.WHITE);
- panel.add(heightLabel);
- add(panel, BorderLayout.NORTH);
-
- int value = (int) (user.getBody().getHeight() * 100);
- slider.setValue(value);
- slider.addChangeListener(this);
- slider.setMajorTickSpacing(20);
- slider.setPaintTicks(true);
- slider.setPaintLabels(true);
- slider.setBackground(Color.WHITE);
- add(slider, BorderLayout.CENTER);
- }
-
- public void stateChanged(ChangeEvent event) {
- if (slider.getModel().getValueIsAdjusting()) {
- return;
- }
- float newHeight = slider.getValue() / 100f;
- if (user.getBody().getHeight() != newHeight) {
- user.getBody().setHeight(newHeight);
- bodyPanel.renderable.setHeight(newHeight);
- try {
- bodyDoc.setHeight(newHeight);
- webClient.updateBody(bodyDoc);
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- }
-
private class WidthPanel extends Panel {
Dimension dimension = new Dimension(150, 25);
@@ -323,7 +263,6 @@
WebAPIAuthenticator authenticator = new WebAPIAuthenticator(wire, descriptor, authCookie);
webClient = new WebAPIClient(descriptor, authenticator, wire);
accountDoc = authenticator.getAccountDocument(true);
- bodyDoc = webClient.getBodyDocument(accountDoc.getUsername(), accountDoc.getDefaultBodyID());
dataManager = new J3DDataManager(true, new TemplateProvider(), new BodyProvider());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|