本文整理汇总了Java中org.apache.pivot.wtk.DesktopApplicationContext类的典型用法代码示例。如果您正苦于以下问题:Java DesktopApplicationContext类的具体用法?Java DesktopApplicationContext怎么用?Java DesktopApplicationContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DesktopApplicationContext类属于org.apache.pivot.wtk包,在下文中一共展示了DesktopApplicationContext类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shutdown
import org.apache.pivot.wtk.DesktopApplicationContext; //导入依赖的package包/类
@Override
public boolean shutdown(boolean optional) throws Exception {
if (optional) {
int numberOfCurrentRunningDownloads = Services.getDownloadService().getNumberOfCurrentRunningDownloads();
if (numberOfCurrentRunningDownloads > 0) {
String message = msgformat("There {0,choice,1#is|1<are} currently {0} active download{0,choice,1#|1<s}.\nReally quit?", numberOfCurrentRunningDownloads);
final Alert alert = new Alert(MessageType.QUESTION, message, new ArrayList<>("Yes", "No"), true);
alert.setTitle("Quit?");
alert.open(this.display, this.window, new DialogCloseListener() {
@Override
public void dialogClosed(Dialog dialog, boolean modal) {
if (alert.getSelectedOptionIndex() == 0) {
DesktopApplicationContext.exit(false);
}
}
});
return true;
}
}
Services.getDownloadService().shutdown();
Services.getHttpClientService().shutdown();
if (this.provider != null) {
this.provider.reset();
this.provider.stop();
this.provider = null;
}
this.display = null;
return false;
}
示例2: apply
import org.apache.pivot.wtk.DesktopApplicationContext; //导入依赖的package包/类
@Override
public Statement apply(final Statement base, final FrameworkMethod method, final Object target) {
return new Statement() {
@Override
public void evaluate() throws Throwable {
TestDesktopPivotApplication.init(target);
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
DesktopApplicationContext.main(TestDesktopPivotApplication.class, startupArgs);
}
});
TestDesktopPivotApplication.getLatch().await();
GriffonApplication application = TestDesktopPivotApplication.getApplication();
application.getInjector().injectMembers(target);
handleTestForAnnotation(application, target);
before(application, target);
try {
base.evaluate();
} finally {
after(application, target);
}
}
};
}
示例3: main
import org.apache.pivot.wtk.DesktopApplicationContext; //导入依赖的package包/类
public static void main(String[] args) {
log.info("GrooveJames started.");
log.info("GrooveJames running on {} {} ({}) in {}", System.getProperty("java.vm.name"), System.getProperty("java.runtime.version"), System.getProperty("java.vm.vendor"), System.getProperty("java.home"));
System.setProperty("org.apache.pivot.wtk.skin.terra.location", "/groovejames/gui/GrooveJames_theme.json");
args = OSUtils.filterSystemProperties(args);
DesktopApplicationContext.main(Main.class, args);
}
示例4: main
import org.apache.pivot.wtk.DesktopApplicationContext; //导入依赖的package包/类
public static void main(String[] args) {
if(args == null || args.length < 1 || args[0] == null) {
URL url = MosaicPaneRefImpl.class.getResource("testModel.txt");
String path = Paths.get(url.toExternalForm()).toAbsolutePath().toString();
try{
path = Paths.get(url.toURI()).toAbsolutePath().toString();
}catch(Exception e) { e.printStackTrace(); }
args = new String[] { "--file="+path, "--surface=test"};
}
DesktopApplicationContext.main(MosaicPaneRefImpl.class, args);
}
示例5: main
import org.apache.pivot.wtk.DesktopApplicationContext; //导入依赖的package包/类
public static void main( String[] args )
{
if (args.length > 0) // Command Line Function
{
Out.setLogger(null);
Out.print(LOG_LEVEL.INFO, "Command Line compiling enabled");
Out.print(LOG_LEVEL.INFO, "Loading application...");
new Master();
for (String s: args) {
if (new File(s).exists() && s.endsWith(".dcp")) {
Out.print(LOG_LEVEL.INFO, "Processing dcp file: " + s);
System.out.println();
Master.facade.process(s);// compile save file with izpack
}
else {
Out.print(LOG_LEVEL.ERR, "Filepath doesn't exist or file is incorrect! Please give a valid path to a dcp save file.");
}
}
}
else // GUI Application
{
// Apache Pivot bugfix for Java VM versions containing '_'
String javaVersionFix = System.getProperty("java.runtime.version").split("_")[0];
System.setProperty("java.vm.version", javaVersionFix);
Out.print(LOG_LEVEL.INFO, "Fixing Java version to v" + System.getProperty("java.vm.version"));
DesktopApplicationContext.main(Master.class, args);
}
}
示例6: main
import org.apache.pivot.wtk.DesktopApplicationContext; //导入依赖的package包/类
public static void main(String[] args) {
DesktopApplicationContext.main(ShareActionTestApp.class, args);
}
示例7: main
import org.apache.pivot.wtk.DesktopApplicationContext; //导入依赖的package包/类
public static void main(String[] args) {
DesktopApplicationContext.main(TextAreaTest.class, args);
}
示例8: main
import org.apache.pivot.wtk.DesktopApplicationContext; //导入依赖的package包/类
public static void main(String[] args) {
DesktopApplicationContext.main(DissectorApplication.class, args);
}
示例9: main
import org.apache.pivot.wtk.DesktopApplicationContext; //导入依赖的package包/类
public static void main(String[] args) {
DesktopApplicationContext.main(DesktopPivotGriffonApplication.class, args);
}
示例10: run
import org.apache.pivot.wtk.DesktopApplicationContext; //导入依赖的package包/类
public static void run(String[] args) {
DesktopApplicationContext.main(DesktopPivotGriffonApplication.class, args);
}
示例11: start
import org.apache.pivot.wtk.DesktopApplicationContext; //导入依赖的package包/类
public static void start(String[] args) {
PlayerServer playerServer = PlayerServer.getInstance();
CameraServer cameraServer = CameraServer.getInstance();
PlayerServerListener playerServerListener = null;
try {
// comment in next line for "test run"
// SerialInterface sI = new SerialInterface("COM8");
GameModerator gameModerator = GameModerator.getInstance();
playerServerListener = new PlayerServerListener(gameModerator);
playerServer.addListener(playerServerListener);
PlayerNetwork.register(playerServer);
playerServer.bind(PlayerNetwork.PLAYER_SERVICE_PORT, PlayerNetwork.PLAYER_SERVICE_PORT);
playerServer.start();
cameraServer.bind(WorldNetwork.CAMERA_SERVICE_PORT, WorldNetwork.CAMERA_SERVICE_PORT);
CameraServerListener cameraServerListener = new CameraServerListener(gameModerator);
cameraServer.addListener(cameraServerListener);
WorldNetwork.register(cameraServer);
cameraServer.start();
boolean displayGui = true;
if (args != null) {
for (String string : args) {
if ("--gui=false".equals(string)) {
displayGui = false;
break;
}
}
}
if (displayGui) {
new RepeatingReleasedEventsFixer().install();
DesktopApplicationContext.main(ServerView.class, args);
}
} catch (Exception e) {
_logger.error("Exception caught during application startup.", e);
if (playerServer != null) {
playerServer.close();
}
if (cameraServer != null) {
cameraServer.close();
}
// TODO: Are this all connections, we need to close?
}
}
示例12: main
import org.apache.pivot.wtk.DesktopApplicationContext; //导入依赖的package包/类
public static void main(String[] args) {
DesktopApplicationContext.main(CameraApplication.class, args);
}
示例13: main
import org.apache.pivot.wtk.DesktopApplicationContext; //导入依赖的package包/类
public static void main(String[] args) {
DesktopApplicationContext.main(PlayerSimulatorApplication.class, args);
}