当前位置: 首页 > news >正文

郑州便宜网站建设哪家公司做网站便宜

郑州便宜网站建设,哪家公司做网站便宜,自媒体平台哪家好,公司邮箱域名怎么起自定义ui理念 利用JavafX / FXML的声明性设计模式#xff0c;并允许用户仅通过使用例如SceneBuilder打开某个视图即可重新定制布局或添加新控件#xff0c;甚至根据用户需要更改样式#xff0c;从而无需任何编码即可自定义某个视图。 FXML文件 CSS基本上可以放置在通过URL可… 自定义ui 理念 利用JavafX / FXML的声明性设计模式并允许用户仅通过使用例如SceneBuilder打开某个视图即可重新定制布局或添加新控件甚至根据用户需要更改样式从而无需任何编码即可自定义某个视图。 FXML文件 CSS基本上可以放置在通过URL可以到达的任何地方。 用户必须只知道FXML内部分配的控制器类的接口/方法。 遥控器 假设此简单的演示控制器类提供了用于远程控制设备和发送MQTT消息的方法则用户可以自定义自己的遥控器。 public class RemoteController{FXMLpublic void onTest(){Alert alert new Alert(Alert.AlertType.INFORMATION);alert.setContentText();alert.setHeaderText(WORKS!);alert.show();}public void onTest(String value){Alert alert new Alert(Alert.AlertType.INFORMATION);alert.setHeaderText(WORKS!);alert.setContentText(value);alert.show();}public void onSwitch(String houseCode, int groudId, int deviceId, String command){Alert alert new Alert(Alert.AlertType.INFORMATION);alert.setHeaderText(Switch!);alert.setContentText(String.format(Command: send %s %d %d %s, houseCode, groudId, deviceId, command));alert.show();} }remote.fxml和remote.css 请注意引用的de.jensd.shichimifx.demo.ext.RemoteController和remote.css 。 因此基本上可以通过以下方式调用控制器动作 onAction#onTest. 不错 如果添加 ?language javascript? 到FXML也可以通过controller -instance通过JavaScript调用传递参数。 onActioncontroller.onTest(OFF) onActioncontroller.onSwitch(a,1,1,ON) 不幸的是除了- this之外 我找不到有关此功能的更多文档但是以某种方式它神奇地起作用了;-)。 甚至可以传递不同类型的参数。 ?xml version1.0 encodingUTF-8??language javascript? ?import javafx.geometry.*? ?import java.lang.*? ?import java.net.*? ?import java.util.*? ?import javafx.scene.*? ?import javafx.scene.control.*? ?import javafx.scene.layout.*?VBox alignmentTOP_CENTER prefHeight400.0 prefWidth600.0 spacing20.0 styleClassmain-pane stylesheetsremote.css xmlnshttp://javafx.com/javafx/8 xmlns:fxhttp://javafx.com/fxml/1 fx:controllerde.jensd.shichimifx.demo.ext.RemoteControllerchildrenLabel styleClasstitle-label textUniversal Remote /HBox alignmentCENTER_RIGHT spacing20.0childrenLabel layoutX228.0 layoutY96.0 styleClasssub-title-label textLight Frontdoor /Button layoutX43.0 layoutY86.0 mnemonicParsingfalse onAction#onTest prefWidth150.0 styleClassbutton-on textON /Button layoutX411.0 layoutY86.0 mnemonicParsingfalse onAction#onTest prefWidth150.0 styleClassbutton-off textOFF //childrenpaddingInsets left10.0 right10.0 //padding/HBoxHBox alignmentCENTER_RIGHT spacing20.0childrenLabel layoutX228.0 layoutY96.0 styleClasssub-title-label textLight Garden /Button layoutX43.0 layoutY86.0 mnemonicParsingfalse onActioncontroller.onTest(ON) prefWidth150.0 styleClassbutton-on textON /Button layoutX411.0 layoutY86.0 mnemonicParsingfalse onActioncontroller.onTest(OFF) prefWidth150.0 styleClassbutton-off textOFF //childrenpaddingInsets left10.0 right10.0 //padding/HBoxHBox alignmentCENTER_RIGHT spacing20.0childrenLabel layoutX228.0 layoutY96.0 styleClasssub-title-label textLight Garden /Button layoutX43.0 layoutY86.0 mnemonicParsingfalse onActioncontroller.onSwitch(a, 1,1,ON) prefWidth150.0 styleClassbutton-on textON /Button layoutX411.0 layoutY86.0 mnemonicParsingfalse onActioncontroller.onTest(OFF) prefWidth150.0 styleClassbutton-off textOFF //childrenpaddingInsets left10.0 right10.0 //padding/HBox/childrenpaddingInsets bottom20.0 left20.0 right20.0 top20.0 //padding /VBox 基于此示例用户可以使用SceneBuilder轻松打开FXM1并添加新的Button来调用controller.onSwitch方法以控制为家庭自动化安装的不同/新设备。 FxmlUtils 的下一个版本ShichimiFX将包含新Utilily类负载FXML如图中ExternalFXMLDemoController 。 请注意 已加载的窗格通过onLoadExternalFxml()添加到演示应用程序的externalPane BorderPane的中心 public class ExternalFXMLDemoController {FXMLprivate ResourceBundle resources;FXMLprivate BorderPane externalPane;FXMLprivate TextField fxmlFileNameTextField;FXMLprivate Button chooseFxmlFileButton;FXMLprivate Button loadFxmlFileButton;private StringProperty fxmlFileName;public void initialize() {fxmlFileNameTextField.textProperty().bindBidirectional(fxmlFileNameProperty());loadFxmlFileButton.disableProperty().bind(fxmlFileNameProperty().isEmpty());}public StringProperty fxmlFileNameProperty() {if (fxmlFileName null) {fxmlFileName new SimpleStringProperty();}return fxmlFileName;}public String getFxmlFileName() {return fxmlFileNameProperty().getValue();}public void setFxmlFileName(String fxmlFileName) {this.fxmlFileNameProperty().setValue(fxmlFileName);}FXMLpublic void chooseFxmlFile() {FileChooser chooser new FileChooser();chooser.setTitle(Choose FXML file to load);if (getFxmlFileName().isEmpty()) {chooser.setInitialDirectory(new File(System.getProperty(user.home)));} else {chooser.setInitialDirectory(new File(getFxmlFileName()).getParentFile());}File file chooser.showOpenDialog(chooseFxmlFileButton.getScene().getWindow());if (file ! null) {setFxmlFileName(file.getAbsolutePath());}}FXMLpublic void onLoadExternalFxml() {try {OptionalURL url FxmlUtils.getFxmlUrl(Paths.get(getFxmlFileName()));if (url.isPresent()) {Pane pane FxmlUtils.loadFxmlPane(url.get(), resources);externalPane.setCenter(pane);} else {Alert alert new Alert(Alert.AlertType.WARNING);alert.setContentText(getFxmlFileName() could not be found!);alert.show();}} catch (IOException ex) {Dialogs.create().showException(ex);}} }翻译自: https://www.javacodegeeks.com/2015/01/how-to-allow-users-to-customize-the-ui.html自定义ui
http://www.zqtcl.cn/news/181155/

