Home » openjdk-7 » javax » swing » text » [javadoc | source]
javax.swing.text
class: TextLayoutStrategy [javadoc | source]
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.
Nested Class Summary:
static class  TextLayoutStrategy.AttributedSegment  Implementation of AttributedCharacterIterator that supports the GlyphView attributes for rendering the glyphs through a TextLayout. 
Fields inherited from javax.swing.text.FlowView$FlowStrategy:
damageStart,  viewBuffer
Constructor:
 public TextLayoutStrategy() 
Method from javax.swing.text.TextLayoutStrategy Summary:
adjustRow,   changedUpdate,   createView,   getLimitingOffset,   insertUpdate,   layout,   layoutRow,   removeUpdate,   sync
Methods from javax.swing.text.FlowView$FlowStrategy:
addDamage,   adjustRow,   changedUpdate,   createView,   getLogicalView,   insertUpdate,   layout,   layoutRow,   removeUpdate,   reparentViews,   unsetDamage
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.text.TextLayoutStrategy Detail:
 protected  void adjustRow(FlowView fv,
    int rowIndex,
    int desiredSpan,
    int x) 
    Adjusts the given row if possible to fit within the layout span. Since all adjustments were already calculated by the LineBreakMeasurer, this is implemented to do nothing.
 public  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. This can be either an entire view from the logical view, or a fragment of the view.
 int getLimitingOffset(View v,
    int startOffset,
    int spanLeft,
    boolean requireNextWord) 
    Calculate the limiting offset for the next view fragment. At most this would be the entire view (i.e. the limiting offset would be the end offset in that case). If the range contains a tab or a direction change, that will limit the offset to something less. This value is then fed to the LineBreakMeasurer as a limit to consider in addition to the remaining span.
 public  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. The strategy should update the appropriate changed region (which depends upon the strategy used for repair).
 public  void layout(FlowView fv) 
    Does a a full layout on the given View. This causes all of the rows (child views) to be rebuilt to match the given constraints for each row. This is called by a FlowView.layout to update the child views in the flow.
 protected int layoutRow(FlowView fv,
    int rowIndex,
    int p0) 
    Creates a row of views that will fit within the layout span of the row. This is implemented to execute the superclass functionality (which fills the row with child views or view fragments) and follow that with bidi reordering of the unidirectional view fragments.
 public  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.
  void sync(FlowView fv) 
    Synchronize the strategy with its FlowView. Allows the strategy to update its state to account for changes in that portion of the model represented by the FlowView. Also allows the strategy to update the FlowView in response to these changes.