|
Compiere 3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.text.View
org.compiere.print.layout.HTMLRenderer
public class HTMLRenderer
HTML Renderer View
| Field Summary |
|---|
| 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 | |
|---|---|
HTMLRenderer(ViewFactory f,
View v)
Constructor |
|
| Method Summary | |
|---|---|
static HTMLRenderer |
get(String html)
Get View from HTML String |
float |
getAlignment(int axis)
Determines the desired alignment for this view along an axis. |
Rectangle |
getAllocation()
Get Allocation |
AttributeSet |
getAttributes()
Fetches the attributes to use when rendering. |
Document |
getDocument()
Returns the document model underlying the view. |
Element |
getElement()
Gets the element that this view is mapped to. |
int |
getEndOffset()
Returns the ending offset into the model for this view. |
float |
getHeight()
Get Height |
float |
getHeightOneLine()
Get Height for one line |
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 along an axis. |
int |
getStartOffset()
Returns the starting offset into the model for this view. |
View |
getView(int n)
Gets the n-th view in this container. |
int |
getViewCount()
Returns the number of views in this view. |
ViewFactory |
getViewFactory()
Fetches the factory to be used for building the various view fragments that make up the view that represents the model. |
float |
getWidth()
Get Width |
Shape |
modelToView(int p0,
Position.Bias b0,
int p1,
Position.Bias b1,
Shape a)
Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it. |
Shape |
modelToView(int pos,
Shape a,
Position.Bias b)
Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it. |
void |
paint(Graphics g,
Shape allocation)
Renders the view. |
void |
setAllocation(int width,
int height)
Set Allocation (actual print size) |
void |
setAllocation(Rectangle allocation)
Set Allocation (actual size) |
void |
setParent(View parent)
Sets the view parent. |
void |
setSize(float width,
float height)
Sets the view size. |
int |
viewToModel(float x,
float y,
Shape a,
Position.Bias[] bias)
Provides a mapping from the view coordinate space to the logical coordinate space of the model. |
| Methods inherited from class javax.swing.text.View |
|---|
append, breakView, changedUpdate, createFragment, forwardUpdate, forwardUpdateToView, getBreakWeight, getChildAllocation, getContainer, getGraphics, getNextVisualPositionFrom, getParent, getResizeWeight, getToolTipText, getViewIndex, getViewIndex, insert, insertUpdate, isVisible, modelToView, preferenceChanged, remove, removeAll, removeUpdate, replace, updateChildren, updateLayout, viewToModel |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HTMLRenderer(ViewFactory f,
View v)
f - factoryv - root view| Method Detail |
|---|
public static HTMLRenderer get(String html)
html - html string
public float getWidth()
public float getHeight()
public float getHeightOneLine()
public void setAllocation(int width,
int height)
width - actual print widthheight - actual print heightpublic void setAllocation(Rectangle allocation)
allocation - actual print sizepublic Rectangle getAllocation()
public AttributeSet getAttributes()
getAttributes in class Viewpublic float getPreferredSpan(int axis)
getPreferredSpan in class Viewaxis - may be either X_AXIS or Y_AXIS
public float getMinimumSpan(int axis)
getMinimumSpan in class Viewaxis - may be either X_AXIS or Y_AXIS
public float getMaximumSpan(int axis)
getMaximumSpan in class Viewaxis - may be either X_AXIS or Y_AXIS
public float getAlignment(int axis)
getAlignment in class Viewaxis - may be either X_AXIS or Y_AXIS
public void paint(Graphics g,
Shape allocation)
paint in class Viewg - the graphics contextallocation - the region to render intopublic void setParent(View parent)
setParent in class Viewparent - the parent viewpublic int getViewCount()
getViewCount in class ViewgetView(int)public View getView(int n)
getView in class Viewn - the number of the view to get
public Shape modelToView(int pos,
Shape a,
Position.Bias b)
throws BadLocationException
modelToView in class Viewpos - the position to converta - the allocated region to render intob - position
BadLocationException
public Shape modelToView(int p0,
Position.Bias b0,
int p1,
Position.Bias b1,
Shape a)
throws BadLocationException
modelToView in class Viewp0 - the position to convert >= 0b0 - the bias toward the previous character or the
next character represented by p0, in case the
position is a boundary of two views.p1 - the position to convert >= 0b1 - the bias toward the previous character or the
next character represented by p1, in case the
position is a boundary of two views.a - the allocated region to render into
BadLocationException - if the given position does
not represent a valid location in the associated document
IllegalArgumentException - for an invalid bias argumentView.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])
public int viewToModel(float x,
float y,
Shape a,
Position.Bias[] bias)
viewToModel in class Viewx - x coordinate of the view location to converty - y coordinate of the view location to converta - the allocated region to render intobias - bias
public Document getDocument()
getDocument in class Viewpublic int getStartOffset()
getStartOffset in class Viewpublic int getEndOffset()
getEndOffset in class Viewpublic Element getElement()
getElement in class View
public void setSize(float width,
float height)
setSize in class Viewwidth - the widthheight - the heightpublic ViewFactory getViewFactory()
getViewFactory in class View
|
Compiere 3.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||