当前位置: 首页>>代码示例>>Java>>正文


Java Platform类代码示例

本文整理汇总了Java中javafx.application.Platform的典型用法代码示例。如果您正苦于以下问题:Java Platform类的具体用法?Java Platform怎么用?Java Platform使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Platform类属于javafx.application包,在下文中一共展示了Platform类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getWebtoon

import javafx.application.Platform; //导入依赖的package包/类
/**
 * 웹툰조회
 */
public void getWebtoon(String code) {

	if (!"".equals(code)) {
		CommonService cs = new CommonService();

		Connection conn = cs.getConnection(code);
		conn.timeout(5000);

		Document doc = null;
		
		codeInputField.setText(code);
		wDesc.setWrapText(true);

		try {

			doc = conn.get();

			String title = doc.select("title").text().split("::")[0];
			setTitle(title);

			String author = doc.select("div.detail h2 > span").text();
			wTitle.setText(title + "(" + author + ")");

			String desc = doc.select("div.detail p").text();
			wDesc.setText(desc);

			String img = doc.select("div.thumb > a img").attr("src");
			thumbnail.setImage(new Image(img, true));

		} catch (Exception e) {
			e.printStackTrace();
		}
	} else {
		Platform.runLater(new Runnable() {
			@Override
			public void run() {
				AlertSupport alert = new AlertSupport("웹툰코드를 입력하세요.");
				alert.alertInfoMsg(stage);
			}
		});
	}
}
 
开发者ID:kimyearho,项目名称:WebtoonDownloadManager,代码行数:46,代码来源:ManualController.java

示例2: loadFX

