布局、HyperLink超级链接、Hyper超级、Insets插入、BorderPane布局顶部,底部,左,右或中心区域中的子节点。 BorderPane的顶部和底部区域允许可调整大小的节点占用所有可用宽度。 左边界区域和右边界区域占据顶部和底部边界之间的可用垂直空间。默认情况下,所有边界区域尊重子节点的首选宽度和高度。 borderPane = new BorderPane(); borderPane.setStyle("-fx-background-color: #330000;"); (top); borderPane.setLeft(letf); // borderPane.setRight(right); borderPane.setBottom borderpane = new BorderPane(); GridPane gridPane = new GridPane(); gridPane.setStyle("
ht.graph.GraphView(dataModel); toolbar = new ht.widget.Toolbar(items); borderPane = new ht.widget.BorderPane(); borderPane.setTopView(toolbar); borderPane.setCenterView (g2d); view = borderPane.getView(); view.className document.body.appendChild(view); window.addEventListener('resize', function (e) { borderPane.invalidate
borderPane = new BorderPane(); FileInputStream fileInputStream1 = new FileInputStream("F:\\IDEADemo borderPane =new BorderPane(); button.setOnAction(new EventHandler<ActionEvent>() { (button); borderPane.setCenter(imageView); Scene scene =new Scene(borderPane,1200,800); 布局编辑BorderPane布局顶部,底部,左,右或中心区域中的子节点。 布局 BorderPane borderPane =new BorderPane(); borderPane.getChildren().addAll(imageView);
import javafx.scene.control.ScrollPane; import javafx.scene.image.Image; import javafx.scene.layout.BorderPane 布局 BorderPane borderPane = new BorderPane(); // 创建一个菜单栏 MenuBar menuBar = new MenuBar (menuBar); borderPane.setCenter(new ScrollPane()); // 1、初始化一个场景 Scene scene = new Scene(borderPane 布局 BorderPane borderPane = new BorderPane(); // 创建一个菜单栏 MenuBar menuBar = new MenuBar(); menuBar.getStyleClass (menuBar); borderPane.setCenter(new ScrollPane()); // 1、初始化一个场景 Scene scene = new Scene(borderPane, 400
borderPane(){ BorderPane borderPane = new BorderPane(); //调用集合 View.visitor.function_visitor.function_select borderPane = vasf.borderPane(); scene = new Scene(borderPane); //进入动物界面 borderPane = vaamall.borderPane(); scene = new Scene(borderPane); //查询 borderPane = vaafafa.borderPane() ; scene = new Scene(borderPane); //----增添按钮 borderPane = vaamaml.borderPane(); scene = new Scene(borderPane); //查询界面
--布局控件BorderPane,fx:controller属性用于声明事件处理的Controller,值为Controller类的类全名--> <! BorderPane.alignment="CENTER" onAction="#handleButtonAction"> <! font> </Button> </BorderPane > 可以看到FXML文件中的元素BorderPane ,Button对应这JavaFX中的布局类或者控件类,Center是BorderPane的属性,而Font是Button的属性。 root = (BorderPane)FXMLLoader.load(getClass().getResource("MainPane.fxml")); Scene scene
HT 将这种实现方法封装了起来,整个外部的 div 就是 HT 的基础组件,这里我们用到的是 ht.widget.BorderPane 组件,上部的 div 封装在 ht.widget.Toolbar 工具条类中,下部分是 3D 部分 ht.graph3d.Graph3dView 组件,将页面中的两个部分通过下面的方式添加进 BorderPane 组件中,并将 BorderPane 添加进 body = new ht.widget.BorderPane(); borderPane.setTopView(toolbar); borderPane.setCenterView(g3d); view = borderPane.getView(); view.className = 'main'; document.body.appendChild(view); window.addEventListener ('resize', function (e) { borderPane.invalidate(); }, false); 上面代码将 borderPane.getView() 添加进 body
ht.graph.GraphView(dataModel); toolbar = new ht.widget.Toolbar(items); borderPane = new ht.widget.BorderPane(); borderPane.setTopView(toolbar); borderPane.setCenterView (g2d); view = borderPane.getView(); view.className document.body.appendChild(view); window.addEventListener('resize', function (e) { borderPane.invalidate
graphView.sm().clearSelection();//每次工具条有点击的时候就清空所有的选中 } return item; } 接着利用 HT 封装的面板组件 ht.widget.BorderPane 我们又利用 HT 封装的 ht.widget.SplitView 分割组件将底部分为上下两个部分,最后将这个外边框 borderPane 添加进 body 体中: splitView = new ht.widget.SplitView (graphView, g3d, 'v', 0.5); borderPane = new ht.widget.BorderPane(); borderPane.setTopView(toolbar); borderPane.setCenterView(splitView); borderPane.addToDOM(); 整个场景都制作完毕,接着就是功能部分。 edit').selected = true; toolbar.getItemById('edit').icon.comps[1].color = '#1E90FF'; borderPane.iv
布局结束记得将最外层组件的最底层 div 添加到 body 中,HT 的组件一般都会嵌入 BorderPane、SplitView 和 TabView 等容器中使用,而最外层的HT组件则需要用户手工将 这里先将整个右边的部分进行布局,下面代码中的变量 listBorder 为上图的左半部分,变量 borderPane 为上图的右半部分,至于鹰眼组件部分,是添加到在 borderPane 的上层: listView (),// 场景中间边框面板组件(http://www.hightopo.com/guide/guide/core/borderpane/ht-borderpane-guide.html) gv = this.gv = this.borderPane = new ht.widget.BorderPane(), toolbar = this.toolbar = new ht.widget.Toolbar(),// (gv);// 设置中间组件 borderPane.setTopView(toolbar);// 设置顶部组件 borderPane.setTopHeight(32);// 设置中间组件高度 从上面的代码可以看出
BorderPane BorderPane将界面分割上上下左右中5部分,我们可以将控件放置在其中。 在SceneBuilder中我们将一个控件拖拽到BorderPane的时候,会有上下左右中的区域显示。 ? 我们在这5个区域放置5个标签,如下图: ? FXML代码如下: <? > <BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" " /> </top> <left> <Label style="-fx-font-family: Arial; -fx-font-size: 20px;" text="左" BorderPane.alignment ="CENTER" /> </bottom> </BorderPane> 该FXML代码中我们设置了字体,让显示更大一些。
= new ht.widget.BorderPane();//边框面板组件 borderPane.setRightView(rightView, 400);//设置 borderPane 右边组件为 rightView,宽度为400 borderPane.setCenterView(gv);//设置 borderPane 中间组件为 gv borderPane.addToDOM();//将 borderPane 这里我结合了 SplitView 和 BorderPane 将场景分成了三个部分。 window.addEventListener('resize', function () { self.iv(); }, false); } HT 的组件一般都会嵌入 BorderPane 和 TabView 等容器中使用,而最外层的 HT 组件则需要用户手工将 getView() 返回的底层 div 元素添加到页面的 DOM 元素中,这里需要注意的是,当父容器大小变化时,如果父容器是 BorderPane
graphView.sm().clearSelection();//每次工具条有点击的时候就清空所有的选中 } return item; } 接着利用 HT 封装的面板组件 ht.widget.BorderPane 我们又利用 HT 封装的 ht.widget.SplitView 分割组件将底部分为上下两个部分,最后将这个外边框 borderPane 添加进 body 体中: splitView = new ht.widget.SplitView (graphView, g3d, 'v', 0.5); borderPane = new ht.widget.BorderPane(); borderPane.setTopView(toolbar); borderPane.setCenterView(splitView); borderPane.addToDOM(); 整个场景都制作完毕,接着就是功能部分。 edit').selected = true; toolbar.getItemById('edit').icon.comps[1].color = '#1E90FF'; borderPane.iv
布局结束记得将最外层组件的最底层 div 添加到 body 中,HT 的组件一般都会嵌入 BorderPane、SplitView 和 TabView 等容器中使用,而最外层的HT组件则需要用户手工将 这里先将整个右边的部分进行布局,下面代码中的变量 listBorder 为上图的左半部分,变量 borderPane 为上图的右半部分,至于鹰眼组件部分,是添加到在 borderPane 的上层: listView (),// 场景中间边框面板组件(http://www.hightopo.com/guide/guide/core/borderpane/ht-borderpane-guide.html) gv = this.gv = this.borderPane = new ht.widget.BorderPane(), toolbar = this.toolbar = new ht.widget.Toolbar(),// (gv);// 设置中间组件 borderPane.setTopView(toolbar);// 设置顶部组件 borderPane.setTopHeight(32);// 设置中间组件高度 从上面的代码可以看出
会发现这个界面是由左右两部分组成的,右边又是由上下两部分组成的,这种分割模式在 HT 中有很好的解决办法,可以完全利用 ht.widget.SplitView 将界面分层,也可以利用 ht.widget.BorderPane g3d = new ht.graph3d.Graph3dView(dataModel);//3d组件 toolbar = new ht.widget.Toolbar(item); //工具条 borderPane = new ht.widget.BorderPane();//面板组件 borderPane.setTopView(toolbar);//toolbar 放在上部 borderPane.setCenterView 放在中间部分 treeView = new ht.widget.TreeView(dataModel); //树组件 mainSplit = new ht.widget.SplitView(treeView, borderPane
ht.graph3d.Graph3dView(dataModel); toolbar = new ht.widget.Toolbar(items); borderPane = new ht.widget.BorderPane(); borderPane.setTopView(toolbar); borderPane.setCenterView
首先,创建场景,HT 中有一个 BorderPane 面板组件是拿来页面排布的,可以排布 html 标签,也可以排布 HT 的组件,这里我们将整个页面分为三个部分,顶部工具条 toolbar、左侧列表 listView 和中间 3d 场景 g3d,再将这个面板组件添加进 html body 体中: borderPane = new ht.widget.BorderPane();//面板组件 listView = new ht.widget.ListView(); //列表组件 g3d = new ht.graph3d.Graph3dView();// 3d 组件 borderPane.setTopView (toolbar);//将 toolbar 放置到面板中的顶部 borderPane.setLeftView(listView, 350); //将 listView 放置到面板中的左侧 borderPane.setCenterView (g3d); //将 g3d 放置到面板中的中间 borderPane.addToDOM(); //将面板组件添加进 body 中 addToDOM 函数是 HT 封装好的将
首先,创建场景,HT 中有一个 BorderPane 面板组件是拿来页面排布的,可以排布 html 标签,也可以排布 HT 的组件,这里我们将整个页面分为三个部分,顶部工具条 toolbar、左侧列表 listView 和中间 3d 场景 g3d,再将这个面板组件添加进 html body 体中: borderPane = new ht.widget.BorderPane();//面板组件 listView = new ht.widget.ListView(); //列表组件 g3d = new ht.graph3d.Graph3dView();// 3d 组件 borderPane.setTopView (toolbar);//将 toolbar 放置到面板中的顶部 borderPane.setLeftView(listView, 350); //将 listView 放置到面板中的左侧 borderPane.setCenterView (g3d); //将 g3d 放置到面板中的中间 borderPane.addToDOM(); //将面板组件添加进 body 中 addToDOM 函数是 HT 封装好的将
> <BorderPane fx:id="mainWindow" prefHeight="600.0" prefWidth="900.0" xmlns="http://javafx.com hello tornadofx"> </Button> </children> </VBox> </BorderPane
import javafx.scene.layout.BorderPane? > <BorderPane xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1" fx:controller ="cn.tzy.MainController">