treetableview

Add up childern values and write them in parent, JavaFX

血红的双手。 提交于 2019-12-24 22:37:37
问题 I have creating this treetable Now I want to sum up th children values and show the result in the parent cell under the related column. For example for Function 7 in column 2 and row 2 I want to right 2.0, and for Function 11 column 4 row 4 right 1.0 (function 12 + function 13) Here is the code which produces the treetable. root.setExpanded(true); Set<String> combinedKeys = new HashSet<>(dc.getCombiFunc().keySet()); Set<String> funcAllKeys = new HashSet<>(dc.getSortedfuncAll().keySet());

How to implement filtering for treetableview

浪子不回头ぞ 提交于 2019-12-19 08:53:47
问题 Can anyone please suggest me how to implement filtering for a TreeTableView component? I am using jdk 1.8.20 回答1: The example below demonstrates a TreeTableView with three columns and a filter box. Filtering is achieved by creating a new hierarchy of TreeItems. If any of child item matches all its parent items are shown as well (to preserve the tree structure). import java.util.HashMap; import java.util.Map; import javafx.animation.KeyFrame; import javafx.application.Application; import

How to implement filtering for treetableview

倾然丶 夕夏残阳落幕 提交于 2019-12-19 08:53:20
问题 Can anyone please suggest me how to implement filtering for a TreeTableView component? I am using jdk 1.8.20 回答1: The example below demonstrates a TreeTableView with three columns and a filter box. Filtering is achieved by creating a new hierarchy of TreeItems. If any of child item matches all its parent items are shown as well (to preserve the tree structure). import java.util.HashMap; import java.util.Map; import javafx.animation.KeyFrame; import javafx.application.Application; import

JavaFX8 treeTableView customize collapse root item

淺唱寂寞╮ 提交于 2019-12-18 06:58:14
问题 How can I customize the collapse appearance of a tree root item? By customizing I mean setting an image and center that little triangle(/new image) inside its cell. Thanks in advance. 回答1: Have a look at the default stylesheet, modena.css, which you can extract from the jfxrt.jar file in jre/lib/ext, or find online. The graphic is defined as a path there: .tree-cell > .tree-disclosure-node, .tree-table-row-cell > .tree-disclosure-node { -fx-padding: 4 6 4 8; -fx-background-color: transparent;

JavaFX TreeTable select children when parent is selected and remove selection from parent

让人想犯罪 __ 提交于 2019-12-11 12:23:11
问题 I have a TreeTable which has maximum depth of 2, e.g. fooType -foo -foo If I select fooType I want the program to select automatically all child-items AND deselect the parent item. But when I try this, I always get an IndexOutOfBoundsException. myTreeTable.getSelectionModel().selectedItemProperty().addListener((obs, ov, nv) -> { if (nv.getValue() instanceof fooType) { myTreeTable.getSelectionModel().clearSelection(myTreeTable.getSelectionModel().getSelectedIndex()); if (!nv.isExpanded()) { nv

Add progressbar in TreeTableView (returning Double value to Observable<Double>)

这一生的挚爱 提交于 2019-12-11 10:53:34
问题 I am experimenting with JavaFX and I am trying to add a progress bar in tree table. Is there a way to link the values of salary to progress bar. My Code is modified version of Oracle's TreeTableView Example: public class TreeTableViewSample extends Application implements Runnable { List<Employee> employees = Arrays.<Employee>asList( new Employee("Ethan Williams", 30.0), new Employee("Emma Jones", 10.0), new Employee("Michael Brown", 70.0), new Employee("Anna Black", 50.0), new Employee(

setting the value of parent according to its children for each column in TreeTableView JavaFX

自作多情 提交于 2019-12-08 09:35:24
问题 The function bellow creates a treetableview, which has this structure: As you see for example there is no value for parents with child. I need to add the value of children (their weight) together and set the text of related parent to this value for each column in which the children are set. which means I want to have instead of x1, 2 and instead of x3, 1 and for x2, the value 3. Do I have to calculate the treetableview 2 times? 1 2 3 4 - a x1 x3 - a1 1 1 - a2 1 0 - b x2 - b1 3 - c 1 1 private

javafx treetableview cell value not getting updated

我的未来我决定 提交于 2019-12-06 11:45:41
问题 Event after updating the data model javafx treetableview cell value not getting updated. I am using the sample code here @ http://docs.oracle.com/javase/8/javafx/user-interface-tutorial/tree-table-view.htm (Example 15-2) On click of button i m trying to update first item: employees.get(0).setName("Test"); Is there any trick using which treetableview can be updated? 回答1: The example, somewhat strangely, returns a ReadOnlyStringWrapper wrapping the property values for the cell value factories.

JavaFX TreeTableView leaves icons behind when collapsing

僤鯓⒐⒋嵵緔 提交于 2019-12-06 05:48:45
问题 I have a TreeTableView where every node has an icon. Everything works perfectly when I expand the tree, but when I collapse the tree, the icons of the no longer visible items are left behind. The rows and the text are removed, but the icons remain "free-floating". In the screenshot you can see the TreeTableView twice, once expanded with the correct text, and once collapsed with only the remaining icons. The screenshot above was created from the following minimal example (you just need to add

Javafx exception when clicking TreeTableCell after repopulating TreeTableView

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 01:00:13
问题 I am currently getting an error that I do not understand. The exception that is thrown points to nothing in my code, yet it is only thrown after I repopulate a TreeTableView by clearing the root item's children and adding a new set och children to it. This is the exception: Exception in thread "JavaFX Application Thread" java.lang.NullPointerException at javafx.scene.control.TreeTableView$TreeTableViewArrayListSelectionModel.handleSelectedCellsListChangeEvent(TreeTableView.java:3056) at