public int getBaseX(int y) { return getEditorUI().getTextMargin().left + ((insets != null) ? insets.left : 0); }
private int getBaseX(int orig) { return orig + getEditorUI().getTextMargin().left; }
public int getBaseX(int y) { return getEditorUI().getTextMargin().left + ((insets != null) ? insets.left : 0); }
public int getBaseX(int y) { return getEditorUI().getTextMargin().left; }
/** Must be called with EventDispatchThread */ boolean scrollRectToVisibleFragile(Rectangle r, int scrollPolicy) { Insets margin = getTextMargin(); Rectangle bounds = getExtentBounds(); r = new Rectangle(r); // make copy of orig rect r.x -= margin.left; r.y -= margin.top; bounds.width -= margin.left + margin.right; bounds.height -= margin.top + margin.bottom; return scrollRectToVisibleImpl(r, scrollPolicy, bounds); }
/** Must be called with EventDispatchThread */ boolean scrollRectToVisibleFragile(Rectangle r, int scrollPolicy) { Insets margin = getTextMargin(); Rectangle bounds = getExtentBounds(); r = new Rectangle(r); // make copy of orig rect r.x -= margin.left; r.y -= margin.top; bounds.width -= margin.left + margin.right; bounds.height -= margin.top + margin.bottom; return scrollRectToVisibleImpl(r, scrollPolicy, bounds); }
public void actionPerformed(ActionEvent evt, JTextComponent target) { if (target != null) { EditorUI editorUI = Utilities.getEditorUI(target); Rectangle bounds = editorUI.getExtentBounds(); bounds.y += editorUI.getLineHeight(); bounds.x += editorUI.getTextMargin().left; editorUI.scrollRectToVisible(bounds, EditorUI.SCROLL_SMALLEST); } }
public void actionPerformed(ActionEvent evt, JTextComponent target) { if (target != null) { EditorUI editorUI = Utilities.getEditorUI(target); Rectangle bounds = editorUI.getExtentBounds(); bounds.y -= editorUI.getLineHeight(); bounds.x += editorUI.getTextMargin().left; editorUI.scrollRectToVisible(bounds, EditorUI.SCROLL_SMALLEST); } }
/** * Gets the maximum size for the editor component. * * @param c * the editor component * @return the size */ public Dimension getMaximumSize(JComponent c) { Insets i = c.getInsets(); Insets margin = getEditorUI().getTextMargin(); Dimension d = new Dimension(); BaseDocument doc = (c instanceof JTextComponent) ? Utilities.getDocument((JTextComponent) c) : null; if (doc != null) { doc.readLock(); } try { d.width = (int) Math.min(rootView.getMaximumSpan(View.X_AXIS) + i.left + i.right + margin.left + margin.right, MAX_SPAN); d.height = (int) Math.min(rootView.getMaximumSpan(View.Y_AXIS) + i.top + i.bottom + margin.top + margin.bottom, MAX_SPAN); } finally { if (doc != null) { doc.readUnlock(); } } return d; }
/** * Gets the minimum size for the editor component. * * @param c * the editor component * @return the size */ public Dimension getMinimumSize(JComponent c) { Insets i = c.getInsets(); Insets margin = getEditorUI().getTextMargin(); Dimension d = new Dimension(); BaseDocument doc = (c instanceof JTextComponent) ? Utilities.getDocument((JTextComponent) c) : null; if (doc != null) { doc.readLock(); } try { d.width = (int) rootView.getMinimumSpan(View.X_AXIS) + i.left + i.right + margin.left + margin.right; d.height = (int) rootView.getMinimumSpan(View.Y_AXIS) + i.top + i.bottom + margin.top + margin.bottom; } finally { if (doc != null) { doc.readUnlock(); } } return d; }
Insets margin = getEditorUI().getTextMargin(); Dimension d = c.getSize(); BaseDocument doc = (c instanceof JTextComponent) ? Utilities.getDocument((JTextComponent) c) : null;
private void graphicsSpecificUpdates(DrawInfo ctx) { Rectangle bounds = ctx.editorUI.getExtentBounds(); Rectangle clip = ctx.graphics.getClipBounds(); Insets textMargin = ctx.editorUI.getTextMargin(); int leftMarginWidth = textMargin.left - ctx.editorUI.lineNumberWidth - ctx.editorUI.textLeftMarginWidth;
private void graphicsSpecificUpdates(DrawInfo ctx) { Rectangle bounds = ctx.editorUI.getExtentBounds(); Rectangle clip = ctx.graphics.getClipBounds(); Insets textMargin = ctx.editorUI.getTextMargin(); int leftMarginWidth = textMargin.left - ctx.editorUI.lineNumberWidth - ctx.editorUI.textLeftMarginWidth;
public void init(DrawContext ctx) { JTextComponent c = ctx.getEditorUI().getComponent(); // initialize reference to annotations annos = ctx.getEditorUI().getDocument().getAnnotations(); drawTextLimitLine = ctx.getEditorUI().textLimitLineVisible; textLimitWidth = ctx.getEditorUI().textLimitWidth; defaultSpaceWidth = ctx.getEditorUI().defaultSpaceWidth; textLimitLineColor = ctx.getEditorUI().textLimitLineColor; absoluteX = ctx.getEditorUI().getTextMargin().left; maxWidth = ctx.getEditorUI().getExtentBounds().width; }
int shift = startOffsetClip.x - getEditorUI().getTextMargin().left - allocReadOnly.x; g.translate(-shift,0);