public Point2D getPoint(TableView<?> tableView, int columnIndex, int rowIndex) { Set<Node> tableRowCell = tableView.lookupAll(".table-row-cell"); TableRow<?> row = null; for (Node tableRow : tableRowCell) { TableRow<?> r = (TableRow<?>) tableRow; if (r.getIndex() == rowIndex) { row = r; break; } } Set<Node> cells = row.lookupAll(".table-cell"); for (Node node : cells) { TableCell<?, ?> cell = (TableCell<?, ?>) node; if (tableView.getColumns().indexOf(cell.getTableColumn()) == columnIndex) { Bounds bounds = cell.getBoundsInParent(); Point2D localToParent = cell.localToParent(bounds.getWidth() / 2, bounds.getHeight() / 2); Point2D rowLocal = row.localToScene(localToParent, true); return rowLocal; } } return null; }
public TableCell<?, ?> getVisibleCellAt(TableView<?> tableView, int row, int column) { Set<Node> lookupAll = getTableCells(tableView); TableCell<?, ?> cell = null; for (Node node : lookupAll) { TableCell<?, ?> cell1 = (TableCell<?, ?>) node; TableRow<?> tableRow = cell1.getTableRow(); TableColumn<?, ?> tableColumn = cell1.getTableColumn(); if (tableRow.getIndex() == row && tableColumn == tableView.getColumns().get(column)) { cell = cell1; break; } } if (cell != null) { return cell; } return null; }
public VarsPanel(AppSession session) { this.session = session; table = new TableView(); table.setPrefWidth(300); table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); setCenter(table); TableColumn nameCol = new TableColumn("Variable"); nameCol.setMinWidth(120); nameCol.setMaxWidth(250); nameCol.setCellValueFactory(new PropertyValueFactory("name")); nameCol.setCellFactory(c -> new StringTooltipCell()); TableColumn typeCol = new TableColumn("Type"); typeCol.setMinWidth(45); typeCol.setMaxWidth(60); typeCol.setCellValueFactory(new PropertyValueFactory("type")); TableColumn<Var, ScriptValue> valueCol = new TableColumn("Value"); valueCol.setCellValueFactory(c -> new ReadOnlyObjectWrapper(c.getValue().getValue())); valueCol.setCellFactory(c -> new VarValueCell()); table.getColumns().addAll(nameCol, typeCol, valueCol); table.setItems(session.getVars()); table.setRowFactory(tv -> { TableRow<Var> row = new TableRow<>(); row.setOnMouseClicked(e -> { if (e.getClickCount() == 2 && !row.isEmpty()) { Var var = row.getItem(); session.logVar(var); } }); return row ; }); }
@Override @SuppressWarnings("unchecked") protected void updateItem(String item, boolean empty) { super.updateItem(item, empty); if (!empty) { TableView<DesignVariable> tv = getTableView(); TableRow<DesignVariable> tr = getTableRow(); if ((tv != null) && (tr != null)) { if (tv.getItems().get(getTableRow().getIndex()).isOutput()) { setTextFill(Color.BLUE); } else if (tv.getItems().get(getTableRow().getIndex()).getValue().equals("INVALID")) { setTextFill(Color.ORANGE); } else { setTextFill(Color.GREEN); } } else { setTextFill(Color.YELLOW); } setText(item); } else { setText(""); } }
private void recomputeVisibleIndexes() { firstIndex = -1; lastIndex = -1; // Work out which of the rows are visible double tblViewHeight = tableView.getHeight(); double headerHeight = tableView.lookup(".column-header-background").getBoundsInLocal().getHeight(); double viewPortHeight = tblViewHeight - headerHeight; for(TableRow<T> r : rows) { double minY = r.getBoundsInParent().getMinY(); double maxY = r.getBoundsInParent().getMaxY(); boolean hidden = (maxY < 0) || (minY > viewPortHeight); // boolean fullyVisible = !hidden && (maxY <= viewPortHeight) && (minY >= 0); if (!hidden) { if (firstIndex < 0 || r.getIndex() < firstIndex) { firstIndex = r.getIndex(); } if (lastIndex < 0 || r.getIndex() > lastIndex) { lastIndex = r.getIndex(); } } } }
private void initTableRowFactory() { setRowFactory(facotry -> { final TableRow<SampServer> row = new TableRow<>(); row.setOnMouseClicked(clicked -> { // A row has been clicked, so we want to hide the previous context menu contextMenu.hide(); if (Objects.nonNull(row.getItem())) { // If there is an item in this row, we want to proceed further handleClick(row, clicked); } else { // Otherwise we clear the selection. getSelectionModel().clearSelection(); } }); return row; }); }
@Override public TableRow call(TableView param) { TableRow row = new TableRow(); row.itemProperty().addListener(new ChangeListener() { @Override public void changed(ObservableValue observable, Object oldValue, Object newValue) { updateRowStyle(row); } }); rowsToHighlight.addListener(new ListChangeListener<Integer>() { @Override public void onChanged(ListChangeListener.Change<? extends Integer> c) { updateRowStyle(row); } }); return row; }
@Test public void shouldSinglePrimaryClickOnCellTrackInPlaylist() { TableCell<TrackTableModel, String> tableCell = cellFactory.call(new TableColumn<>()); tableCell.setItem("trackId"); Track track = new Track("123", "Artist Name", "Artist Image", "456", "Album Name", "Album Image", 2000, "789", "Track Name", 1, "Location", true, Arrays.asList("Genre 1", "Genre 2")); track.setPlaylistId(999); TrackTableModel trackTableModel = new TrackTableModel(track); @SuppressWarnings("unchecked") TableRow<TrackTableModel> mockTableRow = (TableRow<TrackTableModel>)mock(TableRow.class); when(mockTableRow.getItem()).thenReturn(trackTableModel); ReflectionTestUtils.invokeMethod(tableCell, "setTableRow", mockTableRow); when(mockPlaylistManager.isTrackInPlaylist(anyInt(), anyString())).thenReturn(true); tableCell.onMouseClickedProperty().get() .handle(getMouseEvent(MouseEvent.MOUSE_CLICKED, MouseButton.PRIMARY, 1)); verify(mockPlaylistManager, never()).addTrackToPlaylist(PLAYLIST_ID_FAVOURITES, track); verify(mockPlaylistManager, times(1)).removeTrackFromPlaylist(PLAYLIST_ID_FAVOURITES, track); verify(getMockEventManager(), times(1)).fireEvent(Event.PLAYLIST_CONTENT_UPDATED, track.getPlaylistId()); }
@Test public void shouldSinglePrimaryClickOnCellTrackNotInPlaylist() { TableCell<TrackTableModel, String> tableCell = cellFactory.call(new TableColumn<>()); tableCell.setItem("trackId"); Track track = new Track("123", "Artist Name", "Artist Image", "456", "Album Name", "Album Image", 2000, "789", "Track Name", 1, "Location", true, Arrays.asList("Genre 1", "Genre 2")); track.setPlaylistId(999); TrackTableModel trackTableModel = new TrackTableModel(track); @SuppressWarnings("unchecked") TableRow<TrackTableModel> mockTableRow = (TableRow<TrackTableModel>)mock(TableRow.class); when(mockTableRow.getItem()).thenReturn(trackTableModel); ReflectionTestUtils.invokeMethod(tableCell, "setTableRow", mockTableRow); when(mockPlaylistManager.isTrackInPlaylist(anyInt(), anyString())).thenReturn(false); tableCell.onMouseClickedProperty().get() .handle(getMouseEvent(MouseEvent.MOUSE_CLICKED, MouseButton.PRIMARY, 1)); verify(mockPlaylistManager, times(1)).addTrackToPlaylist(PLAYLIST_ID_FAVOURITES, track); verify(mockPlaylistManager, never()).removeTrackFromPlaylist(PLAYLIST_ID_FAVOURITES, track); verify(getMockEventManager(), times(1)).fireEvent(Event.PLAYLIST_CONTENT_UPDATED, track.getPlaylistId()); }
private void moveDataWithAnimation(final TableView<Person> sourceTable, final TableView<Person> destinationTable, final Pane commonTableAncestor, final TableRow<Person> row) { // Create imageview to display snapshot of row: final ImageView imageView = createImageView(row); // Start animation at current row: final Point2D animationStartPoint = row.localToScene(new Point2D(0, 0)); // relative to Scene final Point2D animationEndPoint = computeAnimationEndPoint(destinationTable); // relative to Scene // Set start location final Point2D startInRoot = commonTableAncestor.sceneToLocal(animationStartPoint); // relative to commonTableAncestor imageView.relocate(startInRoot.getX(), startInRoot.getY()); // Create animation final Animation transition = createAndConfigureAnimation( sourceTable, destinationTable, commonTableAncestor, row, imageView, animationStartPoint, animationEndPoint); // add animated image to display commonTableAncestor.getChildren().add(imageView); // start animation transition.play(); }
@Override public TableRow<EditableTableRowItem> call(TableView<EditableTableRowItem> p) { final TableRow<EditableTableRowItem> row = new TableRow<EditableTableRowItem>() { @Override protected void updateItem(EditableTableRowItem entityWrapper, boolean empty) { super.updateItem(entityWrapper, empty); if (!empty && entityWrapper != null && entityWrapper.getIsSummary()) { if (!getStyleClass().contains("summaryRow")) { getStyleClass().add("summaryRow"); } } else { getStyleClass().removeAll(Collections.singleton("summaryRow")); } } }; return row; }
private void setTableContextMenu() { tableTrace.setRowFactory(param -> { TableRow<TraceLineInfo> row = new TableRow<>(); MenuItem moreGeoIPInfo = new MenuItem(" Show GeoIP results from multiple sources"); moreGeoIPInfo.setOnAction(event9 -> Main.openInBrowser(GeoIPResolver.getSecondaryGeoIpPrefix() + row.getItem().ipAddressProperty().get())); Menu copyMenu = generateCopyMenu(row); ContextMenu rowMenu = new ContextMenu(moreGeoIPInfo, copyMenu); row.contextMenuProperty().bind(Bindings.when(Bindings.isNotNull(row.itemProperty())).then(rowMenu).otherwise((ContextMenu) null)); return row; }); }
public SpinnerTableCell(TableColumn<T, Integer> column, int min, int max) { spinner = new Spinner<>(min, max, 1); spinner.editableProperty().bind(column.editableProperty()); spinner.disableProperty().bind(column.editableProperty().not()); tableRowProperty().addListener(e -> { TableRow<?> row = getTableRow(); if (row == null) return; MsSpectrumDataSet dataSet = (MsSpectrumDataSet) row.getItem(); if (dataSet == null) return; spinner.getValueFactory().valueProperty().bindBidirectional(dataSet.lineThicknessProperty()); disableProperty().bind(dataSet.renderingTypeProperty().isEqualTo(MsSpectrumType.CENTROIDED)); }); }
public SpinnerTableCell(TableColumn<T, Integer> column, int min, int max) { spinner = new Spinner<>(min, max, 1); spinner.editableProperty().bind(column.editableProperty()); spinner.disableProperty().bind(column.editableProperty().not()); tableRowProperty().addListener(e -> { TableRow<?> row = getTableRow(); if (row == null) return; ChromatogramPlotDataSet dataSet = (ChromatogramPlotDataSet) row.getItem(); if (dataSet == null) return; spinner.getValueFactory().valueProperty().bindBidirectional(dataSet.lineThicknessProperty()); }); }
@Override public TableRow<File> call(TableView<File> param) { TableRow<File> row = new TableRow<>(); row.setOnMousePressed(event -> { if (event.isPrimaryButtonDown() && event.getClickCount() == 2 && !row.isEmpty()) { File recentProject = row.getItem(); if (recentProject.exists()) { DataService.getInstance().loadProject(recentProject); if (controller.getView().getStage().isShowing()) { controller.getView().getStage().close(); //закрываем стартовое окно } } else { Alert alert = new Alert(Alert.AlertType.ERROR, "File does not exist"); alert.showAndWait(); RecentProjectsController.getInstance().removeRecentProject(recentProject); SettingsManager.getInstance().writeRecentProjects(RecentProjectsController.getInstance().getRecentProjects()); } } }); return row; }
public void prepararTabelaSelecao(TableView<T> tabela, int numTabela){ prepararTabela(tabela, numTabela); tabela.setOnKeyReleased(event -> { Kernel.controlador.acaoAlterar(numTabela+10); }); tabela.setRowFactory((TableView<T> paramP) -> { TableRow<T> row = new TableRow<>(); row.setOnMouseClicked((MouseEvent mouseEvent) -> { if (mouseEvent.getClickCount()==2 && (!row.isEmpty())) { Kernel.controlador.acaoAlterar(numTabela); } if (mouseEvent.getClickCount()==1 && (!row.isEmpty())) { Kernel.controlador.acaoAlterar(numTabela+10); } }); return row; }); }
private void updateRowHighlight(TableRow<Map<String, String>> row) { int r = 160; int g = 160; int b = 160; if (highlightedRows.isEmpty()) { r = 255; g = 255; b = 255; } else if (highlightedRows.contains(row.getIndex())) { r = 200; g = 255; b = 200; } if (row.getIndex() % 2 == 1) { r = Math.max(0, r-16); g = Math.max(0, g-16); b = Math.max(0, b-16); } row.setBackground(new Background(new BackgroundFill(Color.rgb(r, g, b), null, null))); }
private void createDoubleClickTableListener() { playListTable.setRowFactory(tv -> { TableRow<PlaylistElement> row = new TableRow<>(); row.setOnMouseClicked(event -> { if (event.getClickCount() == 2 && !row.isEmpty()) { PlayerFX.getInstance().setPlaylistIndex(row.getIndex()); PlayerFX.getInstance().setActualMedia(PlayerFX.getInstance().getActualPlaylist().get(row.getIndex()).asMedia()); PlayerFX.getInstance().play(); PlayerFX.getInstance().autonext(this); setAvailability(); } }); return row; }); }
public static TableRow<?> getFirstRowOfTableView(String tableSelector) { TableView<?> tableView = new FxRobot().lookup(tableSelector).query(); List<Node> current = tableView.getChildrenUnmodifiable(); while (current.size() == 1) { current = ((Parent) current.get(0)).getChildrenUnmodifiable(); } current = ((Parent) current.get(1)).getChildrenUnmodifiable(); while (!(current.get(0) instanceof TableRow)) { current = ((Parent) current.get(0)).getChildrenUnmodifiable(); } Node node = current.get(0); if (node instanceof TableRow) { return (TableRow<?>) node; } else { throw new RuntimeException("Expected Group with only TableRows as children"); } }
/** * @param row Index of the row * @return the corresponding row */ public TableRow<?> getRow(int row) { List<Node> current = getChildrenUnmodifiable(); while (current.size() == 1) { current = ((Parent) current.get(0)).getChildrenUnmodifiable(); } current = ((Parent) current.get(1)).getChildrenUnmodifiable(); while (!(current.get(0) instanceof TableRow)) { current = ((Parent) current.get(0)).getChildrenUnmodifiable(); } Node node = current.get(row); if (node instanceof TableRow) { return (TableRow<?>) node; } else { throw new RuntimeException("Expected Group with only TableRows as children"); } }
@Override public void configure(DashboardWidget widget, EventTableService eventTableService, DatabaseService databaseService) { super.configure(widget, eventTableService, databaseService); tableView.setPrefWidth(widget.getWidth()); tableView.setPrefHeight(widget.getHeight()); tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); addTopColumns(widget); tableView.setItems(keyValueData); tableView.setRowFactory(tv -> { TableRow<KeyIntegerValue> row = new TableRow<>(); row.setOnMouseClicked(event -> { if (!row.isEmpty()) { KeyIntegerValue rowData = row.getItem(); eventTableService.setTableEvents(keyValueMap.get(rowData.getField())); } }); return row; }); }
/** * Initializes the controller class. */ @Override public void initialize(URL url, ResourceBundle rb) { super.initialize(); tableData = FXCollections.observableArrayList(); table.setItems(tableData); table.setEditable(true); table.setRowFactory(tableView -> { final TableRow<Row> row = new TableRow<>(); final ContextMenu contextMenu = new ContextMenu( createMenuItem("Insert Row", () -> tableData.add(row.getIndex(), new Row())), createMenuItem("Clone Row", () -> cloneRow(row.getItem())), createMenuItem("Delete Row", () -> deleteRowWithConfirmation(row.getItem())) ); row.contextMenuProperty().bind( Bindings.when(row.emptyProperty()) .then((ContextMenu) null) .otherwise(contextMenu) ); return row; }); }
/********************************************* * * * CONTEXT MENU FACTORY * * * *********************************************/ private TableRow<ObservableGanttTask> tableRowFactory(TableView<ObservableGanttTask> table) { final TableRow<ObservableGanttTask> row = new TableRow<>(); row.contextMenuProperty().bind( Bindings.when(Bindings.isNull(row.itemProperty())) .then((ContextMenu)null) .otherwise(Bindings.when(row.indexProperty().isEqualTo(0)) .then(makeFirstTaskContextMenu()) .otherwise(makeRegularTaskContextMenu(row)))); return row; }
public TableViewExt(TableView<T> tableView) { this.tableView = tableView; // Callback to monitor row creation and to identify visible screen rows final Callback<TableView<T>, TableRow<T>> rf = tableView.getRowFactory(); final Callback<TableView<T>, TableRow<T>> modifiedRowFactory = param -> { TableRow<T> r = rf != null ? rf.call(param) : new TableRow<>(); // Save row, this implementation relies on JaxaFX re-using TableRow efficiently // TODO has been causing gui issues. I wonder if it's because rows are never removed rows.add(r); return r; }; tableView.setRowFactory(modifiedRowFactory); }
private void handleClick(final TableRow<SampServer> row, final MouseEvent clicked) { if (clicked.getButton() == MouseButton.PRIMARY) { handleLeftClick(row); } else if (clicked.getButton() == MouseButton.SECONDARY) { handleRightClick(row, clicked); } }
private void handleRightClick(final TableRow<SampServer> row, final MouseEvent clicked) { final List<SampServer> selectedServers = getSelectionModel().getSelectedItems(); if (getSelectionModel().getSelectedIndices().contains(row.getIndex())) { // In case the current selection model contains the clicked row, we want to open the // context menu on the current selection mode displayMenu(selectedServers, clicked.getScreenX(), clicked.getScreenY()); } else { // Otherwise we will select the clicked item and open the context menu on it displayMenu(Arrays.asList(row.getItem()), clicked.getScreenX(), clicked.getScreenY()); } }
private void handleLeftClick(final TableRow<SampServer> row) { final Long lastLeftClickTime = (Long) row.getUserData(); final boolean wasDoubleClick = Objects.nonNull(lastLeftClickTime) && System.currentTimeMillis() - lastLeftClickTime < 300; final boolean onlyOneSelectedItem = getSelectionModel().getSelectedItems().size() == 1; if (wasDoubleClick && onlyOneSelectedItem) { if (ClientPropertiesController.getPropertyAsBoolean(Property.CONNECT_ON_DOUBLECLICK)) { getFirstIfAnythingSelected().ifPresent(server -> GTAController.tryToConnect(server.getAddress(), server.getPort())); } } else { row.setUserData(Long.valueOf(System.currentTimeMillis())); } }
public ClickableTableView(String[] columns) { setRowFactory(tv -> { TableRow<E> row = new TableRow<>(); row.setOnMouseClicked(event -> { if (!row.isEmpty()) { current = row.getItem(); modified = true; } }); return row; }); for (String column : columns) { addColumn(column, 600 / columns.length); } }
private VirtualFlow<TableRow<T>> getVirtualFlow() { Parent p = getSkinnable(); while (p != null) { if (p instanceof VirtualFlow) { return (VirtualFlow<TableRow<T>>) p; } p = p.getParent(); } return null; }
/** {@inheritDoc} */ @Override public TableRow<T> createCell() { TableRow<T> cell; if (tableView.getRowFactory() != null) { cell = tableView.getRowFactory().call(tableView); } else { cell = new CTableRow<T>(); } cell.updateTableView(tableView); return cell; }
/** * Create the ExpandableTableRowSkin and listen to changes for the item this table row represents. When the * item is changed, the old expanded node, if any, is removed from the children list of the TableRow. * * @param tableRow The table row to apply this skin for * @param expander The expander column, used to retrieve the expanded node when this row is expanded */ public ExpandableTableRowSkin(TableRow<S> tableRow, TableRowExpanderColumn<S> expander) { super(tableRow); this.tableRow = tableRow; this.expander = expander; tableRow.itemProperty().addListener((observable, oldValue, newValue) -> { if (oldValue != null) { Node expandedNode = this.expander.getExpandedNode(oldValue); if (expandedNode != null) getChildren().remove(expandedNode); } }); }
private void setSelection(TableRow row) { if (row.isSelected()) { table.getSelectionModel().clearSelection(row.getIndex()); } else { table.getSelectionModel().select(row.getIndex()); } }
/** * Initializes the controller class. */ @Override public void initialize(URL url, ResourceBundle rb) { reviewTable.setPlaceholder(new Text("^ Click 'New' to create a Review")); reviewTable.getSelectionModel().selectedItemProperty().addListener((observe, old, neo) -> { setReview(neo); }); reviewTable.setRowFactory(tv -> { // Display 'X Days Ago' TableRow<Review> row = new TableRow<Review>() { private Tooltip tooltip = new Tooltip(); @Override public void updateItem(Review review, boolean empty) { super.updateItem(review, empty); if (review == null) { setTooltip(null); } else { long age = ChronoUnit.DAYS.between(review.getDate(), LocalDate.now()); tooltip.setText(age + " days ago"); setTooltip(tooltip); } } }; // Quickly switch to editing a review row.setOnMouseClicked(event -> { if (event.getClickCount() == 2 && (!row.isEmpty())) { showReviewEditor(); } }); return row; }); ratingColumn.setCellValueFactory(new PropertyValueFactory<>("Rating")); userColumn.setCellValueFactory(new PropertyValueFactory<>("User")); dateColumn.setCellValueFactory(new PropertyValueFactory<>("Date")); }
private void updateRowStyle(TableRow<T> row) { if (row.getItem() == null) { return; } row.pseudoClassStateChanged(BAD_CLASS, row.getItem().getLastError() != null); row.getItem().lasterrorProperty().addListener(l -> row.pseudoClassStateChanged(BAD_CLASS, row.getItem().getLastError() != null)); }
public CodePaneController(){ this.widthProperty().addListener(c->{ final double w = this.getWidth(); addressColumn.setPrefWidth(w/6); dataTypeColumn.setPrefWidth(w/6); codeColumn.setPrefWidth(w/6); commentColumn.setPrefWidth(w / 2); }); addressColumn.setCellValueFactory(new PropertyValueFactory<>("address")); dataTypeColumn.setCellValueFactory(new PropertyValueFactory<>("informationType")); codeColumn.setCellValueFactory(new PropertyValueFactory<>("text")); commentColumn.setCellValueFactory(new PropertyValueFactory<>("comment")); this.setRowFactory(tableView -> { TableRow<DisplaySet> row = new TableRow<>(); row.itemProperty().addListener((obs, prev, cur) -> { row.setStyle(""); if (cur == null) return; if(cur.getData() instanceof TableSeperator){ row.setStyle("-fx-background-color: "+((TableSeperator)cur.getData()).getColor()); } }); return row; }); this.getColumns().addAll(addressColumn,dataTypeColumn, codeColumn, commentColumn); }
/** * Update row higlighted style * * @param row */ private void updateRowStyle(TableRow row) { if (row != null && row.getItem() != null) { row.getStyleClass().remove("highlightedRow"); int index = ((ImportPcapTableData) row.getItem()).getIndex(); if (rowsToHighlight.contains(index)) { row.getStyleClass().add("highlightedRow"); } } }
private void updateTableCell(TableCell<TrackTableModel, String> tableCell, Track track) { tableCell.setItem(track.getTrackName()); TrackTableModel trackTableModel = new TrackTableModel(track); TableRow<TrackTableModel> tableRow = new TableRow<>(); tableRow.setItem(trackTableModel); tableCell.updateTableRow(tableRow); }
private TranslateTransition createAndConfigureAnimation( final TableView<Person> sourceTable, final TableView<Person> destinationTable, final Pane commonTableAncestor, final TableRow<Person> row, final ImageView imageView, final Point2D animationStartPoint, Point2D animationEndPoint) { final TranslateTransition transition = new TranslateTransition(ANIMATION_DURATION, imageView); // At end of animation, actually move data, and remove animated image transition.setOnFinished(createAnimationFinishedHandler(sourceTable, destinationTable, commonTableAncestor, row.getItem(), imageView)); // configure transition transition.setByX(animationEndPoint.getX() - animationStartPoint.getX()); // absolute translation, computed from coords relative to Scene transition.setByY(animationEndPoint.getY() - animationStartPoint.getY()); // absolute translation, computed from coords relative to Scene return transition; }