Home » openjdk-7 » javax » swing » plaf » basic » [javadoc | source]
javax.swing.plaf.basic
class: BasicTextUI.RootView [javadoc | source]
java.lang.Object
   javax.swing.text.View
      javax.swing.plaf.basic.BasicTextUI$RootView

All Implemented Interfaces:
    SwingConstants

Root view that acts as a gateway between the component and the View hierarchy.
Fields inherited from javax.swing.text.View:
BadBreakWeight,  GoodBreakWeight,  ExcellentBreakWeight,  ForcedBreakWeight,  X_AXIS,  Y_AXIS,  sharedBiasReturn
Constructor:
 RootView() 
Method from javax.swing.plaf.basic.BasicTextUI$RootView Summary:
breakView,   changedUpdate,   getAlignment,   getAttributes,   getChildAllocation,   getContainer,   getDocument,   getElement,   getEndOffset,   getMaximumSpan,   getMinimumSpan,   getNextVisualPositionFrom,   getPreferredSpan,   getResizeWeight,   getStartOffset,   getView,   getViewCount,   getViewFactory,   getViewIndex,   insertUpdate,   modelToView,   modelToView,   paint,   preferenceChanged,   removeUpdate,   setParent,   setSize,   setView,   viewToModel
Methods from javax.swing.text.View:
append,   breakView,   changedUpdate,   createFragment,   forwardUpdate,   forwardUpdateToView,   getAlignment,   getAttributes,   getBreakWeight,   getChildAllocation,   getContainer,   getDocument,   getElement,   getEndOffset,   getGraphics,   getMaximumSpan,   getMinimumSpan,   getNextVisualPositionFrom,   getParent,   getPreferredSpan,   getResizeWeight,   getStartOffset,   getToolTipText,   getView,   getViewCount,   getViewFactory,   getViewIndex,   getViewIndex,   insert,   insertUpdate,   isVisible,   modelToView,   modelToView,   modelToView,   paint,   preferenceChanged,   remove,   removeAll,   removeUpdate,   replace,   setParent,   setSize,   updateChildren,   updateLayout,   viewToModel,   viewToModel
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.plaf.basic.BasicTextUI$RootView Detail:
 public View breakView(int axis,
    float len,
    Shape a) 
    Breaks this view on the given axis at the given length.
 public  void changedUpdate(DocumentEvent e,
    Shape a,
    ViewFactory f) 
    Gives notification from the document that attributes were changed in a location that this view is responsible for.
 public float getAlignment(int axis) 
    Determines the desired alignment for this view along an axis.
 public AttributeSet getAttributes() 
    Fetches the attributes to use when rendering. At the root level there are no attributes. If an attribute is resolved up the view hierarchy this is the end of the line.
 public Shape getChildAllocation(int index,
    Shape a) 
    Fetches the allocation for the given child view. This enables finding out where various views are located, without assuming the views store their location. This returns the given allocation since this view simply acts as a gateway between the view hierarchy and the associated component.
 public Container getContainer() 
    Fetches the container hosting the view. This is useful for things like scheduling a repaint, finding out the host components font, etc. The default implementation of this is to forward the query to the parent view.
 public Document getDocument() 
    Returns the document model underlying the view.
 public Element getElement() 
    Gets the element that this view is mapped to.
 public int getEndOffset() 
    Returns the ending offset into the model for this view.
 public float getMaximumSpan(int axis) 
    Determines the maximum span for this view along an axis.
 public float getMinimumSpan(int axis) 
    Determines the minimum span for this view along an axis.
 public int getNextVisualPositionFrom(int pos,
    Bias b,
    Shape a,
    int direction,
    Bias[] biasRet) throws BadLocationException 
    Provides a way to determine the next visually represented model location that one might place a caret. Some views may not be visible, they might not be in the same order found in the model, or they just might not allow access to some of the locations in the model.
 public float getPreferredSpan(int axis) 
    Determines the preferred span for this view along an axis.
 public int getResizeWeight(int axis) 
    Determines the resizability of the view along the given axis. A value of 0 or less is not resizable.
 public int getStartOffset() 
    Returns the starting offset into the model for this view.
 public View getView(int n) 
    Gets the n-th view in this container.
 public int getViewCount() 
    Returns the number of views in this view. Since this view simply wraps the root of the view hierarchy it has exactly one child.
 public ViewFactory getViewFactory() 
    Fetches the factory to be used for building the various view fragments that make up the view that represents the model. This is what determines how the model will be represented. This is implemented to fetch the factory provided by the associated EditorKit unless that is null, in which case this simply returns the BasicTextUI itself which allows subclasses to implement a simple factory directly without creating extra objects.
 public int getViewIndex(int pos,
    Bias b) 
    Returns the child view index representing the given position in the model. This is implemented to return the index of the only child.
 public  void insertUpdate(DocumentEvent e,
    Shape a,
    ViewFactory f) 
    Gives notification that something was inserted into the document in a location that this view is responsible for.
 public Shape modelToView(int pos,
    Shape a,
    Bias b) throws BadLocationException 
    Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it.
 public Shape modelToView(int p0,
    Bias b0,
    int p1,
    Bias b1,
    Shape a) throws BadLocationException 
    Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it.
 public  void paint(Graphics g,
    Shape allocation) 
    Renders the view.
 public  void preferenceChanged(View child,
    boolean width,
    boolean height) 
    Specifies that a preference has changed. Child views can call this on the parent to indicate that the preference has changed. The root view routes this to invalidate on the hosting component.

    This can be called on a different thread from the event dispatching thread and is basically unsafe to propagate into the component. To make this safe, the operation is transferred over to the event dispatching thread for completion. It is a design goal that all view methods be safe to call without concern for concurrency, and this behavior helps make that true.

 public  void removeUpdate(DocumentEvent e,
    Shape a,
    ViewFactory f) 
    Gives notification that something was removed from the document in a location that this view is responsible for.
 public  void setParent(View parent) 
    Sets the view parent.
 public  void setSize(float width,
    float height) 
    Sets the view size.
  void setView(View v) 
 public int viewToModel(float x,
    float y,
    Shape a,
    Bias[] bias) 
    Provides a mapping from the view coordinate space to the logical coordinate space of the model.