public class LeafView extends BaseView
Modifier and Type | Field and Description |
---|---|
protected int |
mainHeight
Height of the area this view manages excluding areas
managed by its children and excluding insets.
|
helperInd, insets, INSETS_BOTTOM, INSETS_TOP, MAIN_AREA, packed
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Constructor and Description |
---|
LeafView(Element elem)
Construct new base view
|
Modifier and Type | Method and Description |
---|---|
void |
changedUpdate(DocumentEvent evt,
Shape a,
ViewFactory f)
Attributes were changed in the are this view is responsible for.
|
int |
getBaseX(int y) |
int |
getHeight()
Get total height of this view
|
int |
getNextVisualPositionFrom(int pos,
Position.Bias b,
Shape a,
int direction,
Position.Bias[] biasRet)
!!! osetrit konec view -> jump na dalsi v branchview
|
protected int |
getPaintAreas(Graphics g,
int clipY,
int clipHeight)
Returns binary composition of paint areas
|
protected int |
getPosFromY(int y)
Get begin of line position from y-coord.
|
View |
getView(int n)
Gets the n-th child view.
|
int |
getViewCount()
Returns the number of child views in this view.
|
protected int |
getViewStartY(BaseView view,
int helperInd)
Get child view's y base value.
|
protected int |
getYFromPos(int pos)
Get y coordinate from position.
|
void |
insertUpdate(DocumentEvent evt,
Shape a,
ViewFactory f)
Gives notification that something was inserted into the document
in a location that this view is responsible for.
|
Shape |
modelToView(int p0,
Position.Bias b0,
int p1,
Position.Bias b1,
Shape a) |
Shape |
modelToView(int pos,
Shape a,
Position.Bias b) |
protected void |
paintAreas(Graphics g,
int clipY,
int clipHeight,
int paintAreas)
Paint either top insets, main area, or bottom insets depending on paintAreas variable
|
void |
removeUpdate(DocumentEvent evt,
Shape a,
ViewFactory f)
Gives notification from the document that attributes were removed
in a location that this view is responsible for.
|
void |
setParent(View parent) |
void |
updateMainHeight()
Compute and update main area height
|
int |
viewToModel(float x,
float y,
Shape a,
Position.Bias[] biasReturn)
Get position from location on screen.
|
displayHierarchy, getAlignment, getComponent, getEditorUI, getInsets, getPreferredSpan, getStartY, invalidateStartY, isPacked, paint, setHelperInd, setPacked, toString
append, breakView, createFragment, forwardUpdate, forwardUpdateToView, getAttributes, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getGraphics, getMaximumSpan, getMinimumSpan, getParent, getResizeWeight, getStartOffset, getToolTipText, getViewFactory, getViewIndex, getViewIndex, insert, isVisible, modelToView, preferenceChanged, remove, removeAll, replace, setSize, updateChildren, updateLayout, viewToModel
protected int mainHeight
public LeafView(Element elem)
protected int getPaintAreas(Graphics g, int clipY, int clipHeight)
getPaintAreas
in class BaseView
g
- Graphics to paint throughclipY
- clipping area of graphics objectclipHeight
- clipping area of graphics objectprotected void paintAreas(Graphics g, int clipY, int clipHeight, int paintAreas)
paintAreas
in class BaseView
g
- Graphics to paint throughclipY
- clipping area of graphics objectclipHeight
- clipping area of graphics objectpaintAreas
- binary composition of paint areaspublic int getHeight()
public void updateMainHeight()
updateMainHeight
in class BaseView
protected int getPosFromY(int y)
getPosFromY
in class BaseView
y
- y-coord to inspect
always returns startOffset for y < start of main areapublic final int getViewCount()
getViewCount
in class View
public int getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet) throws BadLocationException
getNextVisualPositionFrom
in class View
BadLocationException
protected int getYFromPos(int pos) throws BadLocationException
getYFromPos
in class BaseView
BadLocationException
public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException
modelToView
in class View
BadLocationException
public Shape modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a) throws BadLocationException
modelToView
in class View
BadLocationException
public int viewToModel(float x, float y, Shape a, Position.Bias[] biasReturn)
viewToModel
in class View
x
- the X coordinate >= 0y
- the Y coordinate >= 0a
- the allocated region to render intopublic void insertUpdate(DocumentEvent evt, Shape a, ViewFactory f)
insertUpdate
in class View
evt
- the change information from the associated documenta
- the current allocation of the viewf
- the factory to use to rebuild if the view has childrenpublic void removeUpdate(DocumentEvent evt, Shape a, ViewFactory f)
removeUpdate
in class View
evt
- the change information from the associated documenta
- the current allocation of the viewf
- the factory to use to rebuild if the view has childrenpublic void changedUpdate(DocumentEvent evt, Shape a, ViewFactory f)
changedUpdate
in class View
evt
- the change information from the associated documenta
- the current allocation of the viewf
- the factory to use to rebuild if the view has childrenprotected int getViewStartY(BaseView view, int helperInd)
getViewStartY
in class BaseView
view
- is child view of this view for which
the offset should be computed.helperInd
- is index that child view has cached to ease
the parent view to search for it in its children array.
If this index is correct, parent uses it. If it's incorrect
parent view searches through the whole array of its children
to find the child. It then calls children's
setParentInd()
to correct its location index.