edu.northwestern.at.utils.swing
Class XStyledViewFactory

java.lang.Object
  extended by edu.northwestern.at.utils.swing.XStyledViewFactory
All Implemented Interfaces:
javax.swing.text.ViewFactory

public class XStyledViewFactory
extends java.lang.Object
implements javax.swing.text.ViewFactory

An extended styled view factory which creates views for paragraphs allowing full justification of text.


Constructor Summary
XStyledViewFactory(javax.swing.text.ViewFactory parentFactory)
          Set the parent view factory.
 
Method Summary
 javax.swing.text.View create(javax.swing.text.Element elem)
          Create a view for a text element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XStyledViewFactory

public XStyledViewFactory(javax.swing.text.ViewFactory parentFactory)
Set the parent view factory.

Parameters:
parentFactory - The parent factory.

The parent factory is used to create views for all text elements other than paragraph elements.

Method Detail

create

public javax.swing.text.View create(javax.swing.text.Element elem)
Create a view for a text element.

Specified by:
create in interface javax.swing.text.ViewFactory
Parameters:
elem - The text element for which a view is desired.
Returns:
The view for the text element.

JustifiableTextParagraphView is used to create a view for a paragraph. JustifiableTextParagraphView knows how to fully justify lines of text. The parent factory is used to create views for all other text element types.