public TextBasedSoftWrapPainter(Map<SoftWrapDrawingType, Character> symbols, Editor editor, TextDrawingCallback drawingCallback, ColorProvider colorHolder) throws IllegalArgumentException { if (symbols.size() != SoftWrapDrawingType.values().length) { throw new IllegalArgumentException( String.format("Can't create text-based soft wrap painter. Reason: given 'drawing type -> symbol' mappings " + "are incomplete - expected size %d but got %d (%s)", SoftWrapDrawingType.values().length, symbols.size(), symbols) ); } myEditor = editor; myDrawingCallback = drawingCallback; myColorHolder = colorHolder; for (Map.Entry<SoftWrapDrawingType, Character> entry : symbols.entrySet()) { mySymbols.put(entry.getKey(), new char[]{entry.getValue()}); } reinit(); }
private void initDelegateIfNecessary() { if (myDelegate != null && myDelegate.canUse()) { return; } if (++mySymbolsDrawingIndex < SYMBOLS.size()) { TextDrawingCallback callback = myEditor.getTextDrawingCallback(); ColorProvider colorHolder = ColorProvider.byColorScheme(myEditor, EditorColors.SOFT_WRAP_SIGN_COLOR); myDelegate = new TextBasedSoftWrapPainter(SYMBOLS.get(mySymbolsDrawingIndex), myEditor, callback, colorHolder); initDelegateIfNecessary(); return; } myDelegate = new ArrowSoftWrapPainter(myEditor); }
public TextBasedSoftWrapPainter(Map<SoftWrapDrawingType, Character> symbols, Editor editor, TextDrawingCallback drawingCallback, ColorProvider colorHolder) throws IllegalArgumentException { if (symbols.size() != SoftWrapDrawingType.values().length) { throw new IllegalArgumentException( String.format("Can't create text-based soft wrap painter. Reason: given 'drawing type -> symbol' mappings " + "are incomplete - expected size %d but got %d (%s)", SoftWrapDrawingType.values().length, symbols.size(), symbols) ); } myDrawingCallback = drawingCallback; myColorHolder = colorHolder; myCanUse = init(symbols, editor); }
public ArrowSoftWrapPainter(Editor editor) { myEditor = editor; myArrowPainter = new ArrowPainter(ColorProvider.byColor(myEditor.getColorsScheme().getDefaultForeground()), new WidthProvider(), myHeightProvider); }
public ArrowSoftWrapPainter(Editor editor) { myEditor = editor; myArrowPainter = new ArrowPainter(ColorProvider.byColor(myEditor.getColorsScheme().getDefaultForeground()), myHeightProvider); }