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 |
/** |
/** |
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) |