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

网站策划岗位要求网站设计需要注意什么

网站策划岗位要求,网站设计需要注意什么,wordpress 升级失败,天猫优惠券网站怎么做javafx 示例我有一段时间没有写博客了#xff0c;我想与其他人分享有关JavaFX的所有信息#xff08;我的日常工作和家庭可能是借口#xff09;。 对于那些对此博客不熟悉的人 #xff0c;我是JavaFX 2 Introduction by Example#xff08;JIBE#xff09;的作者#xff… javafx 示例 我有一段时间没有写博客了我想与其他人分享有关JavaFX的所有信息我的日常工作和家庭可能是借口。 对于那些对此博客不熟悉的人 我是JavaFX 2 Introduction by ExampleJIBE的作者 Java 7 Recipes的合著者以及Apress出版的Pro JavaFX 2书籍的技术审阅者。 对于那些已经认识我的人我要感谢您通过购买这些书对我和其他作者的支持。 更重要的是我希望与Java爱好者接触并分享想法。 吨他预定的JavaFX 2简介通过实例   于2011年11月发布此后又添加了许多API。 在本书写作期间我一直在研究JavaFX 2.0的早期版本直到2011年10月JavaOne宣布为止。由于事情几乎是一成不变的试图根据API的变化来更新本书非常疯狂。 我以为它竟然走出了门真是太神奇了。 但是我很高兴。 有些你们谁读的书JIBE的开始明白JIBE的章节在书中Java 7的食谱也被找到实际上它最初是从Java 7个食谱服用。 这个事实说明了为什么JavaFX 2 Introduction by Example这本书让人想起食谱或食谱风格的技术书籍。 我的目的是帮助读者快速入门而又无需太多技术问题。 与其尝试使人们相信JavaFX平台不如通过有用的示例进行演示。 我发现在深入探讨关于某项特定技术为何优于另一项特定技术方面的哲学辩论时会适得其反俗气的80年代Highlander参考资料 。 一压脚提升的JavaFX 2.0的发布才出现了后来的版本如JavaFX的2.12.2和JavaFX 8即将发布2014年1月。 在此博客文章中我将提供JavaFX 8的Printing API的配方。 与我的书JIBE相似我将遵循以前介绍问题解决方案代码和“工作原理”部分的相同模式。 声明 在此博客中您将遇到使用Lambda表达式的Java功能接口。 我将不在这里讨论它们但将使您参考Oracle关于Lambda的教程。 必备软件 JDK 8 – https://jdk8.java.net/download.html 问题 您要创建一个JavaFX应用程序以打印出访问过的网站。 解 使用JavaFX 8 PrintJob和Printer API打印任何JavaFX场景图节点。 另外使用WebView和WebEngine API显示网站或网页。 使用说明 假设您已经编译并运行了应用程序请按照以下说明进行操作 在文本字段中输入网站地址或网址。 按下回车键 页面加载后单击“打印”按钮 转到打印机以获取打印的网页 码 package org.carlfx;import javafx.application.Application; import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.value.ChangeListener; import javafx.concurrent.Worker.State; import javafx.print.*; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.TextField; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; import javafx.scene.transform.Scale; import javafx.scene.web.WebEngine; import javafx.scene.web.WebView; import javafx.stage.Stage;/*** Demo to use JavaFX 8 Printer API.** author cdea*/ public class PrintDemo extends Application {Overridepublic void start(Stage primaryStage) {final TextField urlTextField new TextField();final Button printButton new Button(Print);final WebView webPage new WebView();final WebEngine webEngine webPage.getEngine();HBox hbox new HBox();hbox.getChildren().addAll(urlTextField, printButton);BorderPane borderPane new BorderPane();borderPane.setTop(hbox);borderPane.setCenter(webPage);Scene scene new Scene(borderPane, 300, 250);primaryStage.setTitle(Print Demo);primaryStage.setScene(scene);// print button pressed, page loadedfinal BooleanProperty printButtonClickedProperty new SimpleBooleanProperty(false);final BooleanProperty pageLoadedProperty new SimpleBooleanProperty(false);// when the a page is loaded and the button was pressed call the print() method.final BooleanProperty printActionProperty new SimpleBooleanProperty(false);printActionProperty.bind(pageLoadedProperty.and(printButtonClickedProperty));// WebEngine updates flag when finished loading web page.webEngine.getLoadWorker().stateProperty().addListener( (ChangeListener) (obsValue, oldState, newState) - {if (newState State.SUCCEEDED) {pageLoadedProperty.set(true);}});// When user enters a url and hits the enter key.urlTextField.setOnAction( aEvent - {pageLoadedProperty.set(false);printButtonClickedProperty.set(false);webEngine.load(urlTextField.getText());});// When the user clicks the print button the webview node is printedprintButton.setOnAction( aEvent - {printButtonClickedProperty.set(true);});// Once the print action hears a true go print the WebView node.printActionProperty.addListener( (ChangeListener) (obsValue, oldState, newState) - {if (newState) {print(webPage);}});primaryStage.show();}/** Scales the node based on the standard letter, portrait paper to be printed.* param node The scene node to be printed.*/public void print(final Node node) {Printer printer Printer.getDefaultPrinter();PageLayout pageLayout printer.createPageLayout(Paper.NA_LETTER, PageOrientation.PORTRAIT, Printer.MarginType.DEFAULT);double scaleX pageLayout.getPrintableWidth() / node.getBoundsInParent().getWidth();double scaleY pageLayout.getPrintableHeight() / node.getBoundsInParent().getHeight();node.getTransforms().add(new Scale(scaleX, scaleY));PrinterJob job PrinterJob.createPrinterJob();if (job ! null) {boolean success job.printPage(node);if (success) {job.endJob();}}}/*** The main() method is ignored in correctly deployed JavaFX application.* main() serves only as fallback in case the application can not be* launched through deployment artifacts, e.g., in IDEs with limited FX* support. NetBeans ignores main().** param args the command line arguments*/public static void main(String[] args) {launch(args);} } 使用JavaFX 8进行打印演示 这个怎么运作 该代码首先创建一个TextField 一个Button和一个WebView控件以放置到BorderPane中 。 使用BorderPane布局时您将能够将控件放置在以下区域中顶部右侧左侧底部和中心。 与网络浏览器类似文本字段允许用户输入网站网址。 输入URL后用户将按Enter键将网页加载到WebView节点中。 将控件放置在任何侧面区域上时BorderPane布局将采用所添加的任何控件的首选高度。 中心区域将允许节点占用可用空间减去边界侧边区域的宽度和高度所占用的剩余空间。 换句话说如果侧面区域不包含节点空则中心区域中的节点将有机会占用其父级场景提供的所有可用宽度和高度空间。 由于WebView节点将占据中心区域因此在完全加载网页后它将占据所有可用的宽度和高度减去顶部区域。 您还会注意到滚动条该滚动条允许用户查看大于当前查看端口的页面。 布置完UI的所有组件后您需要进行连接。 在这里您将简单地创建三个布尔属性 javafx.beans.property.SimpleBooleanProperty实例。 第一个属性变量printButtonClickedProperty是一个标志指示何时单击打印按钮。 第二个属性pageLoadedProperty是一个标志指示该网页已完成加载。 最后您需要注意printActionProperty 它通过使用流畅的API绑定了printButtonClickedProperty和pageLoadedProperty。 当他们评估时如果printLoadedProperty和printLoadedProperty均为真值则printActionProperty将为true。 // print button pressed, page loaded final BooleanProperty printButtonClickedProperty new SimpleBooleanProperty(false); final BooleanProperty pageLoadedProperty new SimpleBooleanProperty(false);// when the a page is loaded and the button was pressed call the print() method. final BooleanProperty printActionProperty new SimpleBooleanProperty(false); printActionProperty.bind(pageLoadedProperty.and(printButtonClickedProperty)); çontinuing接线了UI的我花了一个事件驱动的方法把处理程序代码将事件和性能的变化。 从WebView节点开始我将处理程序代码附加到statePropery实例ChangeListener以便在成功加载网页后将pageLoadedProperty设置为true。 // WebEngine updates flag when finished loading web page.webEngine.getLoadWorker().stateProperty().addListener( (ChangeListener) (obsValue, oldState, newState) - {if (newState State.SUCCEEDED) {pageLoadedProperty.set(true);}}); ñ分机你会看到一个包含处理程序代码复位pageLoadedProperty和printButtonClickedProperty对象的文本字段的“setOnAction”的方法。 同样代码将通过WebView的WebEngine load方法启动页面的加载。 // When user enters a url and hits the enter key.urlTextField.setOnAction( aEvent - {pageLoadedProperty.set(false);printButtonClickedProperty.set(false);webEngine.load(urlTextField.getText());}); 一压脚提升TextField的控制的动作代码是有线了打印按钮还需要处理程序代码到printButtonClickedProperty标志设置为true。 最后当printActionProperty属性的状态评估为true时它需要一个ChangeListener来响应。 当此评估为true时将调用我的print方法。 // When the user clicks the print button the webview node is printedprintButton.setOnAction( aEvent - {printButtonClickedProperty.set(true);});// Once the print action hears a true go print the WebView node.printActionProperty.addListener( (ChangeListener) (obsValue, oldState, newState) - {if (newState) {print(webPage);}}); ˚Finally打印方法采用要被打印的JavaFX的节点对象。 Printer对象具有一种方法该方法返回计算机设置为的默认打印机。 在实际打印之前我们可以导出默认页面布局以在打印节点之前缩放节点。 如果您不这样做则只会打印部分网页。 获得默认打印机后将调用createPrinterJob方法以返回执行实际打印的PrinterJob实例。 要打印JavaFX可显示类型的节点只需将Node实例作为参数传入即可调用PrinterJob对象的printPage方法。 /** Scales the node based on the standard letter, portrait paper to be printed.* param node The scene node to be printed.*/public void print(final Node node) {Printer printer Printer.getDefaultPrinter();PageLayout pageLayout printer.createPageLayout(Paper.NA_LETTER, PageOrientation.PORTRAIT, Printer.MarginType.DEFAULT);double scaleX pageLayout.getPrintableWidth() / node.getBoundsInParent().getWidth();double scaleY pageLayout.getPrintableHeight() / node.getBoundsInParent().getHeight();node.getTransforms().add(new Scale(scaleX, scaleY));PrinterJob job PrinterJob.createPrinterJob();if (job ! null) {boolean success job.printPage(node);if (success) {job.endJob();}}} I N最后我发现API是简单相比的Java Swing / AWT API来使用。 我想提一下您可以使用许多功能因为此博客条目仅涉及当前可用API的表面。 注意JavaFX 8打印机API仍处于早期阶段仍然存在未解决的问题Jira问题。 参考 示例介绍JavaFX 8由我们的JCG合作伙伴 Carl Dea在Carls FX Blog博客上进行打印 。 翻译自: https://www.javacodegeeks.com/2013/07/introduction-by-example-javafx-8-printing.htmljavafx 示例
http://www.pierceye.com/news/709760/

