Shape s = view.modelToView(p0, viewBounds, Position.Bias.Forward); Rectangle r = s.getBounds(); Shape shape = view.modelToView(p0, Position.Bias.Forward, p1, Position.Bias.Backward, viewBounds); Rectangle r = shape instanceof Rectangle ? (Rectangle) shape :
Shape s = view.modelToView(offs0, bounds, Position.Bias.Forward); Rectangle r = s.getBounds(); Shape shape = view.modelToView(offs0, Position.Bias.Forward, offs1,Position.Bias.Backward, bounds);
Shape shape = view.modelToView(offs0, Position.Bias.Forward, offs1,Position.Bias.Backward, bounds);
Shape retShape = v.modelToView(pos, childShape, b); if(retShape == null && v.getEndOffset() == pos) { if(++vIndex < getViewCount()) { v = getView(vIndex); retShape = v.modelToView(pos, getChildAllocation(vIndex, a), b);
@Override public Shape modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a) throws BadLocationException { return view.modelToView(p0, b0, p1, b1, a); }
/** * Provides a mapping from the document model coordinate space * to the coordinate space of the view mapped to it. * * @param pos the position to convert * @param a the allocated region to render into * @return the bounding box of the given position */ @Override public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException { return view.modelToView(pos, a, b); }
/** * Provides a mapping from the document model coordinate space * to the coordinate space of the view mapped to it. * * @param pos the position to convert * @param a the allocated region to render into * @return the bounding box of the given position */ @Override public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException { return view.modelToView(pos, a, b); }
/** * Provides a mapping from the document model coordinate space * to the coordinate space of the view mapped to it. * * @param pos the position to convert * @param a the allocated region to render into * @return the bounding box of the given position */ @Override public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException { return view.modelToView(pos, a, b); }
/** * Provides a mapping from the document model coordinate space * to the coordinate space of the view mapped to it. * * @param pos the position to convert * @param a the allocated region to render into * @return the bounding box of the given position */ @Override public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException { return view.modelToView(pos, a, b); }
/** * Provides a mapping from the document model coordinate space * to the coordinate space of the view mapped to it. * * @param pos the position to convert * @param a the allocated region to render into * @return the bounding box of the given position */ @Override public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException { return view.modelToView(pos, a, b); }
@Override public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException { return view.modelToView(pos, a, b); }
/** * Provides a mapping from the document model coordinate space * to the coordinate space of the view mapped to it. * * @param pos the position to convert * @param a the allocated region to render into * @return the bounding box of the given position */ public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException { if (view != null) { return view.modelToView(pos, a, b); } return null; }
/** * Provides a mapping from the document model coordinate space * to the coordinate space of the view mapped to it. * * @param p0 the position to convert >= 0 * @param b0 the bias toward the previous character or the * next character represented by p0, in case the * position is a boundary of two views. * @param p1 the position to convert >= 0 * @param b1 the bias toward the previous character or the * next character represented by p1, in case the * position is a boundary of two views. * @param a the allocated region to render into * @return the bounding box of the given position is returned * @exception BadLocationException if the given position does * not represent a valid location in the associated document * @exception IllegalArgumentException for an invalid bias argument * @see View#viewToModel */ @Override public Shape modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a) throws BadLocationException { return view.modelToView(p0, b0, p1, b1, a); }
/** * Provides a mapping from the document model coordinate space * to the coordinate space of the view mapped to it. * * @param p0 the position to convert >= 0 * @param b0 the bias toward the previous character or the * next character represented by p0, in case the * position is a boundary of two views. * @param p1 the position to convert >= 0 * @param b1 the bias toward the previous character or the * next character represented by p1, in case the * position is a boundary of two views. * @param a the allocated region to render into * @return the bounding box of the given position is returned * @exception BadLocationException if the given position does * not represent a valid location in the associated document * @exception IllegalArgumentException for an invalid bias argument * @see View#viewToModel */ @Override public Shape modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a) throws BadLocationException { return view.modelToView(p0, b0, p1, b1, a); }
/** * Provides a mapping from the document model coordinate space * to the coordinate space of the view mapped to it. * * @param p0 the position to convert >= 0 * @param b0 the bias toward the previous character or the * next character represented by p0, in case the * position is a boundary of two views. * @param p1 the position to convert >= 0 * @param b1 the bias toward the previous character or the * next character represented by p1, in case the * position is a boundary of two views. * @param a the allocated region to render into * @return the bounding box of the given position is returned * @exception BadLocationException if the given position does * not represent a valid location in the associated document * @exception IllegalArgumentException for an invalid bias argument * @see View#viewToModel */ @Override public Shape modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a) throws BadLocationException { return view.modelToView(p0, b0, p1, b1, a); }
/** * Provides a mapping from the document model coordinate space * to the coordinate space of the view mapped to it. * * @param p0 the position to convert >= 0 * @param b0 the bias toward the previous character or the * next character represented by p0, in case the * position is a boundary of two views. * @param p1 the position to convert >= 0 * @param b1 the bias toward the previous character or the * next character represented by p1, in case the * position is a boundary of two views. * @param a the allocated region to render into * @return the bounding box of the given position is returned * @exception BadLocationException if the given position does * not represent a valid location in the associated document * @exception IllegalArgumentException for an invalid bias argument * @see View#viewToModel */ @Override public Shape modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a) throws BadLocationException { return view.modelToView(p0, b0, p1, b1, a); }
@Override public Shape paintLayer( Graphics g, int p0, int p1, Shape shape, JTextComponent c, View view ) { if( shape == null ) { return null; } Shape result = null; try { result = view.modelToView( Math.min( p0, p1 ), javax.swing.text.Position.Bias.Forward, Math.max( p0, p1 ), javax.swing.text.Position.Bias.Backward, shape ); Rectangle bounds = result.getBounds(); drawWavyLine( g, bounds.x, bounds.y + bounds.height - 2, bounds.x + bounds.width - 1 ); } catch( final BadLocationException e ) { // ignore it } return result; }
public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException { lock(); try { if (view != null) { return view.modelToView(pos, a, b); } return null; } finally { unlock(); } }
public Shape modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a) throws BadLocationException { lock(); try { if (view != null) { return view.modelToView(p0, b0, p1, b1, a); } return null; } finally { unlock(); } }
public Shape paintLayer(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c, View view) { Rectangle rect = null; if (offs0 == view.getStartOffset() && offs1 == view.getEndOffset()) { if (bounds instanceof Rectangle) { rect = (Rectangle) bounds; } else { rect = bounds.getBounds(); } } else { try { Shape shape = view.modelToView(offs0, Position.Bias.Forward, offs1, Position.Bias.Backward, bounds); rect = (shape instanceof Rectangle) ? (Rectangle) shape : shape.getBounds(); } catch (BadLocationException ex) { Log.log(ex); return null; } } paint(g, rect, c); return rect; }