This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.swing.text.html
class InlineView

java.lang.Object extended by javax.swing.text.View extended by javax.swing.text.GlyphView extended by javax.swing.text.LabelView extended by javax.swing.text.html.InlineView
All Implemented Interfaces:
Cloneable, SwingConstants, TabableView

public class InlineView
extends LabelView

Displays the inline element styles based upon css attributes.


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.text.GlyphView
GlyphView.GlyphPainter
   
Field Summary
 
Fields inherited from class javax.swing.text.View
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS
 
Constructor Summary

          Constructs a new view wrapped on an element.
 
Method Summary
 View
breakView(int axis, int offset, float pos, float len)

          Tries to break this view on the given axis.
 void

          Gives notification from the document that attributes were changed in a location that this view is responsible for.
 AttributeSet

          Fetches the attributes to use when rendering.
 int
getBreakWeight(int axis, float pos, float len)

          Determines how attractive a break opportunity in this view is.
protected StyleSheet

          
 void

          Gives notification that something was inserted into the document in a location that this view is responsible for.
 void

          Gives notification that something was removed from the document in a location that this view is responsible for.
protected void

          Set the cached properties from the attributes.
 
Methods inherited from class javax.swing.text.LabelView
changedUpdate, getBackground, getFont, getFontMetrics, getForeground, isStrikeThrough, isSubscript, isSuperscript, isUnderline, setBackground, setPropertiesFromAttributes, setStrikeThrough, setSubscript, setSuperscript, setUnderline
 
Methods inherited from class javax.swing.text.GlyphView
breakView, changedUpdate, checkPainter, clone, createFragment, getAlignment, getBackground, getBreakWeight, getEndOffset, getFont, getForeground, getGlyphPainter, getNextVisualPositionFrom, getPartialSpan, getPreferredSpan, getStartOffset, getTabbedSpan, getTabExpander, getText, insertUpdate, isStrikeThrough, isSubscript, isSuperscript, isUnderline, modelToView, paint, removeUpdate, setGlyphPainter, viewToModel
 
Methods inherited from class 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 inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InlineView

public InlineView(Element elem)
Constructs a new view wrapped on an element.

Parameters:
elem - the element
Method Detail

breakView

public View breakView(int axis,
                      int offset,
                      float pos,
                      float len)
Tries to break this view on the given axis. Refer to {@link javax.swing.text.View#breakView} for a complete description of this method.

Behavior of this method is unspecified in case axis is neither View.X_AXIS nor View.Y_AXIS, and in case offset, pos, or len is null.

Overrides:
breakView in class GlyphView
Parameters:
axis - may be either View.X_AXIS or View.Y_AXIS
offset - the location in the document model that a broken fragment would occupy >= 0. This would be the starting offset of the fragment returned
pos - the position along the axis that the broken view would occupy >= 0. This may be useful for things like tab calculations
len - specifies the distance along the axis where a potential break is desired >= 0
Returns:
the fragment of the view that represents the given span.

changedUpdate

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.

Overrides:
changedUpdate in class LabelView
Parameters:
e - the change information from the associated document
a - the current allocation of the view
f - the factory to use to rebuild if the view has children

getAttributes

public AttributeSet getAttributes()
Fetches the attributes to use when rendering. This is implemented to multiplex the attributes specified in the model with a StyleSheet.

Overrides:
getAttributes in class View

getBreakWeight

public int getBreakWeight(int axis,
                          float pos,
                          float len)
Determines how attractive a break opportunity in this view is. This can be used for determining which view is the most attractive to call breakView on in the process of formatting. A view that represents text that has whitespace in it might be more attractive than a view that has no whitespace, for example. The higher the weight, the more attractive the break. A value equal to or lower than BadBreakWeight should not be considered for a break. A value greater than or equal to ForcedBreakWeight should be broken.

This is implemented to provide the default behavior of returning BadBreakWeight unless the length is greater than the length of the view in which case the entire view represents the fragment. Unless a view has been written to support breaking behavior, it is not attractive to try and break the view. An example of a view that does support breaking is LabelView. An example of a view that uses break weight is ParagraphView.

Overrides:
getBreakWeight in class GlyphView
Parameters:
axis - may be either View.X_AXIS or View.Y_AXIS
pos - the potential location of the start of the broken view >= 0. This may be useful for calculating tab positions.
len - specifies the relative length from pos where a potential break is desired >= 0.
Returns:
the weight, which should be a value between ForcedBreakWeight and BadBreakWeight.

getStyleSheet

protected StyleSheet getStyleSheet()

insertUpdate

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. If either parameter is null, behavior of this method is implementation dependent.

Overrides:
insertUpdate in class GlyphView
Parameters:
e - the change information from the associated document
a - the current allocation of the view
f - the factory to use to rebuild if the view has children

removeUpdate

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. If either parameter is null, behavior of this method is implementation dependent.

Overrides:
removeUpdate in class GlyphView
Parameters:
e - the change information from the associated document
a - the current allocation of the view
f - the factory to use to rebuild if the view has children

setPropertiesFromAttributes

protected void setPropertiesFromAttributes()
Set the cached properties from the attributes.

Overrides:
setPropertiesFromAttributes in class LabelView


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.