相关文章:

  • 聊城专业网站建设公司电子商务网站建设与维护李建忠下载
  • icp备案网站接入信息怎么写长兴县网站建设
  • 如何在网上注册公司网站网站不想让百度收录
  • 服务器做jsp网站教程视频免费的舆情网站app下载
  • 肇庆网站建设方案优化家居定制类网站建设
  • 自助建站加盟备案的网站有什么好处
  • 科技公司企业网站建设重庆seo优化
  • 空间站天宫vr全景尚层装饰
  • 有没有专门做中考卷子的网站网络公司推广公司
  • 网站建设费用如何列支wordpress页面构建
  • 用dw做网站怎么做出下拉菜单企业进行网站建设的方式有( )
  • 纯静态网站索引怎么做如何用wampp 做网站
  • 怎样做网站吸引人wordpress数据可视化插件
  • 网站运营管理教材中国设计之窗官方网站
  • 高端网站设计高端网站制作P2P网站怎么建设
  • 一般网站建设的流程故事app怎么制作
  • 一般在什么网站上做电子请帖国外产品设计网
  • 成都网站建设987netADPR国际传媒网站建设
  • 网站开发培训光山价格低
  • 营销型企业网站诊断网站开发图片侵权
  • 电商货源网站大全HTML网站页面建设
  • 购物网站建设款流程html博客转wordpress
  • 泉州建设培训中心网站大连云购物app下载安装到手机
  • 美食网站建设策划书帮人恶意点击网站
  • 网站项目合同永久免费的网站软件
  • 门户网站有哪些局限性wordpress 登录信息
  • 某网站项目策划书怎么做一个简单的网站
  • 建设网站 翻译黑色网站配色
  • 企网官方网站建筑工程网上备案流程
  • 南京建设网站公司深圳国际红树林中心