JIDE 3.5.15

com.jidesoft.editor
Class CodeEditorRowMarginSupport

java.lang.Object
  extended by com.jidesoft.editor.CodeEditorMarginSupport
      extended by com.jidesoft.editor.CodeEditorRowMarginSupport
All Implemented Interfaces:
MarginSupport, RowMarginSupport

public class CodeEditorRowMarginSupport
extends CodeEditorMarginSupport
implements RowMarginSupport

CodeEditorRowMarginSupport provides the margin support for CodeEditor and its subclasses.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.jidesoft.margin.MarginSupport
MarginSupport.ModelChangedCallback, MarginSupport.RepaintCallback
 
Field Summary
 
Fields inherited from class com.jidesoft.editor.CodeEditorMarginSupport
_codeEditor
 
Constructor Summary
CodeEditorRowMarginSupport(CodeEditor codeEditor)
           
 
Method Summary
 int actualRowToVisualRow(int actualRow)
          Converts the actual row index as in the model to the visual row index as in the view.
 int getBaselineAdjustment()
          Gets the baseline adjustment so that the text on the margin aligns properly with the text on the component.
 int getRowCount()
          Gets the total row count in the component.
 int getRowHeight(int row)
          Gets the row height.
 int positionToRow(int position)
          Gets the actual row index corresponding to the position the margin.
 int rowToPosition(int row)
          Gets the position on the margin corresponding to the actual row index.
 void scrollTo(int beginRow, int endRow, boolean select)
          Selects the rows.
 int visualRowToActualRow(int visualRow)
          Converts the visual row index as in the view to the actual row index as in the model.
 
Methods inherited from class com.jidesoft.editor.CodeEditorMarginSupport
getCodeEditor, getViewPosition, getViewSize, installListeners, uninstallListeners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jidesoft.margin.MarginSupport
getViewPosition, getViewSize, installListeners, uninstallListeners
 

Constructor Detail

CodeEditorRowMarginSupport

public CodeEditorRowMarginSupport(CodeEditor codeEditor)
Method Detail

getRowCount

public int getRowCount()
Description copied from interface: RowMarginSupport
Gets the total row count in the component.

Specified by:
getRowCount in interface RowMarginSupport
Returns:
the total row count.

getRowHeight

public int getRowHeight(int row)
Description copied from interface: RowMarginSupport
Gets the row height.

Specified by:
getRowHeight in interface RowMarginSupport
Parameters:
row - the row index.
Returns:
the row height.

positionToRow

public int positionToRow(int position)
Description copied from interface: RowMarginSupport
Gets the actual row index corresponding to the position the margin.

Specified by:
positionToRow in interface RowMarginSupport
Parameters:
position - the position on the margin.
Returns:
the row index corresponding to the position the margin.

rowToPosition

public int rowToPosition(int row)
Description copied from interface: RowMarginSupport
Gets the position on the margin corresponding to the actual row index.

Specified by:
rowToPosition in interface RowMarginSupport
Parameters:
row - the actual row index
Returns:
the position on the margin corresponding to the row index. Integer.MIN_VALUE if the row is not visible.

scrollTo

public void scrollTo(int beginRow,
                     int endRow,
                     boolean select)
Description copied from interface: RowMarginSupport
Selects the rows. Note the beginning row index is not always less than the ending index. It depends on the mouse dragging direction. If user presses and drags upward on the margin, the end index will be smaller than the beginning index. In the implementation of this method, it should try to make the end index visible so that the dragging on the margin will auto-scroll when dragging outside the boundary.

Specified by:
scrollTo in interface RowMarginSupport
Parameters:
beginRow - the beginning row index
endRow - the end row index
select - to select the rows. True to select the row. False to scroll the rows visible only without selecting them.

visualRowToActualRow

public int visualRowToActualRow(int visualRow)
Description copied from interface: RowMarginSupport
Converts the visual row index as in the view to the actual row index as in the model.

Specified by:
visualRowToActualRow in interface RowMarginSupport
Parameters:
visualRow - the visual row index in the view.
Returns:
the actual row index in the model.

actualRowToVisualRow

public int actualRowToVisualRow(int actualRow)
Description copied from interface: RowMarginSupport
Converts the actual row index as in the model to the visual row index as in the view.

Specified by:
actualRowToVisualRow in interface RowMarginSupport
Parameters:
actualRow - the actual row index as in the model.
Returns:
the visual row index in the view.

getBaselineAdjustment

public int getBaselineAdjustment()
Description copied from interface: RowMarginSupport
Gets the baseline adjustment so that the text on the margin aligns properly with the text on the component. You can override it to adjust the value if you notice the texts don't align.

Specified by:
getBaselineAdjustment in interface RowMarginSupport
Returns:
the baseline adjustment.

JIDE 3.5.15