modules/controls/src/main/java/javafx/scene/control/skin/TableColumnHeader.java

Print this page




 344     public final ReadOnlyObjectProperty<TableColumnBase<?,?>> tableColumnProperty() {
 345         return tableColumn.getReadOnlyProperty();
 346     }
 347 
 348 
 349 
 350     /***************************************************************************
 351      *                                                                         *
 352      * Public API                                                              *
 353      *                                                                         *
 354      **************************************************************************/
 355 
 356     /** {@inheritDoc} */
 357     @Override protected void layoutChildren() {
 358         if (isSizeDirty) {
 359             resize(getTableColumn().getWidth(), getHeight());
 360             isSizeDirty = false;
 361         }
 362 
 363         double sortWidth = 0;
 364         double w = snapSize(getWidth()) - (snappedLeftInset() + snappedRightInset());
 365         double h = getHeight() - (snappedTopInset() + snappedBottomInset());
 366         double x = w;
 367 
 368         // a bit hacky, but we REALLY don't want the arrow shape to fluctuate
 369         // in size
 370         if (arrow != null) {
 371             arrow.setMaxSize(arrow.prefWidth(-1), arrow.prefHeight(-1));
 372         }
 373 
 374         if (sortArrow != null && sortArrow.isVisible()) {
 375             sortWidth = sortArrow.prefWidth(-1);
 376             x -= sortWidth;
 377             sortArrow.resize(sortWidth, sortArrow.prefHeight(-1));
 378             positionInArea(sortArrow, x, snappedTopInset(),
 379                     sortWidth, h, 0, HPos.CENTER, VPos.CENTER);
 380         }
 381 
 382         if (label != null) {
 383             double labelWidth = w - sortWidth;
 384             label.resizeRelocate(snappedLeftInset(), 0, labelWidth, getHeight());




 344     public final ReadOnlyObjectProperty<TableColumnBase<?,?>> tableColumnProperty() {
 345         return tableColumn.getReadOnlyProperty();
 346     }
 347 
 348 
 349 
 350     /***************************************************************************
 351      *                                                                         *
 352      * Public API                                                              *
 353      *                                                                         *
 354      **************************************************************************/
 355 
 356     /** {@inheritDoc} */
 357     @Override protected void layoutChildren() {
 358         if (isSizeDirty) {
 359             resize(getTableColumn().getWidth(), getHeight());
 360             isSizeDirty = false;
 361         }
 362 
 363         double sortWidth = 0;
 364         double w = snapSizeX(getWidth()) - (snappedLeftInset() + snappedRightInset());
 365         double h = getHeight() - (snappedTopInset() + snappedBottomInset());
 366         double x = w;
 367 
 368         // a bit hacky, but we REALLY don't want the arrow shape to fluctuate
 369         // in size
 370         if (arrow != null) {
 371             arrow.setMaxSize(arrow.prefWidth(-1), arrow.prefHeight(-1));
 372         }
 373 
 374         if (sortArrow != null && sortArrow.isVisible()) {
 375             sortWidth = sortArrow.prefWidth(-1);
 376             x -= sortWidth;
 377             sortArrow.resize(sortWidth, sortArrow.prefHeight(-1));
 378             positionInArea(sortArrow, x, snappedTopInset(),
 379                     sortWidth, h, 0, HPos.CENTER, VPos.CENTER);
 380         }
 381 
 382         if (label != null) {
 383             double labelWidth = w - sortWidth;
 384             label.resizeRelocate(snappedLeftInset(), 0, labelWidth, getHeight());