Class InvisibleView

java.lang.Object
javax.swing.text.View
com.lightdev.app.shtm.InvisibleView
All Implemented Interfaces:
SwingConstants

public class InvisibleView extends View
A view to hide HTML tags (e.g. comments)
  • Constructor Details

    • InvisibleView

      public InvisibleView(Element e)
      constructor
  • Method Details

    • getPreferredSpan

      public float getPreferredSpan(int axis)
      Determines the preferred span for this view along an axis.
      Specified by:
      getPreferredSpan in class View
      Parameters:
      axis - may be either View.X_AXIS or View.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

      public void paint(Graphics g, Shape allocation)
      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.
      Specified by:
      paint in class View
      Parameters:
      g - the rendering surface to use
      allocation - the allocated region to render into
      See Also:
    • viewToModel

      public int viewToModel(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. The biasReturn argument 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:
      viewToModel in class View
      Parameters:
      x - the X coordinate >= 0
      y - the Y coordinate >= 0
      a - the allocated region in which to render
      Returns:
      the location within the model that best represents the given point in the view >= 0. The biasReturn argument 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

      public Shape modelToView(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.
      Specified by:
      modelToView in class View
      Parameters:
      pos - the position of the desired character (>=0)
      a - the area of the view, which encompasses the requested character
      b - the bias toward the previous character or the next character represented by the offset, in case the position is a boundary of two views; b will 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 - if b is not one of the legal Position.Bias values listed above
      See Also:
    • setParent

      public void setParent(View parent)
      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.
      Overrides:
      setParent in class View
      Parameters:
      parent - the new parent, or null if the view is being removed from a parent
    • isVisible

      public boolean isVisible()
      Overrides:
      isVisible in class View
      Returns:
      true if the Component is visible.