Class TimiFX

java.lang.Object
com.imyeyu.fx.TimiFX

public final class TimiFX extends Object
TimiFX - JavaFX 开发工具
Since:
2021-02-14 10:51
Author:
夜雨
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final javafx.event.EventHandler<javafx.scene.input.MouseEvent>
    阻止取消选择
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addScrollFinishedListener(javafx.scene.control.Control control, com.imyeyu.java.bean.Callback callback)
     
    static void
    doRestart(javafx.application.Application application, String command)
    重启程序,命令需自定
    static javafx.scene.paint.Color
    fromHexString(String hexColorString)
    解析十六进制颜色字符串
    static void
    hoverFocus(javafx.scene.Node node)
    指向即聚焦该节点
    static void
    hoverOpacity(javafx.scene.Node node)
    指向半透
    static void
    hoverOpacity(javafx.scene.Node handler, javafx.scene.Node node)
    指向半透
    static void
    relativeCenter(javafx.stage.Window owner, javafx.stage.Window window)
    设置相对居中窗体
    static void
    relativeCenter4PrimaryScreen(javafx.stage.Window stage)
    设置窗体到主屏幕中间(偏上少许)
    static void
    relativeCenter4Screen(javafx.stage.Screen screen, javafx.stage.Window stage)
    设置窗体到屏幕中间(偏上少许)
    static void
    requestTop(javafx.stage.Stage stage)
    请求焦点,执行显示、置顶并聚焦
    static String
    resizeSVG(String svg, double scale)
    重新设置 SVG 大小
    static void
    scrollToCenter(javafx.scene.control.Control control, int index)
    滚动指定项至控件可视范围的中央
    static void
    showCenter(javafx.stage.Window owner, javafx.stage.Window window)
    相对于某窗体居中显示新窗体(需预设宽高)
    static void
    toggleStyleClass(javafx.scene.Node node, javafx.beans.property.ReadOnlyBooleanProperty booleanProperty, String onTrue, String onFalse)
    根据布尔值监听动态切换节点 CSS 类
    static void
    toggleStyleClass4Binding(javafx.scene.Node node, javafx.beans.binding.BooleanBinding booleanBinding, String onTrue, String onFalse)
    根据布尔值监听动态切换节点 CSS 类
    static String
    toHexString(javafx.scene.paint.Color color)
    十六进制颜色含透明度:0xFF00FF00

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • EVENT_CONSUME_TG_BTN

      public static final javafx.event.EventHandler<javafx.scene.input.MouseEvent> EVENT_CONSUME_TG_BTN
      阻止取消选择
          addEventFilter(MouseEvent.MOUSE_PRESSED, EVENT_CONSUME_TGBTN);
      
  • Constructor Details

    • TimiFX

      public TimiFX()
  • Method Details

    • toHexString

      public static String toHexString(javafx.scene.paint.Color color)
      十六进制颜色含透明度:0xFF00FF00
      Parameters:
      color - 颜色
      Returns:
      十六进制颜色字符串
    • fromHexString

      public static javafx.scene.paint.Color fromHexString(String hexColorString)
      解析十六进制颜色字符串
      Parameters:
      hexColorString - 十六进制颜色字符串
      Returns:
      颜色
    • resizeSVG

      public static String resizeSVG(String svg, double scale)
      重新设置 SVG 大小
      Parameters:
      svg - SVG 路径
      scale - 缩放倍率
      Returns:
      SVG 路径
    • relativeCenter

      public static void relativeCenter(javafx.stage.Window owner, javafx.stage.Window window)
      设置相对居中窗体
      Parameters:
      owner - 依赖窗体
      window - 居中窗体
    • relativeCenter4PrimaryScreen

      public static void relativeCenter4PrimaryScreen(javafx.stage.Window stage)
      设置窗体到主屏幕中间(偏上少许)
      Parameters:
      stage - 窗体
    • relativeCenter4Screen

      public static void relativeCenter4Screen(javafx.stage.Screen screen, javafx.stage.Window stage)
      设置窗体到屏幕中间(偏上少许)
      Parameters:
      screen - 屏幕
      stage - 窗体
    • showCenter

      public static void showCenter(javafx.stage.Window owner, javafx.stage.Window window)
      相对于某窗体居中显示新窗体(需预设宽高)
      Parameters:
      owner - 依赖窗体
      window - 需显示的窗体
    • requestTop

      public static void requestTop(javafx.stage.Stage stage)
      请求焦点,执行显示、置顶并聚焦
      Parameters:
      stage - 窗体
    • toggleStyleClass

      public static void toggleStyleClass(javafx.scene.Node node, javafx.beans.property.ReadOnlyBooleanProperty booleanProperty, String onTrue, String onFalse)
      根据布尔值监听动态切换节点 CSS 类
      Parameters:
      node - 节点
      booleanProperty - 布尔值监听
      onTrue - 为 true 时的 css 类
      onFalse - 为 false 时的 css 类
    • toggleStyleClass4Binding

      public static void toggleStyleClass4Binding(javafx.scene.Node node, javafx.beans.binding.BooleanBinding booleanBinding, String onTrue, String onFalse)
      根据布尔值监听动态切换节点 CSS 类
      Parameters:
      node - 节点
      booleanBinding - 布尔值监听
      onTrue - 为 true 时的 css 类
      onFalse - 为 false 时的 css 类
    • hoverOpacity

      public static void hoverOpacity(javafx.scene.Node node)
      指向半透
      Parameters:
      node - 节点
    • hoverOpacity

      public static void hoverOpacity(javafx.scene.Node handler, javafx.scene.Node node)
      指向半透
      Parameters:
      handler - 触发节点
      node - 节点
    • hoverFocus

      public static void hoverFocus(javafx.scene.Node node)
      指向即聚焦该节点
      Parameters:
      node - 节点
    • scrollToCenter

      public static void scrollToCenter(javafx.scene.control.Control control, int index)
      滚动指定项至控件可视范围的中央
      Parameters:
      control - 控件(ListView, TableView 等)
      index - 指定项下标
    • addScrollFinishedListener

      public static void addScrollFinishedListener(javafx.scene.control.Control control, com.imyeyu.java.bean.Callback callback)
    • doRestart

      public static void doRestart(javafx.application.Application application, String command) throws Exception
      重启程序,命令需自定
      Parameters:
      application - FX 程序
      command - 重启命令
      Throws:
      Exception - 异常