Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
272,500
String () { return "gold_LinePainter2D"; }
getGoldenImageName
272,501
Dimension () { return new Dimension((LINE_LEN * 2 + 2) * 4 + 2, LINE_LEN * 2 + 4); }
getImageSize
272,502
int[] () { return new int[] {1, 2, 3}; }
getScales
272,503
void () { super.testGoldenImages(); }
testGoldenImages
272,504
void () { ImageComparator comparator = new ImageComparator(); /* * In fact, absolute accuracy is achieved by painting with enabled antialiasing, in which case alpha more precisely * shows sub-pixel offsets. However, in that case outlining the right/bottom rect edge would bring additional * complexity to calculating the...
testRectOutlining
272,505
Void (Graphics2D g) { paintRects(g, StrokeType.CENTERED, 2, 2); paintRects(g, StrokeType.INSIDE, RECT_SIZE + 2, 0); paintRects(g, StrokeType.OUTSIDE, RECT_SIZE + 2, 0); return null; }
paint
272,506
void (Graphics2D g, StrokeType type, float trX, float trY) { g.translate(JBUIScale.scale(trX), JBUIScale.scale(trY)); Object aa = RenderingHints.VALUE_ANTIALIAS_ON; paintRect(g, 0, 0, RECT_SIZE, RECT_SIZE, null, type, 1, aa, false); paintRect(g, 0, RECT_SIZE + 3, RECT_SIZE, RECT_SIZE, ARC_SIZE, type, 1, aa, false); pai...
paintRects
272,507
void (Graphics2D g, double x, double y, double w, double h, Double arc, StrokeType strokeType, double strokeWidth, Object valueAA, boolean fill) { strokeWidth = JBUIScale.scale((float)strokeWidth); if (arc != null) arc = Double.valueOf(JBUIScale.scale(arc.floatValue())); x = JBUIScale.scale((float)x); y = JBUIScale.sca...
paintRect
272,508
void (Graphics2D g, double[] values) { RectanglePainter2D.DRAW.paint(g, values[0], values[1], values[2], values[3]); RectanglePainter2D.FILL.paint(g, values[0], values[1], values[2], values[3]); }
paintBoundaries
272,509
void (ImageComparator comparator, double scale, boolean jreHiDPIEnabled, StrokeType strokeType) { overrideJreHiDPIEnabled(jreHiDPIEnabled); float scale1 = jreHiDPIEnabled ? 1 : (float)scale; JBUIScale.setUserScaleFactor(scale1); BufferedImage rect = supplyGraphics(scale, 15, 15, strokeType == StrokeType.INSIDE ? Rectan...
testRectOutline
272,510
Rectangle2D (Graphics2D g) { double x = PaintUtil.alignToInt(JBUIScale.scale(3f), g); double w = PaintUtil.alignToInt(JBUIScale.scale(10f), g); //noinspection SuspiciousNameCombination return new Rectangle2D.Double(x, x, w, w); }
rectBounds
272,511
Void (Graphics2D g) { return _paintRect(g, true); }
paintRectInside
272,512
Void (Graphics2D g) { return _paintRect(g, false); }
paintRectCentered
272,513
Void (Graphics2D g, boolean inside) { Rectangle2D b = rectBounds(g); RectanglePainter2D.DRAW.paint(g, b.getX(), b.getY(), b.getWidth(), b.getHeight(), inside ? StrokeType.INSIDE : StrokeType.CENTERED, JBUIScale.scale(1f)); return null; }
_paintRect
272,514
Void (Graphics2D g) { Rectangle2D b = rectBounds(g); double x = b.getX(); double y = b.getY(); double xx = x + b.getWidth(); double yy = y + b.getHeight(); // the rect right/bottom edge is painted at x + width - 1/y + height - 1 (unlike in Graphics.drawRect) double _xx = xx - 1; double _yy = yy - 1; LinePainter2D.paint...
outlineRectInside
272,515
Void (Graphics2D g) { Rectangle2D b = rectBounds(g); double x = b.getX(); double y = b.getY(); double xx = x + b.getWidth(); double yy = y + b.getHeight(); // the rect right/bottom edge is painted at x + width - 1/y + height - 1 (unlike in Graphics.drawRect) xx -= 1; yy -= 1; LinePainter2D.paint(g, b.getX(), b.getY(), ...
outlineRectCentered
272,516
String () { return "gold_RectanglePainter2D"; }
getGoldenImageName
272,517
Dimension () { return new Dimension((RECT_SIZE + 2) * 3 + 3, (RECT_SIZE + 3) * 4 + 2); }
getImageSize
272,518
int[] () { return new int[] {1, 2, 3}; }
getScales
272,519
void () { TestScaleHelper.assumeStandalone(); TestScaleHelper.assumeHeadful(); System.setProperty(JAVA2D_UI_SCALE_ENABLED_PROP, "true"); System.setProperty(JAVA2D_UI_SCALE_PROP, "3.0"); assertTrue(JAVA2D_UI_SCALE_ENABLED_PROP + " system property is ignored", JreHiDpiUtil.isJreHiDPIEnabled()); if (!SystemInfoRt.isMac) {...
test
272,520
void () { assumeFalse(SystemInfoRt.isMac); }
before
272,521
void () { TestScaleHelper.assumeStandalone(); TestScaleHelper.assumeHeadful(); System.setProperty(JAVA2D_UI_SCALE_ENABLED_PROP, "false"); assertFalse(JAVA2D_UI_SCALE_ENABLED_PROP + " system property is ignored", JreHiDpiUtil.isJreHiDPIEnabled()); }
test
272,522
void () { TestScaleHelper.assumeStandalone(); TestScaleHelper.assumeHeadful(); System.setProperty(HIDPI_PROP, "false"); UiKt.checkHiDPISettings(); Graphics2D g = TestScaleHelper.createGraphics(2); Assert.assertFalse(UI_SCALE_PROP + " should be disabled", Boolean.getBoolean(UI_SCALE_PROP)); Assert.assertFalse("hidpi sho...
test
272,523
void () { TestScaleHelper.assumeStandalone(); TestScaleHelper.assumeHeadful(); System.setProperty(IDE_UI_SCALE_PROP, "1.0"); JBUIScale.setUserScaleFactor(2f); assertEquals(IDE_UI_SCALE_PROP + " system property is ignored", 1f, JBUIScale.scale(1f)); }
test
272,524
void (Graphics g) { super.paintComponent(g); g.setColor(Color.red); final Graphics2D g2d = (Graphics2D)g; int arc1 = 4; int arc2 = 6; final Rectangle r = new Rectangle(arc1, arc1, getWidth() - arc1 - 1, getHeight() - arc1 - 1); myT.reset(r); myT.moveTo(myT.getX() - myT.deltaX(arc1), myT.getMaxY()); myT.quadTo(myT.getX(...
paintComponent
272,525
void (String[] args) { final JFrame frame = new JFrame(); frame.getContentPane().setLayout(new BorderLayout()); final JPanel content = new JPanel(new FlowLayout(FlowLayout.CENTER)); frame.getContentPane().add(content, BorderLayout.CENTER); content.add(new Painter("TOP", new ShapeTransform.Top())); content.add(new Paint...
main
272,526
void (ActionEvent e) { if (myProgressButton.getText().equals("Start")) { myProgressBar1.setIndeterminate(true); myProgressButton.setText("Stop"); } else { myProgressBar1.setIndeterminate(false); myProgressButton.setText("Start"); } }
actionPerformed
272,527
void (ActionEvent e) { myStartButton.setEnabled(false); new Thread("darcula test"){ @Override public void run() { while (myProgressBar2.getValue() < 100) { TimeoutUtil.sleep(20); myProgressBar2.setValue(myProgressBar2.getValue() + 1); } TimeoutUtil.sleep(1000); myProgressBar2.setValue(0); myStartButton.setEnabled(true)...
actionPerformed
272,528
void () { while (myProgressBar2.getValue() < 100) { TimeoutUtil.sleep(20); myProgressBar2.setValue(myProgressBar2.getValue() + 1); } TimeoutUtil.sleep(1000); myProgressBar2.setValue(0); myStartButton.setEnabled(true); }
run
272,529
void (String[] args) { try { UIManager.setLookAndFeel(new DarculaLaf()); } catch (UnsupportedLookAndFeelException ignored) {} final JFrame frame = new JFrame("Darcula Demo"); frame.setSize(900, 500); final DarculaTest form = new DarculaTest(); final JPanel root = form.myRoot; frame.setContentPane(root); frame.getRootPa...
main
272,530
void (AWTEvent event) { if (event instanceof KeyEvent && event.getID() == KeyEvent.KEY_PRESSED && ((KeyEvent)event).getKeyCode() == KeyEvent.VK_F1) { new ShowUIDefaultsAction().perform(null); } }
eventDispatched
272,531
void () { JBUIScale.DEF_SYSTEM_FONT_SIZE = 12; overrideJreHiDPIEnabled(false); for (int usrScale : new int[] {1, 2, 3}) { test(ScaleContext.Companion.of(new Scale[]{SYS_SCALE.of(1), USR_SCALE.of(usrScale)})); } overrideJreHiDPIEnabled(true); for (int sysScale : new int[] {1, 2, 3}) { for (int usrScale : new int[] {1, 2...
test
272,532
void (ScaleContext ctx) { JBUIScale.setUserScaleFactor((float)ctx.getScale(USR_SCALE)); Font font = StartupUiUtil.getLabelFont().deriveFont(JBUIScale.scale(JBUIScale.DEF_SYSTEM_FONT_SIZE)); Graphics2D g = TestScaleHelper.createGraphics(ctx.getScale(SYS_SCALE)); double actual = EffectPainter2D.maybeScaleFontMetricsThick...
test
272,533
void () { overrideJreHiDPIEnabled(false); testPainter(EffectPainter2D.LINE_UNDERSCORE); overrideJreHiDPIEnabled(true); testPainter(EffectPainter2D.LINE_UNDERSCORE); }
testLineUnderscore
272,534
void () { overrideJreHiDPIEnabled(false); testPainter(EffectPainter2D.BOLD_LINE_UNDERSCORE); overrideJreHiDPIEnabled(true); testPainter(EffectPainter2D.BOLD_LINE_UNDERSCORE); }
testBoldLineUnderscore
272,535
void () { overrideJreHiDPIEnabled(false); testPainter(EffectPainter2D.BOLD_DOTTED_UNDERSCORE); overrideJreHiDPIEnabled(true); testPainter(EffectPainter2D.BOLD_DOTTED_UNDERSCORE); }
testBoldDottedUnderscore
272,536
void () { overrideJreHiDPIEnabled(false); testPainter(EffectPainter2D.WAVE_UNDERSCORE); overrideJreHiDPIEnabled(true); testPainter(EffectPainter2D.WAVE_UNDERSCORE); }
testWaveUnderscore
272,537
void () { overrideJreHiDPIEnabled(false); testPainter(EffectPainter2D.STRIKE_THROUGH); overrideJreHiDPIEnabled(true); testPainter(EffectPainter2D.STRIKE_THROUGH); }
testStrikeThrough
272,538
void (EffectPainter2D painter) { for (int size : SIZES) testPainter(painter, 100, size); }
testPainter
272,539
void (EffectPainter2D painter, int width, int height) { if (painter == EffectPainter2D.STRIKE_THROUGH) height += 10; // default font size testPainter(painter, ImageUtil.createImage(width, height, BufferedImage.TYPE_INT_ARGB)); }
testPainter
272,540
void (EffectPainter2D painter, BufferedImage image) { String[] content = createContent(image, painter, 0); testContent(content, content.length / 2, false); for (int size : SIZES) testPartialContent(painter, image, content, size); testPartialContent(painter, image, content, content.length / 2); Assert.assertEquals("unex...
testPainter
272,541
void (EffectPainter2D painter, BufferedImage image, String[] content, int offset) { String[] partial = createContent(image, painter, offset); int length = content.length; Assert.assertEquals("content size differs", length, partial.length); for (int i = offset; i < length; i++) { Assert.assertEquals("content differs", c...
testPartialContent
272,542
String[] (BufferedImage image, EffectPainter2D painter, int offset) { return createContent(image, painter, FOREGROUND, offset); }
createContent
272,543
String[] (BufferedImage image, EffectPainter2D painter, Paint foreground, int offset) { int width = image.getWidth(); int height = image.getHeight(); double width2D = width; double height2D = height; double offset2D = offset; // prepare buffers String[] content = new String[width]; char[] chars = new char[height]; if (...
createContent
272,544
void (String[] content, int offset, Boolean expected) { Assert.assertFalse("unexpected right part (empty background)", isEmpty(content, offset)); if (expected != null) Assert.assertEquals("unexpected left part", expected, isEmpty(content, 0, offset)); }
testContent
272,545
boolean (String value) { return value.chars().allMatch(ch -> ch == ' '); }
isEmpty
272,546
boolean (String[] content) { return Arrays.stream(content).anyMatch(EffectPainterTest::isEmpty); }
hasEmpty
272,547
boolean (String[] content) { return Arrays.stream(content).allMatch(EffectPainterTest::isEmpty); }
isEmpty
272,548
boolean (String[] content, int offset) { return Arrays.stream(content, offset, content.length).allMatch(EffectPainterTest::isEmpty); }
isEmpty
272,549
boolean (String[] content, int offset, int length) { return Arrays.stream(content, offset, offset + length).allMatch(EffectPainterTest::isEmpty); }
isEmpty
272,550
void () { BufferedImage testImg = new BufferedImage(32, 32, BufferedImage.TYPE_INT_ARGB); Color testColor1 = Color.RED; Color testColor2 = Color.BLUE; { Graphics2D g = testImg.createGraphics(); g.setColor(testColor1); g.fillRect(0,0, testImg.getWidth(), testImg.getHeight()); g.setColor(testColor2); g.fillRect(testImg.g...
testPaintImage
272,551
void () { List<TreePath> list = new ArrayList<>(); Collections.addAll(list, PARENT1, CHILD11, CHILD12, PARENT2, CHILD21, CHILD22); testCollect(list, TreeCollector.TreePathLeafs.collect(list), 4); Collections.reverse(list); testCollect(list, TreeCollector.TreePathLeafs.collect(list), 4); Collections.shuffle(list); testC...
testTreePathLeafsCollect
272,552
void () { List<TreePath> list = new ArrayList<>(); Collections.addAll(list, PARENT1, CHILD11, CHILD12, PARENT2, CHILD21, CHILD22); testCollect(list, TreeCollector.TreePathRoots.collect(list), 2); Collections.reverse(list); testCollect(list, TreeCollector.TreePathRoots.collect(list), 2); Collections.shuffle(list); testC...
testTreePathRootsCollect
272,553
void () { testCollectDuplicates(TreeCollector.TreePathLeafs.collect( new TreePath("duplicated"), new TreePath("duplicated"), new TreePath("duplicated"))); }
testTreePathLeafsCollectDuplicates
272,554
void () { testCollectDuplicates(TreeCollector.TreePathRoots.collect( new TreePath("duplicated"), new TreePath("duplicated"), new TreePath("duplicated"))); }
testTreePathRootsCollectDuplicates
272,555
void (List<TreePath> list) { Assert.assertEquals(1, list.size()); }
testCollectDuplicates
272,556
void () { testCollectMutable(TreeCollector.TreePathLeafs.collect()); testCollectMutable(TreeCollector.TreePathLeafs.collect(new TreePath(new Object()))); }
testTreePathLeafsCollectMutable
272,557
void () { testCollectMutable(TreeCollector.TreePathRoots.collect()); testCollectMutable(TreeCollector.TreePathRoots.collect(new TreePath(new Object()))); }
testTreePathRootsCollectMutable
272,558
void (List<TreePath> list) { list.add(new TreePath(new Object())); Assert.assertFalse(list.isEmpty()); list.clear(); Assert.assertTrue(list.isEmpty()); }
testCollectMutable
272,559
void () { testCollectNull(TreeCollector.VirtualFileLeafs.collect((VirtualFile)null)); testCollectNull(TreeCollector.VirtualFileLeafs.collect((VirtualFile[])null)); }
testVirtualFileLeafsCollectNull
272,560
void () { testCollectNull(TreeCollector.VirtualFileRoots.collect((VirtualFile)null)); testCollectNull(TreeCollector.VirtualFileRoots.collect((VirtualFile[])null)); }
testVirtualFileRootsCollectNull
272,561
void () { testCollectNull(TreeCollector.TreePathLeafs.collect((TreePath)null)); testCollectNull(TreeCollector.TreePathLeafs.collect((TreePath[])null)); }
testTreePathLeafsCollectNull
272,562
void () { testCollectNull(TreeCollector.TreePathRoots.collect((TreePath)null)); testCollectNull(TreeCollector.TreePathRoots.collect((TreePath[])null)); }
testTreePathRootsCollectNull
272,563
void () { testCreate(TreeCollector.VirtualFileLeafs::create); }
testVirtualFileLeafsCreate
272,564
void () { testCreate(TreeCollector.VirtualFileRoots::create); }
testVirtualFileRootsCreate
272,565
void () { testCreate(TreeCollector.TreePathLeafs::create); }
testTreePathLeafsCreate
272,566
void () { testCreate(TreeCollector.TreePathRoots::create); }
testTreePathRootsCreate
272,567
void (String[] args) { testPaths(FIND_COMMON_PATH, FAST, 10, 10); testPaths(FIND_COMMON_PATH, FAST, 1, 10); testPaths(FIND_COMMON_PATH, SLOW, 1, 1); testPaths(FIND_COMMON_PATH, SLOW, 1, 2); testPaths(FIND_COMMON_PATH, SLOW, 1, 3); testPaths(FIND_COMMON_PATH, SLOW, 1, 4); testPaths(FIND_COMMON_PATH, SLOW, 1, 5); testPat...
main
272,568
void (IntFunction<Object> function, int min, int max, List<TreePath> list, TreePath path) { if (path == null) path = new TreePath(function.apply(0)); // create path to root node int count = path.getPathCount(); if (min <= count) list.add(path); if (max <= count) return; for (int i = 0; i <= count; i++) { addPaths(funct...
addPaths
272,569
void (Consumer<TreePath[]> consumer, IntFunction<Object> function, int min, int max) { List<TreePath> list = new ArrayList<>(); addPaths(function, min, max, list, null); System.err.println(); System.err.println(list.size() + " paths with count from " + min + " to " + max); System.err.println("1. ordered list:"); consum...
testPaths
272,570
void (String method, Runnable runnable) { System.err.printf("%,12d ms to %s%n", TimeoutUtil.measureExecutionTime(runnable::run), method); }
measureExecutionTime
272,571
String () { return String.valueOf(id); }
toString
272,572
int () { return id; }
hashCode
272,573
boolean (Object object) { TimeoutUtil.sleep(1); // simulate slow comparison return object instanceof Slow && ((Slow)object).id == id; }
equals
272,574
void (JTree tree, String... expected) { test(tree, true, false, expected); }
testIncrease
272,575
void (JTree tree, String... expected) { test(tree, false, true, expected); }
testDecrease
272,576
void (JTree tree, String... expected) { test(tree, true, true, expected); }
testIncreaseDecrease
272,577
void (JTree tree, boolean increase, boolean decrease, String... expected) { int length = expected.length; if (length < 2) throw new IllegalArgumentException(); if (!increase && !decrease) throw new IllegalArgumentException(); assertTree(tree, expected[0]); if (increase) { for (int i = 1; i < expected.length; i++) { pro...
test
272,578
void (int row, String expected) { test(tree -> { select(tree, row); testDecrease(tree, expected, expected); }); test(TreeSelectionModel.SINGLE_TREE_SELECTION, tree -> { select(tree, row); testDecrease(tree, expected, expected); }); }
testDecreaseDoNotClearSelection
272,579
void () { TestApplicationManager.getInstance(); }
setUp
272,580
void () { testDecreaseDoNotClearSelection(10, """ -Root -Color Red Green Blue +Digit -Letter -Greek Alpha Beta [Gamma] Delta Epsilon """); }
testDecreaseFromLeafNode
272,581
void () { testDecreaseDoNotClearSelection(5, """ -Root -Color Red Green Blue +[Digit] -Letter -Greek Alpha Beta Gamma Delta Epsilon """); }
testDecreaseFromCollapsedNode
272,582
void () { testDecreaseDoNotClearSelection(7, """ -Root -Color Red Green Blue +Digit -Letter -[Greek] Alpha Beta Gamma Delta Epsilon """); }
testDecreaseFromExpandedNode
272,583
void () { testDecreaseDoNotClearSelection(6, """ -Root -Color Red Green Blue +Digit -[Letter] -Greek Alpha Beta Gamma Delta Epsilon """); }
testDecreaseFromExpandedParentNode
272,584
void () { test(true, tree -> { select(tree, 5); testIncrease(tree, """ -Root -Color Red Green Blue +[Digit] -Letter -Greek Alpha Beta Gamma Delta Epsilon """, // 1 // 1 // 1 // select siblings of node """ -Root -[Color] [Red] [Green] [Blue] +[Digit] -[Letter] -[Greek] [Alpha] [Beta] [Gamma] [Delta] [Epsilon] """, // 2 ...
testIncreaseToVisibleRoot
272,585
void () { test(false, tree -> { select(tree, 5); testIncrease(tree, """ -Root -Color Red Green Blue +[Digit] -Letter -Greek Alpha Beta Gamma Delta Epsilon """, // 1 // 1 // 1 // select siblings of node """ -Root -[Color] [Red] [Green] [Blue] +[Digit] -[Letter] -[Greek] [Alpha] [Beta] [Gamma] [Delta] [Epsilon] """, // 2...
testIncreaseToHiddenRoot
272,586
void () { test(tree -> { select(tree, 10); testIncreaseDecrease(tree, """ -Root -Color Red Green Blue +Digit -Letter -Greek Alpha Beta [Gamma] Delta Epsilon """, // 1 // 1 // 1 // select siblings of node """ -Root -Color Red Green Blue +Digit -Letter -Greek [Alpha] [Beta] [Gamma] [Delta] [Epsilon] """, // 2 // 2 // 2 /...
testIncreaseDecreaseFromLeafNode
272,587
void () { test(tree -> { select(tree, 5); testIncreaseDecrease(tree, """ -Root -Color Red Green Blue +[Digit] -Letter -Greek Alpha Beta Gamma Delta Epsilon """, // 1 // 1 // 1 // select siblings of node """ -Root -[Color] [Red] [Green] [Blue] +[Digit] -[Letter] -[Greek] [Alpha] [Beta] [Gamma] [Delta] [Epsilon] """); })...
testIncreaseDecreaseFromCollapsedNode
272,588
void () { test(tree -> { select(tree, 7); testIncreaseDecrease(tree, """ -Root -Color Red Green Blue +Digit -Letter -[Greek] Alpha Beta Gamma Delta Epsilon """, // 1 // 1 // 1 // select children of node """ -Root -Color Red Green Blue +Digit -Letter -[Greek] [Alpha] [Beta] [Gamma] [Delta] [Epsilon] """, // 2 // 2 // 2 ...
testIncreaseDecreaseFromExpandedNode
272,589
void () { test(tree -> { select(tree, 6); testIncreaseDecrease(tree, """ -Root -Color Red Green Blue +Digit -[Letter] -Greek Alpha Beta Gamma Delta Epsilon """, // 1 // 1 // 1 // select descendants of node """ -Root -Color Red Green Blue +Digit -[Letter] -[Greek] [Alpha] [Beta] [Gamma] [Delta] [Epsilon] """, // 2 // 2 ...
testIncreaseDecreaseFromExpandedParentNode
272,590
void () { test(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION, tree -> { select(tree, 3, 10); testIncreaseDecrease(tree, """ -Root -Color Red [Green] Blue +Digit -Letter -Greek Alpha Beta [Gamma] Delta Epsilon """, // 1 // 1 // 1 // select siblings of second node """ -Root -Color Red [Green] Blue +Digit -Letter -Greek...
testIncreaseDecreaseWithoutCapture
272,591
void () { test(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION, tree -> { select(tree, 10, 3); testIncrease(tree, """ -Root -Color Red [Green] Blue +Digit -Letter -Greek Alpha Beta [Gamma] Delta Epsilon """, // 1 // 1 // 1 // select siblings of second node """ -Root -Color [Red] [Green] [Blue] +Digit -Letter -Greek Alp...
testIncreaseDecreaseWithCapture
272,592
void () { test(TreeSelectionModel.SINGLE_TREE_SELECTION, tree -> { select(tree, 10); testIncreaseDecrease(tree, """ -Root -Color Red Green Blue +Digit -Letter -Greek Alpha Beta [Gamma] Delta Epsilon """, // 1 // 1 // 1 // do nothing """ -Root -Color Red Green Blue +Digit -Letter -Greek Alpha Beta [Gamma] Delta Epsilon ...
testSingleTreeSelection
272,593
void () { @SuppressWarnings("UndesirableClassUsage") JTree tree = new JTree(new DefaultTreeModel( node("/", node("ktor", node("ktor-core"), node("ktor-features", node("jetty-http-client"), node("ktor-locations", node("src", node("asdsd.asdas.asdas", node("a"), node("b"), node("c"))), node("tests", node("fooo")), node("...
testSelectionDoesntJumpTooQuickly
272,594
TreeNode () { return node("Root", node("Color", node("Red"), node("Green"), node("Blue")), node("Digit", node("One"), node("Two"), node("Three"), node("Four"), node("Five"), node("Six"), node("Seven"), node("Eight"), node("Nine")), node("Letter", node("Greek", node("Alpha"), node("Beta"), node("Gamma"), node("Delta"), ...
root
272,595
int (JTree tree, int row) { return tree.isRootVisible() ? row : row - 1; }
normalize
272,596
void (JTree tree, int... rows) { for (int row : rows) tree.addSelectionRow(normalize(tree, row)); }
select
272,597
void (JTree tree, String expected) { String actual = new TreeTestUtil(tree).withSelection().toString(); Assert.assertEquals(expected, !tree.isRootVisible() ? "-Root\n" + actual : actual); }
assertTree
272,598
void (Consumer<? super JTree> consumer) { test(true, consumer); test(false, consumer); }
test
272,599
void (int selectionMode, Consumer<? super JTree> consumer) { test(selectionMode, true, consumer); test(selectionMode, false, consumer); }
test