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

陇南市建设局网站公示做pc端网站教程

陇南市建设局网站公示,做pc端网站教程,网站制作镇江,微网站微商城JavaFX “缺少功能调查”中提到的“缺少功能”的第一件事就是能够自动调整表/树表中的列大小。 没错#xff0c;没有公共API是正确的#xff0c;但是当您密切关注时#xff0c;您会注意到JavaFX内部一定有执行此操作的代码#xff0c;因为用户可以通过双击分隔线自动调整列… JavaFX “缺少功能调查”中提到的“缺少功能”的第一件事就是能够自动调整表/树表中的列大小。 没错没有公共API是正确的但是当您密切关注时您会注意到JavaFX内部一定有执行此操作的代码因为用户可以通过双击分隔线自动调整列的大小。在该列与右侧的下一列之间。 但是像大多数人一样我觉得这对我的代码还不够好。 我想要一个FlexGanttFX的API该API允许用户自动调整甘特图内一列或所有列的大小。 因此我搜索了隐藏在树表或树表皮肤某处实际上不记得在哪里的代码并在类中进行了一些细微修改以重新使用它。 以下是这项工作的结果。 它以TreeTableView而不是TableView为目标但是使它适用于标准表很简单。 只需将所有TreeTableColumn出现替换为TableColumn即可 。 请注意调整所有行的大小可能会对性能产生严重影响因此您可能必须通过maxRows参数来限制要用于计算的行数 。 /*** This method will resize all columns in the tree table view to ensure that* the content of all cells will be completely visible. Note: this is a very* expensive operation and should only be used when the number of rows is* small.** see #resizeColumn(TreeTableColumn, int)*/public final void resizeColumns() {resizeColumns(-1);}/*** This method will resize all columns in the tree table view to ensure that* the content of all cells will be completely visible. Note: this is a very* expensive operation and should only be used with a small number of rows.** param maxRows* the maximum number of rows that will be considered for the* width calculations** see #resizeColumn(TreeTableColumn, int)*/public final void resizeColumns(int maxRows) {for (TreeTableColumnR, ? column : getTreeTable().getColumns()) {resizeColumn(column, maxRows);}}/*** This method will resize the given column in the tree table view to ensure* that the content of the column cells will be completely visible. Note:* this is a very expensive operation and should only be used when the* number of rows is small.** see #resizeColumn(TreeTableColumn, int)*/public final void resizeColumn(TreeTableColumnR, ? column) {resizeColumn(column, -1);}/*** This method will resize the given column in the tree table view to ensure* that the content of the column cells will be completely visible. Note:* this is a very expensive operation and should only be used when the* number of rows is small.** see #resizeColumn(TreeTableColumn, int)*/public final void resizeColumn(TreeTableColumnR, ? tc, int maxRows) {final TreeTableColumn col tc;List? items getItems();if (items null || items.isEmpty()) {return;}Callback cellFactory tc.getCellFactory();if (cellFactory null) {return;}TreeTableCellR, ? cell (TreeTableCellR, ?) cellFactory.call(tc);if (cell null) {return;}// set this property to tell the TableCell we want to know its actual// preferred width, not the width of the associated TableColumnBasecell.getProperties().put(deferToParentPrefWidth, Boolean.TRUE); //$NON-NLS-1$// determine cell paddingdouble padding 10;Node n cell.getSkin() null ? null : cell.getSkin().getNode();if (n instanceof Region) {Region r (Region) n;padding r.snappedLeftInset() r.snappedRightInset();}TreeTableRowR treeTableRow new TreeTableRow();treeTableRow.updateTreeTableView(treeTableView);int rows maxRows -1 ? items.size(): Math.min(items.size(), maxRows);double maxWidth 0;for (int row 0; row rows; row) {treeTableRow.updateIndex(row);treeTableRow.updateTreeItem(treeTableView.getTreeItem(row));cell.updateTreeTableColumn(col);cell.updateTreeTableView(treeTableView);cell.updateTreeTableRow(treeTableRow);cell.updateIndex(row);if ((cell.getText() ! null !cell.getText().isEmpty())|| cell.getGraphic() ! null) {getChildren().add(cell);cell.impl_processCSS(false);double w cell.prefWidth(-1);maxWidth Math.max(maxWidth, w);getChildren().remove(cell);}}// dispose of the cell to prevent it retaining listeners (see RT-31015)cell.updateIndex(-1);// RT-23486double widthMax maxWidth padding;if (treeTableView.getColumnResizePolicy() TreeTableView.CONSTRAINED_RESIZE_POLICY) {widthMax Math.max(widthMax, tc.getWidth());}tc.impl_setWidth(widthMax);}翻译自: https://www.javacodegeeks.com/2015/12/javafx-tip-22-autosize-tree-table-columns.html
http://www.huolong8.cn/news/377774/

相关文章:

  • 机关网站建设 方案山西网站制作设计
  • 自学做网站可以嘛信息流优化师职业规划
  • 山东网站建设是什么标志设计图片
  • 怎样购买起名软件自己做网站网站建设问题及解决办法
  • php网站多语言翻译怎么做建设企业网站需要什么呢
  • 找个专门做各种外卖的网站做酒业网站的要求
  • 成品网站软件网站主体注销
  • 怎么查询最新网站学校网站建设项目背景
  • 成都解放号网站建设网上购物商城网站
  • 国内建网站软件石家庄自动seo
  • 杭州富阳做网站体育如何做原创视频网站
  • 废旧网站哪个做的最好网站流量提供商
  • 上海闵行区网站建设wordpress怎么破解
  • 网站点击率原因聊城手机站网站公司
  • 成都和奇乐网站建设公司怎么样网络科技有限公司起名大全参考
  • 设计网站轮廓模板秦皇岛建设里二手房
  • 深圳交易网站建设海外营销推广服务
  • 铁岭手机网站建设网站建设合同概念
  • 百度竞价做网站建设家具行业网站建设
  • 防城港建设局网站网页单机游戏
  • 如何制作微网站建个网站能赚钱吗
  • 各种网站解决方案中国机加工企业哪里最多
  • 优惠券的网站制作网站开发数据库设计的作用
  • 辽宁住房建设厅网站wordpress 主题 插件 加载
  • 做网站谁家好专门做win7的网站
  • 网站建设毅文科技做网站工作好么
  • 佛山网站建设方案领动云建站
  • 成都建站费用羊绒制品有限公司网站建设论文
  • wap网站 什么意思网站如何设置长尾词
  • 做网站需要哪些工具锦兴建筑人才招聘平台