站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

MutablePositionRegion (Editor Utilities) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.util/1 1.17

org.netbeans.lib.editor.util.swing
Class MutablePositionRegion

java.lang.Object
  extended by org.netbeans.lib.editor.util.swing.PositionRegion
      extended by org.netbeans.lib.editor.util.swing.MutablePositionRegion

public class MutablePositionRegion
extends PositionRegion

A pair of positions delimiting a text region in a swing document.
At all times it should be satisfied that PositionRegion.getStartOffset() <= PositionRegion.getEndOffset().

Since:
1.6

Constructor Summary
MutablePositionRegion(Document doc, int startOffset, int endOffset)
          Construct new mutable position region based on the knowledge of the document and starting and ending offset.
MutablePositionRegion(Position startPosition, Position endPosition)
          Construct new mutable position region.
 
Method Summary
 void reset(Position startPosition, Position endPosition)
          Set a new start and end positions of this region.
 void setEndPosition(Position endPosition)
          Set a new end position of this region.
 void setStartPosition(Position startPosition)
          Set a new start position of this region.
 
Methods inherited from class org.netbeans.lib.editor.util.swing.PositionRegion
createFixedPosition, getComparator, getEndOffset, getEndPosition, getLength, getStartOffset, getStartPosition, isRegionsSorted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutablePositionRegion

public MutablePositionRegion(Position startPosition,
                             Position endPosition)
Construct new mutable position region.

Parameters:
startPosition - non-null start position of the region <= end position.
endPosition - non-null end position of the region >= start position.

MutablePositionRegion

public MutablePositionRegion(Document doc,
                             int startOffset,
                             int endOffset)
                      throws BadLocationException
Construct new mutable position region based on the knowledge of the document and starting and ending offset.

Throws:
BadLocationException
Method Detail

reset

public final void reset(Position startPosition,
                        Position endPosition)
Set a new start and end positions of this region.
They should satisfy PositionRegion.getStartOffset() <= PositionRegion.getEndOffset().

Parameters:
startPosition - non-null new start position of this region.
Since:
1.10

setStartPosition

public final void setStartPosition(Position startPosition)
Set a new start position of this region.
It should satisfy PositionRegion.getStartOffset() <= PositionRegion.getEndOffset().

Parameters:
startPosition - non-null new start position of this region.

setEndPosition

public final void setEndPosition(Position endPosition)
Set a new end position of this region.
It should satisfy PositionRegion.getStartOffset() <= PositionRegion.getEndOffset().

Parameters:
endPosition - non-null new start position of this region.

org.netbeans.modules.editor.util/1 1.17

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.