This class can be used to represent a logical view for
a flow. It keeps the children updated to reflect the state
of the model, gives the logical child views access to the
view hierarchy, and calculates a preferred span. It doesn't
do any rendering, layout, or model/view translation.
| Method from javax.swing.JEditorPane$PlainEditorKit$PlainParagraph$LogicalView Detail: |
protected void childAllocation(int index,
Rectangle a) {
}
|
protected void forwardUpdateToView(View v,
DocumentEvent e,
Shape a,
ViewFactory f) {
v.setParent(this);
super.forwardUpdateToView(v, e, a, f);
}
Forward the DocumentEvent to the given child view. This
is implemented to reparent the child to the logical view
(the children may have been parented by a row in the flow
if they fit without breaking) and then execute the
superclass behavior. |
public float getPreferredSpan(int axis) {
if( getViewCount() != 1 )
throw new Error("One child view is assumed.");
View v = getView(0);
//((GlyphView)v).setGlyphPainter(null);
return v.getPreferredSpan(axis);
}
|
protected View getViewAtPoint(int x,
int y,
Rectangle alloc) {
return null;
}
|
protected int getViewIndexAtPosition(int pos) {
Element elem = getElement();
if (elem.getElementCount() > 0) {
return elem.getElementIndex(pos);
}
return 0;
}
|
protected boolean isAfter(int x,
int y,
Rectangle alloc) {
return false;
}
|
protected boolean isBefore(int x,
int y,
Rectangle alloc) {
return false;
}
|
protected void loadChildren(ViewFactory f) {
Element elem = getElement();
if (elem.getElementCount() > 0) {
super.loadChildren(f);
} else {
View v = new GlyphView(elem);
append(v);
}
}
|
public void paint(Graphics g,
Shape allocation) {
}
|
protected boolean updateChildren(DocumentEvent.ElementChange ec,
DocumentEvent e,
ViewFactory f) {
return false;
}
|