Save This Page
Home » openjdk-7 » javax » swing » text » html » [javadoc | source]
javax.swing.text.html
public static class: StyleSheet.BoxPainter [javadoc | source]
java.lang.Object
   javax.swing.text.html.StyleSheet$BoxPainter

All Implemented Interfaces:
    Serializable

Class to carry out some of the duties of CSS formatting. Implementations of this class enable views to present the CSS formatting while not knowing anything about how the CSS values are being cached.

As a delegate of Views, this object is responsible for the insets of a View and making sure the background is maintained according to the CSS attributes.
Nested Class Summary:
static enum class  BoxPainter.HorizontalMargin   
Field Summary
 float topMargin     
 float bottomMargin     
 float leftMargin     
 float rightMargin     
 short marginFlags     
 Border border     
 Insets binsets     
 CSS css     
 StyleSheet ss     
 Color bg     
 StyleSheet.BackgroundImagePainter bgPainter     
Constructor:
 BoxPainter(AttributeSet a,
    CSS css,
    StyleSheet ss) 
Method from javax.swing.text.html.StyleSheet$BoxPainter Summary:
getBorder,   getBorderColor,   getInset,   getLength,   getOrientationMargin,   isLeftToRight,   isOrientationAware,   paint
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.text.html.StyleSheet$BoxPainter Detail:
 Border getBorder(AttributeSet a) 
    Fetches a border to render for the given attributes. PENDING(prinz) This is pretty badly hacked at the moment.
 Color getBorderColor(AttributeSet a) 
    Fetches the color to use for borders. This will either be the value specified by the border-color attribute (which is not inherited), or it will default to the color attribute (which is inherited).
 public float getInset(int side,
    View v) 
    Fetches the inset needed on a given side to account for the margin, border, and padding.
 float getLength(CSS.Attribute key,
    AttributeSet a) 
 float getOrientationMargin(StyleSheet.BoxPainter.HorizontalMargin side,
    float cssMargin,
    AttributeSet a,
    boolean isLeftToRight) 
    for , ,
      etc. margins are Left-To-Right/Right-To-Left depended. see 5088268 for more details margin-(left|right)-(ltr|rtl) were introduced to describe it if margin-(left|right) is present we are to use it.
 static boolean isLeftToRight(View v) 
 static boolean isOrientationAware(View v) 
 public  void paint(Graphics g,
    float x,
    float y,
    float w,
    float h,
    View v) 
    Paints the CSS box according to the attributes given. This should paint the border, padding, and background.