相关文章:

  • 网站建设空间选择的重要性wordpress菲插件关键词
  • 基于wap的企业网站设计与实现洛阳霞光seo网络公司
  • 在家做的手工活哪里有网站网站开发与运营方向和企业管理方向
  • 厦门网站建设厦门南京宣传片公司有哪些
  • 专门做问卷的网站南宁做网站公司
  • 鹰潭做网站公司网站模板及素材
  • dw网站引导页怎么做wordpress 福利
  • PS网站设计网站每年都要备案吗
  • 建设通网站账号erp实施顾问
  • 变装小说 wordpress网站建设好怎么优化
  • 苏州网站建设制作开发公司江浦做网站
  • 网站开发哪一门语言更快网站设计方案模板
  • 阿里云做网站需要些什么条件个人博客网站设计模板
  • 更改网站模板内容我赢职场wordpress
  • h5模板下载有哪些网站南京高端网站制作公司
  • 户外旅游网站模板佛山网络优化推广公司
  • 海南住房和城乡建设网站技术支持 重庆网站
  • 网站图片展示代码怎样给响应式网站提速
  • 学校 网站建设 招标广而告之微信推广平台
  • 企业如何通过地方网站宣传网站中国建设银行招聘官网
  • 上海品牌网站建设公网站的开发与建设项目
  • 做网站的艰辛电子商务网站建设与维护概述
  • 织梦网站做关键词网站开发到上线的过程
  • 威海千淼网站建设北京知名广告公司有哪些
  • wordpress多站点可视化wordpress主题flarum
  • 网站免费虚拟主机申请成华区微信网站建设公
  • 机械制造设备类企业网站织梦模板网站模板 博客
  • js跳转网站怎么做网络营销方式单一的原因
  • 做网站的职责做章的网站
  • 万网建设网站wordpress的ftp設置