/** * Returns the color to use for the line underneath a folded region line. * * @param textArea The text area. * @return The color to use. */ public static Color getFoldedLineBottomColor(RSyntaxTextArea textArea) { Color color = Color.gray; Gutter gutter = RSyntaxUtilities.getGutter(textArea); if (gutter!=null) { color = gutter.getFoldIndicatorForeground(); } return color; }
@Test public void testSetFoldIndicatorForeground() { RTextArea textArea = new RTextArea(PLAIN_TEXT); Gutter gutter = new Gutter(textArea); Color color = Color.red; gutter.setFoldIndicatorForeground(color); Assert.assertEquals(color, gutter.getFoldIndicatorForeground()); color = Color.green; gutter.setFoldIndicatorForeground(color); Assert.assertEquals(color, gutter.getFoldIndicatorForeground()); // Sets to default - not a public value, but also not Color.green. gutter.setFoldIndicatorForeground(null); Assert.assertNotNull(gutter.getFoldIndicatorForeground()); Assert.assertNotEquals(color, gutter.getFoldIndicatorForeground()); }
@Test public void testGetFoldIndicatorForeground() { RTextArea textArea = new RTextArea(PLAIN_TEXT); Gutter gutter = new Gutter(textArea); Color color = Color.red; gutter.setFoldIndicatorForeground(color); Assert.assertEquals(color, gutter.getFoldIndicatorForeground()); color = Color.green; gutter.setFoldIndicatorForeground(color); Assert.assertEquals(color, gutter.getFoldIndicatorForeground()); }
/** * Returns the color to use for the line underneath a folded region line. * * @param textArea The text area. * @return The color to use. */ public static Color getFoldedLineBottomColor(RSyntaxTextArea textArea) { Color color = Color.gray; Gutter gutter = RSyntaxUtilities.getGutter(textArea); if (gutter!=null) { color = gutter.getFoldIndicatorForeground(); } return color; }
lineNumberFont = gutter.getLineNumberFont().getFamily(); lineNumberFontSize = gutter.getLineNumberFont().getSize(); foldIndicatorFG = gutter.getFoldIndicatorForeground(); foldBG = gutter.getFoldBackground(); armedFoldBG = gutter.getArmedFoldBackground();
Assert.assertEquals(Color.red, gutter.getFoldIndicatorForeground()); Assert.assertEquals(Color.red, gutter.getFoldBackground()); Assert.assertEquals(Color.red, gutter.getArmedFoldBackground());
Assert.assertEquals(gutter1.getLineNumberColor(), gutter2.getLineNumberColor()); Assert.assertEquals(gutter1.getLineNumberFont(), gutter2.getLineNumberFont()); Assert.assertEquals(gutter1.getFoldIndicatorForeground(), gutter2.getFoldIndicatorForeground()); Assert.assertEquals(gutter1.getFoldBackground(), gutter2.getFoldBackground());
Assert.assertNotEquals(gutter1.getLineNumberColor(), gutter2.getLineNumberColor()); Assert.assertNotEquals(gutter1.getLineNumberFont(), gutter2.getLineNumberFont()); Assert.assertNotEquals(gutter1.getFoldIndicatorForeground(), gutter2.getFoldIndicatorForeground()); Assert.assertNotEquals(gutter1.getFoldBackground(), gutter2.getFoldBackground());
lineNumberFont = gutter.getLineNumberFont().getFamily(); lineNumberFontSize = gutter.getLineNumberFont().getSize(); foldIndicatorFG = gutter.getFoldIndicatorForeground(); foldBG = gutter.getFoldBackground(); armedFoldBG = gutter.getArmedFoldBackground();