|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.text.View
com.inet.html.views.BoxView
com.inet.html.views.BlockView
public class BlockView
The block view is a view for any 'normal' block-element except tables, controls and images. It can be layouted to hold other block-elements or to display inline content. Any block-element has the ability to be the root of floated ancestors(if it's either the html-element view or floated).
http://www.w3.org/TR/1998/REC-CSS2/visuren.html#box-gen
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 | |
---|---|
BlockView(javax.swing.text.Element elem)
Create a new View object |
|
BlockView(javax.swing.text.Element elem,
ViewPainter painter)
create a new view object |
Method Summary | |
---|---|
void |
changedUpdate(javax.swing.event.DocumentEvent e,
java.awt.Shape a,
javax.swing.text.ViewFactory f)
|
javax.swing.text.View |
createFragment(int start,
int end)
|
java.awt.Shape |
getChildAllocation(int index,
java.awt.Shape a)
|
javax.swing.text.View[] |
getChildViews()
Returns all child views of this view |
int |
getCompleteHight()
This represents the real maximum-hight of all inner components including floats. |
int |
getContentHeight()
This is the layouted height in pixel. |
Layout |
getLayout()
Returns the layout of this View |
java.awt.Point |
getLeftUpperCorner(BoxView child)
This methos calulates the left upper corner of a childs content relative to the left upper corner of the Document. |
java.util.concurrent.atomic.AtomicInteger |
getListValue()
Returns the list value counter of this block |
java.awt.Insets |
getMargins()
Get the CSS margins |
float |
getMinimumSpan(int axis)
|
java.awt.Insets |
getOriginalMargins()
Returns the original set of margins of this block. |
int |
getOuterHeight()
Returns the outer height of this box which is content+padding+border. |
StackManager |
getPositionManager(boolean create)
Returns the float position manager for all descendands of this view. |
float |
getPreferredSpan(int axis)
|
java.awt.Rectangle |
getSpan()
Returns the span of this view. |
int |
getTextIndent()
Returns the CSS.TextIndent property |
javax.swing.text.View |
getView(int n)
|
int |
getViewCount()
|
void |
insertUpdate(javax.swing.event.DocumentEvent e,
java.awt.Shape a,
javax.swing.text.ViewFactory f)
|
boolean |
isPositionRoot()
Returns whether this block is a root for positioned or floated elements |
java.awt.Shape |
modelToView(int pos,
java.awt.Shape a,
javax.swing.text.Position.Bias b)
|
void |
paint(java.awt.Graphics g,
java.awt.Shape allocation)
|
java.awt.Rectangle |
performLayout(boolean hard)
Causes this view to update its layout. |
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. |
void |
performPreLayout()
Causes this view to update its preLayout data. |
void |
predictWidth(int width)
Can be used to force a view to a specified width. |
void |
removeUpdate(javax.swing.event.DocumentEvent e,
java.awt.Shape a,
javax.swing.text.ViewFactory f)
|
void |
replace(int offset,
int count,
javax.swing.text.View[] newViews)
|
boolean |
replace(int elementIndex,
java.util.List<javax.swing.text.Element> oldElements,
java.util.List<javax.swing.text.Element> newElements)
Replaces the views responsible for the elements. |
void |
setParent(javax.swing.text.View parent)
|
void |
toExternalBox(java.awt.Rectangle span)
Converts the size of the content to the size of the size of the outer box area of this view. |
java.lang.String |
toString()
|
void |
updateListMarkers()
Updates the list markers of all children, which are list items with marker. |
int |
viewToModel(float x,
float y,
java.awt.Shape a,
javax.swing.text.Position.Bias[] biasReturn)
|
Methods inherited from class javax.swing.text.View |
---|
append, breakView, getAttributes, getBreakWeight, getContainer, getDocument, getElement, getGraphics, getMaximumSpan, getNextVisualPositionFrom, getParent, getToolTipText, getViewFactory, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, viewToModel |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BlockView(javax.swing.text.Element elem)
elem
- Element to presentpublic BlockView(javax.swing.text.Element elem, ViewPainter painter)
elem
- element to presentpainter
- painter to use for painting the viewMethod Detail |
---|
public java.util.concurrent.atomic.AtomicInteger getListValue()
public void setParent(javax.swing.text.View parent)
setParent
in class BoxView
public int getViewCount()
getViewCount
in class javax.swing.text.View
public javax.swing.text.View getView(int n)
getView
in class javax.swing.text.View
public javax.swing.text.View[] getChildViews()
public void replace(int offset, int count, javax.swing.text.View[] newViews)
replace
in class javax.swing.text.View
public javax.swing.text.View createFragment(int start, int end)
createFragment
in class javax.swing.text.View
public float getPreferredSpan(int axis)
getPreferredSpan
in class javax.swing.text.View
public float getMinimumSpan(int axis)
getMinimumSpan
in class javax.swing.text.View
public java.awt.Shape modelToView(int pos, java.awt.Shape a, javax.swing.text.Position.Bias b) throws javax.swing.text.BadLocationException
modelToView
in class javax.swing.text.View
javax.swing.text.BadLocationException
public int viewToModel(float x, float y, java.awt.Shape a, javax.swing.text.Position.Bias[] biasReturn)
viewToModel
in class javax.swing.text.View
public java.awt.Shape getChildAllocation(int index, java.awt.Shape a)
getChildAllocation
in class javax.swing.text.View
public void paint(java.awt.Graphics g, java.awt.Shape allocation)
paint
in class BoxView
public java.awt.Point getLeftUpperCorner(BoxView child)
child
- The child to find the coordinates of or this view
public boolean isPositionRoot()
public java.lang.String toString()
toString
in class java.lang.Object
public StackManager getPositionManager(boolean create)
create
- if true, a stack manager will be created on the next subsequent position root, if false
this is only a search for the next root an may very likely return null
public Layout getLayout()
getLayout
in interface ILayouted
public void performPreLayout()
performPreLayout
in interface ILayouted
performPreLayout
in class BoxView
public java.awt.Rectangle performLayout(boolean hard)
performLayout
in class BoxView
hard
- if set to true, the current layout state will be ignored and the view will be re-layouted anyways
public void toExternalBox(java.awt.Rectangle span)
span
- the box to modifypublic void performLayoutWidth()
performLayoutWidth
in class BoxView
public void predictWidth(int width)
predictWidth
in interface ILayouted
width
- Width to setpublic int getContentHeight()
getContentHeight
in class BoxView
public int getOuterHeight()
getOuterHeight
in class BoxView
public int getCompleteHight()
getCompleteHight
in class BoxView
public void performLayoutVAlign(int baseline)
performLayoutVAlign
in class BoxView
baseline
- external prediction of the first baseline for BASELINE alignmentpublic void insertUpdate(javax.swing.event.DocumentEvent e, java.awt.Shape a, javax.swing.text.ViewFactory f)
insertUpdate
in class javax.swing.text.View
public void removeUpdate(javax.swing.event.DocumentEvent e, java.awt.Shape a, javax.swing.text.ViewFactory f)
removeUpdate
in class javax.swing.text.View
public void changedUpdate(javax.swing.event.DocumentEvent e, java.awt.Shape a, javax.swing.text.ViewFactory f)
changedUpdate
in class javax.swing.text.View
public void updateListMarkers()
public boolean replace(int elementIndex, java.util.List<javax.swing.text.Element> oldElements, java.util.List<javax.swing.text.Element> newElements)
elementIndex
- This will ONLY be used if oldElements is empty!oldElements
- The elements whose views have to be removednewElements
- The new element, which require views
public int getTextIndent()
public java.awt.Insets getMargins()
getMargins
in class BoxView
public java.awt.Insets getOriginalMargins()
public java.awt.Rectangle getSpan()
getSpan
in class BoxView
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |