|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.text.html.StyleSheet.ListPainter
Class to carry out some of the duties of CSS list formatting. Implementations of this class enable views to present the CSS formatting while not knowing anything about how the CSS values are being cached.
Field Summary | |
private int |
bulletgap
|
private boolean |
checkedForStart
|
(package private) URL |
imageurl
|
(package private) Icon |
img
|
private Rectangle |
paintRect
|
(package private) static char[][] |
romanChars
|
private int |
start
|
private CSS.Value |
type
|
Constructor Summary | |
(package private) |
StyleSheet.ListPainter(AttributeSet attr,
StyleSheet ss)
|
Method Summary | |
(package private) void |
drawIcon(Graphics g,
int ax,
int ay,
int ah,
float align,
Component c)
Draws the bullet icon specified by the list-style-image argument. |
(package private) void |
drawLetter(Graphics g,
char letter,
int ax,
int ay,
int ah,
float align,
int index)
Draws the letter or number for an ordered list. |
(package private) void |
drawShape(Graphics g,
CSS.Value type,
int ax,
int ay,
int ah,
float align)
Draws the graphical bullet item specified by the type argument. |
(package private) String |
formatAlphaNumerals(int itemNum)
Converts the item number into an alphabetic character |
(package private) String |
formatItemNum(int itemNum,
char type)
Converts the item number into the ordered list number (i.e. 1 2 3, i ii iii, a b c, etc. |
(package private) String |
formatRomanDigit(int level,
int digit)
Converts the item number into a roman numeral |
(package private) String |
formatRomanNumerals(int num)
Converts the item number into a roman numeral |
(package private) String |
formatRomanNumerals(int level,
int num)
Converts the item number into a roman numeral |
private CSS.Value |
getChildType(View childView)
Returns a string that represents the value of the HTML.Attribute.TYPE attribute. |
private int |
getRenderIndex(View parentView,
int childIndex)
Returns an integer that should be used to render the child at childIndex with. |
private void |
getStart(View parent)
Obtains the starting index from parent . |
void |
paint(Graphics g,
float x,
float y,
float w,
float h,
View v,
int item)
Paints the CSS list decoration according to the attributes given. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final char[][] romanChars
private Rectangle paintRect
private boolean checkedForStart
private int start
private CSS.Value type
URL imageurl
Icon img
private int bulletgap
Constructor Detail |
StyleSheet.ListPainter(AttributeSet attr, StyleSheet ss)
Method Detail |
private CSS.Value getChildType(View childView)
private void getStart(View parent)
parent
.
private int getRenderIndex(View parentView, int childIndex)
childIndex
with. The retValue will usually be
childIndex
+ 1, unless parentView
has some Views that do not represent LI's, or one of the views
has a HTML.Attribute.START specified.
public void paint(Graphics g, float x, float y, float w, float h, View v, int item)
g
- the rendering surface.x
- the x coordinate of the list item allocationy
- the y coordinate of the list item allocationw
- the width of the list item allocationh
- the height of the list item allocationv
- the allocated area to paint into.item
- which list item is being painted. This
is a number greater than or equal to 0.void drawIcon(Graphics g, int ax, int ay, int ah, float align, Component c)
g
- the graphics contextax
- x coordinate to place the bulletay
- y coordinate to place the bulletah
- height of the container the bullet is placed inalign
- preferred alignment factor for the child viewvoid drawShape(Graphics g, CSS.Value type, int ax, int ay, int ah, float align)
g
- the graphics contexttype
- type of bullet to draw (circle, square, disc)ax
- x coordinate to place the bulletay
- y coordinate to place the bulletah
- height of the container the bullet is placed inalign
- preferred alignment factor for the child viewvoid drawLetter(Graphics g, char letter, int ax, int ay, int ah, float align, int index)
g
- the graphics contextletter
- type of ordered list to drawax
- x coordinate to place the bulletay
- y coordinate to place the bulletah
- height of the container the bullet is placed inindex
- position of the list item in the listString formatItemNum(int itemNum, char type)
itemNum
- number to formattype
- type of ordered listString formatAlphaNumerals(int itemNum)
itemNum
- number to formatString formatRomanNumerals(int num)
num
- number to formatString formatRomanNumerals(int level, int num)
num
- number to formatString formatRomanDigit(int level, int digit)
level
- position
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |