double dx = lastX - event.getX(); if (Math.abs(dx) > 0.5) { double newHVal = (getHvalue() + dx / (container.getWidth())); setHvalue(newHVal);
public class YourController implements Initializable { @FXML HBox mHBox; @FXML Button mButton; @Override public void initialize(final URL paramURL, final ResourceBundle paramResourceBundle) { Platform.runLater(new Runnable() { public void run() { double w0 = mHBox.getWidth(); double w1 = mButton.getWidth(); double h0 = mHBox.getHeight(); double size = Math.min(w0-w1, h0); Canvas canvas = new Canvas(size, size); mHBox.getChildren().add(0, canvas); }}); } }
box.setLayoutX((WIDTH - box.getWidth())/2); getContent().add(box);
clip.setWidth(menu.getWidth()); clip.setHeight(menu.getHeight()); new KeyValue(clip.arcWidthProperty(), Math.min(b.getWidth(), b.getHeight())), new KeyValue(clip.arcHeightProperty(), Math.min(b.getWidth(), b.getHeight())), new KeyValue(menu.translateXProperty(), menu.getWidth() - b.getMaxX()))); new KeyValue(clip.xProperty(), 0), new KeyValue(clip.yProperty(), 0), new KeyValue(clip.widthProperty(), menu.getWidth()), new KeyValue(clip.heightProperty(), menu.getHeight()), new KeyValue(clip.arcHeightProperty(), 0),
Rectangle rect = new ResizableRectangle(hBox.getWidth(),50); rect.setFill(Color.RED); rect.widthProperty().bind(hBox.widthProperty().subtract(20));
action.setOnAction(createAction(tasks.get(currentIndex.get()), aldermanOffice)); navigationBar.getChildren().addAll(back, action, next); navigationBar.setLayoutX((CloseButtonDialog.WIDTH - navigationBar.getWidth()) / 2); navigationBar.widthProperty().addListener((observable, oldWidth, newWidth) -> navigationBar.setLayoutX((CloseButtonDialog.WIDTH - newWidth.doubleValue()) / 2));
double dx = lastX - event.getX(); if (Math.abs(dx) > 0.5) { double newHVal = (getHvalue() + dx / (container.getWidth())); setHvalue(newHVal);