java.lang.Object
javax.swing.text.View
javax.swing.text.GlyphView
javax.swing.text.LabelView
javax.swing.text.html.InlineView
- All Implemented Interfaces:
- Cloneable,- SwingConstants,- TabableView
Displays the inline element styles
 based upon css attributes.
- 
Nested Class SummaryNested classes/interfaces declared in class javax.swing.text.GlyphViewGlyphView.GlyphPainter
- 
Field SummaryFields declared in class javax.swing.text.ViewBadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXISFields declared in interface javax.swing.SwingConstantsBOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbreakView(int axis, int offset, float pos, float len) Tries to break this view on the given axis.voidchangedUpdate(DocumentEvent e, Shape a, ViewFactory f) Gives notification from the document that attributes were changed in a location that this view is responsible for.Fetches the attributes to use when rendering.intgetBreakWeight(int axis, float pos, float len) Determines how attractive a break opportunity in this view is.protected StyleSheetConvenient method to get the StyleSheet.voidinsertUpdate(DocumentEvent e, Shape a, ViewFactory f) Gives notification that something was inserted into the document in a location that this view is responsible for.voidremoveUpdate(DocumentEvent e, Shape a, ViewFactory f) Gives notification that something was removed from the document in a location that this view is responsible for.protected voidSet the cached properties from the attributes.Methods declared in class javax.swing.text.LabelViewgetBackground, getFont, getFontMetrics, getForeground, isStrikeThrough, isSubscript, isSuperscript, isUnderline, setBackground, setStrikeThrough, setSubscript, setSuperscript, setUnderlineMethods declared in class javax.swing.text.GlyphViewcheckPainter, clone, createFragment, getAlignment, getEndOffset, getGlyphPainter, getMinimumSpan, getNextVisualPositionFrom, getPartialSpan, getPreferredSpan, getStartOffset, getTabbedSpan, getTabExpander, getText, modelToView, paint, setGlyphPainter, viewToModelMethods declared in class javax.swing.text.Viewappend, forwardUpdate, forwardUpdateToView, getChildAllocation, getContainer, getDocument, getElement, getGraphics, getMaximumSpan, getParent, getResizeWeight, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, replace, setParent, setSize, updateChildren, updateLayout, viewToModelMethods declared in class java.lang.Objectequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods declared in interface javax.swing.text.TabableViewgetPartialSpan, getTabbedSpan
- 
Constructor Details- 
InlineViewConstructs a new view wrapped on an element.- Parameters:
- elem- the element
 
 
- 
- 
Method Details- 
insertUpdateGives notification that something was inserted into the document in a location that this view is responsible for. If either parameter isnull, behavior of this method is implementation dependent.- Overrides:
- insertUpdatein 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
- Since:
- 1.5
- See Also:
 
- 
removeUpdateGives notification that something was removed from the document in a location that this view is responsible for. If either parameter isnull, behavior of this method is implementation dependent.- Overrides:
- removeUpdatein 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
- Since:
- 1.5
- See Also:
 
- 
changedUpdateGives notification from the document that attributes were changed in a location that this view is responsible for.- Overrides:
- changedUpdatein 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
- See Also:
 
- 
getAttributesFetches the attributes to use when rendering. This is implemented to multiplex the attributes specified in the model with a StyleSheet.- Overrides:
- getAttributesin class- View
- Returns:
- the attributes to use when rendering
 
- 
getBreakWeightpublic 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 callbreakViewon 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 thanBadBreakWeightshould not be considered for a break. A value greater than or equal toForcedBreakWeightshould be broken.This is implemented to provide the default behavior of returning BadBreakWeightunless 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 isLabelView. An example of a view that uses break weight isParagraphView.- Overrides:
- getBreakWeightin 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.
- See Also:
 
- 
breakViewTries to break this view on the given axis. Refer toView.breakView(int, int, float, float)for a complete description of this method.Behavior of this method is unspecified in case axisis neitherView.X_AXISnorView.Y_AXIS, and in caseoffset,pos, orlenis null.- Overrides:
- breakViewin class- GlyphView
- Parameters:
- axis- may be either- View.X_AXISor- 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.
- Since:
- 1.5
- See Also:
 
- 
setPropertiesFromAttributesprotected void setPropertiesFromAttributes()Set the cached properties from the attributes.- Overrides:
- setPropertiesFromAttributesin class- LabelView
 
- 
getStyleSheetConvenient method to get the StyleSheet.- Returns:
- the StyleSheet
 
 
-