javafx.scene.text.Text.isVisible()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(80)

本文整理了Java中javafx.scene.text.Text.isVisible()方法的一些代码示例,展示了Text.isVisible()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Text.isVisible()方法的具体详情如下:
包路径:javafx.scene.text.Text
类名称:Text
方法名:isVisible

Text.isVisible介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

/**
 * {@inheritDoc}
 */
@Override
protected void layoutChildren(double contentX, double contentY, double contentWidth, double contentHeight) {
  final double strokeWidth = arc.getStrokeWidth();
  final double radius = Math.min(contentWidth, contentHeight) / 2 - strokeWidth / 2;
  final double arcSize = snapSize(radius * 2 + strokeWidth);
  arcPane.resizeRelocate((contentWidth - arcSize) / 2 + 1, (contentHeight - arcSize) / 2 + 1, arcSize, arcSize);
  updateArcLayout(radius, arcSize);
  fillRect.setWidth(arcSize);
  fillRect.setHeight(arcSize);
  if (!isValid) {
    initialize();
    isValid = true;
  }
  if (!getSkinnable().isIndeterminate()) {
    arc.setLength(arcLength);
    if (text.isVisible()) {
      final double progress = control.getProgress();
      int intProgress = (int) Math.round(progress * 100.0);
      Font font = text.getFont();
      text.setFont(Font.font(font.getFamily(), radius / 1.7));
      text.setText((progress > 1 ? 100 : intProgress) + "%");
      text.relocate((arcSize - text.getLayoutBounds().getWidth()) / 2, (arcSize - text.getLayoutBounds().getHeight()) / 2);
    }
  }
}

代码示例来源:origin: nl.cloudfarming.client/calendar-api

double tickWidth = 2 * gap -2; //leave some space
  if (!text.isVisible()) {
    boolean hasEnoughSpace = text.getLayoutBounds().getWidth() < tickWidth;
    text.setVisible(hasEnoughSpace);
if (text.isVisible()) {
  text.setOnMouseClicked(tickMarkEventHandler); 
  text.setCursor(Cursor.HAND);

代码示例来源:origin: com.jfoenix/jfoenix

/**
 * {@inheritDoc}
 */
@Override
protected void layoutChildren(double contentX, double contentY, double contentWidth, double contentHeight) {
  final double strokeWidth = arc.getStrokeWidth();
  final double radius = Math.min(contentWidth, contentHeight) / 2 - strokeWidth / 2;
  final double arcSize = snapSize(radius * 2 + strokeWidth);
  arcPane.resizeRelocate((contentWidth - arcSize) / 2 + 1, (contentHeight - arcSize) / 2 + 1, arcSize, arcSize);
  updateArcLayout(radius, arcSize);
  fillRect.setWidth(arcSize);
  fillRect.setHeight(arcSize);
  if (!isValid) {
    initialize();
    isValid = true;
  }
  if (!getSkinnable().isIndeterminate()) {
    arc.setLength(arcLength);
    if (text.isVisible()) {
      final double progress = control.getProgress();
      int intProgress = (int) Math.round(progress * 100.0);
      Font font = text.getFont();
      text.setFont(Font.font(font.getFamily(), radius / 1.7));
      text.setText((progress > 1 ? 100 : intProgress) + "%");
      text.relocate((arcSize - text.getLayoutBounds().getWidth()) / 2, (arcSize - text.getLayoutBounds().getHeight()) / 2);
    }
  }
}

相关文章