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


Java SwingNode类代码示例

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


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

示例1: createSwingContent

import javafx.embed.swing.SwingNode; //导入依赖的package包/类
private void createSwingContent(final SwingNode swingNode)
{

	String param = this.getString(null);
	debug.Debugger.out();
	SwingUtilities.invokeLater(new Runnable() {
		@Override
		public void run()
		{
			
			//Zugriff auf "Objekte im Haus"(Methoden)
			try {
				Printer.giveToPrint(param);
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		
		}
	});
}
 
开发者ID:CoffeeCodeSwitzerland,项目名称:Lernkartei_2017,代码行数:22,代码来源:DruckModel.java

示例2: start

import javafx.embed.swing.SwingNode; //导入依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
    SwingNode swingNode = new SwingNode();
    SwingUtilities.invokeLater(() -> initializeSwing(swingNode));

    BorderPane parent = new BorderPane();
    parent.setCenter(swingNode);

    primaryStage.setOnCloseRequest(event -> {
        CefApp.getInstance().dispose();
        System.exit(0);
    });

    Scene scene = new Scene(parent, 800, 600);
    primaryStage.setScene(scene);
    primaryStage.show();
}
 
开发者ID:Panda-Programming-Language,项目名称:Pandomium,代码行数:18,代码来源:WindowsFXTest.java

示例3: initializeSwing

import javafx.embed.swing.SwingNode; //导入依赖的package包/类
private void initializeSwing(SwingNode swingNode) {
    CefApp.addAppHandler(new CefAppHandlerAdapter(null) {
        @Override
        public void stateHasChanged(org.cef.CefApp.CefAppState state) {
            if (state == CefApp.CefAppState.TERMINATED) {
                System.exit(0);
            }
        }
    });

    CefSettings settings = new CefSettings();
    settings.windowless_rendering_enabled = OS.isLinux();
    CefApp cefApp = CefApp.getInstance(settings);
    CefClient cefClient = cefApp.createClient();

    CefBrowser cefBrowser = cefClient.createBrowser("http://www.google.com", OS.isLinux(), false);
    Component browserUI = cefBrowser.getUIComponent();

    JPanel panel = new JPanel();
    panel.add(browserUI);

    swingNode.setContent(panel);
}
 
开发者ID:Panda-Programming-Language,项目名称:Pandomium,代码行数:24,代码来源:WindowsFXTest.java

示例4: createSwingContent

import javafx.embed.swing.SwingNode; //导入依赖的package包/类
private void createSwingContent(final SwingNode swingNode)
{

	String param = this.getString(null);
	debug.Debugger.out();
	SwingUtilities.invokeLater(new Runnable() {
		@Override
		public void run()
		{
			
			//Erstellt "Haus(Klasse)" in diesem "Haus(Klasse)" sind "Objekte(Methoden)" 
			Printer p = new Printer();
			//Zugriff auf "Objekte im Haus"(Methoden)
			p.printer(param);				
		}
	});
}
 
开发者ID:RookStudios,项目名称:Lernkartei,代码行数:18,代码来源:DruckModel.java

示例5: showConfirmDialog

import javafx.embed.swing.SwingNode; //导入依赖的package包/类
public static boolean showConfirmDialog(String title, JComponent content) {
	if (Platform.isFxApplicationThread()) {
		Alert alert = new Alert(AlertType.NONE, null, ButtonType.OK, ButtonType.CANCEL);
		if (QuPathGUI.getInstance() != null)
			alert.initOwner(QuPathGUI.getInstance().getStage());
		alert.getDialogPane().setHeaderText(null);
		alert.setTitle(title);
		SwingNode node = new SwingNode();
		node.setContent(content);
		content.validate();
		content.setSize(content.getPreferredSize());
		StackPane pane = new StackPane(node);
		pane.setPrefSize(content.getPreferredSize().width + 25, content.getPreferredSize().height + 25);
		alert.getDialogPane().setContent(pane);
		Optional<ButtonType> result = alert.showAndWait();
		return result.isPresent() && result.get() == ButtonType.OK;
	} else
		return JOptionPane.showConfirmDialog(null, content, title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE) == JOptionPane.OK_OPTION;
}
 
开发者ID:qupath,项目名称:qupath,代码行数:20,代码来源:DisplayHelpers.java

示例6: showPlainMessage

import javafx.embed.swing.SwingNode; //导入依赖的package包/类
public static void showPlainMessage(final String title, final JComponent message) {
		logger.info(title + ": " + message);
		if (!GraphicsEnvironment.isHeadless()) {
			if (Platform.isFxApplicationThread()) {
				Alert alert = new Alert(AlertType.INFORMATION);
				alert.getDialogPane().setHeaderText(null);
				alert.setTitle(title);
				SwingNode node = new SwingNode();
				node.setContent(message);
				alert.getDialogPane().setContent(node);
				alert.show();
			} else
				JOptionPane.showMessageDialog(getPossibleParent(), message, title, JOptionPane.PLAIN_MESSAGE, null);
		}
//			showDialog(title, message);
	}
 
开发者ID:qupath,项目名称:qupath,代码行数:17,代码来源:DisplayHelpers.java

示例7: newSpaceTab

import javafx.embed.swing.SwingNode; //导入依赖的package包/类
public Tab newSpaceTab() {
    Tab t = new Tab(/*"Space"*/);
    AwesomeDude.setIcon(t, AwesomeIcon.MAP_MARKER);
    
    
    SwingNode swingMap = new SwingNode();
    t.selectedProperty().addListener(new ChangeListener<Boolean>() {
        boolean firstvisible = true;
        @Override
        public void changed(ObservableValue<? extends Boolean> o, Boolean a, Boolean b) {
            if (swingMap.isVisible() && firstvisible) {
                swingMap.setContent(new SwingMap( new GeoPosition(40.00, -80.00)));
                t.setContent(swingMap);
                firstvisible = false;
            }
        }
    });
    return t;
}
 
开发者ID:automenta,项目名称:netentionj-desktop,代码行数:20,代码来源:NodeControlPane.java

示例8: createSwingContent

import javafx.embed.swing.SwingNode; //导入依赖的package包/类
private void createSwingContent (final SwingNode swingNode)
{
	SwingUtilities.invokeLater(new Runnable() {
		@Override
		public void run ()
		{
			debug.Debugger.out("Game model: starting swing thread...");
			if (mf == null) init();
			mf.setVisible(true);
			gamePanel.first = true;
		}
	});
}
 
开发者ID:CoffeeCodeSwitzerland,项目名称:Lernkartei_2017,代码行数:14,代码来源:GameModel.java

示例9: doAction

import javafx.embed.swing.SwingNode; //导入依赖的package包/类
@Override
public int doAction (Command command, String... param)
{
	switch (command)
	{
		case NEW:
			final SwingNode swingNode = new SwingNode();
			createSwingContent(swingNode);
			return 1;
		default:
			return super.doAction(command, param);
	}
}
 
开发者ID:CoffeeCodeSwitzerland,项目名称:Lernkartei_2017,代码行数:14,代码来源:GameModel.java

示例10: doAction

import javafx.embed.swing.SwingNode; //导入依赖的package包/类
@Override
public int doAction (Command command, String... param)
{
	switch (command)
	{
		case NEW:
			
			final SwingNode swingNode = new SwingNode();
			createSwingContent(swingNode);
			
			return 1;
		default:
			return super.doAction(command, param);
	}
}
 
开发者ID:CoffeeCodeSwitzerland,项目名称:Lernkartei_2017,代码行数:16,代码来源:DruckModel.java

示例11: DFAPanelFx

import javafx.embed.swing.SwingNode; //导入依赖的package包/类
public DFAPanelFx() {
	super();

	//		setLayout(new BorderLayout());
	//		JPanel leftPanel = new JPanel();
	BorderPane leftPanel = new BorderPane();

	nodeList = new JList(nodes);
	nodeList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
	nodeList.setFixedCellWidth(150);
	//		nodeList.setBorder(BorderFactory.createLineBorder(Color.black));
	nodeList.addListSelectionListener(this);

	SwingNode swingJList = new SwingNode();
	createSwingContent(swingJList, new JScrollPane(nodeList));

	leftPanel.setCenter(swingJList);

	//		add(leftPanel, BorderLayout.WEST);
	setLeft(leftPanel);
	dfaCanvas = new DFACanvas();
	dfaCanvas.setBackground(Color.WHITE);
	dfaCanvas.setPreferredSize(new Dimension(900, 1400));

	JScrollPane scrollPane = new JScrollPane(dfaCanvas);
	SwingNode swingScrollPane = new SwingNode();
	createSwingContent(swingScrollPane, scrollPane);
	//		add(scrollPane, BorderLayout.CENTER);
	setCenter(swingScrollPane);
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:31,代码来源:DFAPanelFx.java

示例12: createASTPanel

import javafx.embed.swing.SwingNode; //导入依赖的package包/类
private javafx.scene.Node createASTPanel() {
	astTreeWidget.setCellRenderer(createNoImageTreeCellRenderer());
	TreeSelectionModel model = astTreeWidget.getSelectionModel();
	model.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
	model.addTreeSelectionListener(new SymbolTableListener());
	model.addTreeSelectionListener(new CodeHighlightListener());
	SwingNode swingNode = new SwingNode();
	createSwingContent(swingNode, new JScrollPane(astTreeWidget));
	return swingNode;
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:11,代码来源:DesignerFx.java

示例13: createXPathResultPanel

import javafx.embed.swing.SwingNode; //导入依赖的package包/类
private javafx.scene.Node createXPathResultPanel() {
	xpathResults.addElement("No XPath results yet, run an XPath Query first.");
	xpathResultList.setBorder(BorderFactory.createLineBorder(Color.black));
	xpathResultList.setFixedCellWidth(300);
	xpathResultList.setCellRenderer(new ASTListCellRenderer());
	xpathResultList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
	xpathResultList.getSelectionModel().addListSelectionListener(new ASTSelectionListener());
	JScrollPane scrollPane = new JScrollPane();
	scrollPane.getViewport().setView(xpathResultList);

	SwingNode swingNode = new SwingNode();
	createSwingContent(swingNode, scrollPane);
	return swingNode;
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:15,代码来源:DesignerFx.java

示例14: createSymbolTableResultPanel

import javafx.embed.swing.SwingNode; //导入依赖的package包/类
private javafx.scene.Node createSymbolTableResultPanel() {
	symbolTableTreeWidget.setCellRenderer(createNoImageTreeCellRenderer());

	SwingNode swingNode = new SwingNode();
	JScrollPane jScrollPane = new JScrollPane(symbolTableTreeWidget);
	createSwingContent(swingNode, jScrollPane);
	return swingNode;
}
 
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:9,代码来源:DesignerFx.java

示例15: start

import javafx.embed.swing.SwingNode; //导入依赖的package包/类
@Override
public void start(Stage stage) {
    SwingNode swingNode = new SwingNode();
    BorderPane pane = new BorderPane();

    createSwingContent(swingNode);
    pane.setCenter(swingNode);

    stage.setTitle("SwingNode DnD test");
    stage.setScene(new Scene(pane, 300, 300));
    stage.onCloseRequestProperty().addListener((Observable observable) -> {
        System.exit(0);
    });
    stage.show();
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:16,代码来源:SwingNodeDragDropApp.java


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