?? localdesktopenvironment.java
字號(hào):
package org.j3de.environment.desktop;
import java.rmi.RemoteException;
import java.util.List;
import javax.vecmath.Vector3f;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.j3de.behavior.MovementBehavior;
import org.j3de.behavior.DominantHandBehavior;
import org.j3de.exception.ExceptionHandler;
import org.j3de.interfaces.Environment;
import org.j3de.interfaces.LocalEnvironment;
import org.j3de.ui.LocalUIFactory;
import org.j3de.util.AbstractComponent;
import org.j3de.util.ConfigurationException;
import org.j3de.util.ConfigHelper;
import org.j3de.util.EntryFactory;
import org.j3de.util.InitializationException;
import org.j3de.util.StringParser;
public class LocalDesktopEnvironment extends AbstractComponent implements LocalEnvironment {
private LocalUIFactory localUIFactory;
private List startupURLs;
private MovementBehavior movementBehavior;
private DominantHandBehavior dominantHandBehavior;
private Vector3f position;
public Environment getEnvironment() {
return new DesktopEnvironment(localUIFactory.getUIFactory(),
startupURLs,
movementBehavior,
dominantHandBehavior,
position);
}
public void configure(Node node, Document nodeFactory) throws ConfigurationException {
super.configure(node, nodeFactory);
position = StringParser.parseVector3f(helper.getPropertyValue("position", "0.0 0.0 0.0", true));
try {
localUIFactory = (LocalUIFactory)helper.getComponent("UIFactory",
null, null, null,
this.getClass().getClassLoader());
} catch (Exception e) {
ExceptionHandler.handleException(e);
throw new ConfigurationException("Exception while creating UIFactory : " + e.getMessage());
}
try {
movementBehavior = (MovementBehavior)helper.getComponent("MovementBehavior",
null, null, null,
this.getClass().getClassLoader());
dominantHandBehavior = (DominantHandBehavior)helper.getComponent("DominantHandBehavior",
null, null, null,
this.getClass().getClassLoader());
} catch (Exception e) {
ExceptionHandler.handleException(e);
throw new ConfigurationException("Exception while creating Behaviors : " + e.getMessage());
}
startupURLs = helper.getList("startupApplications",
new EntryFactory() {
public Object createEntry(Node node) {
try {
NamedNodeMap attributes = node.getAttributes();
Node attrib = attributes.getNamedItem("url");
return attrib.getNodeValue();
} catch (NullPointerException e) {
return null;
}
}
});
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -