com.inet.html.views
Class InlineView

java.lang.Object
  extended by javax.swing.text.View
      extended by com.inet.html.views.BoxView
          extended by com.inet.html.views.InlineView
All Implemented Interfaces:
javax.swing.SwingConstants

public class InlineView
extends BoxView

This view represents an inline layer. Inline layers are NEVER displayed as a view. In fact, this view shouln't even be present in the view tree. It's only purpose is to inform the View-User that the element should not be displayed itself, but has children which have to be displayed.


Field Summary
 
Fields inherited from class com.inet.html.views.BoxView
BASELINE, STATUS_REQ_LAYOUT, STATUS_REQ_PRELAYOUT, STATUS_UPTODATE
 
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
InlineView(javax.swing.text.Element elem)
          Creates the view with no element to block any initialization
 
Method Summary
 int getPosition()
          Returns the position attribute of the underlying inline element
 float getPreferredSpan(int axis)
          
 boolean isBlock()
          Returns true if this is a block by CSS display attribute
 boolean isInFlow()
          If this returns false this view may be a normal block view or a positioned block view.
 java.awt.Shape modelToView(int pos, java.awt.Shape a, javax.swing.text.Position.Bias b)
          
 java.awt.Rectangle performLayout(boolean hard)
          This is the final layout method.
 void performLayoutVAlign(int baseline)
          If this box has a overall vertical align, like in table cells for instance, this method calculates teh offset to align the content.
 void performLayoutWidth()
          Layout what is required to determin the width of this view.
 int viewToModel(float x, float y, java.awt.Shape a, javax.swing.text.Position.Bias[] biasReturn)
          
 
Methods inherited from class com.inet.html.views.BoxView
addBoxPainter, factoryPreset, forceLayout, forceLayout, getAlignment, getAutoMarginJustify, getBackgroundValue, getBorderBottomColor, getBorderLeftColor, getBorderRightColor, getBorderTopColor, getBottomInset, getBox, getBoxPainter, getClear, getCompleteHight, getContentHeight, getContentVerticalOffset, getContentWidth, getDirection, getDisplay, getEndOffset, getFirstLineBaseLine, getFloat, getFontSize, getHeightUnit, getHTMLRoot, getJustification, getLeftInset, getLineHeight, getMargins, getOuterHeight, getOuterWidth, getOverflow, getPainter, getRenderContext, getResizeWeight, getRightInset, getSpan, getStartOffset, getStatus, getSwingAlign, getTopInset, getUnicodeBidi, getViewForPosition, getViewIndex, getViewIndex, getVisibility, getWhiteSpace, getWidthUnit, isAbsolutePositioned, isBreak, isBreakable, isFloating, isListItemWithMarker, isLTR, isMarker, isNativeLTR, isTableCell, isWidthSet, paint, performPreLayout, setBackgroundValue, setBorderBottomColor, setBorderLeftColor, setBorderRightColor, setBorderTopColor, setContentVerticalOffset, setContentWidth, setFirstLineBaseLine, setIsNativeLTR, setJustification, setMarker, setPainter, setParent, setRoot, setSize, setSizeContent, setStartAndEndOffset, setStatus, setStatusLocal
 
Methods inherited from class javax.swing.text.View
append, breakView, changedUpdate, createFragment, getAttributes, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getGraphics, getMaximumSpan, getMinimumSpan, getNextVisualPositionFrom, getParent, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, insert, insertUpdate, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, removeUpdate, replace, viewToModel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InlineView

public InlineView(javax.swing.text.Element elem)
Creates the view with no element to block any initialization

Parameters:
elem - the inline box element which defines this inline view
Method Detail

performLayout

public java.awt.Rectangle performLayout(boolean hard)
This is the final layout method. It has to perform a layout of this view and call the layout of all children. Every change to the size of any view in the document will at least call the performLayout method!

Specified by:
performLayout in class BoxView
Parameters:
hard - If set to true, the status of the children will be ignored and all views will be layouted. This should be done on view-size changes. If set to false the status of the children will be respected and up-to-date views will not be layouted again.
Returns:
the bottom-right point of the layout span, required for overflow calculations

performLayoutVAlign

public void performLayoutVAlign(int baseline)
If this box has a overall vertical align, like in table cells for instance, this method calculates teh offset to align the content. It has to be called after the box has it's final size an was layouted. NOTE: If the content is larger than the box or valign is top this method will have no visible effect!

Specified by:
performLayoutVAlign in class BoxView
Parameters:
baseline - external prediction of the first baseline for BASELINE alignment

performLayoutWidth

public void performLayoutWidth()
Layout what is required to determin the width of this view. In most cases this method only requires the CSS width setting, the parent's width and the minumum and preferred span. ATTENTION: This method mus be called before layouting the children of a view. Otherwise the children don't get a corrent parent's size.

Specified by:
performLayoutWidth in class BoxView

getPreferredSpan

public float getPreferredSpan(int axis)

Specified by:
getPreferredSpan in class javax.swing.text.View

modelToView

public java.awt.Shape modelToView(int pos,
                                  java.awt.Shape a,
                                  javax.swing.text.Position.Bias b)
                           throws javax.swing.text.BadLocationException

Specified by:
modelToView in class javax.swing.text.View
Throws:
javax.swing.text.BadLocationException

viewToModel

public int viewToModel(float x,
                       float y,
                       java.awt.Shape a,
                       javax.swing.text.Position.Bias[] biasReturn)

Specified by:
viewToModel in class javax.swing.text.View

isBlock

public boolean isBlock()
Returns true if this is a block by CSS display attribute

Overrides:
isBlock in class BoxView
Returns:
Returns true if this is a block by CSS display attribute

isInFlow

public boolean isInFlow()
If this returns false this view may be a normal block view or a positioned block view. A positioned block view can be the child of a flowing content view because it is taken out of the flow at runtime.

Overrides:
isInFlow in class BoxView
Returns:
false if this is a block but not inline, true otherwise

getPosition

public int getPosition()
Returns the position attribute of the underlying inline element

Overrides:
getPosition in class BoxView
Returns:
the position constant
See Also:
Position