|
|||||||||
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.ContentView
public class ContentView
The Content view displays one block of text(in most cases a word) or several whitespaces. A content view is responsible for displaying all inline styles of itself and all inline elements up to the next paragraph.
Field Summary | |
---|---|
static int |
CJK_TYPE_CHARACTER
This view represents only CJK characters an thus can be broken at any character position |
static int |
CJK_TYPE_NONE
there are no CJK characters represented by this view |
static int |
CJK_TYPE_PUNCTUATION
this view represents one or more CJK punctuation marks, which should be preceded by an CJK character on line breaks |
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 | |
---|---|
ContentView(javax.swing.text.Element elem)
Creates the object, does nothing else. |
|
ContentView(javax.swing.text.Element elem,
ViewPainter painter)
Creates the object, and sets the paint controller |
|
ContentView(javax.swing.text.Element elem,
ViewPainter painter,
ContentPainter contentPainter)
Creates the object, and sets the paint controller |
Method Summary | |
---|---|
javax.swing.text.View |
createFragment(int start,
int end)
|
int |
getBottomInset()
Gets the bottom inset. |
int |
getCJKType()
Returns the content type regarding CJK characters of this view. |
ContentPainter |
getContentPainter()
Returns the content painter used by this view |
java.awt.Font |
getFont()
Returns the font used by this view |
int |
getLeftInset()
Gets the left inset. |
java.awt.Insets |
getMargins()
Get the CSS margins |
float |
getMinimumSpan(int axis)
|
float |
getPreferredSpan(int axis)
|
int |
getRightInset()
Gets the right inset. |
int |
getTextLength()
Returns the number of displayed by this view. |
int |
getTopInset()
Gets the top inset. |
void |
insertUpdate(javax.swing.event.DocumentEvent e,
java.awt.Shape a,
javax.swing.text.ViewFactory f)
|
boolean |
isBlock()
Returns true if this is a block by CSS display attribute |
boolean |
isBreakable()
Returns true, if this view may be used to break an inline layout |
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.lang.String |
paramString()
Returns a custom toString version |
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. |
void |
setBreakable(boolean isBreakable)
Returns true, if this is a white space, which can be wrapped |
void |
setCJKType(int cjkType)
Sets the content type regarding CJK characters of this view. |
void |
setIsNativeLTR(boolean isLTR)
Sets the native LTR flag of this view. |
void |
setParent(javax.swing.text.View parent)
|
void |
setSize(float newWidth,
float newHeight)
BLOCKED FOR CONTENT This method changes the OUTER box size, which is the box around the border of this box. |
void |
setSizeContent(float newWidth,
float newHeight)
BLOCKED FOR CONTENT This method changes the CONTENT size, which is the inner box of the box model. |
java.lang.String |
toString()
|
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, changedUpdate, getAttributes, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getGraphics, getMaximumSpan, getNextVisualPositionFrom, getParent, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, removeUpdate, replace, viewToModel |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int CJK_TYPE_NONE
public static final int CJK_TYPE_PUNCTUATION
public static final int CJK_TYPE_CHARACTER
Constructor Detail |
---|
public ContentView(javax.swing.text.Element elem)
elem
- The element this view ill display, must not be nullpublic ContentView(javax.swing.text.Element elem, ViewPainter painter)
elem
- the element this view ill display, must not be nullpainter
- the paint controller to use, may be null if there is nonepublic ContentView(javax.swing.text.Element elem, ViewPainter painter, ContentPainter contentPainter)
elem
- the element this view ill display, must not be nullpainter
- the paint controller to use, may be null if there is nonecontentPainter
- the painter to be used by this viewMethod Detail |
---|
public void setParent(javax.swing.text.View parent)
setParent
in class BoxView
public void setSize(float newWidth, float newHeight)
setSize
in class BoxView
newWidth
- the new width in pxnewHeight
- the new height in pxpublic void setSizeContent(float newWidth, float newHeight)
setSizeContent
in class BoxView
newWidth
- the new width in pxnewHeight
- the new height in pxpublic 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 void paint(java.awt.Graphics g, java.awt.Shape allocation)
paint
in class BoxView
public int getTextLength()
public int getLeftInset()
getLeftInset
in class BoxView
public boolean isBlock()
isBlock
in class BoxView
public int getRightInset()
getRightInset
in class BoxView
public int getTopInset()
getTopInset
in class BoxView
public int getBottomInset()
getBottomInset
in class BoxView
public java.awt.Insets getMargins()
getMargins
in class BoxView
public java.lang.String paramString()
public java.awt.Rectangle performLayout(boolean hard)
performLayout
in class BoxView
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.
public void performLayoutWidth()
performLayoutWidth
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 boolean isBreakable()
isBreakable
in class BoxView
public void setBreakable(boolean isBreakable)
isBreakable
- Returns true, if this is a white space, which can be wrappedpublic java.awt.Font getFont()
public void setIsNativeLTR(boolean isLTR)
setIsNativeLTR
in class BoxView
isLTR
- true for native LTR, false for native RTLpublic java.lang.String toString()
toString
in class java.lang.Object
public ContentPainter getContentPainter()
public int getCJKType()
CJK_TYPE_NONE
,
CJK_TYPE_PUNCTUATION
,
CJK_TYPE_CHARACTER
public void setCJKType(int cjkType)
cjkType
- the CJK type of this viewCJK_TYPE_NONE
,
CJK_TYPE_PUNCTUATION
,
CJK_TYPE_CHARACTER
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |