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

MarkBlockChain (Editor Library) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor.lib/1 1.14.0 3

org.netbeans.editor
Class MarkBlockChain

java.lang.Object
  extended by org.netbeans.editor.MarkBlockChain
Direct Known Subclasses:
MarkBlockChain.LayerChain

public class MarkBlockChain
extends Object

Support class for chain of MarkBlocks


Nested Class Summary
static class MarkBlockChain.LayerChain
           
 
Field Summary
protected  MarkBlock chain
          Chain of all blocks
protected  MarkBlock currentBlock
          Current block to make checks faster
protected  BaseDocument doc
          Document for this block
 
Constructor Summary
MarkBlockChain(BaseDocument doc)
          Construct chain using regular base marks
 
Method Summary
 void addBlock(int startPos, int endPos, boolean concat)
          Add non-empty block to the chain of blocks
 int adjustToBlockEnd(int pos)
           
 int adjustToNextBlockStart(int pos)
          Return the position adjusted to the start of the next mark-block.
protected  MarkBlock checkedRemove(MarkBlock blk)
          Removes mark block and possibly updates the chain.
 int compareBlock(int startPos, int endPos)
          Tests whether the position range is partly or fully inside some mark block from the chain.
protected  MarkBlock createBlock(int startPos, int endPos)
           
protected  Mark createBlockEndMark()
           
protected  Mark createBlockStartMark()
           
 MarkBlock getChain()
           
 void removeBlock(int startPos, int endPos)
          Remove non-empty block from area covered by blocks from chain
 void removeEmptyBlocks()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

chain

protected MarkBlock chain
Chain of all blocks


currentBlock

protected MarkBlock currentBlock
Current block to make checks faster


doc

protected BaseDocument doc
Document for this block

Constructor Detail

MarkBlockChain

public MarkBlockChain(BaseDocument doc)
Construct chain using regular base marks

Method Detail

getChain

public final MarkBlock getChain()

compareBlock

public int compareBlock(int startPos,
                        int endPos)
Tests whether the position range is partly or fully inside some mark block from the chain.

Parameters:
startPos - starting position of tested area
endPos - ending position of tested area for removal or same as startPos when insert is made
Returns:
relation of currentBlock to the given block

removeEmptyBlocks

public void removeEmptyBlocks()

createBlock

protected MarkBlock createBlock(int startPos,
                                int endPos)
                         throws BadLocationException
Throws:
BadLocationException

createBlockStartMark

protected Mark createBlockStartMark()

createBlockEndMark

protected Mark createBlockEndMark()

addBlock

public void addBlock(int startPos,
                     int endPos,
                     boolean concat)
Add non-empty block to the chain of blocks

Parameters:
concat - whether concatenate adjacent blocks

removeBlock

public void removeBlock(int startPos,
                        int endPos)
Remove non-empty block from area covered by blocks from chain


checkedRemove

protected MarkBlock checkedRemove(MarkBlock blk)
Removes mark block and possibly updates the chain.

Returns:
next block after removed one

adjustToBlockEnd

public int adjustToBlockEnd(int pos)

adjustToNextBlockStart

public int adjustToNextBlockStart(int pos)
Return the position adjusted to the start of the next mark-block.


toString

public String toString()
Overrides:
toString in class Object

org.netbeans.modules.editor.lib/1 1.14.0 3

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