|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.text.View javax.swing.text.AsyncBoxView javax.swing.text.ZoneView.Zone
Internally created view that has the purpose of holding the views that represent the children of the ZoneView that have been arranged in a zone.
Nested Class Summary |
Nested classes inherited from class javax.swing.text.AsyncBoxView |
AsyncBoxView.ChildLocator, AsyncBoxView.ChildState, AsyncBoxView.FlushTask |
Field Summary | |
private Position |
end
|
private Position |
start
|
Fields inherited from class javax.swing.text.AsyncBoxView |
axis, bottomInset, changing, estimatedMajorSpan, flushTask, leftInset, locator, majorChanged, majorSpan, minorChanged, minorSpan, minRequest, prefRequest, rightInset, stats, topInset |
Fields inherited from class javax.swing.text.View |
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, sharedBiasReturn, 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 | |
ZoneView.Zone(Element elem,
Position start,
Position end)
|
Method Summary | |
void |
changedUpdate(DocumentEvent e,
Shape a,
ViewFactory f)
Gives notification from the document that attributes were changed in a location that this view is responsible for. |
protected void |
flushRequirementChanges()
Publish the changes in preferences upward to the parent view. |
AttributeSet |
getAttributes()
Fetches the attributes to use when rendering. |
int |
getEndOffset()
End of the zones range. |
int |
getStartOffset()
Start of the zones range. |
int |
getViewIndex(int pos,
Position.Bias b)
Returns the child view index representing the given position in the model. |
void |
insertUpdate(DocumentEvent e,
Shape a,
ViewFactory f)
Gives notification that something was inserted into the document in a location that this view is responsible for. |
boolean |
isLoaded()
Determines if the zone is in the loaded state or not. |
void |
load()
Creates the child views and populates the zone with them. |
protected void |
loadChildren(ViewFactory f)
This method is reimplemented to not build the children since the children are created when the zone is loaded rather then when it is placed in the view hierarchy. |
Shape |
modelToView(int pos,
Shape a,
Position.Bias b)
Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it. |
void |
paint(Graphics g,
Shape a)
Renders using the given rendering surface and area on that surface. |
void |
removeUpdate(DocumentEvent e,
Shape a,
ViewFactory f)
Gives notification that something was removed from the document in a location that this view is responsible for. |
void |
unload()
Removes the child views and returns to a state of unloaded. |
protected boolean |
updateChildren(DocumentEvent.ElementChange ec,
DocumentEvent e,
ViewFactory f)
Updates the child views in response to receiving notification that the model changed, and there is change record for the element this view is responsible for. |
int |
viewToModel(float x,
float y,
Shape a,
Position.Bias[] bias)
Provides a mapping from the view coordinate space to the logical coordinate space of the model. |
Methods inherited from class javax.swing.text.View |
append, breakView, createFragment, forwardUpdate, forwardUpdateToView, getAlignment, getBreakWeight, getContainer, getDocument, getElement, getGraphics, getParent, getResizeWeight, getToolTipText, getViewFactory, getViewIndex, insert, isVisible, modelToView, modelToView, remove, removeAll, viewToModel |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Position start
private Position end
Constructor Detail |
public ZoneView.Zone(Element elem, Position start, Position end)
Method Detail |
public void load()
public void unload()
public boolean isLoaded()
protected void loadChildren(ViewFactory f)
loadChildren
in class AsyncBoxView
f
- the view factoryAsyncBoxView.setParent(javax.swing.text.View)
protected void flushRequirementChanges()
This is reimplemented to stop the superclass behavior if the zone has not yet been loaded. If the zone is unloaded for example, the last seen major span is the best estimate and a calculated span for no children is undesirable.
flushRequirementChanges
in class AsyncBoxView
public int getViewIndex(int pos, Position.Bias b)
getViewIndex
in class AsyncBoxView
pos
- the position >= 0
protected boolean updateChildren(DocumentEvent.ElementChange ec, DocumentEvent e, ViewFactory f)
View
ViewFactory
is used to create child views for each element
specified as added in the ElementChange
, starting at the
index specified in the given ElementChange
. The number of
child views representing the removed elements specified are
removed.
updateChildren
in class View
ec
- the change information for the element this view
is responsible for. This should not be null
if
this method gets callede
- the change information from the associated documentf
- the factory to use to build child views
View.insertUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
,
View.removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
,
View.changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public AttributeSet getAttributes()
getAttributes
in class View
public void paint(Graphics g, Shape a)
paint
in class AsyncBoxView
g
- the rendering surface to usea
- the allocated region to render intoView.paint(java.awt.Graphics, java.awt.Shape)
public int viewToModel(float x, float y, Shape a, Position.Bias[] bias)
viewToModel
in class AsyncBoxView
x
- x coordinate of the view location to convert >= 0y
- y coordinate of the view location to convert >= 0a
- the allocated region to render into
View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])
public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException
modelToView
in class AsyncBoxView
pos
- the position to converta
- the allocated region to render intob
- the bias toward the previous character or the
next character represented by the offset, in case the
position is a boundary of two views.
BadLocationException
- if the given position does not represent a
valid location in the associated documentView.modelToView(int, java.awt.Shape, javax.swing.text.Position.Bias)
public int getStartOffset()
getStartOffset
in class View
View.getStartOffset()
public int getEndOffset()
getEndOffset
in class View
View.getEndOffset()
public void insertUpdate(DocumentEvent e, Shape a, ViewFactory f)
insertUpdate
in class View
e
- the change information from the associated documenta
- the current allocation of the viewf
- the factory to use to rebuild if the view has childrenView.insertUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public void removeUpdate(DocumentEvent e, Shape a, ViewFactory f)
removeUpdate
in class View
e
- the change information from the associated documenta
- the current allocation of the viewf
- the factory to use to rebuild if the view has childrenView.removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f)
changedUpdate
in class View
e
- the change information from the associated documenta
- the current allocation of the viewf
- the factory to use to rebuild if the view has childrenView.removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |