/[classpath]/classpath/javax/swing/text/DefaultCaret.java
ViewVC logotype

Diff of /classpath/javax/swing/text/DefaultCaret.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23 by audriusa, Tue Nov 8 23:42:56 2005 UTC revision 1.24 by langel, Thu Nov 17 20:45:14 2005 UTC
# Line 781  public class DefaultCaret extends Rectan Line 781  public class DefaultCaret extends Rectan
781     */     */
782    public void moveDot(int dot)    public void moveDot(int dot)
783    {    {
784      this.dot = dot;      if (dot >= 0)
785      handleHighlight();        {
786      adjustVisibility(this);          this.dot = dot;
787      appear();          handleHighlight();
788            adjustVisibility(this);
789            appear();
790          }
791    }    }
792    
793    /**    /**
794     * Sets the current position of this <code>Caret</code> within the     * Sets the current position of this <code>Caret</code> within the
795     * <code>Document</code>. This also sets the <code>mark</code> to the     * <code>Document</code>. This also sets the <code>mark</code> to the new
796     * new location.     * location.
797     *     *
798     * @param dot the new position to be set     * @param dot
799     *     *          the new position to be set
800     * @see #moveDot(int)     * @see #moveDot(int)
801     */     */
802    public void setDot(int dot)    public void setDot(int dot)
803    {    {
804      this.dot = dot;      if (dot >= 0)
805      this.mark = dot;        {
806      handleHighlight();          this.mark = dot;
807      adjustVisibility(this);          this.dot = dot;
808      appear();          handleHighlight();
809            adjustVisibility(this);
810            appear();
811          }
812    }    }
813        
814    /**    /**
# Line 878  public class DefaultCaret extends Rectan Line 884  public class DefaultCaret extends Rectan
884            }            }
885          Rectangle area = null;          Rectangle area = null;
886          try          try
887            {            {            
888              area = getComponent().modelToView(getDot());              area = getComponent().modelToView(getDot());
889            }            }
890          catch (BadLocationException ex)          catch (BadLocationException ex)

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26