inner.setAlignment(Pos.CENTER); inner.getStyleClass().add("tab-container"); inner.setRotate(getSkinnable().getSide().equals(Side.BOTTOM) ? 180.0F : 0.0F);
private double calculateNewFirstPos(double length, double catSpacing) { final Side side = getSide(); double newPos = 1; if (side != null) { double offset = ((isGapStartAndEnd()) ? (catSpacing / 2) : (0)); if (side.equals(Side.TOP) || side.equals(Side.BOTTOM)) { // HORIZONTAL newPos = 0 + getStartMargin() + offset; } else { // VERTICAL newPos = length - getStartMargin() - offset; } } // if autoranging is off setRange is not called so we update first // cateogory pos. if (!isAutoRanging()) { firstCategoryPos.set(newPos); } return newPos; }
/** * Get the data value for the given display position on this axis. If the * axis is a CategoryAxis this will be the nearest value. * * @param displayPosition * A pixel position on this axis * @return the nearest data value to the given pixel position or null if not * on axis; */ @Override public CalendarNode getValueForDisplay(double displayPosition) { if (getSide().equals(Side.TOP) || getSide().equals(Side.BOTTOM)) { // HORIZONTAL if (displayPosition < 0 || displayPosition > getHeight()) { return null; } double d = (displayPosition - firstCategoryPos.get()) / categorySpacing.get(); return toRealValue(d); } else { // VERTICAL if (displayPosition < 0 || displayPosition > getWidth()) { return null; } double d = (displayPosition - firstCategoryPos.get()) / (categorySpacing.get() * -1); return toRealValue(d); } }
private void show(Side side) { if (hideTimeline != null) { hideTimeline.stop(); } if (showTimeline != null && showTimeline.getStatus() == Status.RUNNING) { return; } KeyValue[] keyValues = new KeyValue[Side.values().length]; for (Side s : Side.values()) { keyValues[s.ordinal()] = new KeyValue(visibility[s.ordinal()], s.equals(side) ? 1 : 0); } Duration delay = getSkinnable().getAnimationDelay() != null ? getSkinnable() .getAnimationDelay() : Duration.millis(300); Duration duration = getSkinnable().getAnimationDuration() != null ? getSkinnable() .getAnimationDuration() : Duration.millis(200); KeyFrame keyFrame = new KeyFrame(duration, keyValues); showTimeline = new Timeline(keyFrame); showTimeline.setDelay(delay); showTimeline.play(); }
inner.setAlignment(Pos.CENTER); inner.getStyleClass().add("tab-container"); inner.setRotate(getSkinnable().getSide().equals(Side.BOTTOM) ? 180.0F : 0.0F);