Module  javafx.controls

Class TitledPaneSkin

    • 构造方法详细信息

      • TitledPaneSkin

        public TitledPaneSkin​(TitledPane control)
        创建一个新的TitledPaneSkin实例,将必需的子节点安装到Control children列表中,以及处理密钥,鼠标等事件的必要输入映射。
        参数
        control - 这个皮肤应该安装到的控件。
    • 方法详细信息

      • dispose

        public void dispose​()
        当Skinnable更换皮肤时,由Skinnable调用。 该方法允许皮肤在不再需要皮肤后,实现任何必要的清理功能。 它可能用于释放本机资源。 方法Skin.getSkinnable()Skin.getNode()应在调用处理后返回null。 呼叫处理两次无效。
        Specified by:
        dispose在接口 Skin<C extends Labeled>
        重写:
        disposeSkinBase<TitledPane>
      • updateChildren

        protected void updateChildren​()
        更新由LabeledSkinBase管理的子项,LabeledSkinBase可以是Labeled图形和/或Text节点。 仅使用实际必须使用的那些节点。 例如,使用GRAPHIC_ONLY的ContentDisplay不添加文本节点,并且使用TEXT_ONLY的ContentDisplay,不会添加图形。
        重写:
        updateChildrenLabeledSkinBase<TitledPane>
      • layoutChildren

        protected void layoutChildren​(double x,
                                      double y,
                                      double w,
                                      double h)
        布局算法的工作原理如下: - 获取标签的w / h,图形w / h,文本w / h - 基于graphicVPos,graphicHPos,graphicTextGap和图形w / h和文本w / h - (请注意,文本内容已经在必要时被预截取) - 基于内容w / h计算内容x / y并标记为w / h,标记的hpos和vpos定位图形和文本
        重写:
        layoutChildrenLabeledSkinBase<TitledPane>
        参数
        x - x位置
        y - y位置
        w - 宽度
        h - 高度
      • computeMinWidth

        protected double computeMinWidth​(double height,
                                         double topInset,
                                         double rightInset,
                                         double bottomInset,
                                         double leftInset)
        计算并返回此Labeled的最小宽度。 最小宽度是“...”宽度的较小值,带有实际文本的宽度。 这样,如果文本宽度本身小于省略号,那么我们应该将其用作最小宽度,否则省略号需要是最小宽度。

        我们在这里使用相同的计算方法,无论我们在谈论单个或多个标签。 所以一个多行的标签可能会发现,“...”的宽度与它将会得到的一样小。

        重写:
        computeMinWidthLabeledSkinBase<TitledPane>
        参数
        height - 皮肤的高度,以防该值可能决定最小宽度。
        topInset - 像素拍摄的顶部插图
        rightInset - 像素拍摄正确的插图
        bottomInset - 像素攫取底部插图
        leftInset - 像素拍摄左边插图
        结果
        表示此皮肤最小宽度的双倍。
      • computeMinHeight

        protected double computeMinHeight​(double width,
                                          double topInset,
                                          double rightInset,
                                          double bottomInset,
                                          double leftInset)
        根据提供的宽度计算皮肤的最小允许高度。
        重写:
        computeMinHeightLabeledSkinBase<TitledPane>
        参数
        width - 皮肤的宽度,以防该值可能决定最小高度。
        topInset - 像素拍摄的顶部插图
        rightInset - 像素拍摄正确的插图
        bottomInset - 像素攫取底部插图
        leftInset - 像素拍摄左边插图
        结果
        一个双倍代表这个皮肤的最小高度。
      • computePrefWidth

        protected double computePrefWidth​(double height,
                                          double topInset,
                                          double rightInset,
                                          double bottomInset,
                                          double leftInset)
        计算SkinBase的首选宽度。 默认实现将这个宽度计算为被管理子对象以其首选宽度位于其当前位置时占用的区域的宽度。
        重写:
        computePrefWidthLabeledSkinBase<TitledPane>
        参数
        height - 如果首选宽度取决于应该使用的高度
        topInset - 像素拍摄的顶部插图
        rightInset - 像素拍摄正确的插图
        bottomInset - 像素攫取底部插图
        leftInset - 像素拍摄左边插图
        结果
        计算的优选宽度
      • computePrefHeight

        protected double computePrefHeight​(double width,
                                           double topInset,
                                           double rightInset,
                                           double bottomInset,
                                           double leftInset)
        计算SkinBase的首选高度。 默认实现将此高度计算为被管理儿童以其首选高度位于其当前位置时占用的区域的高度。
        重写:
        computePrefHeightLabeledSkinBase<TitledPane>
        参数
        width - 如果偏好的高度取决于应该使用的宽度
        topInset - 像素拍摄顶部插图
        rightInset - 像素拍摄正确的插图
        bottomInset - 像素啪嗒的底部插入
        leftInset - 像素拍摄左边插图
        结果
        计算的优选高度
      • computeMaxWidth

        protected double computeMaxWidth​(double height,
                                         double topInset,
                                         double rightInset,
                                         double bottomInset,
                                         double leftInset)
        根据提供的高度计算皮肤的最大允许宽度。
        重写:
        computeMaxWidthLabeledSkinBase<TitledPane>
        参数
        height - 皮肤的高度,以防该值可能决定最大宽度。
        topInset - 像素拍摄顶部插图
        rightInset - 像素拍摄正确的插图
        bottomInset - 像素啪嗒的底部插入
        leftInset - 像素拍摄左边插图
        结果
        双倍表示此皮肤的最大宽度。