Exemple #1
0
 public static Set<View> findViews(MultiSplitPane docker) {
   Set<View> views = new HashSet<>();
   for (Component c : docker.leaves()) {
     if (c instanceof Tile) {
       Tile tile = (Tile) c;
       for (int i = 0; i < tile.numViews(); i++) {
         views.add(tile.view(i));
       }
     }
   }
   return views;
 }
Exemple #2
0
 public static Tile findLargestTile(MultiSplitPane docker) {
   int largestArea = -1;
   Tile largestTile = null;
   for (Component c : docker.leaves()) {
     int area = c.getWidth() * c.getHeight();
     if (area > largestArea && c instanceof Tile) {
       largestTile = (Tile) c;
       largestArea = area;
     }
   }
   return largestTile;
 }