⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 desktopapplicationenvironment.java

📁 Java 3D Desktop Environment旨在使用Java 3D来创建一个3D桌面环境。功能包括:分布式的应用程序
💻 JAVA
字号:
package org.j3de.environment.desktop;        

import org.j3de.ui.impl.UniverseManager;
 
import java.rmi.Remote;
import java.rmi.RemoteException;

import org.j3de.events.DistributedEventService;
import org.j3de.exception.ExceptionHandler; 
import org.j3de.interfaces.ApplicationEnvironment;
import org.j3de.interfaces.Environment;import org.j3de.interfaces.EnvironmentManager;import org.j3de.ui.UIElement;
import org.j3de.ui.UIFactory;
import org.j3de.ui.UIContainer;
import org.j3de.ui.UICreationException;
import org.j3de.util.InitializationException;
public class DesktopApplicationEnvironment implements ApplicationEnvironment {
  private UIFactory          uiFactory;          
  private UIContainer        appContainer;               
  private UIElement          rootElement;
  private EnvironmentManager environmentManager;  private Environment        environment;                                        
  public DesktopApplicationEnvironment(UIFactory uiFactory,                                        UIContainer container,                                       Environment environment,                                       EnvironmentManager environmentManager)                                 throws UICreationException,        
                                       RemoteException {
    setUIFactory(uiFactory);             
    this.appContainer = container;    this.environment  = environment;    this.environmentManager = environmentManager;
  }     
  
  public UIFactory getUIFactory() {
    return uiFactory;
  } 

  public void setUIFactory(UIFactory uiFactory) {
    this.uiFactory = uiFactory;
  } 
                       
  public void setRootUIElement(UIElement rootElement) throws RemoteException {  
    try {   
      if (this.rootElement != null) {
        appContainer.remove(this.rootElement);
      }

      this.rootElement = rootElement;  
      if (rootElement != null)        appContainer.add(rootElement);   
    } catch (Exception e) {
      ExceptionHandler.handleException(e);
    }
  }
  
  public DistributedEventService getDistributedEventService() {
    return null;
  }
    public void startEnvironment(Environment environment) throws RemoteException, InitializationException {    environmentManager.startEnvironment(environment);  }  public void startModalEnvironment(Environment environment) throws RemoteException, InitializationException {    environmentManager.startModalEnvironment(environment);  }  public void exitEnvironment() throws RemoteException {    environmentManager.exitEnvironment(environment);  }    
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -