DhStyleBase Class

DhStyleBase Class

This Package | All Packages

Component
  |
  +--DhStyleBase
public class DhStyleBase
extends cor.Component
implements DhStringIDs

Provides the superclass for classes that support styles, such as DhStyle objects and DhElement. Classes that extend DhStyleBase have certain typographic and other visual properties, such as colors, fonts, and so on.

Also see DhStyle, DhElement

Fields
Name Description
BOLD Used by the style attribute of the setFont method.
ITALIC Used by the style attribute of the setFont method.
OK_TO_CACHE_STYLES Setting this flag to false (default is true) forces all CSS styles to be drawn from the client peer instead of a cached value.
STRIKEOUT Used by the style attribute of the setFont method.
UNDERLINE Used by the style attribute of the setFont method.

Constructors
Name Description
DhStyleBase() Topic under construction.
DhStyleBase(int unit) Topic under construction.

Methods
Name Description
ensurePaddings() Topic under construction.
getBackColor() Retrieves the background color property.
getBackgroundColor() Retrieves the background color property.
getBackgroundColorString() Retrieves the background color property as a string.
getBorderInfo() Retrieves the DhBorderInfo class with informatioon about the current border state.
getBounds() Retrieves the position and size of the element.
getClipRect() Retrieves the current clipping rectangle.
getClipString() Retrieves the current clip setting string.
getColor() Retrieves the text foreground color property.
getCursor() Retrieves the cursor style for this element.
getCursorString() Retrieves the cursor style for this element.
getFont() Topic under construction.
getFontName() Retrieves the font name for this element.
getFontSize() Retrieves the size of the font for this element.
getFontStyle() Topic under construction.
getForeColor() Retrieves the foreground color property.
getHeightUnit() Retrieves the height unit.
getLeftUnit() Retrieves the left position unit.
getLocation() Retrieves the position (or location) of the element.
getMarginWidthInfo() Retrieves a DhMarginWidthInfo class describing the current margin settings for this element.
getPaddingWidthInfo() Retrieves a DhPaddingWidthInfo class describing the current padding width settings for this element.
getPositionInfo() Topic under construction.
getSize() Retrieves the size of the element.
getStyleInt(String strStyleKey) Retrieves the style number.
getStyleString(String strStyleKey) Retrieves the style.
getStyleText() Retrieves the underlying CSS text string.
getTextAlignment( ) Retrieves the current text alignment setting.
getTextVerticalAlign( ) Retrieves the current text alignment setting.
getTopUnit() Retrieves the top position unit.
getVisible() Retrieves the visibility state of this element.
getWidthUnit() Retrieves the width unit.
getZIndex() Retrieves the z-index (layering) ordering of this element with respect to its container.
hasDefaultBackColor() Determines if the background color is set to the default.
hasDefaultFont() Topic under construction.
hasDefaultForeColor() Determines if the background color is the default (black).
hasDefaultLocation() Topic under construction.
hasDefaultPositionInfo() Topic under construction.
hasDefaultSize() Topic under construction.
hasDefaultZIndex() Topic under construction.
setBackColor(Color color) Sets the background color of the element.
setBackgroundColor(int color) Sets the background color of the element.
setBackgroundColor(String color) Sets the background color of the element.
setBorderColor( int nBordermask, String strColor ) Sets the border color to the specified value.
setBorderColor( String strColor ) Sets all border colors to the specified value.
setBorderColor( int nBorderMask, int nColor ) Sets the border color to the specified value defined in DhColors.
setBorderColor( int nColor ) Sets all border colors to the specified value defined in DhColor.
setBorderInfo( DhBorderInfo biNew ) Updates the border styles for this element.
setBorderStyle( int nBorderMask, String strStyle ) Sets the border style to a specified value.
setBorderStyle( String strStyle ) Sets all border styles to a specified value.
setBorderStyle( int nBorderMask, int nBorderKey ) Sets the style to a specified value constant.
setBorderStyle( int nBorderKey ) Sets the style to a specified value constant.
setBorderWidth( int nBorderMask, String strWidth ) Sets the border width to the value specified.
setBorderWidth( int nBorderMask, int nWidth, int nUnitKey ) Sets the border width to the value and unit specified.
setBorderWidth( int nWidth, int nUnitKey ) Sets all border widths to the value and unit specified.
setBorderWidth( String strWidth ) Sets the border width to the value specified.
setBorderWidth( int nBorderWidthKey ) Sets the border width to the value specified.
setBounds(int x, int y, int width, int height) Sets the position and size of the element.
setBounds(Rectangle rect) Sets the position and size of the element.
setClip( Rectangle r ) Sets the clipping rectangle.
setClip( String strClip ) Sets the clipping rectangle string in the form:

