swing - How to draw timelines in a tree table -


i writing analyzer visually see application spending time. interface trying achieve (see below) similar tree table

  • lines or boxes denote response time.
  • be collapsible tree graph
  • the ability display metrics in table columns (e.g., start time, cost, etc)
  • the ability display labels or description , metrics on left , lines on right

i create following diagram (see below) in r -- unfortunately, although graph production automated, approach not interactive. wondering if suggest better way -- maybe tree table. looked @ many swing, javafx tree table examples. have not seen example has lines (time lines) in tree table.

enter image description here

any suggestions appreciated. in advance.

you can show node in treetablecell using grahic property in javafx. includes rectangles.

this simple example of showing bars in column using rectangles:

// arrays in treeitems contain {startvalue, endvalue} (both positive) treeitem<int[]> root = new treeitem<>(new int[]{0, 10}); root.getchildren().addall(new treeitem<>(new int[]{0, 5}), new treeitem<>(new int[]{5, 10})); treetableview<int[]> ttv = new treetableview<>(root);  // column displaying bars based on data of treeitem. not use // first column, otherwise alignment off depending on // distance root. treetablecolumn<int[], int[]> column = new treetablecolumn<>(); column.setcellvaluefactory(c -> c.getvalue().valueproperty());  final double bar_size = 20; column.setcellfactory((t) -> new treetablecell<int[], int[]>() {      // bar     private final rectangle rectangle = new rectangle(0, 10);      {         setcontentdisplay(contentdisplay.graphic_only);          // bar invisible default         rectangle.setvisible(false);         setgraphic(rectangle);     }      @override     protected void updateitem(int[] item, boolean empty) {         super.updateitem(item, empty);         if (!empty && item != null) {             // resize , display bar, item present             rectangle.setwidth((item[1] - item[0]) * bar_size);             rectangle.settranslatex(item[0] * bar_size);             rectangle.setvisible(true);         } else {             // no item -> hide bar             rectangle.setvisible(false);         }     } });  // add columns new column // add additional empty column @ start prevent bars being // aligned based on distance root ttv.getcolumns().addall(new treetablecolumn<>(), column); 

things need do


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

android - Keyboard hides my half of edit-text and button below it even in scroll view -