javax.swing.text.html
Class CSS.BorderWidthValue

java.lang.Object
  extended byjavax.swing.text.html.CSS.CssValue
      extended byjavax.swing.text.html.CSS.LengthValue
          extended byjavax.swing.text.html.CSS.BorderWidthValue
All Implemented Interfaces:
Serializable
Enclosing class:
CSS

static class CSS.BorderWidthValue
extends CSS.LengthValue

BorderWidthValue is used to model BORDER_XXX_WIDTH and adds support for the thin/medium/thick values.


Field Summary
private  int index
          Index into values.
(package private)  boolean percentage
          If true, span is a percentage value, and that to determine the length another value needs to be passed in.
(package private)  float span
          Either the absolute value (percentage == false) or a percentage value.
(package private)  String svalue
          The value as a string... before conversion to a binary format.
private static float[] values
          Values used to represent border width.
 
Constructor Summary
(package private) CSS.BorderWidthValue(String svalue, int index)
           
 
Method Summary
(package private)  Object fromStyleConstants(StyleConstants key, Object value)
          Converts a StyleConstants attribute value to a CSS attribute value.
(package private)  float getValue()
          Returns the length (span) to use.
(package private)  float getValue(float currentValue)
          Returns the length (span) to use.
(package private)  boolean isPercentage()
          Returns true if the length represents a percentage of the containing box.
(package private)  Object parseCssValue(String value)
          Convert a CSS value string to the internal format (for fast processing) used in the attribute sets.
(package private)  Object parseHtmlValue(String value)
          Convert an HTML attribute value to a CSS attribute value.
 String toString()
          Return the CSS format of the value
(package private)  Object toStyleConstants(StyleConstants key, View v)
          Converts a CSS attribute value to a StyleConstants value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

index

private int index
Index into values.


values

private static final float[] values
Values used to represent border width.


percentage

boolean percentage
If true, span is a percentage value, and that to determine the length another value needs to be passed in.


span

float span
Either the absolute value (percentage == false) or a percentage value.


svalue

String svalue
The value as a string... before conversion to a binary format.

Constructor Detail

CSS.BorderWidthValue

CSS.BorderWidthValue(String svalue,
                     int index)
Method Detail

getValue

float getValue()
Description copied from class: CSS.LengthValue
Returns the length (span) to use.

Overrides:
getValue in class CSS.LengthValue

getValue

float getValue(float currentValue)
Description copied from class: CSS.LengthValue
Returns the length (span) to use. If the value represents a percentage, it is scaled based on currentValue.

Overrides:
getValue in class CSS.LengthValue

parseCssValue

Object parseCssValue(String value)
Description copied from class: CSS.CssValue
Convert a CSS value string to the internal format (for fast processing) used in the attribute sets. The fallback storage for any value that we don't have a special binary format for is a String.

Overrides:
parseCssValue in class CSS.LengthValue

parseHtmlValue

Object parseHtmlValue(String value)
Description copied from class: CSS.CssValue
Convert an HTML attribute value to a CSS attribute value. If there is no conversion, return null. This is implemented to simply forward to the CSS parsing by default (since some of the attribute values are the same). If the attribute value isn't recognized as a CSS value it is generally returned as null.

Overrides:
parseHtmlValue in class CSS.LengthValue

isPercentage

boolean isPercentage()
Returns true if the length represents a percentage of the containing box.


fromStyleConstants

Object fromStyleConstants(StyleConstants key,
                          Object value)
Converts a StyleConstants attribute value to a CSS attribute value. If there is no conversion, returns null. By default, there is no conversion.

Overrides:
fromStyleConstants in class CSS.CssValue
Parameters:
key - the StyleConstants attribute
value - the value of a StyleConstants attribute to be converted
Returns:
the CSS value that represents the StyleConstants value

toStyleConstants

Object toStyleConstants(StyleConstants key,
                        View v)
Converts a CSS attribute value to a StyleConstants value. If there is no conversion, returns null. By default, there is no conversion.

Overrides:
toStyleConstants in class CSS.CssValue
Parameters:
key - the StyleConstants attribute
v - the view containing AttributeSet
Returns:
the StyleConstants attribute value that represents the CSS attribute value

toString

public String toString()
Return the CSS format of the value

Overrides:
toString in class Object
Returns:
a string representation of the object.