rect( top, right, bottom, left )

where top, left, bottom or right can be "auto" or a length measurement.

setColor(int color) Sets the text color (and other foreground objects).
setColor(String color) Sets the color for foreground objects, such as text.
setCursor( int nCursor ) Sets the cursor style for this element.
setCursor( String strCursor ) Sets the cursor style for this element.
setFont(String name, int size, int style) Sets the font value for this element.
setFont(String name, int size) Sets the font value for this element.
setFont(Font font) Topic under construction.
setForeColor(Color color) Sets the color of foreground objects, such as text.
setHeightUnit( int h, int unit ) Sets the height of the element.
setLeftUnit( int v, int unit ) Sets the left position of the element.
setLocation(int x, int y) Sets the position of the element.
setLocation( Point pt ) Sets the position of the element.
setMarginWidth( int nWidth, int nUnit ) Sets the width of all the margins to the specified value.
setMarginWidth( int nMarginMask, int nWidth, int nUnit ) Sets the width of the margins to the specified value.
setMarginWidthInfo( DhMarginWidthInfo mwi ) Sets the margins widths according to those in a DhMarginWidthInfo class.
setPaddingWidth( int nWidth, int nUnit ) Sets the width of all paddings to the specified value.
setPaddingWidth( int nPaddingMask, int nWidth, int nUnit ) Sets the width of the padding to the specified value.
setPaddingWidthInfo( DhPaddingWidthInfo mwi ) Sets the padding widths according to those in a DhPaddingWidthInfo class.
setPositionInfo(PositionInfo posi) Topic under construction.
setSize(int w, int h) Sets the size of the element.
setSize(Point pt) Sets the size of the element.
setStyle(String strStyleKey, String value) Sets the style.
setStyleInt(String strStyleKey, int value) Sets the style.
setTextAlignment( int nAlignment ) Sets the text alignment style.
setTextVerticalAlign( int nVerticalAlign ) Sets the text vertical alignment style.
setTopUnit( int t, int unit ) Sets the top position of the element.
setVisible( boolean visible ) Sets the visiblility of the element.
setWidthUnit( int w, int unit ) Sets the width of the element.
setZIndex( int i ) Sets the z-index (layering) order of this element relative to the other elements in its container.

Fields

DhStyleBase.BOLD

Syntax
public static final int BOLD;
Description
Used by the style attribute of the setFont method.

DhStyleBase.ITALIC

Syntax
public static final int ITALIC;
Description
Used by the style attribute of the setFont method.

DhStyleBase.OK_TO_CACHE_STYLES

Syntax
public static boolean OK_TO_CACHE_STYLES;
Description
Setting this flag to false (default is true) forces all CSS styles to be drawn from the client peer instead of a cached value. This flag will probably be removed by release.

DhStyleBase.STRIKEOUT

Syntax
public static final int STRIKEOUT;
Description
Used by the style attribute of the setFont method.

DhStyleBase.UNDERLINE

Syntax
public static final int UNDERLINE;
Description
Used by the style attribute of the setFont method.

Constructors

DhStyleBase.DhStyleBase

Syntax 1
public DhStyleBase();
Description

Topic under construction.



Syntax 2
public DhStyleBase( int unit );
Description

Topic under construction.

Methods

DhStyleBase.ensurePaddings

Syntax
public synchronized void ensurePaddings();
Description

Topic under construction.

DhStyleBase.getBackColor

Syntax
public Color getBackColor();
Return Value

Returns one of the DhColors constants.

Description

Retrieves the background color property.

DhStyleBase.getBackgroundColor

Syntax
public int getBackgroundColor();
Return Value

Returns one of the DhColors constants.

Description

Retrieves the background color property.

DhStyleBase.getBackgroundColorString

Syntax
public String getBackgroundColorString();
Return Value

Returns a string representing the current background color.

Description

Retrieves the background color property as a string.

DhStyleBase.getBorderInfo

Syntax
public DhBorderInfo getBorderInfo();
Return Value

Returns the border information class.

Description

Retrieves the DhBorderInfo class with informatioon about the current border state.

DhStyleBase.getBounds

Syntax
final public Rectangle getBounds();
Return Value

Returns the location of the element as a Rectangle object.

Description

Retrieves the position and size of the element.

See Also
getWidthUnit, getHeightUnit, getTopUnit, getLeftUnit

DhStyleBase.getClipRect

Syntax
public Rectangle getClipRect();
Return Value

Returns a Rectangle object with the current clipping rectangle values. If the values are undefined or "auto", -1 is returned.

Description

Retrieves the current clipping rectangle.

DhStyleBase.getClipString

Syntax
public String getClipString();
Return Value

Returns the clip string.

Description

Retrieves the current clip setting string.

See Also
setClip

DhStyleBase.getColor

Syntax
public int getColor();
Return Value

Returns one of the DhColors constants.

Description

Retrieves the text foreground color property.

DhStyleBase.getCursor

Syntax
public int getCursor();
Return Value

Returns the current cursor type.

Description

Retrieves the cursor style for this element. For predefined values, see DhCursorEnum.

DhStyleBase.getCursorString

Syntax
public String getCursorString();
Return Value

Returns the current cursor type.

Description

Retrieves the cursor style for this element. For details, see the CSS cursor reference in the CSS Attributes reference of the Internet Client SDK (http://www.microsoft.com/msdn/sdk/inetsdk/help/dhtml/references/css/cursor.htm).

DhStyleBase.getFont

Syntax
public Font getFont();
Description

Topic under construction.

DhStyleBase.getFontName

Syntax
public String getFontName();
Return Value

Returns the name of the font family (for example, "arial").

Description

Retrieves the font name for this element.

DhStyleBase.getFontSize

Syntax
public int getFontSize();
Return Value

Returns the size of the font for this element.

Description

Retrieves the size of the font for this element.

DhStyleBase.getFontStyle

Syntax
public int getFontStyle();
Description

Topic under construction.

DhStyleBase.getForeColor

Syntax
public Color getForeColor();
Return Value

Returns one of the DhColors constants.

Description

Retrieves the foreground color property.

DhStyleBase.getHeightUnit

Syntax
final public int getHeightUnit();
Return Value

Returns one of DhUnitEnum constants to express the units of measurement.

Description

Retrieves the height unit.

See Also
getBounds

DhStyleBase.getLeftUnit

Syntax
final public int getLeftUnit();
Return Value

Returns one of DhUnitEnum constants to express the units of measurement.

Description

Retrieves the left position unit.

See Also
getBounds

DhStyleBase.getLocation

Syntax
public Point getLocation();
Return Value

Returns the location of the element.

Description

Retrieves the position (or location) of the element.

See Also
getTopUnit, getLeftUnit

DhStyleBase.getMarginWidthInfo

Syntax
public DhMarginWidthInfo getMarginWidthInfo();
Return Value

Returns a DhMarginWidthInfo class.

Description

Retrieves a DhMarginWidthInfo class describing the current margin settings for this element.

DhStyleBase.getPaddingWidthInfo

Syntax
public DhPaddingWidthInfo getPaddingWidthInfo();
Return Value

Returns a DhPaddingWidthInfo class.

Description

Retrieves a DhPaddingWidthInfo class describing the current padding width settings for this element.

DhStyleBase.getPositionInfo

Syntax
public PositionInfo getPositionInfo();
Description

Topic under construction.

DhStyleBase.getSize

Syntax
public Point getSize();
Return Value

Returns the size of the element as a Point object.

Description

Retrieves the size of the element.

See Also
getWidthUnit, getHeightUnit

DhStyleBase.getStyleInt

Syntax
public int getStyleInt( String strStyleKey );
Parameters
strStyleKey
The name of the style to get.
Description

Retrieves the style number. Calling this method directly is not part of the normal usage of this package. You should use more specific style methods (for example, DhStyleBase.getFontName).

DhStyleBase.getStyleString

Syntax
public String getStyleString( String strStyleKey );
Parameters
strStyleKey
The name of the style to get.
Return Value

Returns the style string.

Description

Retrieves the style. Calling this method directly is not part of the normal usage of this package. You should use more specific style methods (for example, DhStyleBase.getFontName).

DhStyleBase.getStyleText

Syntax
public String getStyleText();
Return Value

Returns the underlying CSS text string for this object.

Description

Retrieves the underlying CSS text string. (This is a very advanced feature of the library and is not part of normal usage scenarios.)

DhStyleBase.getTextAlignment

Syntax
public int getTextAlignment( );
Return Value

Returns the current alignment as LEFT (default), RIGHT, CENTER, or JUSTIFY from DhAlignEnum.

Description

Retrieves the current text alignment setting.

See Also
setTextAlignment

DhStyleBase.getTextVerticalAlign

Syntax
public int getTextVerticalAlign( );
Return Value

Returns the current alignment. This can be one of the following values found in DhAlignEnum:

Description

Retrieves the current text alignment setting.

See Also
setTextVerticalAlign

DhStyleBase.getTopUnit

Syntax
final public int getTopUnit();
Return Value

Returns one of DhUnitEnum constants to express the units of measurement.

Description

Retrieves the top position unit.

See Also
getBounds

DhStyleBase.getVisible

Syntax
public boolean getVisible();
Return Value

Returns true if element is visible; otherwise, returns false.

Description

Retrieves the visibility state of this element.

DhStyleBase.getWidthUnit

Syntax
final public int getWidthUnit();
Return Value

Returns one of DhUnitEnum constants to express the units of measurement.

Description

Retrieves the width unit.

See Also
getBounds

DhStyleBase.getZIndex

Syntax
public int getZIndex();
Return Value

Returns the z-index value set by setZIndex.

Description

Retrieves the z-index (layering) ordering of this element with respect to its container.

See Also
setZIndex

DhStyleBase.hasDefaultBackColor

Syntax
public boolean hasDefaultBackColor();
Return Value

Returns true if the background color is the default (white); otherwise, returns false.

Description

Determines if the background color is set to the default.

DhStyleBase.hasDefaultFont

Syntax
public boolean hasDefaultFont();
Description

Topic under construction.

DhStyleBase.hasDefaultForeColor

Syntax
public boolean hasDefaultForeColor();
Return Value

Returns true if successful; otherwise, returns false.

Description

Determines if the background color is the default (black).

DhStyleBase.hasDefaultLocation

Syntax
public boolean hasDefaultLocation();
Description

Topic under construction.

DhStyleBase.hasDefaultPositionInfo

Syntax
public boolean hasDefaultPositionInfo();
Description

Topic under construction.

DhStyleBase.hasDefaultSize

Syntax
public boolean hasDefaultSize();
Description

Topic under construction.

DhStyleBase.hasDefaultZIndex

Syntax
public boolean hasDefaultZIndex();
Description

Topic under construction.

DhStyleBase.setBackColor

Syntax
public void setBackColor( Color color );
Parameters
color
One of the DhColors constants.
Description

Sets the background color of the element. If never set, the background color used is that of the container.

DhStyleBase.setBackgroundColor

Syntax 1
public void setBackgroundColor( int color );
Parameters
color
One of the DhColors constants.
Description

Sets the background color of the element. If never set, the background color used is that of the container.



Syntax 2
public void setBackgroundColor( String color );
Parameters
color
One of the CSS-approved string constants, such as red or saddle brown.
Description

Sets the background color of the element. If never set, the background color used is that of the container.

DhStyleBase.setBorderColor

Syntax 1
public void setBorderColor( int nBordermask, String strColor );
Parameters
nBorderMask
The border sides you want to set. Can be any combination of DhBorderEnum.BORDER_SIDE_ALL, DhBorderEnum.BORDER_SIDE_LEFT, DhBorderEnum.BORDER_SIDE_RIGHT, DhBorderEnum.BORDER_SIDE_TOP, DhBorderEnum.BORDER_SIDE_BOTTOM.
strColor
The color string.
Description

Sets the border color to the specified value. It can be a hexadecimal color (for example, "#F0F0FF") or a defined color word (for example, "white", "black", "blue", and so on.)



Syntax 2
public void setBorderColor( String strColor );
Parameters
strColor
The color string.
Description

Sets all border colors to the specified value. The color can be a hexadecimal color (for example, "#F0F0FF") or a defined color word (for example, "white", "black", "blue", and so on.)



Syntax 3
public void setBorderColor( int nBorderMask, int nColor );
Parameters
nBorderMask
The border sides you want to set. Can be any combination of DhBorderEnum.BORDER_SIDE_ALL, DhBorderEnum.BORDER_SIDE_LEFT, DhBorderEnum.BORDER_SIDE_RIGHT, DhBorderEnum.BORDER_SIDE_TOP, DhBorderEnum.BORDER_SIDE_BOTTOM.
nColor
One of the DhColors constants.
Description

Sets the border color to the specified value defined in DhColors.



Syntax 4
public void setBorderColor( int nColor );
Parameters
nColor
One of the DhColors constants.
Description

Sets all border colors to the specified value defined in DhColor.

DhStyleBase.setBorderInfo

Syntax
public void setBorderInfo( DhBorderInfo biNew );
Parameters
biNew
The class containing the new state of the borders. String values are used over integer settings in the structure.
Description

Updates the border styles for this element.

DhStyleBase.setBorderStyle

Syntax 1
public void setBorderStyle( int nBorderMask, String strStyle );
Parameters
nBorderMask
The border sides you want to set. This can be any combination of DhBorderEnum.BORDER_SIDE_ALL, DhBorderEnum.BORDER_SIDE_LEFT, DhBorderEnum.BORDER_SIDE_RIGHT, DhBorderEnum.BORDER_SIDE_TOP, DhBorderEnum.BORDER_SIDE_BOTTOM.
strStyle
The style string. This can be one of the following strings:
  • "solid"
  • "dotted"
  • "dashed"
  • "groove"
  • "inset"
  • "outset"
  • "double"
  • "ridge"
  • "none"
Description

Sets the border style to a specified value.



Syntax 2
public void setBorderStyle( String strStyle );
Parameters
strStyle
The style string. This can be one of the following strings:
  • "solid"
  • "dotted"
  • "dashed"
  • "groove"
  • "inset"
  • "outset"
  • "double"
  • "ridge"
  • "none"
Description

Sets all border styles to a specified value.



Syntax 3
public void setBorderStyle( int nBorderMask, int nBorderKey );
Parameters
nBorderMask
The border sides you want to set. This can be any combination of DhBorderEnum.BORDER_SIDE_ALL, DhBorderEnum.BORDER_SIDE_LEFT, DhBorderEnum.BORDER_SIDE_RIGHT, DhBorderEnum.BORDER_SIDE_TOP, DhBorderEnum.BORDER_SIDE_BOTTOM.
nBorderKey
One of the DhBorderEnum constants.
Description

Sets the style to a specified value constant.



Syntax 4
public void setBorderStyle( int nBorderKey );
Parameters
nBorderKey
One of the DhBorderEnum constants.
Description

Sets the style to a specified value constant.

DhStyleBase.setBorderWidth

Syntax 1
public void setBorderWidth( int nBorderMask, String strWidth );
Parameters
nBorderMask
The border sides you want to set. This can be any combination of DhBorderEnum.BORDER_SIDE_ALL, DhBorderEnum.BORDER_SIDE_LEFT, DhBorderEnum.BORDER_SIDE_RIGHT, DhBorderEnum.BORDER_SIDE_TOP, DhBorderEnum.BORDER_SIDE_BOTTOM.
strWidth
String describing width in format described above.
Description

Sets the border width to the value specified. Border width is in the following form:


<border-width> ::= thick | medium | thin | none | <width-value>
<width-value>  ::= <integer><unit>
<unit>		 ::= px | pc | pt | em | in | mm | cm | ex 



Syntax 2
public void setBorderWidth( int nBorderMask, int nWidth, int nUnitKey );
Parameters
nBorderMask
The border sides you want to set. This can be any combination of DhBorderEnum.BORDER_SIDE_ALL, DhBorderEnum.BORDER_SIDE_LEFT, DhBorderEnum.BORDER_SIDE_RIGHT, DhBorderEnum.BORDER_SIDE_TOP, DhBorderEnum.BORDER_SIDE_BOTTOM.
nWidth
The numerical width of the border.
nUnitKey
The unit key to assign to the width. See DhUnitEnum for values.
Description

Sets the border width to the value and unit specified.



Syntax 3
public void setBorderWidth( int nWidth, int nUnitKey );
Parameters
nWidth
The numerical width of the borders.
nUnitKey
The unit key to assign to the width. See DhUnitEnum for values.
Description

Sets all border widths to the value and unit specified.



Syntax 4
public void setBorderWidth( String strWidth );
Parameters
strWidth
The border width.
Description

Sets the border width to the value specified.



Syntax 5
public void setBorderWidth( int nBorderWidthKey );
Parameters
strWidth
A string describing the width, such as a key from DhStringIDs.
Description

Sets the border width to the value specified.

DhStyleBase.setBounds

Syntax 1
final public void setBounds( int x, int y, int width, int height );
Parameters
x
The left coordinate of the position.
y
The top coordinate of the position.
width
The new width of the element.
height
The new height of the element.
Description

Sets the position and size of the element.

See Also
setWidthUnit, setHeightUnit, setTopUnit, setLeftUnit, setSize, setLocation



Syntax 2
final public void setBounds( Rectangle rect );
Parameters
rect
The position and dimensions of the element.
Description

Sets the position and size of the element.

See Also
setWidthUnit, setHeightUnit, setTopUnit, setLeftUnit

DhStyleBase.setClip

Syntax 1
public void setClip( Rectangle r );
Parameters
r
The clipping rectangle.
Description

Sets the clipping rectangle. Regions outside the clipping rectangle will not be drawn.



Syntax 2
public void setClip( String strClip );
Parameters
strClip
The clip string.
Description

Sets the clipping rectangle string in the form:

rect( top, right, bottom, left )

where top, left, bottom or right can be "auto" or a length measurement.

DhStyleBase.setColor

Syntax 1
public void setColor( int color );
Parameters
color
One of the DhColors constants.
Description

Sets the text color (and other foreground objects).



Syntax 2
public void setColor( String color );
Parameters
color
One of the CSS-approved string constants, such as red or saddle brown.
Description

Sets the color for foreground objects, such as text.

DhStyleBase.setCursor

Syntax 1
public void setCursor( int nCursor );
Parameters
nCursor
The cursor type.
Description

Sets the cursor style for this element. For predefined values, see DhCursorEnum.



Syntax 2
public void setCursor( String strCursor );
Parameters
strCursor
The desired cursor.
Description

Sets the cursor style for this element. For details, see the CSS cursor reference in the CSS Attributes reference of the Internet Client SDK (http://www.microsoft.com/msdn/sdk/inetsdk/help/dhtml/references/css/cursor.htm).

DhStyleBase.setFont

Syntax 1
public void setFont( String name, int size, int style );
Parameters
name
The name of the font family (for example, "arial", "comic sans ms", and so on.)
size
The size of the font (in points).
style
A set of flags (BOLD, ITALIC, UNDERLINE, STRIKEOUT) that can be bitwise OR'd together to form the style of font. The number 0 is also valid and implies none of these attributes.
Description

Sets the font value for this element.



Syntax 2
public void setFont( String name, int size );
Parameters
name
The name of the font family (for example, "arial", "comic sans ms", and so on.)
size
The size of the font (in points).
Description

Sets the font value for this element.



Syntax 3
public void setFont( Font font );
Description

Topic under construction.

DhStyleBase.setForeColor

Syntax
public void setForeColor( Color color );
Parameters
color
One of the DhColors constants.
Description

Sets the color of foreground objects, such as text.

DhStyleBase.setHeightUnit

Syntax
public void setHeightUnit( int h, int unit );
Parameters
h
The height value.
unit
One of DhUnitEnum constants to express the units of measurement.
Description

Sets the height of the element.

See Also
setBounds

DhStyleBase.setLeftUnit

Syntax
final public void setLeftUnit( int v, int unit );
Parameters
v
The left position value.
unit
One of DhUnitEnum constants to express the units of measurement.
Description

Sets the left position of the element.

See Also
setBounds

DhStyleBase.setLocation

Syntax 1
public void setLocation( int x, int y );
Parameters
x
The left coordinate of the position.
y
The top coordinate of the position.
Description

Sets the position of the element.

See Also
setTopUnit, setLeftUnit



Syntax 2
public void setLocation( Point pt );
Parameters
pt
The new location of the element.
Description

Sets the position of the element.

See Also
setTopUnit, setLeftUnit

DhStyleBase.setMarginWidth

Syntax 1
public void setMarginWidth( int nWidth, int nUnit );
Parameters
nWidth
The width of the margins.
nUnit
The unit of the margins widths. See DhUnitEnum) for details.
Description

Sets the width of all the margins to the specified value.



Syntax 2
public void setMarginWidth( int nMarginMask, int nWidth, int nUnit );
Parameters
nMarginMask
A combination of the margins you want apply. See DhMarginEnum.
nWidth
The width of the margins.
nUnit
The unit of the margin widths. See DhUnitEnum) for details.
Description

Sets the width of the margins to the specified value.

DhStyleBase.setMarginWidthInfo

Syntax
public void setMarginWidthInfo( DhMarginWidthInfo mwi );
Parameters
mni
The margin width settings.
Description

Sets the margins widths according to those in a DhMarginWidthInfo class.

DhStyleBase.setPaddingWidth

Syntax 1
public void setPaddingWidth( int nWidth, int nUnit );
Parameters
nWidth
The padding widths.
nUnit
The unit of the padding widths. See DhUnitEnum for details.
Description

Sets the width of all paddings to the specified value.



Syntax 2
public void setPaddingWidth( int nPaddingMask, int nWidth, int nUnit );
Parameters
nPaddingMask
A combination of the paddings you want to apply. See DhEnumConstants for details.
nWidth
The padding widths.
nUnit
The unit of the padding widths. See DhUnitEnum for details.
Description

Sets the width of the padding to the specified value.

DhStyleBase.setPaddingWidthInfo

Syntax
public void setPaddingWidthInfo( DhPaddingWidthInfo mwi );
Parameters
mwi
The new padding width settings.
Description

Sets the padding widths according to those in a DhPaddingWidthInfo class.

DhStyleBase.setPositionInfo

Syntax
public void setPositionInfo( PositionInfo posi );
Description

Topic under construction.

DhStyleBase.setSize

Syntax 1
public void setSize( int w, int h );
Parameters
width
The new width of the element.
height
The new height of the element.
Description

Sets the size of the element.

See Also
setWidthUnit, setHeightUnit



Syntax 2
public void setSize( Point pt );
Parameters
pt
The new width and height of the element.
Description

Sets the size of the element.

Exceptions

IllegalArgumentException thrown if either width or height is less than 0.

See Also
setWidthUnit, setHeightUnit

DhStyleBase.setStyle

Syntax
public void setStyle( String strStyleKey, String value );
Parameters
strStyleKey
The name of the style to set.
value
A string value.
Description

Sets the style.

Calling this method directly is not part of the normal usage of this package. You should use the more specific style methods (for example, DhStyleBase.setFont).

DhStyleBase.setStyleInt

Syntax
public void setStyleInt( String strStyleKey, int value );
Parameters
strStyleKey
The name of the style to set.
value
An integer value.
Description

Sets the style.

Calling this method directly is not part of the normal usage of this package. You should use the more specific style methods (for example, DhStyleBase.setFont).

DhStyleBase.setTextAlignment

Syntax
public void setTextAlignment( int nAlignment );
Parameters
nAlignment
The new alignment setting. This can be one of values found in DhAlignEnum:
  • LEFT (default)
  • RIGHT
  • CENTER
  • JUSTIFY
Description

Sets the text alignment style.

Exceptions

IllegalArgumentException Thrown if nAlignment is not one of the above values.

DhStyleBase.setTextVerticalAlign

Syntax
public void setTextVerticalAlign( int nVerticalAlign );
Parameters
nVerticalAlign
The new alignment setting. This can be one of values found in DhAlignEnum:
  • BASELINE (default)
  • SUBSCRIPT
  • SUPERSCRIPT
Description

Sets the text vertical alignment style.

Exceptions

IllegalArgumentException Thrown if nAlignment is not one of the above values.

DhStyleBase.setTopUnit

Syntax
final public void setTopUnit( int t, int unit );
Parameters
t
The top position value.
unit
One of DhUnitEnum constants to express the units of measurement.
Description

Sets the top position of the element.

See Also
setBounds

DhStyleBase.setVisible

Syntax
public void setVisible( boolean visible );
Parameters
visible
Set to true to allow element to be rendered; otherwise, set to false.
Description

Sets the visiblility of the element.

DhStyleBase.setWidthUnit

Syntax
public void setWidthUnit( int w, int unit );
Parameters
w
The width value.
unit
One of DhUnitEnum constants to express the units of measurement.
Description

Sets the width of the element.

See Also
getBounds

DhStyleBase.setZIndex

Syntax
public void setZIndex( int i );
Parameters
i
The z-index value of this element
Description

Sets the z-index (layering) order of this element relative to the other elements in its container. The lower the number, the further back this element is displayed. The element with the highest number z-index in any given container is displayed over all other elements.