/*
* Copyright (c) 2005 Thomas Weise
*
* E-Mail : tweise@gmx.de
* Creation Date : 2005-08-20 19:19:03
* Original Filename: org.sfc.xml.formats.Style.java
* Version : 1.0.2
* Last modification: 2006-03-07
* by: Thomas Weise
*
* License : GNU LESSER GENERAL PUBLIC LICENSE
* Version 2.1, February 1999
* You should have received a copy of this license along
* with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307, USA or download the license under
* http://www.gnu.org/copyleft/lesser.html.
*
* Warranty : This software is provided "as is" without any
* warranty; without even the implied warranty of
* merchantability or fitness for a particular purpose.
* See the Gnu Lesser General Public License for more
* details.
*/
package org.sfc.xml.formats;
import java.awt.Color;
import java.io.Serializable;
import org.sfc.utils.ICloneable;
import org.sfc.xml.formats.meta.BackgroundAttachment;
import org.sfc.xml.formats.meta.BackgroundRepeat;
import org.sfc.xml.formats.meta.BorderCollapse;
import org.sfc.xml.formats.meta.BorderStyle;
import org.sfc.xml.formats.meta.BorderWidth;
import org.sfc.xml.formats.meta.CaptionSide;
import org.sfc.xml.formats.meta.Clear;
import org.sfc.xml.formats.meta.Cursor;
import org.sfc.xml.formats.meta.Direction;
import org.sfc.xml.formats.meta.Display;
import org.sfc.xml.formats.meta.EmptyCells;
import org.sfc.xml.formats.meta.Floating;
import org.sfc.xml.formats.meta.FontSize;
import org.sfc.xml.formats.meta.FontStyle;
import org.sfc.xml.formats.meta.FontVariant;
import org.sfc.xml.formats.meta.FontWeight;
import org.sfc.xml.formats.meta.ListStylePosition;
import org.sfc.xml.formats.meta.ListStyleType;
import org.sfc.xml.formats.meta.Overflow;
import org.sfc.xml.formats.meta.Position;
import org.sfc.xml.formats.meta.SpeakHeaderCell;
import org.sfc.xml.formats.meta.TableLayout;
import org.sfc.xml.formats.meta.TextAlign;
import org.sfc.xml.formats.meta.TextDecoration;
import org.sfc.xml.formats.meta.TextTransform;
import org.sfc.xml.formats.meta.Unit;
import org.sfc.xml.formats.meta.VerticalAlign;
import org.sfc.xml.formats.meta.Visibility;
import org.sfc.xml.formats.meta.WhiteSpace;
import org.sfc.xml.formats.meta.Unit.NoPercentUnit;
/**
* An xhtml style declaration.
*
* @author Thomas Weise
*/
public final class Style implements ICloneable, Serializable
{
/**
* The serial version uid.
*/
private static final long serialVersionUID = 1;
/**
* The internal string builder.
*/
private StringBuilder m_sb ;
/**
* Create a new style.
*/
public Style ()
{
super();
this.m_sb = new StringBuilder();
}
/**
* Create a copy of this style.
* @return The copy of this style.
*/
public final Style copy ()
{
Style l_st;
try
{
l_st = ((Style)(super.clone()));
l_st.m_sb = new StringBuilder(this.m_sb);
return l_st;
}
catch(CloneNotSupportedException l_c)
{
return null;
}
}
/**
* Creates and returns a copy of this object. The precise meaning
* of "copy" may depend on the class of the object.
*
* @return A clone of this instance.
*
* @see java.lang.Cloneable
*/
@Override
public final Object clone ()
{
return this.copy();
}
/**
* Put a given id-value pair.
* @param p_sb The string builder.
* @param p_id The string id.
* @param p_value The value.
*/
private static final void put (final StringBuilder p_sb,
final String p_id,
final String p_value)
{
p_sb.append(p_id);
p_sb.append(':');
p_sb.append(p_value);
p_sb.append(';');
}
/**
* Put a given id-value pair.
* @param p_sb The string builder.
* @param p_id The string id.
* @param p_value The value.
* @param p_unit The unit.
*/
private static final void put_unit (final StringBuilder p_sb,
final String p_id,
final float p_value,
final Unit p_unit)
{
p_sb.append(p_id);
p_sb.append(':');
p_sb.append(p_value);
p_sb.append((p_unit != null) ? p_unit.toString() :
Unit.DEFAULT.toString());
p_sb.append(';');
}
/**
* Put a given id-color pair.
* @param p_sb The string builder.
* @param p_id The string id.
* @param p_value The value.
*/
private static final void put_color(final StringBuilder p_sb,
final String p_id,
Color p_value)
{
String l_s;
p_sb.append(p_id);
p_sb.append(":#");
if(p_value == null) p_value = Color.BLACK;
l_s = Integer.toHexString(p_value.getRed());
if(l_s.length() < 2) p_sb.append('0');
p_sb.append(l_s);
l_s = Integer.toHexString(p_value.getGreen());
if(l_s.length() < 2) p_sb.append('0');
p_sb.append(l_s);
l_s = Integer.toHexString(p_value.getBlue());
if(l_s.length() < 2) p_sb.append('0');
p_sb.append(l_s);
p_sb.append(';');
}
/**
* Store the font-family argument.
* @param p_ff The wanted font-family.
* @return this
*/
public final Style font_family (final String p_ff)
{
put(this.m_sb, "font-family", p_ff);
return this;
}
/**
* Store the font-style argument.
* @param p_fs The wanted font-style.
* @return this
*/
public final Style font_style (final FontStyle p_fs)
{
put(this.m_sb, "font-style",
(p_fs != null) ? p_fs.toString() :
FontStyle.DEFAULT.toString());
return this;
}
/**
* Store the font-variant argument.
* @param p_fv The wanted font-varian.
* @return this
*/
public final Style font_variant (final FontVariant p_fv)
{
put(this.m_sb, "font-variant",
(p_fv != null) ? p_fv.toString() :
FontVariant.DEFAULT.toString());
return this;
}
/**
* Store the font-size argument.
* @param p_fs The wanted font-size.
* @return this
*/
public final Style font_size (final FontSize p_fs)
{
put(this.m_sb, "font-size",
(p_fs != null) ? p_fs.toString() :
FontSize.DEFAULT.toString());
return this;
}
/**
* Store the font-size argument.
* @param p_fs The wanted font-size.
* @param p_unit The unit of the font-size.
* @return this
*/
public final Style font_size (final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "font-size",
p_fs, p_unit);
return this;
}
/**
* Store the font-weight argument.
* @param p_fw The wanted font-weight.
* @return this
*/
public final Style font_weight (final FontWeight p_fw)
{
put(this.m_sb, "font-weight",
(p_fw != null) ? p_fw.toString() :
FontWeight.DEFAULT.toString());
return this;
}
/**
* Store the word-spacing argument.
* @param p_fs The wanted word-spacing.
* @param p_unit The unit of the word-spacing.
* @return this
*/
public final Style word_spacing (final float p_fs,
final NoPercentUnit p_unit)
{
put_unit(this.m_sb, "word-spacing", p_fs, p_unit);
return this;
}
/**
* Store the letter-spacing argument.
* @param p_fs The wanted letter-spacing.
* @param p_unit The unit of the letter-spacing.
* @return this
*/
public final Style letter_spacing (final float p_fs,
final NoPercentUnit p_unit)
{
put_unit(this.m_sb, "letter-spacing", p_fs, p_unit);
return this;
}
/**
* Store the text-decoration argument.
* @param p_fs The wanted text-decoration.
* @return this
*/
public final Style text_decoration (final TextDecoration p_fs)
{
put(this.m_sb, "text-decoration",
(p_fs != null) ? p_fs.toString() :
TextDecoration.DEFAULT.toString());
return this;
}
/**
* Store the text-transformation argument.
* @param p_fs The wanted text-transformation.
* @return this
*/
public final Style text_transform (final TextTransform p_fs)
{
put(this.m_sb, "text-transform",
(p_fs != null) ? p_fs.toString() :
TextTransform.DEFAULT.toString());
return this;
}
/**
* Store the text-color argument.
* @param p_c The wanted text-color.
* @return this
*/
public final Style text_color (final Color p_c)
{
put_color(this.m_sb, "color", p_c);
return this;
}
/**
* Store the text-indent argument.
* @param p_fs The wanted text-indent.
* @param p_unit The unit of the text-indent.
* @return this
*/
public final Style text_indent (final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "text-indent", p_fs, p_unit);
return this;
}
/**
* Store the line-height argument.
* @param p_fs The wanted line-height.
* @param p_unit The unit of the line-height.
* @return this
*/
public final Style line_height (final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "line-height", p_fs, p_unit);
return this;
}
/**
* Store the vertical-align argument.
* @param p_fw The wanted vertical-align.
* @return this
*/
public final Style vertical_align (final VerticalAlign p_fw)
{
put(this.m_sb, "vertical-align",
(p_fw != null) ? p_fw.toString() :
VerticalAlign.DEFAULT.toString());
return this;
}
/**
* Store the text-align argument.
* @param p_fw The wanted text-align.
* @return this
*/
public final Style text_align (final TextAlign p_fw)
{
put(this.m_sb, "text-align",
(p_fw != null) ? p_fw.toString() :
TextAlign.DEFAULT.toString());
return this;
}
/**
* Store the white-space argument.
* @param p_fw The wanted white-space.
* @return this
*/
public final Style white_space (final WhiteSpace p_fw)
{
put(this.m_sb, "white-space",
(p_fw != null) ? p_fw.toString() :
WhiteSpace.DEFAULT.toString());
return this;
}
/**
* Store the margin-top argument.
* @param p_fs The wanted margin-top.
* @param p_unit The unit of the margin-top.
* @return this
*/
public final Style margin_top (final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "margin-top", p_fs, p_unit);
return this;
}
/**
* Store the margin-bottom argument.
* @param p_fs The wanted margin-bottom.
* @param p_unit The unit of the margin-bottom.
* @return this
*/
public final Style margin_bottom(final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "margin-bottom", p_fs, p_unit);
return this;
}
/**
* Store the margin-left argument.
* @param p_fs The wanted margin-left.
* @param p_unit The unit of the margin-left.
* @return this
*/
public final Style margin_left (final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "margin-left", p_fs, p_unit);
return this;
}
/**
* Store the margin-right argument.
* @param p_fs The wanted margin-right.
* @param p_unit The unit of the margin-right.
* @return this
*/
public final Style margin_right(final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "margin-right", p_fs, p_unit);
return this;
}
/**
* Store the margin-top argument.
* @param p_fs The wanted margin.
* @param p_unit The unit of the margin.
* @return this
*/
public final Style margin (final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "margin", p_fs, p_unit);
return this;
}
/**
* Store the padding-top argument.
* @param p_fs The wanted padding-top.
* @param p_unit The unit of the padding-top.
* @return this
*/
public final Style padding_top (final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "padding-top", p_fs, p_unit);
return this;
}
/**
* Store the padding-bottom argument.
* @param p_fs The wanted padding-bottom.
* @param p_unit The unit of the padding-bottom.
* @return this
*/
public final Style padding_bottom(final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "padding-bottom", p_fs, p_unit);
return this;
}
/**
* Store the padding-left argument.
* @param p_fs The wanted padding-left.
* @param p_unit The unit of the padding-left.
* @return this
*/
public final Style padding_left (final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "padding-left", p_fs, p_unit);
return this;
}
/**
* Store the padding-right argument.
* @param p_fs The wanted padding-right.
* @param p_unit The unit of the padding-right.
* @return this
*/
public final Style padding_right(final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "padding-right", p_fs, p_unit);
return this;
}
/**
* Store the padding-top argument.
* @param p_fs The wanted padding.
* @param p_unit The unit of the padding.
* @return this
*/
public final Style padding (final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "padding", p_fs, p_unit);
return this;
}
/**
* Store the border-top-width argument.
* @param p_fs The wanted border-top-width.
* @param p_unit The unit of the border-top-width.
* @return this
*/
public final Style border_top_width (final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "border-top-width", p_fs, p_unit);
return this;
}
/**
* Store the border-bottom-width argument.
* @param p_fs The wanted border-bottom-width.
* @param p_unit The unit of the border-bottom-width.
* @return this
*/
public final Style border_bottom_width (final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "border-bottom-width", p_fs, p_unit);
return this;
}
/**
* Store the border-right-width argument.
* @param p_fs The wanted border-right-width.
* @param p_unit The unit of the border-right-width.
* @return this
*/
public final Style border_right_width (final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "border-right-width", p_fs, p_unit);
return this;
}
/**
* Store the border-left-width argument.
* @param p_fs The wanted border-left-width.
* @param p_unit The unit of the border-left-width.
* @return this
*/
public final Style border_left_width (final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "border-left-width", p_fs, p_unit);
return this;
}
/**
* Store the border-width argument.
* @param p_fs The wanted border-width.
* @param p_unit The unit of the border-width.
* @return this
*/
public final Style border_width (final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "border-width", p_fs, p_unit);
return this;
}
/**
* Store the border-top-width argument.
* @param p_fs The wanted border-top-width.
* @return this
*/
public final Style border_top_width (final BorderWidth p_fs)
{
put(this.m_sb, "border-top-width",
(p_fs != null) ? p_fs.toString() :
BorderWidth.DEFAULT.toString());
return this;
}
/**
* Store the border-bottom-width argument.
* @param p_fs The wanted border-bottom-width.
* @return this
*/
public final Style border_bottom_width (final BorderWidth p_fs)
{
put(this.m_sb, "border-bottom-width",
(p_fs != null) ? p_fs.toString() :
BorderWidth.DEFAULT.toString());
return this;
}
/**
* Store the border-right-width argument.
* @param p_fs The wanted border-right-width.
* @return this
*/
public final Style border_right_width (final BorderWidth p_fs)
{
put(this.m_sb, "border-right-width",
(p_fs != null) ? p_fs.toString() :
BorderWidth.DEFAULT.toString());
return this;
}
/**
* Store the border-left-width argument.
* @param p_fs The wanted border-left-width.
* @return this
*/
public final Style border_left_width (final BorderWidth p_fs)
{
put(this.m_sb, "border-left-width",
(p_fs != null) ? p_fs.toString() :
BorderWidth.DEFAULT.toString());
return this;
}
/**
* Store the border-width argument.
* @param p_fs The wanted border-width.
* @return this
*/
public final Style border_width (final BorderWidth p_fs)
{
put(this.m_sb, "border-width",
(p_fs != null) ? p_fs.toString() :
BorderWidth.DEFAULT.toString());
return this;
}
/**
* Store the border-top-style argument.
* @param p_fs The wanted border-top-style.
* @return this
*/
public final Style border_top_style (final BorderStyle p_fs)
{
put(this.m_sb, "border-top-style",
(p_fs != null) ? p_fs.toString() :
BorderStyle.DEFAULT.toString());
return this;
}
/**
* Store the border-bottom-style argument.
* @param p_fs The wanted border-bottom-style.
* @return this
*/
public final Style border_bottom_style (final BorderStyle p_fs)
{
put(this.m_sb, "border-bottom-style",
(p_fs != null) ? p_fs.toString() :
BorderStyle.DEFAULT.toString());
return this;
}
/**
* Store the border-right-style argument.
* @param p_fs The wanted border-right-style.
* @return this
*/
public final Style border_right_style (final BorderStyle p_fs)
{
put(this.m_sb, "border-right-style",
(p_fs != null) ? p_fs.toString() :
BorderStyle.DEFAULT.toString());
return this;
}
/**
* Store the border-left-style argument.
* @param p_fs The wanted border-left-style.
* @return this
*/
public final Style border_left_style (final BorderStyle p_fs)
{
put(this.m_sb, "border-left-style",
(p_fs != null) ? p_fs.toString() :
BorderStyle.DEFAULT.toString());
return this;
}
/**
* Store the border-style argument.
* @param p_fs The wanted border-style.
* @return this
*/
public final Style border_style (final BorderStyle p_fs)
{
put(this.m_sb, "border-style",
(p_fs != null) ? p_fs.toString() :
BorderStyle.DEFAULT.toString());
return this;
}
/**
* Store the border-top-color argument.
* @param p_fs The wanted border-top-color.
* @return this
*/
public final Style border_top_color (final Color p_fs)
{
put_color(this.m_sb, "border-top-color", p_fs);
return this;
}
/**
* Store the border-bottom-color argument.
* @param p_fs The wanted border-bottom-color.
* @return this
*/
public final Style border_bottom_color (final Color p_fs)
{
put_color(this.m_sb, "border-bottom-color", p_fs);
return this;
}
/**
* Store the border-right-color argument.
* @param p_fs The wanted border-right-color.
* @return this
*/
public final Style border_right_color (final Color p_fs)
{
put_color(this.m_sb, "border-right-color", p_fs);
return this;
}
/**
* Store the border-left-color argument.
* @param p_fs The wanted border-left-color.
* @return this
*/
public final Style border_left_color (final Color p_fs)
{
put_color(this.m_sb, "border-left-color", p_fs);
return this;
}
/**
* Store the border-color argument.
* @param p_fs The wanted border-color.
* @return this
*/
public final Style border_color (final Color p_fs)
{
put_color(this.m_sb, "border-color", p_fs);
return this;
}
/**
* Store the background-color argument.
* @param p_fs The wanted background-color.
* @return this
*/
public final Style background_color (final Color p_fs)
{
put_color(this.m_sb, "background-color", p_fs);
return this;
}
/**
* Store the background-image argument.
* @param p_fs The wanted background-image.
* @return this
*/
public final Style background_image (final String p_fs)
{
put(this.m_sb, "background-image", p_fs);
return this;
}
/**
* Store the background-repeat argument.
* @param p_fs The wanted background-repeat.
* @return this
*/
public final Style background_repeat (final BackgroundRepeat p_fs)
{
put(this.m_sb, "background-repeat",
(p_fs != null) ? p_fs.toString() :
BackgroundRepeat.DEFAULT.toString());
return this;
}
/**
* Store the background-attachment argument.
* @param p_fs The wanted background-attachment.
* @return this
*/
public final Style background_attachment(final BackgroundAttachment p_fs)
{
put(this.m_sb, "background-attachment",
(p_fs != null) ? p_fs.toString() :
BackgroundAttachment.DEFAULT.toString());
return this;
}
/**
* Store the position of the background-image.
* @param p_abs_x The absolute x position.
* @param p_x_unit The unit of the absolute x position.
* @param p_abs_y The absolute y position.
* @param p_y_unit The unit of the absolute y position.
* @return this
*/
public final Style background_position (final float p_abs_x,
final Unit p_x_unit,
final float p_abs_y,
final Unit p_y_unit)
{
StringBuilder l_sb;
l_sb = this.m_sb;
l_sb.append("background-position:");
l_sb.append(p_abs_x);
l_sb.append((p_x_unit != null) ? p_x_unit.toString() :
Unit.DEFAULT.toString());
l_sb.append(' ');
l_sb.append(p_abs_y);
l_sb.append((p_y_unit != null) ? p_y_unit.toString() :
Unit.DEFAULT.toString());
l_sb.append(';');
return this;
}
/**
* Store the list-style-type argument.
* @param p_fs The wanted list-style-type.
* @return this
*/
public final Style list_style_type (final ListStyleType p_fs)
{
if(p_fs != null)
{
put(this.m_sb, "list-style-type", p_fs.toString());
}
return this;
}
/**
* Store the list-style-position argument.
* @param p_fs The wanted list-style-position.
* @return this
*/
public final Style list_style_position (final ListStylePosition p_fs)
{
put(this.m_sb, "list-style-position",
(p_fs != null) ? p_fs.toString() :
ListStylePosition.DEFAULT.toString());
return this;
}
/**
* Store the list-style-position argument.
* @param p_fs The wanted list-style-image.
* @return this
*/
public final Style list_style_image (final String p_fs)
{
if(p_fs != null)
{
put(this.m_sb, "list-style-image", p_fs);
}
return this;
}
/**
* Store the caption-side argument.
* @param p_fs The wanted caption-side.
* @return this
*/
public final Style caption_side (final CaptionSide p_fs)
{
put(this.m_sb, "caption-side",
(p_fs != null) ? p_fs.toString() :
CaptionSide.DEFAULT.toString());
return this;
}
/**
* Store the table-layout argument.
* @param p_fs The wanted table-layout.
* @return this
*/
public final Style table_layout (final TableLayout p_fs)
{
put(this.m_sb, "table-layout",
(p_fs != null) ? p_fs.toString() :
TableLayout.DEFAULT.toString());
return this;
}
/**
* Store the border-collapse argument.
* @param p_fs The wanted border-collapse.
* @return this
*/
public final Style border_collapse (final BorderCollapse p_fs)
{
put(this.m_sb, "border-collapse",
(p_fs != null) ? p_fs.toString() :
BorderCollapse.DEFAULT.toString());
return this;
}
/**
* Store the border-spacing argument.
* @param p_fs The wanted border-spacing.
* @param p_unit The unit.
* @return this
*/
public final Style border_spacing (final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "border-spacing", p_fs, p_unit);
return this;
}
/**
* Store the empty-cells argument.
* @param p_fs The wanted empty-cells.
* @return this
*/
public final Style empty_cells (final EmptyCells p_fs)
{
put(this.m_sb, "empty-cells",
(p_fs != null) ? p_fs.toString() :
EmptyCells.DEFAULT.toString());
return this;
}
/**
* Store the speak-header-cell argument.
* @param p_fs The wanted speak-header-cell.
* @return this
*/
public final Style speak_header_cell (final SpeakHeaderCell p_fs)
{
put(this.m_sb, "speak-header-cell",
(p_fs != null) ? p_fs.toString() :
SpeakHeaderCell.DEFAULT.toString());
return this;
}
/**
* Store the position argument.
* @param p_fs The wanted position.
* @return this
*/
public final Style position (final Position p_fs)
{
put(this.m_sb, "position",
(p_fs != null) ? p_fs.toString() :
Position.DEFAULT.toString());
return this;
}
/**
* Store the top argument.
* @param p_fs The wanted top.
* @param p_unit The unit.
* @return this
*/
public final Style top (final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "top", p_fs, p_unit);
return this;
}
/**
* Store the right argument.
* @param p_fs The wanted right.
* @param p_unit The unit.
* @return this
*/
public final Style right(final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "right", p_fs, p_unit);
return this;
}
/**
* Store the left argument.
* @param p_fs The wanted left.
* @param p_unit The unit.
* @return this
*/
public final Style left (final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "left", p_fs, p_unit);
return this;
}
/**
* Store the bottom argument.
* @param p_fs The wanted bottom.
* @param p_unit The unit.
* @return this
*/
public final Style bottom(final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "bottom", p_fs, p_unit);
return this;
}
/**
* Store the width argument.
* @param p_fs The wanted width.
* @param p_unit The unit.
* @return this
*/
public final Style width(final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "width", p_fs, p_unit);
return this;
}
/**
* Store the min-width argument.
* @param p_fs The wanted min-width.
* @param p_unit The unit.
* @return this
*/
public final Style min_width(final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "min-width", p_fs, p_unit);
return this;
}
/**
* Store the max-width argument.
* @param p_fs The wanted max-width.
* @param p_unit The unit.
* @return this
*/
public final Style max_width(final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "max-width", p_fs, p_unit);
return this;
}
/**
* Store the height argument.
* @param p_fs The wanted height.
* @param p_unit The unit.
* @return this
*/
public final Style height(final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "height", p_fs, p_unit);
return this;
}
/**
* Store the min-height argument.
* @param p_fs The wanted min-height.
* @param p_unit The unit.
* @return this
*/
public final Style min_height(final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "min-height", p_fs, p_unit);
return this;
}
/**
* Store the max-height argument.
* @param p_fs The wanted max-height.
* @param p_unit The unit.
* @return this
*/
public final Style max_height(final float p_fs,
final Unit p_unit)
{
put_unit(this.m_sb, "max-height", p_fs, p_unit);
return this;
}
/**
* Store the overflow argument.
* @param p_fs The wanted overflow.
* @return this
*/
public final Style overflow (final Overflow p_fs)
{
put(this.m_sb, "overflow",
(p_fs != null) ? p_fs.toString() :
Overflow.DEFAULT.toString());
return this;
}
/**
* Store the direction argument.
* @param p_fs The wanted direction.
* @return this
*/
public final Style direction (final Direction p_fs)
{
put(this.m_sb, "direction",
(p_fs != null) ? p_fs.toString() :
Direction.DEFAULT.toString());
return this;
}
/**
* Store the float argument.
* @param p_fs The wanted float.
* @return this
*/
public final Style floating (final Floating p_fs)
{
put(this.m_sb, "float",
(p_fs != null) ? p_fs.toString() :
Floating.DEFAULT.toString());
return this;
}
/**
* Store the clear argument.
* @param p_fs The wanted clear.
* @return this
*/
public final Style clear (final Clear p_fs)
{
put(this.m_sb, "clear",
(p_fs != null) ? p_fs.toString() :
Clear.DEFAULT.toString());
return this;
}
/**
* Store the z-order argument.
* @param p_fs The wanted z-index.
* @return this
*/
public final Style z_index (final int p_fs)
{
StringBuilder l_sb;
l_sb = this.m_sb;
l_sb.append("z-index:");
l_sb.append(p_fs);
l_sb.append(';');
return this;
}
/**
* Store the display argument.
* @param p_fs The wanted display.
* @return this
*/
public final Style display (final Display p_fs)
{
if(p_fs != null)
{
put(this.m_sb, "display", p_fs.toString());
}
return this;
}
/**
* Store the visibility argument.
* @param p_fs The wanted visibility.
* @return this
*/
public final Style visibility (final Visibility p_fs)
{
put(this.m_sb, "visibility",
(p_fs != null) ? p_fs.toString() :
Visibility.DEFAULT.toString());
return this;
}
/**
* Store the clip argument.
* @param p_top The wanted top.
* @param p_top_unit The top unit.
* @param p_left The wanted left.
* @param p_left_unit The left unit.
* @param p_bottom The wanted bottom.
* @param p_bottom_unit The bottom unit.
* @param p_right The wanted right.
* @param p_right_unit The right unit.
* @return this
*/
public final Style clip (final float p_top,
final Unit p_top_unit,
final float p_left,
final Unit p_left_unit,
final float p_bottom,
final Unit p_bottom_unit,
final float p_right,
final Unit p_right_unit)
{
StringBuilder l_sb;
l_sb = this.m_sb;
l_sb.append("clip:rect(");
l_sb.append(p_top);
l_sb.append((p_top_unit != null) ? p_top_unit.toString() :
Unit.DEFAULT.toString());
l_sb.append(',');
l_sb.append(p_right);
l_sb.append((p_right_unit != null) ? p_right_unit.toString() :
Unit.DEFAULT.toString());
l_sb.append(',');
l_sb.append(p_bottom);
l_sb.append((p_bottom_unit != null) ? p_bottom_unit.toString() :
Unit.DEFAULT.toString());
l_sb.append(',');
l_sb.append(p_left);
l_sb.append((p_left_unit != null) ? p_left_unit.toString() :
Unit.DEFAULT.toString());
l_sb.append(");");
return this;
}
/**
* Store the cursor argument.
* @param p_fs The wanted cursor.
* @return this
*/
public final Style cursor (final Cursor p_fs)
{
put(this.m_sb, "cursor",
(p_fs != null) ? p_fs.toString() :
Cursor.DEFAULT.toString());
return this;
}
/**
* Store the scrollbar-base-color.
* @param p_fs The wanted scrollbar-base-color.
* @return this
*/
public final Style scrollbar_base_color (final Color p_fs)
{
put_color(this.m_sb, "scrollbar-base-color", p_fs);
return this;
}
/**
* Store the scrollbar-3dlight-color.
* @param p_fs The wanted scrollbar-3dlight-color.
* @return this
*/
public final Style scrollbar_3dlight_color (final Color p_fs)
{
put_color(this.m_sb, "scrollbar-3dlight-color", p_fs);
return this;
}
/**
* Store the scrollbar-arrow-color.
* @param p_fs The wanted scrollbar-arrow-color.
* @return this
*/
public final Style scrollbar_arrow_color (final Color p_fs)
{
put_color(this.m_sb, "scrollbar-arrow-color", p_fs);
return this;
}
/**
* Store the scrollbar-darkshadow-color.
* @param p_fs The wanted scrollbar-darkshadow-color.
* @return this
*/
public final Style scrollbar_darkshadow_color (final Color p_fs)
{
put_color(this.m_sb, "scrollbar-darkshadow-color", p_fs);
return this;
}
/**
* Store the scrollbar-face-color.
* @param p_fs The wanted scrollbar-face-color.
* @return this
*/
public final Style scrollbar_face_color (final Color p_fs)
{
put_color(this.m_sb, "scrollbar-face-color", p_fs);
return this;
}
/**
* Store the scrollbar-highlight-color.
* @param p_fs The wanted scrollbar-highlight-color.
* @return this
*/
public final Style scrollbar_highlight_color (final Color p_fs)
{
put_color(this.m_sb, "scrollbar-highlight-color", p_fs);
return this;
}
/**
* Store the scrollbar-shadow-color.
* @param p_fs The wanted scrollbar-shadow-color.
* @return this
*/
public final Style scrollbar_shadow_color (final Color p_fs)
{
put_color(this.m_sb, "scrollbar-shadow-color", p_fs);
return this;
}
/**
* Store the scrollbar-track-color.
* @param p_fs The wanted scrollbar-track-color.
* @return this
*/
public final Style scrollbar_track_color (final Color p_fs)
{
put_color(this.m_sb, "scrollbar-track-color", p_fs);
return this;
}
/**
* Store the cursor-uri argument.
* @param p_fs The wanted cursor-uri.
* @return this
*/
public final Style cursor (final String p_fs)
{
StringBuilder l_sb;
if(p_fs != null)
{
l_sb = this.m_sb;
l_sb.append("cursor:uri(");
l_sb.append(p_fs);
l_sb.append(");");
}
return this;
}
/**
* Put "content" as to be used with the pseudo-class :before and :after.
* @param p_content The content to be put.
* @return this
*/
public final Style content (final String p_content)
{
put(this.m_sb, "content", p_content);
return this;
}
/**
* Returns the string-representation of this style.
* @return The string-representation of this style.
*/
@Override
public final String toString ()
{
return this.m_sb.toString();
}
}