net.sf.colorer.impl
Class BaseEditorNative

java.lang.Object
  |
  +--net.sf.colorer.impl.BaseEditorNative
All Implemented Interfaces:
BaseEditor

public class BaseEditorNative
extends java.lang.Object
implements BaseEditor


Constructor Summary
BaseEditorNative(ParserFactory pf, LineSource lineSource)
           
 
Method Summary
 void addRegionHandler(long iptr, RegionHandler rh, Region filter)
           
 void addRegionHandler(RegionHandler rh, Region filter)
          Adds specified RegionHandler object into the parse process.
 java.lang.String chooseFileType(long iptr, java.lang.String fname)
           
 java.lang.String chooseFileType(java.lang.String fname)
          Chooses filetype according to the filename and first line of text
protected  void finalize()
           
 RegionDefine getBackground()
          Current Background Region (def:Text)
 RegionDefine getBackground(long iptr)
           
 java.lang.String getFileType()
          Returns Currently selected file type
 java.lang.String getFileType(long iptr)
           
 RegionDefine getHorzCross()
          Current Horizontal Rule (def:HorzCross)
 RegionDefine getHorzCross(long iptr)
           
 LineRegion[] getLineRegions(int lno)
          Return parsed and colored LineRegions of requested line.
 LineRegion[] getLineRegions(long iptr, int lno)
           
 PairMatch getPairMatch(int lineNo, int linePos)
          Searches and creates pair match object.
 RegionDefine getVertCross()
          Current Vertical Rule (def:VertCross)
 RegionDefine getVertCross(long iptr)
           
 void idleJob(int time)
          Tries to do some parsing job while user is doing nothing.
 void idleJob(long iptr, int time)
           
 void lineCountEvent(int newLineCount)
          Informs about total lines count change.
 void lineCountEvent(long iptr, int newLineCount)
           
 void modifyEvent(int topLine)
          Informs BaseEditor object about text modification event.
 void modifyEvent(long iptr, int topLine)
           
 void modifyLineEvent(int line)
          Informs about single line modification event.
 void modifyLineEvent(long iptr, int line)
           
 void removeRegionHandler(long iptr, RegionHandler rh)
           
 void removeRegionHandler(RegionHandler rh)
          Removes previously added region handler.
 void searchGlobalPair(PairMatch pm)
          Searches pair match in all available text, possibly, making additional processing.
 void searchLocalPair(PairMatch pm)
          Searches pair match in currently visible text.
 void setBackParse(int backParse)
          Specifies number of lines, for which parser would be able to run continual processing without highlight invalidation.
 void setBackParse(long iptr, int backParse)
           
 void setFileType(long iptr, java.lang.String typename)
           
 void setFileType(java.lang.String typename)
          Changes used file type
 void setRegionCompact(boolean compact)
          LineRegionsSupport object preferences.
 void setRegionCompact(long iptr, boolean compact)
           
 void setRegionMapper(long iptr, java.lang.String cls, java.lang.String name)
           
 void setRegionMapper(java.lang.String cls, java.lang.String name)
          Installs specified RegionMapper.
 void validate(int lno)
          Validates current state of the editor and runs parser, if needed.
 void validate(long iptr, int lno)
           
 void visibleTextEvent(int wStart, int wSize)
          Informs about changes in visible range of text lines.
 void visibleTextEvent(long iptr, int wStart, int wSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseEditorNative

public BaseEditorNative(ParserFactory pf,
                        LineSource lineSource)
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
java.lang.Throwable

setRegionCompact

public void setRegionCompact(boolean compact)
Description copied from interface: BaseEditor
LineRegionsSupport object preferences. Installs specified RegionStore (basically HRDRegionStore), which maps HRC Regions into color data, sets default size (in lines) of Regions structure cache.

Specified by:
setRegionCompact in interface BaseEditor
Parameters:
compact - Creates LineRegionsSupport (false) or LineRegionsCompactSupport (true) object to store lists of RegionDefine's

setFileType

public void setFileType(java.lang.String typename)
Description copied from interface: BaseEditor
Changes used file type

Specified by:
setFileType in interface BaseEditor

chooseFileType

public java.lang.String chooseFileType(java.lang.String fname)
Description copied from interface: BaseEditor
Chooses filetype according to the filename and first line of text

Specified by:
chooseFileType in interface BaseEditor

getFileType

public java.lang.String getFileType()
Description copied from interface: BaseEditor
Returns Currently selected file type

Specified by:
getFileType in interface BaseEditor

setRegionMapper

public void setRegionMapper(java.lang.String cls,
                            java.lang.String name)
Description copied from interface: BaseEditor
Installs specified RegionMapper.

Specified by:
setRegionMapper in interface BaseEditor

addRegionHandler

public void addRegionHandler(RegionHandler rh,
                             Region filter)
Description copied from interface: BaseEditor
Adds specified RegionHandler object into the parse process.

Specified by:
addRegionHandler in interface BaseEditor
Parameters:
filter - If not null, handler would be activated only if passed regions have specified filter parent. This allows to optimize performance and disable unnecesary JNI context switches.

removeRegionHandler

public void removeRegionHandler(RegionHandler rh)
Description copied from interface: BaseEditor
Removes previously added region handler.

Specified by:
removeRegionHandler in interface BaseEditor

getBackground

public RegionDefine getBackground()
Description copied from interface: BaseEditor
Current Background Region (def:Text)

Specified by:
getBackground in interface BaseEditor

getVertCross

public RegionDefine getVertCross()
Description copied from interface: BaseEditor
Current Vertical Rule (def:VertCross)

Specified by:
getVertCross in interface BaseEditor

getHorzCross

public RegionDefine getHorzCross()
Description copied from interface: BaseEditor
Current Horizontal Rule (def:HorzCross)

Specified by:
getHorzCross in interface BaseEditor

setBackParse

public void setBackParse(int backParse)
Description copied from interface: BaseEditor
Specifies number of lines, for which parser would be able to run continual processing without highlight invalidation.

Specified by:
setBackParse in interface BaseEditor
Parameters:
backParse - Number of lines. If <= 0, dropped into default value.

getPairMatch

public PairMatch getPairMatch(int lineNo,
                              int linePos)
Description copied from interface: BaseEditor
Searches and creates pair match object. Returned object can be used later in the pair search methods. This object is valid only until reparse of it's line occured. After that event information about line region's references in it becomes invalid and, if used, can produce faults.

Specified by:
getPairMatch in interface BaseEditor
Parameters:
lineNo - Line number, where to search paired region.
linePos - Position in line, where paired region to be searched. Paired Region is found, if it includes specified position or ends directly at one char before line position.

searchLocalPair

public void searchLocalPair(PairMatch pm)
Description copied from interface: BaseEditor
Searches pair match in currently visible text.

Specified by:
searchLocalPair in interface BaseEditor
Parameters:
pm - Unmatched pair match

searchGlobalPair

public void searchGlobalPair(PairMatch pm)
Description copied from interface: BaseEditor
Searches pair match in all available text, possibly, making additional processing.

Specified by:
searchGlobalPair in interface BaseEditor
Parameters:
pm - Unmatched pair match

getLineRegions

public LineRegion[] getLineRegions(int lno)
Description copied from interface: BaseEditor
Return parsed and colored LineRegions of requested line. This method validates current cache state and, if needed, calls Colorer parser to validate modified block of text. Size of reparsed text is choosed according to information about visible text range and modification events.

Specified by:
getLineRegions in interface BaseEditor

validate

public void validate(int lno)
Description copied from interface: BaseEditor
Validates current state of the editor and runs parser, if needed. This method can be called periodically in background thread to make possible background parsing process.

Specified by:
validate in interface BaseEditor
Parameters:
lno - Line number, for which validation is requested. If this number is in the current visible window range, the part of text is validated, which is required for visual repaint. If this number is equals to -1, all the text is validated. If this number is not in visible range, optimal partial validation is used

idleJob

public void idleJob(int time)
Description copied from interface: BaseEditor
Tries to do some parsing job while user is doing nothing.

Specified by:
idleJob in interface BaseEditor
Parameters:
time - integer between 0 and 100, shows an abount of time, available for this job.

modifyEvent

public void modifyEvent(int topLine)
Description copied from interface: BaseEditor
Informs BaseEditor object about text modification event. All the text becomes invalid after the specified line.

Specified by:
modifyEvent in interface BaseEditor
Parameters:
topLine - Topmost modified line of text.

modifyLineEvent

public void modifyLineEvent(int line)
Description copied from interface: BaseEditor
Informs about single line modification event. Generally, this type of event can be processed much faster because of pre-checking line's changed structure and cancelling further parsing in case of unmodified text structure.

Specified by:
modifyLineEvent in interface BaseEditor
Parameters:
line - Modified line of text.

visibleTextEvent

public void visibleTextEvent(int wStart,
                             int wSize)
Description copied from interface: BaseEditor
Informs about changes in visible range of text lines. This information is used to make assumptions about text structure and to make faster parsing.

Specified by:
visibleTextEvent in interface BaseEditor
Parameters:
wStart - Topmost visible line of text.
wSize - Number of currently visible text lines. This number must includes all partially visible lines.

lineCountEvent

public void lineCountEvent(int newLineCount)
Description copied from interface: BaseEditor
Informs about total lines count change. This must include initial lines number setting.

Specified by:
lineCountEvent in interface BaseEditor

setRegionCompact

public void setRegionCompact(long iptr,
                             boolean compact)

setRegionMapper

public void setRegionMapper(long iptr,
                            java.lang.String cls,
                            java.lang.String name)

addRegionHandler

public void addRegionHandler(long iptr,
                             RegionHandler rh,
                             Region filter)

removeRegionHandler

public void removeRegionHandler(long iptr,
                                RegionHandler rh)

setFileType

public void setFileType(long iptr,
                        java.lang.String typename)

chooseFileType

public java.lang.String chooseFileType(long iptr,
                                       java.lang.String fname)

getFileType

public java.lang.String getFileType(long iptr)

setBackParse

public void setBackParse(long iptr,
                         int backParse)

getBackground

public RegionDefine getBackground(long iptr)

getVertCross

public RegionDefine getVertCross(long iptr)

getHorzCross

public RegionDefine getHorzCross(long iptr)

getLineRegions

public LineRegion[] getLineRegions(long iptr,
                                   int lno)

validate

public void validate(long iptr,
                     int lno)

idleJob

public void idleJob(long iptr,
                    int time)

modifyEvent

public void modifyEvent(long iptr,
                        int topLine)

modifyLineEvent

public void modifyLineEvent(long iptr,
                            int line)

visibleTextEvent

public void visibleTextEvent(long iptr,
                             int wStart,
                             int wSize)

lineCountEvent

public void lineCountEvent(long iptr,
                           int newLineCount)


Copyright © 2003 Cail Lomecb. All Rights Reserved.