Cloneable
, SwingConstants
, TabableView
public class InlineView extends LabelView
GlyphView.GlyphPainter
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Constructor | Description |
---|---|
InlineView |
Constructs a new view wrapped on an element. |
Modifier and Type | Method | Description |
---|---|---|
View |
breakView |
Tries to break this view on the given axis. |
void |
changedUpdate |
Gives notification from the document that attributes were changed in a location that this view is responsible for. |
AttributeSet |
getAttributes() |
Fetches the attributes to use when rendering. |
int |
getBreakWeight |
Determines how attractive a break opportunity in this view is. |
protected StyleSheet |
getStyleSheet() |
Convenient method to get the StyleSheet. |
void |
insertUpdate |
Gives notification that something was inserted into the document in a location that this view is responsible for. |
void |
removeUpdate |
Gives notification that something was removed from the document in a location that this view is responsible for. |
protected void |
setPropertiesFromAttributes() |
Set the cached properties from the attributes. |
getBackground, getFont, getFontMetrics, getForeground, isStrikeThrough, isSubscript, isSuperscript, isUnderline, setBackground, setStrikeThrough, setSubscript, setSuperscript, setUnderline
checkPainter, clone, createFragment, getAlignment, getEndOffset, getGlyphPainter, getMinimumSpan, getNextVisualPositionFrom, getPartialSpan, getPreferredSpan, getStartOffset, getTabbedSpan, getTabExpander, getText, modelToView, paint, setGlyphPainter, viewToModel
append, 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, viewToModel
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPartialSpan, getTabbedSpan
public InlineView(Element elem)
elem
- the elementpublic void insertUpdate(DocumentEvent e, Shape a, ViewFactory f)
null
, behavior of this method is implementation dependent.insertUpdate
in class GlyphView
e
- the change information from the associated documenta
- the current allocation of the viewf
- the factory to use to rebuild if the view has childrenpublic void removeUpdate(DocumentEvent e, Shape a, ViewFactory f)
null
, behavior of this method is implementation dependent.removeUpdate
in class GlyphView
e
- the change information from the associated documenta
- the current allocation of the viewf
- the factory to use to rebuild if the view has childrenpublic void changedUpdate(DocumentEvent e, Shape a, ViewFactory f)
changedUpdate
in class LabelView
e
- the change information from the associated documenta
- the current allocation of the viewf
- the factory to use to rebuild if the view has childrenpublic AttributeSet getAttributes()
getAttributes
in class View
public int getBreakWeight(int axis, float pos, float len)
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
.
getBreakWeight
in class GlyphView
axis
- may be either View.X_AXIS or View.Y_AXISpos
- 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.public View breakView(int axis, int offset, float pos, float len)
View.breakView(int, int, float, float)
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.
breakView
in class GlyphView
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 returnedpos
- the position along the axis that the broken view would occupy >= 0. This may be useful for things like tab calculationslen
- specifies the distance along the axis where a potential break is desired >= 0protected void setPropertiesFromAttributes()
setPropertiesFromAttributes
in class LabelView
protected StyleSheet getStyleSheet()
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/text/html/InlineView.html