当前位置: 首页 > 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://wiki.neutronadmin.com/news/377774/

相关文章:

  • 汉中网站制作汕头建设免费网站
  • 贵州飞乐云毕节网站建设沧州网站建设制作
  • 网站外链有什么用如何做网站demo
  • 网站建站网站建站用js做的个人酷炫网站
  • 网站排名必做阶段性seo策略学了3个月ui好找工作吗
  • 连州市网站建设网上哪个网站教做西点
  • 镇江网站建设国内顶尖的公司
  • 高档手表网站wordpress 制作企业站
  • 项城网站制作多少钱如何查域名备案信息查询
  • 网站开发程序流程图织梦模板首页修改
  • 学会网站开发需要多久上海建设网站
  • sql wordpress迁移网站推广教程优化整站
  • win2003搭建php网站广州市住房 建设局网站
  • 怀化网站制作建设木藕设计网
  • 中小企业做网站推广wordpress栏目布局
  • 杭州网站建设出 名好看的手机网站布局
  • 上市设计公司网站短网址还原网站
  • 河北seo网站优化公司论坛创建
  • iis部署网站 asp 物理路径求网站建设合伙人
  • 选择手机网站建设电商网站用什么做最好
  • 北京交易网站建设wordpress多图主题
  • wordpress站中站wordpress工具包
  • 电子商务网站建设感想十堰做网站排名
  • 下载网站备案的核验单农产品应该建设哪个网站
  • 网站外链隐形框架是什么如何选择网站建设案例
  • 怎么建设课程的网站苏州公司网站建设电话
  • 常熟做网站多少钱按html5制作网站开发
  • 银川市做网站的公司二维码生成短链接
  • 建湖网站设计邢台网站建设设计制作
  • 泰州做网站的公司市场营销实务