Package com.lightdev.app.shtm
Class InvisibleView
java.lang.Object
javax.swing.text.View
com.lightdev.app.shtm.InvisibleView
- All Implemented Interfaces:
SwingConstants
A view to hide HTML tags (e.g. comments)
-
Field Summary
Fields inherited from class javax.swing.text.View
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXISFields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatDetermines the maximum span for this view along an axis.floatDetermines the minimum span for this view along an axis.floatgetPreferredSpan(int axis) Determines the preferred span for this view along an axis.booleanmodelToView(int pos, Shape a, Position.Bias b) Provides a mapping, for a given character, from the document model coordinate space to the view coordinate space.voidRenders using the given rendering surface and area on that surface.voidEstablishes the parent view for this view.intviewToModel(float x, float y, Shape a, Position.Bias[] parm4) Provides a mapping from the view coordinate space to the logical coordinate space of the model.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, getResizeWeight, getStartOffset, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, insertUpdate, modelToView, modelToView, preferenceChanged, remove, removeAll, removeUpdate, replace, setSize, updateChildren, updateLayout, viewToModel
-
Constructor Details
-
InvisibleView
constructor
-
-
Method Details
-
getPreferredSpan
public float getPreferredSpan(int axis) Determines the preferred span for this view along an axis.- Specified by:
getPreferredSpanin classView- Parameters:
axis- may be eitherView.X_AXISorView.Y_AXIS- Returns:
- the span the view would like to be rendered into. Typically the view is told to render into the span that is returned, although there is no guarantee. The parent may choose to resize or break the view
- See Also:
-
getMaximumSpan
public float getMaximumSpan()Determines the maximum span for this view along an axis.- Returns:
- the maximum span the view can be rendered into
- See Also:
-
getMinimumSpan
public float getMinimumSpan()Determines the minimum span for this view along an axis.- Returns:
- the minimum span the view can be rendered into
- See Also:
-
paint
Renders using the given rendering surface and area on that surface. The view may need to do layout and create child views to enable itself to render into the given allocation. -
viewToModel
Provides a mapping from the view coordinate space to the logical coordinate space of the model. ThebiasReturnargument will be filled in to indicate that the point given is closer to the next character in the model or the previous character in the model.- Specified by:
viewToModelin classView- Parameters:
x- the X coordinate >= 0y- the Y coordinate >= 0a- the allocated region in which to render- Returns:
- the location within the model that best represents the
given point in the view >= 0. The
biasReturnargument will be filled in to indicate that the point given is closer to the next character in the model or the previous character in the model.
-
modelToView
Provides a mapping, for a given character, from the document model coordinate space to the view coordinate space.- Specified by:
modelToViewin classView- Parameters:
pos- the position of the desired character (>=0)a- the area of the view, which encompasses the requested characterb- the bias toward the previous character or the next character represented by the offset, in case the position is a boundary of two views;bwill have one of these values:-
Position.Bias.Forward -
Position.Bias.Backward
-
- Returns:
- the bounding box, in view coordinate space, of the character at the specified position
- Throws:
IllegalArgumentException- ifbis not one of the legalPosition.Biasvalues listed above- See Also:
-
setParent
Establishes the parent view for this view. This is guaranteed to be called before any other methods if the parent view is functioning properly. This is also the last method called, since it is called to indicate the view has been removed from the hierarchy as well. When this method is called to set the parent to null, this method does the same for each of its children, propagating the notification that they have been disconnected from the view tree. If this is reimplemented,super.setParent()should be called. -
isVisible
public boolean isVisible()
-