|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.text.FlowView.FlowStrategy | +--javax.swing.text.TextLayoutStrategy
A flow strategy that uses java.awt.font.LineBreakMeasureer to produce java.awt.font.TextLayout for i18n capable rendering. If the child view being placed into the flow is of type GlyphView and can be rendered by TextLayout, a GlyphPainter that uses TextLayout is plugged into the GlyphView.
Field Summary | |
private java.awt.font.LineBreakMeasurer |
measurer
|
private javax.swing.text.TextLayoutStrategy.AttributedSegment |
text
|
Constructor Summary | |
TextLayoutStrategy()
Constructs a layout strategy for paragraphs based upon java.awt.font.LineBreakMeasurer. |
Method Summary | |
protected void |
adjustRow(FlowView fv,
int rowIndex,
int desiredSpan,
int x)
Adjusts the given row if possible to fit within the layout span. |
void |
changedUpdate(FlowView fv,
DocumentEvent e,
Rectangle alloc)
Gives notification from the document that attributes were changed in a location that this view is responsible for. |
protected View |
createView(FlowView fv,
int startOffset,
int spanLeft,
int rowIndex)
Creates a unidirectional view that can be used to represent the current chunk. |
(package private) int |
getLimitingOffset(View v,
int startOffset,
int spanLeft,
boolean requireNextWord)
Calculate the limiting offset for the next view fragment. |
void |
insertUpdate(FlowView fv,
DocumentEvent e,
Rectangle alloc)
Gives notification that something was inserted into the document in a location that the given flow view is responsible for. |
void |
layout(FlowView fv)
Does a a full layout on the given View. |
protected int |
layoutRow(FlowView fv,
int rowIndex,
int p0)
Creates a row of views that will fit within the layout span of the row. |
void |
removeUpdate(FlowView fv,
DocumentEvent e,
Rectangle alloc)
Gives notification that something was removed from the document in a location that the given flow view is responsible for. |
(package private) void |
sync(FlowView fv)
Synchronize the strategy with its FlowView. |
Methods inherited from class javax.swing.text.FlowStrategy |
getLogicalView |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.awt.font.LineBreakMeasurer measurer
private javax.swing.text.TextLayoutStrategy.AttributedSegment text
Constructor Detail |
public TextLayoutStrategy()
Method Detail |
public void insertUpdate(FlowView fv, DocumentEvent e, Rectangle alloc)
insertUpdate
in class javax.swing.text.FlowView.FlowStrategy
e
- the change information from the associated documentalloc
- the current allocation of the view inside of the insets.
This value will be null if the view has not yet been displayed.View.insertUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public void removeUpdate(FlowView fv, DocumentEvent e, Rectangle alloc)
removeUpdate
in class javax.swing.text.FlowView.FlowStrategy
e
- the change information from the associated documentalloc
- the current allocation of the view inside of the insets.View.removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public void changedUpdate(FlowView fv, DocumentEvent e, Rectangle alloc)
changedUpdate
in class javax.swing.text.FlowView.FlowStrategy
View.changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public void layout(FlowView fv)
layout
in class javax.swing.text.FlowView.FlowStrategy
protected int layoutRow(FlowView fv, int rowIndex, int p0)
layoutRow
in class javax.swing.text.FlowView.FlowStrategy
rowIndex
- the index of the row to fill in with views. The
row is assumed to be empty on entry.p0
- The current position in the children of
this views element from which to start.
protected void adjustRow(FlowView fv, int rowIndex, int desiredSpan, int x)
adjustRow
in class javax.swing.text.FlowView.FlowStrategy
desiredSpan
- the current layout span >= 0x
- the location r starts at.protected View createView(FlowView fv, int startOffset, int spanLeft, int rowIndex)
createView
in class javax.swing.text.FlowView.FlowStrategy
fv
- the view holding the flowstartOffset
- the start location for the view being createdspanLeft
- the about of span left to fill in the rowrowIndex
- the row the view will be placed intoint getLimitingOffset(View v, int startOffset, int spanLeft, boolean requireNextWord)
v
- the logical view representing the starting offset.startOffset
- the model location to start at.void sync(FlowView fv)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |