API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.text. View View Source
Author(s)
Timothy Prinzing
Since
Version
1.75 07/13/06
Serial
Hierarchy
 Object
      View
Implements
 SwingConstants
Subclasses
Description
publicabstract abstract class View
  A very important part of the text package is the View class.
See also:   
Constructors
public View (Element elem)
  Creates a new View object.
Methods
Hide/Show inherited methods
public void append (View v)
  Appends a single child view.
public View breakView (int axis, int offset, float pos, float len)
  Tries to break this view on the given axis.
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 View createFragment (int p0, int p1)
  Creates a view that represents a portion of the element.
protected void forwardUpdate (ElementChange ec, DocumentEvent e, Shape a, ViewFactory f)
  Forwards the given DocumentEvent to the child views that need to be notified of the change to the model.
protected void forwardUpdateToView (View v, DocumentEvent e, Shape a, ViewFactory f)
  Forwards the DocumentEvent to the give child view.
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.
public int getBreakWeight (int axis, float pos, float len)
  Determines how attractive a break opportunity in this view is.
public Shape getChildAllocation (int index, Shape a)
  Fetches the allocation for the given child view.
public Container getContainer ()
  Fetches the container hosting the view.
public Document getDocument ()
  Fetches the model associated with the view.
public Element getElement ()
  Fetches the structural portion of the subject that this view is mapped to.
public int getEndOffset ()
  Fetches the portion of the model for which this view is responsible.
public Graphics getGraphics ()
  Fetch a Graphics for rendering.
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 at which one might place a caret.
public View getParent ()
  Returns the parent of the view.
publicabstract 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.
public int getStartOffset ()
  Fetches the portion of the model for which this view is responsible.
public String getToolTipText (float x, float y, Shape allocation)
  Returns the tooltip text at the specified location.
public View getView (int n)
  Gets the nth child view.
public int getViewCount ()
  Returns the number of views in this view.
public ViewFactory getViewFactory ()
  Fetches the ViewFactory implementation that is feeding the view hierarchy.
public int getViewIndex (float x, float y, Shape allocation)
  Returns the child view index representing the given position in the view.
public int getViewIndex (int pos, Bias b)
  Returns the child view index representing the given position in the model.
public void insert (int offs, View v)
  Inserts a single child view.
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 boolean isVisible ()
  Returns a boolean that indicates whether the view is visible or not.
public Shape modelToView (int p0, Bias b0, int p1, Bias b1, Shape a) throws BadLocationException
  Provides a mapping, for a given region, from the document model coordinate space to the view coordinate space.
@Deprecated
public Shape modelToView (int pos, Shape a) throws BadLocationException
  Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it.
publicabstract Shape modelToView (int pos, Shape a, Bias b) throws BadLocationException
  Provides a mapping, for a given character, from the document model coordinate space to the view coordinate space.
publicabstract void paint (Graphics g, Shape allocation)
  Renders using the given rendering surface and area on that surface.
public void preferenceChanged (View child, boolean width, boolean height)
  Child views can call this on the parent to indicate that the preference has changed and should be reconsidered for layout.
public void remove (int i)
  Removes one of the children at the given position.
public void removeAll ()
  Removes all of the children.
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 replace (int offset, int length, View views)
  Replaces child views.
public void setParent (View parent)
  Establishes the parent view for this view.
public void setSize (float width, float height)
  Sets the size of the view.
protected boolean updateChildren (ElementChange ec, DocumentEvent e, ViewFactory f)
  Updates the child views in response to receiving notification that the model changed, and there is change record for the element this view is responsible for.
protected void updateLayout (ElementChange ec, DocumentEvent e, Shape a)
  Updates the layout in response to receiving notification of change from the model.
@Deprecated
public int viewToModel (float x, float y, Shape a)
  Provides a mapping from the view coordinate space to the logical coordinate space of the model.
publicabstract int viewToModel (float x, float y, Shape a, Bias biasReturn)
  Provides a mapping from the view coordinate space to the logical coordinate space of the model.
Fields
Hide/Show inherited fields
publicfinalstatic int BadBreakWeight = "0"
  The weight to indicate a view is a bad break opportunity for the purpose of formatting.
publicfinalstatic int BOTTOM = "3" [Inherited From SwingConstants]
Box-orientation constant used to specify the bottom of a box.
publicfinalstatic int CENTER = "0" [Inherited From SwingConstants]
  The central position in an area.
publicfinalstatic int EAST = "3" [Inherited From SwingConstants]
Compass-direction east (right).
publicfinalstatic int ExcellentBreakWeight = "2000"
  The weight to indicate a view supports breaking, and this represents a very attractive place to break.
publicfinalstatic int ForcedBreakWeight = "3000"
  The weight to indicate a view supports breaking, and must be broken to be represented properly when placed in a view that formats its children by breaking them.
publicfinalstatic int GoodBreakWeight = "1000"
  The weight to indicate a view supports breaking, but better opportunities probably exist.
publicfinalstatic int HORIZONTAL = "0" [Inherited From SwingConstants]
  Horizontal orientation.
publicfinalstatic int LEADING = "10" [Inherited From SwingConstants]
  Identifies the leading edge of text for use with left-to-right and right-to-left languages.
publicfinalstatic int LEFT = "2" [Inherited From SwingConstants]
Box-orientation constant used to specify the left side of a box.
publicfinalstatic int NEXT = "12" [Inherited From SwingConstants]
  Identifies the next direction in a sequence.
publicfinalstatic int NORTH = "1" [Inherited From SwingConstants]
Compass-direction North (up).
publicfinalstatic int NORTH_EAST = "2" [Inherited From SwingConstants]
Compass-direction north-east (upper right).
publicfinalstatic int NORTH_WEST = "8" [Inherited From SwingConstants]
Compass-direction north west (upper left).
publicfinalstatic int PREVIOUS = "13" [Inherited From SwingConstants]
  Identifies the previous direction in a sequence.
publicfinalstatic int RIGHT = "4" [Inherited From SwingConstants]
Box-orientation constant used to specify the right side of a box.
pack-privatefinalstatic Bias sharedBiasReturn
publicfinalstatic int SOUTH = "5" [Inherited From SwingConstants]
Compass-direction south (down).
publicfinalstatic int SOUTH_EAST = "4" [Inherited From SwingConstants]
Compass-direction south-east (lower right).
publicfinalstatic int SOUTH_WEST = "6" [Inherited From SwingConstants]
Compass-direction south-west (lower left).
publicfinalstatic int TOP = "1" [Inherited From SwingConstants]
Box-orientation constant used to specify the top of a box.
publicfinalstatic int TRAILING = "11" [Inherited From SwingConstants]
  Identifies the trailing edge of text for use with left-to-right and right-to-left languages.
publicfinalstatic int VERTICAL = "1" [Inherited From SwingConstants]
  Vertical orientation.
publicfinalstatic int WEST = "7" [Inherited From SwingConstants]
Compass-direction west (left).
publicfinalstatic int X_AXIS = "0"
Axis for format/break operations.
publicfinalstatic int Y_AXIS = "1"
Axis for format/break operations.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar