@Override public LineReader reader(int width) { int[] widths = new int[cols.size()]; int[] minWidths = new int[cols.size()]; for (int i = 0;i < cols.size();i++) { LineRenderer renderable = cols.get(i); widths[i] = Math.max(widths[i], renderable.getActualWidth()); minWidths[i] = Math.max(minWidths[i], renderable.getMinWidth()); } widths = Layout.flow().compute(false, width, widths, minWidths); if (widths == null) { return null; } else { // Size could be smaller and lead to ArrayIndexOutOfBounds later widths = Arrays.copyOf(widths, minWidths.length); return renderer(widths, -1); } } }
final int[] widths = columnLayout.compute(separator != null, width - (border != null ? 2 : 0), eltWidths, eltMinWidths); minHeights[row.getIndex()] = row.getMinHeight(widths); heights = rowLayout.compute(false, height - (border != null ? 2 : 0), actualHeights, minHeights); if (heights == null) { return null;
@Override public LineReader reader(int width) { int[] widths = new int[cols.size()]; int[] minWidths = new int[cols.size()]; for (int i = 0;i < cols.size();i++) { LineRenderer renderable = cols.get(i); widths[i] = Math.max(widths[i], renderable.getActualWidth()); minWidths[i] = Math.max(minWidths[i], renderable.getMinWidth()); } widths = Layout.flow().compute(false, width, widths, minWidths); if (widths == null) { return null; } else { // Size could be smaller and lead to ArrayIndexOutOfBounds later widths = Arrays.copyOf(widths, minWidths.length); return renderer(widths, -1); } } }
@Override public LineReader reader(int width) { int[] widths = new int[cols.size()]; int[] minWidths = new int[cols.size()]; for (int i = 0;i < cols.size();i++) { LineRenderer renderable = cols.get(i); widths[i] = Math.max(widths[i], renderable.getActualWidth()); minWidths[i] = Math.max(minWidths[i], renderable.getMinWidth()); } widths = Layout.flow().compute(false, width, widths, minWidths); if (widths == null) { return null; } else { // Size could be smaller and lead to ArrayIndexOutOfBounds later widths = Arrays.copyOf(widths, minWidths.length); return renderer(widths, -1); } } }
@Override public LineReader reader(int width) { int[] widths = new int[cols.size()]; int[] minWidths = new int[cols.size()]; for (int i = 0;i < cols.size();i++) { Renderer renderable = cols.get(i); widths[i] = Math.max(widths[i], renderable.getActualWidth()); minWidths[i] = Math.max(minWidths[i], renderable.getMinWidth()); } widths = Layout.flow().compute(false, width, widths, minWidths); if (widths == null) { return null; } else { // Size could be smaller and lead to ArrayIndexOutOfBounds later widths = Arrays.copyOf(widths, minWidths.length); return renderer(widths, -1); } } }
public void run() { MyFrame frame = new MyFrame(); frame.setSize(320, 240); frame.setLocationRelativeTo(null); frame.setVisible(true); // a layout algorithm instance plugged to the graph Layout layout = new SpringBox(false); graph.addSink(layout); layout.addAttributeSink(graph); graph.addNode("A"); graph.addNode("B"); graph.addNode("C"); graph.addEdge("AB", "A", "B"); graph.addEdge("BC", "B", "C"); graph.addEdge("CA", "C", "A"); graph.addAttribute("ui.quality"); graph.addAttribute("ui.antialias"); // iterate the compute() method a number of times while(layout.getStabilization() < 0.9){ layout.compute(); } }
final int[] widths = columnLayout.compute(separator != null, width - (border != null ? 2 : 0), eltWidths, eltMinWidths); minHeights[row.getIndex()] = row.getMinHeight(widths); heights = rowLayout.compute(false, height - (border != null ? 2 : 0), actualHeights, minHeights); if (heights == null) { return null;
final int[] widths = columnLayout.compute(separator != null, width - (border != null ? 2 : 0), eltWidths, eltMinWidths); minHeights[row.getIndex()] = row.getMinHeight(widths); heights = rowLayout.compute(false, height - (border != null ? 2 : 0), actualHeights, minHeights); if (heights == null) { return null;
final int[] widths = columnLayout.compute(separator != null, width - (border != null ? 2 : 0), eltWidths, eltMinWidths); minHeights[row.getIndex()] = row.getMinHeight(widths); heights = rowLayout.compute(false, height - (border != null ? 2 : 0), actualHeights, minHeights); if (heights == null) { return null;