/** * update the size of error container and its clip * * @param w * @param errorContainerHeight */ private void updateErrorContainerSize(double w, double errorContainerHeight) { errorContainerClip.setWidth(w); errorContainerClip.setHeight(errorContainerHeight); resize(w, errorContainerHeight); }
@Override protected void setOverLayBounds(Rectangle overlay) { overlay.setWidth(ripplerPane.getWidth()); overlay.setHeight(ripplerPane.getHeight()); }
protected void setOverLayBounds(Rectangle overlay){ overlay.setWidth(control.getLayoutBounds().getWidth()); overlay.setHeight(control.getLayoutBounds().getHeight()); }
@Override protected void handleControlPropertyChanged(String property) { super.handleControlPropertyChanged(property); if ("SELECTED_TAB".equals(property)) { isSelectingTab = true; selectedTab = getSkinnable().getSelectionModel().getSelectedItem(); getSkinnable().requestLayout(); } else if ("WIDTH".equals(property)) { clip.setWidth(getSkinnable().getWidth()); } else if ("HEIGHT".equals(property)) { clip.setHeight(getSkinnable().getHeight()); } }
public void layoutPane(final double x, final double y, final double w, final double h) { relocate(x, y); // resize error container if animation is disabled if (control.isDisableAnimation() || isErrorVisible()) { resize(w, computeErrorHeight(computeErrorWidth(w))); errorContainerClip.setWidth(w); } }
public void invalid(double w) { final ValidatorBase activeValidator = control.getActiveValidator(); if (activeValidator != null) { showError(activeValidator); final double errorContainerWidth = w - errorIcon.prefWidth(-1); setOpacity(1); resize(w, computeErrorHeight(errorContainerWidth)); errorContainerClip.setWidth(w); errorContainerClip.setHeight(getHeight()); errorClipScale.setY(1); } }
/** * {@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); } } }
private void updateHeaderContainerClip() { final double clipOffset = getClipOffset(); final Side side = getSkinnable().getSide(); double controlPrefWidth = 2 * snapSize(rightControlButton.prefWidth(-1)); // Add the spacer if the control buttons are shown // controlPrefWidth = controlPrefWidth > 0 ? controlPrefWidth + SPACER : controlPrefWidth; measureClosingTabs = true; final double headersPrefWidth = snapSize(headersRegion.prefWidth(-1)); final double headersPrefHeight = snapSize(headersRegion.prefHeight(-1)); measureClosingTabs = false; final double maxWidth = snapSize(getWidth()) - controlPrefWidth - clipOffset; final double clipWidth = headersPrefWidth < maxWidth ? headersPrefWidth : maxWidth; final double clipHeight = headersPrefHeight; clip.setX((side == Side.LEFT || side == Side.BOTTOM) && headersPrefWidth >= maxWidth ? headersPrefWidth - maxWidth : 0); clip.setY(0); clip.setWidth(clipWidth); clip.setHeight(clipHeight); }
tabsClip.setWidth(contentWidth); tabsClip.setHeight(contentHeight); tabsContainerHolder.resize(contentWidth, contentHeight); tabContentHolder.setTranslateX(contentWidth * i); if (tabContentHolder.getClip() != null) { ((Rectangle) tabContentHolder.getClip()).setWidth(contentWidth); ((Rectangle) tabContentHolder.getClip()).setHeight(contentHeight);
clip.setWidth(getWidth());
/** * update the size of error container and its clip * * @param w * @param errorContainerHeight */ private void updateErrorContainerSize(double w, double errorContainerHeight) { errorContainerClip.setWidth(w); errorContainerClip.setHeight(errorContainerHeight); resize(w, errorContainerHeight); }
public void setCount(int count) { text.setText(Integer.toString(count)); double height = text.getBoundsInLocal().getHeight(); double width = Math.max(text.getBoundsInLocal().getWidth(), height); r1.setWidth(width * 1.3); r1.setHeight(height * 1.3); r2.setWidth(width * 1.2); r2.setHeight(height * 1.2); } }
@Override protected void setOverLayBounds(Rectangle overlay) { overlay.setWidth(ripplerPane.getWidth()); overlay.setHeight(ripplerPane.getHeight()); }
/** * Resized the specified rectangle so that its upper left point is {@code (0, 0)} and its width and height are * both 0. * * @param rectangle * the {@link Rectangle} which will be resized */ private static void resizeRectangleToZero(Rectangle rectangle) { rectangle.setX(0); rectangle.setY(0); rectangle.setWidth(0); rectangle.setHeight(0); }
protected void setOverLayBounds(Rectangle overlay){ overlay.setWidth(control.getLayoutBounds().getWidth()); overlay.setHeight(control.getLayoutBounds().getHeight()); }
@Override protected void layoutChildren(double x, double y, double w, double h) { final double notificationBarHeight = notificationBar.prefHeight(w); notificationBar.resize(w, notificationBarHeight); // layout the content if (content != null) { content.resizeRelocate(x, y, w, h); } // and update the clip so that the notification bar does not draw outside // the bounds of the notification pane clip.setX(x); clip.setY(y); clip.setWidth(w); clip.setHeight(h); }
public void layoutPane(final double x, final double y, final double w, final double h) { relocate(x, y); // resize error container if animation is disabled if (control.isDisableAnimation() || isErrorVisible()) { resize(w, computeErrorHeight(computeErrorWidth(w))); errorContainerClip.setWidth(w); } }
private Shape createSegmentedShape(double width, double heigth, List<Integer> visibleSegments) { double segmentWidth = width/3; double segmentHeight = heigth/3; Shape shape = new Rectangle(); for (Integer visibleSegment : visibleSegments) { Rectangle rect = new Rectangle(); rect.setWidth(segmentWidth); rect.setHeight(segmentHeight); int row = (visibleSegment-1) / 3; int col = (visibleSegment-1) % 3; rect.setY(row * segmentHeight); rect.setX(col * segmentWidth); shape = Shape.union(shape, rect); } return shape; }
public void invalid(double w) { final ValidatorBase activeValidator = control.getActiveValidator(); if (activeValidator != null) { showError(activeValidator); final double errorContainerWidth = w - errorIcon.prefWidth(-1); setOpacity(1); resize(w, computeErrorHeight(errorContainerWidth)); errorContainerClip.setWidth(w); errorContainerClip.setHeight(getHeight()); errorClipScale.setY(1); } }
@Override protected void layoutChildren() { int space = 0; int w = 16; this.horizontal.resizeRelocate(0, getHeight() - w, getWidth() - w , w); this.vertical.resizeRelocate(getWidth() - w, 0, w, getHeight()- w); if (this.center != null) { this.clip.setX(0); this.clip.setY(0); this.clip.setWidth(getWidth() - w - space); this.clip.setHeight(getHeight() - w - space); this.center.resizeRelocate(0, 0, getWidth() - w - space, getHeight() - w - space); } }