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

免费行情网站app大全网站质作

免费行情网站app大全,网站质作,优化方案英语必修三,wordpress wiki主题最近#xff0c;我不得不为应用程序实现一个布局#xff0c;其中可以根据用户是否登录来隐藏或通过滑入/滑出动画显示或显示菜单区域和状态区域。 以下视频显示了实际的布局#xff1a; 在过去#xff0c;我可能会使用自定义控件和自定义布局代码来实现这种行为#xff0… 最近我不得不为应用程序实现一个布局其中可以根据用户是否登录来隐藏或通过滑入/滑出动画显示或显示菜单区域和状态区域。 以下视频显示了实际的布局 在过去我可能会使用自定义控件和自定义布局代码来实现这种行为如“皮肤中的layoutChildren方法”。 但是这次我的设置有所不同因为我使用的是Adam Bien的afterburner.fx 现在有了FXML和一个控制器类。 那该怎么办呢 我决定尝试使用锚定窗格来实现运气并通过时间轴实例更新堆栈窗格上的约束。 约束存储在堆栈窗格的可观察属性映射中。 只要这些限制发生变化就会自动请求锚定窗格的布局。 如果发生这种情况而没有任何闪烁那么我们最终将获得一个流畅的动画。 顺便说一句来自Swing我总是希望闪烁但是JavaFX通常不会发生闪烁。 最后我写了下面的控制器类来管理锚窗格及其子堆栈窗格。 请注意中间属性menuPaneLocation和bottomPaneLocation的小技巧。 它们是必需的因为动画时间轴可与属性一起使用。 因此它会更新这些属性并且每当它们更改时都会应用新的锚定窗格约束。 import static javafx.scene.layout.AnchorPane.setBottomAnchor; import static javafx.scene.layout.AnchorPane.setLeftAnchor; import javafx.animation.KeyFrame; import javafx.animation.KeyValue; import javafx.animation.Timeline; import javafx.beans.property.BooleanProperty; import javafx.beans.property.DoubleProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleDoubleProperty; import javafx.fxml.FXML; import javafx.scene.layout.StackPane; import javafx.util.Duration;/code/*** This presenter covers the top-level layout concepts of the workbench.*/ public class WorkbenchPresenter {FXML private StackPane topPane;FXML private StackPane menuPane;FXML private StackPane centerPane;FXML private StackPane bottomPane;public WorkbenchPresenter() { }private final BooleanProperty showMenuPane new SimpleBooleanProperty(this, showMenuPane, true);public final boolean isShowMenuPane() {return showMenuPane.get(); }public final void setShowMenuPane(boolean showMenu) {showMenuPane.set(showMenu); }/** * Returns the property used to control the visibility of the menu panel. * When the value of this property changes to false then the menu panel will * slide out to the left). * * return the property used to control the menu panel */ public final BooleanProperty showMenuPaneProperty() {return showMenuPane; }private final BooleanProperty showBottomPane new SimpleBooleanProperty(this, showBottomPane, true);public final boolean isShowBottomPane() {return showBottomPane.get(); }public final void setShowBottomPane(boolean showBottom) {showBottomPane.set(showBottom); }/** * Returns the property used to control the visibility of the bottom panel. * When the value of this property changes to false then the bottom panel * will slide out to the left). * * return the property used to control the bottom panel */ public final BooleanProperty showBottomPaneProperty() {return showBottomPane; }public final void initialize() {menuPaneLocation.addListener(it - updateMenuPaneAnchors());bottomPaneLocation.addListener(it - updateBottomPaneAnchors());showMenuPaneProperty().addListener(it - animateMenuPane());showBottomPaneProperty().addListener(it - animateBottomPane());menuPane.setOnMouseClicked(evt - setShowMenuPane(false));centerPane.setOnMouseClicked(evt - {setShowMenuPane(true);setShowBottomPane(true);});bottomPane.setOnMouseClicked(evt - setShowBottomPane(false)); }/** The updateMenu/BottomPaneAnchors methods get called whenever the value of* menuPaneLocation or bottomPaneLocation changes. Setting anchor pane* constraints will automatically trigger a relayout of the anchor pane* children.*/private void updateMenuPaneAnchors() {setLeftAnchor(menuPane, getMenuPaneLocation());setLeftAnchor(centerPane, getMenuPaneLocation() menuPane.getWidth()); }private void updateBottomPaneAnchors() {setBottomAnchor(bottomPane, getBottomPaneLocation());setBottomAnchor(centerPane, getBottomPaneLocation() bottomPane.getHeight());setBottomAnchor(menuPane,getBottomPaneLocation() bottomPane.getHeight()); }/* * Starts the animation for the menu pane. */ private void animateMenuPane() {if (isShowMenuPane()) {slideMenuPane(0);} else {slideMenuPane(-menuPane.prefWidth(-1));} }/* * Starts the animation for the bottom pane. */ private void animateBottomPane() {if (isShowBottomPane()) {slideBottomPane(0);} else {slideBottomPane(-bottomPane.prefHeight(-1));} }/** The animations are using the JavaFX timeline concept. The timeline updates* properties. In this case we have to introduce our own properties further* below (menuPaneLocation, bottomPaneLocation) because ultimately we need to* update layout constraints, which are not properties. So this is a little* work-around.*/private void slideMenuPane(double toX) {KeyValue keyValue new KeyValue(menuPaneLocation, toX);KeyFrame keyFrame new KeyFrame(Duration.millis(300), keyValue);Timeline timeline new Timeline(keyFrame);timeline.play(); }private void slideBottomPane(double toY) {KeyValue keyValue new KeyValue(bottomPaneLocation, toY);KeyFrame keyFrame new KeyFrame(Duration.millis(300), keyValue);Timeline timeline new Timeline(keyFrame);timeline.play(); }private DoubleProperty menuPaneLocation new SimpleDoubleProperty(this, menuPaneLocation);private double getMenuPaneLocation() {return menuPaneLocation.get(); }private DoubleProperty bottomPaneLocation new SimpleDoubleProperty(this, bottomPaneLocation);private double getBottomPaneLocation() {return bottomPaneLocation.get(); } } 以下是此项工作所需的FXML ?xml version1.0 encodingUTF-8??import java.lang.*? ?import javafx.scene.layout.*?AnchorPane maxHeight-Infinity maxWidth-Infinity minHeight-Infinity minWidth-Infinity prefHeight400.0 prefWidth600.0 xmlnshttp://javafx.com/javafx/8 xmlns:fxhttp://javafx.com/fxml/1 fx:controllercom.workbench.WorkbenchPresenterchildrenStackPane fx:idbottomPane layoutX-4.0 layoutY356.0 prefHeight40.0 AnchorPane.bottomAnchor0.0 AnchorPane.leftAnchor0.0 AnchorPane.rightAnchor0.0 /StackPane fx:idmenuPane layoutY28.0 prefWidth200.0 AnchorPane.bottomAnchor40.0 AnchorPane.leftAnchor0.0 AnchorPane.topAnchor40.0 /StackPane fx:idtopPane prefHeight40.0 AnchorPane.leftAnchor0.0 AnchorPane.rightAnchor0.0 AnchorPane.topAnchor0.0 /StackPane fx:idcenterPane layoutX72.0 layoutY44.0 AnchorPane.bottomAnchor40.0 AnchorPane.leftAnchor200.0 AnchorPane.rightAnchor0.0 AnchorPane.topAnchor40.0 //children /AnchorPane翻译自: https://www.javacodegeeks.com/2015/02/javafx-tip-17-animated-workbench-layout-anchorpane.html
http://wiki.neutronadmin.com/news/51104/

相关文章:

  • 一元云购网站开发达内网络营销
  • 微网站 建设网络营销推广主要做什么?有哪些方法和技巧
  • 重庆建设教育协会网站郴州有哪些县
  • 网站开发属于软件开发吗关于我们 网站
  • 索引网站有哪些动漫制作专业名称
  • 临沂网站汕头站扩建工程
  • 最容易做的门户网站请问聊城网站建设
  • 一流的网站建设公司wordpress设置固定链接静态化
  • 普通网站一年要多少钱网站视频提取软件app
  • 建工网站新蔡县城乡建设局网站
  • html5网站修改图片生成链接的网站
  • 上海网站seo诊断做业务一般要注册哪些网站
  • 陕西省建设招投标网站网站设计步骤包括
  • 网站做百度权重排名论坛制作网页平台
  • 门户网站是啥意思外贸网站产品
  • 新开传奇网站刚开一秒第一区联盟文明网站建设有新突破
  • 扬州网站建设 开元电子公司logo设计
  • 微页制作网站模板下载软件拨打12355可以找团员密码吗
  • 商城网站支付端怎么做重庆网站建设重庆
  • 比较大的建站公司注册公司流程及所需资料
  • 年前做网站的好处有帮人做网站的人吗
  • 那些网站可以做宣传尚仁网站建设
  • 企业电子商务网站开发wap平台
  • 皮革材料做网站wordpress查看主题
  • 网站开发文件综述百度推广有效果吗
  • 做网站知乎芜湖建设公司网站
  • 凡客建站百度旧版本下载
  • 大型门户网站源码爱战网关键词挖掘
  • 口碑好的邯郸网站建设网站建设与管理自考
  • 宠物医院网站建设甘肃购物网站建设