public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { boolean active = false; if (enabled) { if (ctx.getFragmentOffset() == pos) { active = true; setNextActivityChangeOffset(pos + len); } } return active; }
public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { boolean active; if (mark != null) { active = mark.activateLayer; } else { active = doc.isPosGuarded(ctx.getFragmentOffset()); } return active; }
public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { boolean active = false; if (enabled) { if (ctx.getFragmentOffset() == pos) { active = true; setNextActivityChangeOffset(pos + len); } } return active; }
public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { boolean active; if (mark != null) { active = mark.activateLayer; } else { active = doc.isPosGuarded(ctx.getFragmentOffset()); } return active; }
public void updateContext(DrawContext ctx) { int pos = ctx.getFragmentOffset(); if (pos >= blocks[curInd] && pos < blocks[curInd + 1]) { if (coloring == null) { coloring = ctx.getEditorUI().getColoring(SettingsNames.HIGHLIGHT_SEARCH_COLORING); } if (coloring != null) { coloring.apply(ctx); } } }
public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { boolean active; if (mark != null) { active = mark.activateLayer; } else { JTextComponent c = ctx.getEditorUI().getComponent(); active = (c != null) && c.getCaret().isSelectionVisible() && ctx.getFragmentOffset() >= c.getSelectionStart() && ctx.getFragmentOffset() < c.getSelectionEnd(); } return active; }
public void updateContext(DrawContext ctx) { int pos = ctx.getFragmentOffset(); if (pos >= blocks[curInd] && pos < blocks[curInd + 1]) { if (coloring == null) { coloring = ctx.getEditorUI().getColoring(SettingsNames.HIGHLIGHT_SEARCH_COLORING); } if (coloring != null) { coloring.apply(ctx); } } }
public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { boolean active; if (mark != null) { active = mark.activateLayer; } else { JTextComponent c = ctx.getEditorUI().getComponent(); active = (c != null) && c.getCaret().isSelectionVisible() && ctx.getFragmentOffset() >= c.getSelectionStart() && ctx.getFragmentOffset() < c.getSelectionEnd(); } return active; }
public void updateContext(DrawContext ctx) { if (coloring != null) { coloring.apply(ctx); } int fragEndOffset = ctx.getFragmentOffset() + ctx.getFragmentLength(); while (active && fragEndOffset >= tokenEndOffset) { if (!moveNext || tokenSequence.moveNext()) { updateTokenEndOffsetAndColoring(-1); } else { if (pastSequences.isEmpty()) { active = false; } else { tokenSequence = pastSequences.pop(); if ((tokenSequence.offset() + tokenSequence.token().length()) > tokenEndOffset) { //highlight the rest of the popped token: goToEmbed = false; moveNext = false; } } } } }
public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { boolean active; if (enabled) { int pos = ctx.getFragmentOffset(); if (pos == blocks[curInd]) { active = true; setNextActivityChangeOffset(blocks[curInd + 1]); } else if (pos == blocks[curInd + 1]) { active = false; curInd += 2; setNextActivityChangeOffset(blocks[curInd]); if (pos == blocks[curInd]) { // just follows setNextActivityChangeOffset(blocks[curInd + 1]); active = true; } } else { setNextActivityChangeOffset(blocks[curInd]); active = false; } } else { active = false; } return active; }
public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { boolean active; if (enabled) { int pos = ctx.getFragmentOffset(); if (pos == blocks[curInd]) { active = true; setNextActivityChangeOffset(blocks[curInd + 1]); } else if (pos == blocks[curInd + 1]) { active = false; curInd += 2; setNextActivityChangeOffset(blocks[curInd]); if (pos == blocks[curInd]) { // just follows setNextActivityChangeOffset(blocks[curInd + 1]); active = true; } } else { setNextActivityChangeOffset(blocks[curInd]); active = false; } } else { active = false; } return active; }
public boolean targetOffsetReached(int offset, char ch, int x, int charWidth, DrawContext ctx) { JTextComponent c = BaseCaret.this.component; if (c != null) { BaseCaret.this.beforeCaretFont = (offset == ctx.getFragmentOffset()) ? previousFont : ctx.getFont(); BaseCaret.this.afterCaretFont = ctx.getFont(); BaseCaret.this.x = x; BaseCaret.this.y = this.getY(); BaseCaret.this.width = charWidth; BaseCaret.this.height = Utilities.getEditorUI(c).getLineHeight(); BaseCaret.this.textForeColor = ctx.getForeColor(); BaseCaret.this.textBackColor = ctx.getBackColor(); BaseCaret.this.dotChar[0] = ch; } return false; }
public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { boolean active; if (mark != null) { active = (ctx.getEditorUI().getComponent() != null) && mark.activateLayer; if (active) { try { BaseDocument doc = ctx.getEditorUI().getDocument(); int nextRowStartPos = Utilities.getRowStart(doc, ctx.getFragmentOffset(), 1); if (nextRowStartPos < 0) { // end of doc nextRowStartPos = Integer.MAX_VALUE; } setNextActivityChangeOffset(nextRowStartPos); } catch (BadLocationException e) { active = false; } } } else { active = false; } return active; }
public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { boolean active; if (mark != null) { active = (ctx.getEditorUI().getComponent() != null) && mark.activateLayer; if (active) { try { BaseDocument doc = ctx.getEditorUI().getDocument(); int nextRowStartPos = Utilities.getRowStart( doc, ctx.getFragmentOffset(), 1); if (nextRowStartPos < 0) { // end of doc nextRowStartPos = Integer.MAX_VALUE; } setNextActivityChangeOffset(nextRowStartPos); } catch (BadLocationException e) { active = false; } } } else { active = false; } return active; }
public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { boolean active = false; if (mark != null) { active = (ctx.getEditorUI().getComponent() != null) && mark.activateLayer; if (active) { try { BaseDocument doc = ctx.getEditorUI().getDocument(); int nextRowStartPos = Utilities.getRowStart(doc, ctx.getFragmentOffset(), 1); if (nextRowStartPos < 0) { // end of doc nextRowStartPos = Integer.MAX_VALUE; } setNextActivityChangeOffset(nextRowStartPos); } catch (BadLocationException e) { active = false; } } } return active; }
public boolean isActive(DrawContext ctx, MarkFactory.DrawMark mark) { boolean active = false; if (mark != null) { active = (ctx.getEditorUI().getComponent() != null) && mark.activateLayer; if (active) { try { BaseDocument doc = ctx.getEditorUI().getDocument(); int nextRowStartPos = Utilities.getRowStart( doc, ctx.getFragmentOffset(), 1); if (nextRowStartPos < 0) { // end of doc nextRowStartPos = Integer.MAX_VALUE; } setNextActivityChangeOffset(nextRowStartPos); } catch (BadLocationException e) { active = false; } } } return active; }
if (activeAnno == null) return false; if (ctx.getFragmentOffset() >= activeAnno.getOffset()) if (ctx.getFragmentOffset() < activeAnno.getOffset()+activeAnno.getLength() || activeAnno.isWholeLine()) { coloring = activeAnno.getColoring(); return true; nextLineStart = Utilities.getRowStart(doc, ctx.getFragmentOffset(), 1); } catch (BadLocationException e) { return false; nextActivityOffset = ctx.getFragmentOffset() + anno.getLength(); if (nextActivityOffset > nextLineStart) nextActivityOffset = nextLineStart;
nextLineStart = Utilities.getRowStart(doc, ctx.getFragmentOffset(), 1); } catch (BadLocationException e) { return false; nextActivityOffset = ctx.getFragmentOffset() + anno.getLength(); if (nextActivityOffset > nextLineStart) nextActivityOffset = nextLineStart;