import javafx.application.Platform; //导入依赖的package包/类
@Test public void loadFX() throws Exception {
    final CountDownLatch cdl = new CountDownLatch(1);
    final CountDownLatch done = new CountDownLatch(1);
    final JFXPanel p = new JFXPanel();
    Platform.runLater(new Runnable() {
        @Override
        public void run() {
            Node wv = TestPages.getFX(10, cdl);
            Scene s = new Scene(new Group(wv));
            p.setScene(s);
            done.countDown();
        }
    });
    done.await();
    JFrame f = new JFrame();
    f.getContentPane().add(p);
    f.pack();
    f.setVisible(true);
    cdl.await();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:ComponentsTest.java

示例3: handleInput

import javafx.application.Platform; //导入依赖的package包/类
@Override public void handleInput(GroupInputInfo info) {
    try {
        File file = info.getFile();
        if (file == null) {
            return;
        }
        Group group = Group.createGroup(type, file.toPath(), info.getName());
        if (group == null) {
            return;
        }
        fileUpdated(file);
        navigatorPanel.updated(DisplayWindow.this, new FileResource(file.getParentFile()));
        suitesPanel.updated(DisplayWindow.this, new FileResource(file));
        featuresPanel.updated(DisplayWindow.this, new FileResource(file));
        storiesPanel.updated(DisplayWindow.this, new FileResource(file));
        issuesPanel.updated(DisplayWindow.this, new FileResource(file));
        Platform.runLater(() -> openFile(file));
    } catch (Exception e) {
        e.printStackTrace();
        FXUIUtils.showConfirmDialog(DisplayWindow.this,
                "Could not complete creation of " + type.fileType().toLowerCase() + " file.",
                "Error in creating a " + type.fileType().toLowerCase() + " file", AlertType.ERROR);
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:25,代码来源:DisplayWindow.java

示例4: performSetup

import javafx.application.Platform; //导入依赖的package包/类
@Override
protected void performSetup() {
    setTitle();
    // TODO: Better loading.
    Platform.runLater(new Runnable() {
        @Override
        public void run() {
            devicesLoadingLabel.setVisible(true);
            diskListView.setCellFactory(lv -> {
                TextFieldListCell<Disk> cell = new TextFieldListCell<>();
                cell.setConverter(workflowController.getStringConverterForDisks());
                return cell;
            });
            ObservableList<Disk> disks = FXCollections.observableArrayList();
            disks.addAll(workflowController.getAvailableDisks());
            devicesLoadingLabel.setVisible(false);
            diskListView.setItems(disks);
        }});
}
 
开发者ID:ciphertechsolutions,项目名称:IO,代码行数:20,代码来源:SelectDeviceController.java

示例5: getText

import javafx.application.Platform; //导入依赖的package包/类
@Test public void getText() {
    ChoiceBox<?> choiceBox = (ChoiceBox<?>) getPrimaryStage().getScene().getRoot().lookup(".choice-box");
    LoggingRecorder lr = new LoggingRecorder();
    List<String> text = new ArrayList<>();
    Platform.runLater(() -> {
        RFXChoiceBox rfxChoiceBox = new RFXChoiceBox(choiceBox, null, null, lr);
        choiceBox.getSelectionModel().select(1);
        rfxChoiceBox.focusLost(null);
        text.add(rfxChoiceBox._getText());
    });
    new Wait("Waiting for choice box text.") {
        @Override public boolean until() {
            return text.size() > 0;
        }
    };
    AssertJUnit.assertEquals("Cat", text.get(0));
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:18,代码来源:RFXChoiceBoxTest.java

示例6: initStatusBar

import javafx.application.Platform; //导入依赖的package包/类
/**
 * Initialize the status bar
 */
private void initStatusBar() {
    statusPanel.getFixtureLabel().setOnMouseClicked((e) -> {
        onSelectFixture();
    });
    statusPanel.getRowLabel().setOnMouseClicked((e) -> {
        gotoLine();
    });
    statusPanel.getInsertLabel().setOnMouseClicked((e) -> {
        Platform.runLater(() -> {
            if (currentEditor != null) {
                currentEditor.toggleInsertMode();
            }
        });
    });
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:19,代码来源:DisplayWindow.java

示例7: onViewCreated

import javafx.application.Platform; //导入依赖的package包/类
@Override
protected void onViewCreated() {
    siderBarView.setOnItemSelectedListener(contentView::loadBucket);
    contentView.setOnItemSelectedListener(this::updateSelectItem);
    contentView.setUpdateListener(bucketFile -> {
        if (Platform.isFxApplicationThread()) {
            updateSelectItem(bucketFile);
        } else {
            runOnUiThread(() -> this.updateSelectItem(bucketFile));
        }
    });

    // 初始化菜单
    Menu setting = new Menu("设置");
    setting.getItems().add(getMenuItem("TinyPNG", "tinypng"));
    setting.getItems().add(getMenuItem("七牛", "qiniu"));
    setting.getItems().add(getMenuItem("Gif", "gif"));

    Menu about = new Menu("关于");
    about.getItems().add(getMenuItem("关于BlogHelper", "aboutBlogHelper"));
    about.getItems().add(getMenuItem("关于作者cmlanche", "aboutAnchor"));

    menuBar.getMenus().add(setting);
    menuBar.getMenus().add(about);

    if (PlatformUtil.isMac()) {
        menuBar.setUseSystemMenuBar(true);
    }

    // 操作按钮
    downloadBtn.setOnAction(event -> contentView.handleAction("download"));
    renameBtn.setOnAction(event -> contentView.handleAction("rename"));
    deleteBtn.setOnAction(event -> contentView.handleAction("delete"));
    optimizeBtn.setOnAction(event -> contentView.handleAction("optimize"));
    uploadBtn.setOnAction(event -> contentView.handleAction("upload"));
}
 
开发者ID:cmlanche,项目名称:javafx-qiniu-tinypng-client,代码行数:37,代码来源:MainView.java

示例8: spellcheckDocument

import javafx.application.Platform; //导入依赖的package包/类
public boolean spellcheckDocument() {
    editorToolBar.setActionText("Spell checking document \'" + file.getName() + "\'");
    Platform.runLater(() -> {
        try {
            timer.start();
            List<RuleMatch> matches = spellcheck.check(getContent());
            MarkdownHighligher.computeSpellcheckHighlighting(matches, this);
            editorToolBar.setActionText("Found " + matches.size() + " misspellings in the document \'" + file.getName() + "\' (" + timer.end() + "ms)");
        } catch (IOException e) {
            dialogFactory.buildExceptionDialogBox(
                    dict.DIALOG_EXCEPTION_TITLE,
                    dict.DIALOG_EXCEPTION_SPELLCHECK_CONTENT,
                    e.getMessage(),
                    e
            );
        }
    });

    return true;
}
 
开发者ID:jdesive,项目名称:textmd,代码行数:21,代码来源:EditorPane.java

示例9: select

import javafx.application.Platform; //导入依赖的package包/类
@Test public void select() {
    TreeView<?> treeView = (TreeView<?>) getPrimaryStage().getScene().getRoot().lookup(".tree-view");
    LoggingRecorder lr = new LoggingRecorder();
    Platform.runLater(new Runnable() {
        @Override public void run() {
            Point2D point = getPoint(treeView, 1);
            RFXTreeView rfxListView = new RFXTreeView(treeView, null, point, lr);
            rfxListView.focusGained(rfxListView);
            CheckBoxTreeItem<?> treeItem = (CheckBoxTreeItem<?>) treeView.getTreeItem(1);
            treeItem.setSelected(true);
            rfxListView.focusLost(rfxListView);
        }
    });
    List<Recording> recordings = lr.waitAndGetRecordings(1);
    Recording recording = recordings.get(0);
    AssertJUnit.assertEquals("recordSelect", recording.getCall());
    AssertJUnit.assertEquals("Child Node 1:checked", recording.getParameters()[0]);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:19,代码来源:RFXTreeViewCheckBoxTreeCellTest.java

示例10: initialize

import javafx.application.Platform; //导入依赖的package包/类
public void initialize() {
    MenuBar menuBar = new MenuBar();
    // Make same width as the stage
    menuBar.prefWidthProperty().bind(primaryStage.widthProperty());
    rootPane.setTop(menuBar);

    // File menu - new, save, exit
    Menu fileMenu = new Menu("File");
    MenuItem newMenuItem = createMenuItem("New", actionEvent -> this.onNewFile());

    MenuItem openMenuItem = createMenuItem("Open", actionEvent -> this.onOpenFile());

    MenuItem saveMenuItem = createMenuItem("Save", actionEvent -> this.onSaveFile());
    saveMenuItem.disableProperty().bind(jwkSetData.changedProperty().not());

    MenuItem exitMenuItem = createMenuItem("Exit", actionEvent -> Platform.exit());

    fileMenu.getItems().addAll(newMenuItem, openMenuItem, saveMenuItem,
            new SeparatorMenuItem(), exitMenuItem);

    menuBar.getMenus().addAll(fileMenu);
}
 
开发者ID:atbashEE,项目名称:atbash-octopus,代码行数:23,代码来源:ApplicationMenu.java

示例11: testNormalStart

import javafx.application.Platform; //导入依赖的package包/类
@Test
public void testNormalStart() throws Exception {
    Platform.runLater(() -> {
        Ember ember = new Ember();
        Stage stage = new Stage();
        try {
            ember.start(stage);
        } catch (Exception ex) {
            fail("An exception is thrown.");
            Logger.getLogger(
                    EmberTest.class.getName()).
                    log(Level.SEVERE, null, ex);
        }
    });

}
 
开发者ID:Soheibooo,项目名称:EMBER,代码行数:17,代码来源:EmberTest.java

示例12: startGUI

import javafx.application.Platform; //导入依赖的package包/类
public void startGUI(Pane pane) {
    Platform.runLater(new Runnable() {
        @Override public void run() {
            primaryStage.hide();
            primaryStage.setScene(new Scene(pane));
            primaryStage.sizeToScene();
            primaryStage.show();
        }
    });
    new Wait("Waiting for applicationHelper to be initialized") {
        @Override public boolean until() {
            try {
                return primaryStage.getScene().getRoot() == pane;
            } catch (Throwable t) {
                return false;
            }
        }
    };
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:20,代码来源:JavaFXElementTest.java

示例13: startAutoSync

import javafx.application.Platform; //导入依赖的package包/类
@FXML
    public void startAutoSync() {
        DataSync.getMainStage().setOnCloseRequest(closeEvent -> this.syncController.kill());
        this.syncController.execute((count) -> {
            Platform.runLater(() -> {
                Date date = new Date();
                TOALogger.log(Level.INFO, "Executing update #" + count + " at " + DateFormat.getTimeInstance(DateFormat.SHORT).format(date));
                TOALogger.log(Level.INFO, "There are " + Thread.activeCount() + " threads.");
                this.matchesController.syncMatches();
                this.matchesController.checkMatchSchedule();
                this.matchesController.checkMatchDetails();
//                this.rankingsController.syncRankings();
                // We're going to try THIS instead....
                this.rankingsController.getRankingsByFile();
                this.rankingsController.postRankings();
                if (this.btnSyncMatches.selectedProperty().get()) {
                     this.matchesController.postCompletedMatches();
                }
            });
        });
    }
 
开发者ID:orange-alliance,项目名称:TOA-DataSync,代码行数:22,代码来源:DataSyncController.java

示例14: duplicateMenuPath

import javafx.application.Platform; //导入依赖的package包/类
@Test public void duplicateMenuPath() {
    List<String> path = new ArrayList<>();
    Platform.runLater(() -> {
        Menu menuFile = new Menu("File");
        MenuItem add = new MenuItem("Shuffle");

        MenuItem clear = new MenuItem("Clear");
        MenuItem clear1 = new MenuItem("Clear");
        MenuItem clear2 = new MenuItem("Clear");

        MenuItem exit = new MenuItem("Exit");

        menuFile.getItems().addAll(add, clear, clear1, clear2, new SeparatorMenuItem(), exit);
        RFXMenuItem rfxMenuItem = new RFXMenuItem(null, null);
        path.add(rfxMenuItem.getSelectedMenuPath(clear2));
    });
    new Wait("Waiting for menu selection path") {
        @Override public boolean until() {
            return path.size() > 0;
        }
    };
    AssertJUnit.assertEquals("File>>Clear(2)", path.get(0));
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:24,代码来源:RFXMenuItemTest.java

示例15: startMe

import javafx.application.Platform; //导入依赖的package包/类
/**
 * Called by a thread created when
 */
public static void startMe()
{
    if (primaryStage == null)
    {
        try
        {
            Platform.setImplicitExit(false);
            Bootstrap.launch();
        }
        catch (Exception exception)
        {
            FlexFXBundle.setStartupException(exception);
        }
    }
    else
    {
        FlexFXBundle.setStage(primaryStage, IS_FX_THREAD_RESTART);
    }
}
 
开发者ID:jtkb,项目名称:flexfx,代码行数:23,代码来源:Bootstrap.java


注:本文中的javafx.application.Platform类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。