JavaTM Platform
Standard Ed. 6

javax.swing.text
�� FlowView.FlowStrategy

java.lang.Object
  �̳��� javax.swing.text.FlowView.FlowStrategy
���ڷ���ࣺ
FlowView

public static class FlowView.FlowStrategy
extends Object

ά������������ʽ�IJ��ԡ�Ĭ��ʵ������ȫ��״̬�ģ�������������� FlowView ������Ч����Ҫ���¼��������������ò��Կ���ͨ����������ʵ�֣����ҿ��ԶԲ��ֻ��÷ֽ���Ϊִ�������޸���

�����°汾��ʼ��
1.3

���췽��ժҪ
FlowView.FlowStrategy()
           
 
����ժҪ
protected  void adjustRow(FlowView fv, int rowIndex, int desiredSpan, int x)
          ���п��ܣ�������������ʹ���ʺϲ�������
 void changedUpdate(FlowView fv, DocumentEvent e, Rectangle alloc)
          ����֪ͨ��֪ͨ�ĵ��д���ͼ�����ij��λ�õ������Ѹ��ġ�
protected  View createView(FlowView fv, int startOffset, int spanLeft, int rowIndex)
          ����һ�������ڱ�ʾ���ĵ�ǰƬ�ε���ͼ��
protected  View getLogicalView(FlowView fv)
          �˷����ṩ���� FlowView ���߼���ͼ�������ԡ�
 void insertUpdate(FlowView fv, DocumentEvent e, Rectangle alloc)
          ����֪ͨ��֪ͨ���ĵ��д���ͼ�����ij��λ���Ѳ������ݡ�
 void layout(FlowView fv)
          ���¸��� FlowView ������
protected  int layoutRow(FlowView fv, int rowIndex, int pos)
          ����һ�����ϸ��в����������ͼ���С�
 void removeUpdate(FlowView fv, DocumentEvent e, Rectangle alloc)
          ����֪ͨ��֪ͨ�Ѵ��ĵ��д˸�������ͼ�����ij��λ���Ƴ�ijЩ���ݡ�
 
���� java.lang.Object �̳еķ���
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

���췽����ϸ��Ϣ

FlowView.FlowStrategy

public FlowView.FlowStrategy()
������ϸ��Ϣ

insertUpdate

public void insertUpdate(FlowView fv,
                         DocumentEvent e,
                         Rectangle alloc)
����֪ͨ��֪ͨ���ĵ��д���ͼ�����ij��λ���Ѳ������ݡ��ò���Ӧ�ܸ�����Ӧ���Ѹ���������ȡ�����޸����õIJ��ԣ���

������
e - ��������ĵ��ĸ�����Ϣ
alloc - �� insets �ڴ���ͼ�ĵ�ǰ�������������ͼ��δ��ʾ�����ֵΪ null��
������
View.insertUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)

removeUpdate

public void removeUpdate(FlowView fv,
                         DocumentEvent e,
                         Rectangle alloc)
����֪ͨ��֪ͨ�Ѵ��ĵ��д˸�������ͼ�����ij��λ���Ƴ�ijЩ���ݡ�

������
e - ��������ĵ��ĸ�����Ϣ
alloc - �� insets �ڴ���ͼ�ĵ�ǰ��������
������
View.removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)

changedUpdate

public void changedUpdate(FlowView fv,
                          DocumentEvent e,
                          Rectangle alloc)
����֪ͨ��֪ͨ�ĵ��д���ͼ�����ij��λ�õ������Ѹ��ġ�

������
fv - ������Щ���ĵ� FlowView
e - �������ĵ������ĸ��ĵ� DocumentEvent
alloc - ��ͼ�ı߽�
������
View.changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)

getLogicalView

protected View getLogicalView(FlowView fv)
�˷����ṩ���� FlowView ���߼���ͼ�������ԡ�


layout

public void layout(FlowView fv)
���¸��� FlowView ������Ĭ������£������ᵼ�������У�����ͼ�����ؽ�����ƥ��ÿ�еĸ���Լ�����˷����� FlowView.layout �������������е�����ͼ��

������
fv - ������ͼ

layoutRow

protected int layoutRow(FlowView fv,
                        int rowIndex,
                        int pos)
����һ�����ϸ��в����������ͼ���С������ɲ��ַ������á�ͨ���ظ����� createView ������ʵ���е���䣬ֱ���þ�������������ǿ���жϻ� createView �������� null Ϊֹ��������þ�ʣ����������� adjustRow �������������У���ͼʹ�����ϸ�������

������
rowIndex - Ҫʹ����ͼ�����е��������ٶ������Ϊ�ա�
pos - ��ͼ�Ӽ���Ԫ�ش��俪ʼ�ĵ�ǰλ�á�
���أ�
��ʼ��һ�е�λ��

adjustRow

protected void adjustRow(FlowView fv,
                         int rowIndex,
                         int desiredSpan,
                         int x)
���п��ܣ�������������ʹ���ʺϲ�������Ĭ������£��˲�������ͼ������ӽ��н�β��λ���ҵ�����ж�Ȩ�ء��������ǿ���жϣ�����жϽ���λ��ǿ���жϵ�λ�á�

������
rowIndex - ������ǰ����������С�
desiredSpan - ��ǰ�������򣬸�ֵ >= 0
x - �п�ʼ����λ�á�

createView

protected View createView(FlowView fv,
                          int startOffset,
                          int spanLeft,
                          int rowIndex)
����һ�������ڱ�ʾ���ĵ�ǰƬ�ε���ͼ����������߼���ͼ�е�������ͼ��Ҳ�����Ǹ��߼���ͼ��һ��Ƭ�Ρ�

������
fv - ����������ͼ
startOffset - ����������ͼ�Ŀ�ʼλ��
spanLeft - ��������������벿��
rowIndex - ��ͼ���������е���

JavaTM Platform
Standard Ed. 6

�ύ��������
�йظ���� API �ο����ϺͿ�����Ա�ĵ�������� Java SE ������Ա�ĵ������ĵ���������ϸ�ġ����򿪷���Ա���������Լ�������������ﶨ�塢ʹ�ü��ɺ͹�������ʾ����

��Ȩ���� 2007 Sun Microsystems, Inc. ��������Ȩ���� ����������֤��������������ĵ����·ַ�������