javax.swing.text.html
Class NoFramesView

java.lang.Object
  extended byjavax.swing.text.View
      extended byjavax.swing.text.CompositeView
          extended byjavax.swing.text.BoxView
              extended byjavax.swing.text.html.BlockView
                  extended byjavax.swing.text.html.NoFramesView
All Implemented Interfaces:
SwingConstants

class NoFramesView
extends BlockView

This is the view associated with the html tag NOFRAMES. This view has been written to ignore the contents of the NOFRAMES tag. The contents of the tag will only be visible when the JTextComponent the view is contained in is editable.

Author:
Sunita Mani

Field Summary
(package private)  boolean visible
           
 
Fields inherited from class javax.swing.text.html.BlockView
 
Fields inherited from class javax.swing.text.BoxView
 
Fields inherited from class javax.swing.text.CompositeView
 
Fields inherited from class javax.swing.text.View
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS
 
Fields 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
NoFramesView(Element elem, int axis)
          Creates a new view that represents an html box.
 
Method Summary
 float getMaximumSpan(int axis)
          Determines the maximum span for this view along an axis.
 float getMinimumSpan(int axis)
          Determines the minimum span for this view along an axis.
 float getPreferredSpan(int axis)
          Determines the preferred span for this view.
 boolean isVisible()
          Returns a true/false value that represents whether the view is visible or not.
protected  void layout(int width, int height)
          Do nothing if the view is not visible, otherwise invoke the superclass to perform layout.
 void paint(Graphics g, Shape allocation)
          If this view is not visible, then it returns.
 void setParent(View p)
          Determines if the JTextComponent that the view is contained in is editable.
 
Methods inherited from class javax.swing.text.html.BlockView
calculateMajorAxisRequirements, calculateMinorAxisRequirements, changedUpdate, getAlignment, getAttributes, getResizeWeight, getStyleSheet, isPercentage, layoutMinorAxis, setPropertiesFromAttributes, spanSetFromAttributes
 
Methods inherited from class javax.swing.text.BoxView
baselineLayout, baselineRequirements, childAllocation, flipEastAndWestAtEnds, forwardUpdate, getAxis, getChildAllocation, getHeight, getOffset, getSpan, getViewAtPoint, getWidth, isAfter, isAllocationValid, isBefore, isLayoutValid, layoutChanged, layoutMajorAxis, modelToView, paintChild, preferenceChanged, replace, setAxis, setSize, viewToModel
 
Methods inherited from class javax.swing.text.CompositeView
getBottomInset, getInsideAllocation, getLeftInset, getNextEastWestVisualPositionFrom, getNextNorthSouthVisualPositionFrom, getNextVisualPositionFrom, getRightInset, getTopInset, getView, getViewAtPosition, getViewCount, getViewIndex, getViewIndexAtPosition, loadChildren, modelToView, setInsets, setParagraphInsets
 
Methods inherited from class javax.swing.text.View
append, breakView, createFragment, forwardUpdateToView, getBreakWeight, getContainer, getDocument, getElement, getEndOffset, getGraphics, getParent, getStartOffset, getToolTipText, getViewFactory, getViewIndex, insert, insertUpdate, modelToView, remove, removeAll, removeUpdate, updateChildren, updateLayout, viewToModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

visible

boolean visible
Constructor Detail

NoFramesView

public NoFramesView(Element elem,
                    int axis)
Creates a new view that represents an html box. This can be used for a number of elements. By default this view is not visible.

Parameters:
elem - the element to create a view for
axis - either View.X_AXIS or View.Y_AXIS
Method Detail

paint

public void paint(Graphics g,
                  Shape allocation)
If this view is not visible, then it returns. Otherwise it invokes the superclass.

Overrides:
paint in class BlockView
Parameters:
g - the rendering surface to use
allocation - the allocated region to render into
See Also:
isVisible(), text.ParagraphView#paint

setParent

public void setParent(View p)
Determines if the JTextComponent that the view is contained in is editable. If so, then this view and all its child views are visible. Once this has been determined, the superclass is invoked to continue processing.

Overrides:
setParent in class BlockView
Parameters:
p - the parent View.
See Also:
BlockView.setParent(javax.swing.text.View)

isVisible

public boolean isVisible()
Returns a true/false value that represents whether the view is visible or not.

Overrides:
isVisible in class View
Returns:
always returns true

layout

protected void layout(int width,
                      int height)
Do nothing if the view is not visible, otherwise invoke the superclass to perform layout.

Overrides:
layout in class BoxView
Parameters:
width - the width (inside of the insets) >= 0
height - the height (inside of the insets) >= 0

getPreferredSpan

public float getPreferredSpan(int axis)
Determines the preferred span for this view. Returns 0 if the view is not visible, otherwise it calls the superclass method to get the preferred span. axis.

Overrides:
getPreferredSpan in class BlockView
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:
text.ParagraphView#getPreferredSpan

getMinimumSpan

public float getMinimumSpan(int axis)
Determines the minimum span for this view along an axis. Returns 0 if the view is not visible, otherwise it calls the superclass method to get the minimum span.

Overrides:
getMinimumSpan in class BlockView
Parameters:
axis - may be either View.X_AXIS or View.Y_AXIS
Returns:
the minimum span the view can be rendered into
See Also:
text.ParagraphView#getMinimumSpan

getMaximumSpan

public float getMaximumSpan(int axis)
Determines the maximum span for this view along an axis. Returns 0 if the view is not visible, otherwise it calls the superclass method ot get the maximum span.

Overrides:
getMaximumSpan in class BlockView
Parameters:
axis - may be either View.X_AXIS or View.Y_AXIS
Returns:
the maximum span the view can be rendered into
See Also:
text.ParagraphView#getMaximumSpan