|
org.netbeans.modules.editor.lib/1 1.14.0 3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.text.View
org.netbeans.lib.editor.view.GapBoxView
org.netbeans.lib.editor.view.GapDocumentView
public class GapDocumentView
View responsible for holding all line views for a particular document.
There is one instance of this view per document.
It is expected that this view will not act as an active
layout state i.e. that it will not be hosted by a view
implementing ViewLayoutState.Parent
.
The implementation tries to optimize calls to updateLayout()
so that if there are multiple changes in children then
they will all be serviced at once.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.netbeans.editor.view.spi.ViewLayoutState |
---|
ViewLayoutState.Parent |
Field Summary |
---|
Fields inherited from class org.netbeans.lib.editor.view.GapBoxView |
---|
GAP_BOX_VIEW_LAST_USED_STATUS_BIT |
Fields inherited from class javax.swing.text.View |
---|
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Constructor Summary | |
---|---|
GapDocumentView(Element elem)
Construct a view intended to cover the whole document. |
Method Summary | |
---|---|
void |
changedUpdate(DocumentEvent e,
Shape a,
ViewFactory f)
|
protected org.netbeans.lib.editor.view.GapBoxViewChildren |
createChildren()
Can be overriden by subclasses to return a different children implementation. |
protected void |
directUpdateLayout()
This method is called when this view is not acting as active layout state and its layout becomes invalid. |
protected int |
getLastAllocationHeight()
|
protected int |
getLastAllocationWidth()
|
protected int |
getLastAllocationX()
|
protected int |
getLastAllocationY()
|
protected ViewLayoutQueue |
getLayoutQueue()
Fetch the queue to use for layout. |
void |
insertUpdate(DocumentEvent evt,
Shape a,
ViewFactory f)
|
protected void |
layoutLock()
|
protected void |
layoutUnlock()
|
protected boolean |
markRepaint(int childIndex,
boolean repaintTillEnd)
Mark that the child with the given index should be repainted. |
protected void |
markSizeInvalid(int childIndex,
int count)
This method marks sizes of all the children as invalid so the next layout update will resize each children. |
void |
paint(Graphics g,
Shape a)
Render the view using the given allocation and rendering surface. |
protected void |
processRepaint(ViewLayoutState.Parent lsParent)
Process pending repaint requests from children. |
protected Rectangle |
reallocate(Shape a)
Reallocate the view to the new size given by the passed shape. |
void |
removeUpdate(DocumentEvent evt,
Shape a,
ViewFactory f)
|
void |
renderWithUpdateLayout(Runnable r)
|
void |
repaint(ViewLayoutState child,
double majorAxisOffset,
double majorAxisSpan,
float minorAxisOffset,
float minorAxisSpan)
Inform the parent that the child layout state needs a repaint. |
protected void |
resetEstimatedSpan(int childIndex,
int count)
Set estimated span flag to false on the given children views. |
void |
setParent(View parent)
Sets the parent of the view. |
void |
setSize(float width,
float height)
Sets the size of the view. |
Methods inherited from class javax.swing.text.View |
---|
append, breakView, createFragment, forwardUpdate, forwardUpdateToView, getAttributes, getBreakWeight, getContainer, getDocument, getElement, getEndOffset, getGraphics, getParent, getResizeWeight, getStartOffset, getToolTipText, getViewFactory, getViewIndex, insert, isVisible, modelToView, modelToView, remove, removeAll, updateChildren, viewToModel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GapDocumentView(Element elem)
elem
- the element of the model to represent.majorAxis
- the axis to tile along. This can be
either X_AXIS or Y_AXIS.baselineLayout
- whether baseline layout should be used
instead of default layout.Method Detail |
---|
protected org.netbeans.lib.editor.view.GapBoxViewChildren createChildren()
GapBoxView
createChildren
in class GapBoxView
protected Rectangle reallocate(Shape a)
GapBoxView
reallocate
in class GapBoxView
a
- shape to which to reallocate the view.
protected void directUpdateLayout()
GapBoxView
directUpdateLayout
in class GapBoxView
protected final void layoutLock()
protected final void layoutUnlock()
public void renderWithUpdateLayout(Runnable r)
public void setParent(View parent)
GapBoxView
getViewCount()
)
or for preferred, minimum or maximum span of this view.
setParent
in class GapBoxView
parent
- the parent of the view, null
if nonepublic void setSize(float width, float height)
GapBoxView
The propagation of this operation to child views can be done asynchronously if appropriate.
setSize
in class GapBoxView
width
- the width >= 0height
- the height >= 0public void insertUpdate(DocumentEvent evt, Shape a, ViewFactory f)
insertUpdate
in class GapBoxView
public void removeUpdate(DocumentEvent evt, Shape a, ViewFactory f)
removeUpdate
in class GapBoxView
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f)
changedUpdate
in class GapBoxView
public void paint(Graphics g, Shape a)
GapBoxView
paint
in class GapBoxView
g
- the rendering surface to usea
- the allocated region to render intoView.paint(java.awt.Graphics, java.awt.Shape)
public void repaint(ViewLayoutState child, double majorAxisOffset, double majorAxisSpan, float minorAxisOffset, float minorAxisSpan)
ViewLayoutState.Parent
updateLayout()
.
repaint
in interface ViewLayoutState.Parent
repaint
in class GapBoxView
child
- child that needs its area to be repainted.majorAxisOffset
- offset along the major axis defining
the begining of the repaint region. If the allocation
has changed along the major axis the view is fully repainted
(see majorAxisPreferenceChanged()
).
majorAxisSpan
- span along the major axis
that should be repainted. If it is set to zero then
it means that the end of the repaint region along the major axis
span is determined by the span allocated for the child
in this parent.minorAxisOffset
- offset along the minor axis
defining the begining of the repaint region.minorAxisSpan
- span along the minor axis
that should be repainted. If it is set to zero then
it means that the end of the repaint region along the minor axis
span is determined by the span of this parent.protected boolean markRepaint(int childIndex, boolean repaintTillEnd)
GapBoxView
markRepaint
in class GapBoxView
childIndex
- index of child that should be marked for repaint.repaintTillEnd
- if set to true then all children following
the child should be repainted as well.
protected void processRepaint(ViewLayoutState.Parent lsParent)
GapBoxView
processRepaint
in class GapBoxView
protected void resetEstimatedSpan(int childIndex, int count)
GapBoxView
setEstimatedSpan()
and from children.replace()
if the number of added
children exceeds threshold count.
resetEstimatedSpan
in class GapBoxView
protected void markSizeInvalid(int childIndex, int count)
GapBoxView
markSizeInvalid
in class GapBoxView
protected final int getLastAllocationX()
protected final int getLastAllocationY()
protected final int getLastAllocationWidth()
protected final int getLastAllocationHeight()
protected ViewLayoutQueue getLayoutQueue()
|
org.netbeans.modules.editor.lib/1 1.14.0 3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |