com.incrediblesoft.redjey
Class Style

java.lang.Object
  extended by com.incrediblesoft.redjey.Style

public class Style
extends java.lang.Object


Constructor Summary
Style(CustomFont font, Background background, AbstractBorder border, java.util.Hashtable attributes)
           
Style(int marginLeft, int marginRight, int marginTop, int marginBottom, int paddingLeft, int paddingRight, int paddingTop, int paddingBottom, int paddingHorizontal, int paddingVertical, CustomFont font, Background background, AbstractBorder border, java.util.Hashtable attributes)
          Creates a new Style.
 
Method Summary
 void addAttribute(java.lang.Object key, java.lang.Object value)
           
 Style clone()
          Clones this style.
 java.util.Hashtable getAttributes()
           
 int getClientOffsetX()
           
 int getClientOffsetY()
           
 CustomFont getFont()
           
 int getMarginBottom()
           
 int getMarginLeft()
           
 int getMarginRight()
           
 int getMarginTop()
           
 int getMinHeight()
           
 int getMinWidth()
           
 int getPaddingBottom()
           
 int getPaddingHorizontal()
           
 int getPaddingLeft()
           
 int getPaddingRight()
           
 int getPaddingTop()
           
 int getPaddingVertical()
           
 Dimension getPreferredSize()
           
 void paint(javax.microedition.lcdui.Graphics g, int x, int y, int width, int height)
           
 void setAttributes(java.util.Hashtable attributes)
           
 Style setBackground(Background background)
           
 Style setBorder(AbstractBorder border)
           
 Style setFont(CustomFont font)
           
 void setMarginBottom(int marginBottom)
           
 void setMarginLeft(int marginLeft)
           
 void setMarginRight(int marginRight)
           
 void setMarginTop(int marginTop)
           
 void setPaddingBottom(int paddingBottom)
           
 void setPaddingHorizontal(int paddingHorizontal)
           
 void setPaddingLeft(int paddingLeft)
           
 void setPaddingRight(int paddingRight)
           
 void setPaddingTop(int paddingTop)
           
 void setPaddingVertical(int paddingVertical)
           
 void tick(int dt)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Style

public Style(int marginLeft,
             int marginRight,
             int marginTop,
             int marginBottom,
             int paddingLeft,
             int paddingRight,
             int paddingTop,
             int paddingBottom,
             int paddingHorizontal,
             int paddingVertical,
             CustomFont font,
             Background background,
             AbstractBorder border,
             java.util.Hashtable attributes)
Creates a new Style.

Parameters:
marginLeft - the margin in pixels to the next element on the left
marginRight - the margin in pixels to the next element on the right
marginTop - the margin in pixels to the next element on the top
marginBottom - the margin in pixels to the next element on the bottom
paddingLeft - the padding between the left border and content in pixels
paddingRight - the padding between the right border and content in pixels
paddingTop - the padding between the top border and content in pixels
paddingBottom - the padding between the bottom border and content in pixels
paddingVertical - the vertical padding between internal elements of an item
paddingHorizontal - the horizontal padding between internal elements of an item
font - the content-font for this style
background - the background for this style
border - the border for this style
attributes - additional attributes

Style

public Style(CustomFont font,
             Background background,
             AbstractBorder border,
             java.util.Hashtable attributes)
Method Detail

getMinWidth

public int getMinWidth()

getMinHeight

public int getMinHeight()

getPreferredSize

public Dimension getPreferredSize()

getClientOffsetX

public int getClientOffsetX()

getClientOffsetY

public int getClientOffsetY()

setFont

public Style setFont(CustomFont font)

getFont

public CustomFont getFont()

setBorder

public Style setBorder(AbstractBorder border)

setBackground

public Style setBackground(Background background)

getPaddingLeft

public int getPaddingLeft()

setPaddingLeft

public void setPaddingLeft(int paddingLeft)

getPaddingTop

public int getPaddingTop()

setPaddingTop

public void setPaddingTop(int paddingTop)

getPaddingRight

public int getPaddingRight()

setPaddingRight

public void setPaddingRight(int paddingRight)

getPaddingBottom

public int getPaddingBottom()

setPaddingBottom

public void setPaddingBottom(int paddingBottom)

getPaddingVertical

public int getPaddingVertical()

setPaddingVertical

public void setPaddingVertical(int paddingVertical)

getPaddingHorizontal

public int getPaddingHorizontal()

setPaddingHorizontal

public void setPaddingHorizontal(int paddingHorizontal)

getMarginLeft

public int getMarginLeft()

setMarginLeft

public void setMarginLeft(int marginLeft)

getMarginTop

public int getMarginTop()

setMarginTop

public void setMarginTop(int marginTop)

getMarginRight

public int getMarginRight()

setMarginRight

public void setMarginRight(int marginRight)

getMarginBottom

public int getMarginBottom()

setMarginBottom

public void setMarginBottom(int marginBottom)

getAttributes

public java.util.Hashtable getAttributes()

setAttributes

public void setAttributes(java.util.Hashtable attributes)

addAttribute

public void addAttribute(java.lang.Object key,
                         java.lang.Object value)

tick

public void tick(int dt)

paint

public void paint(javax.microedition.lcdui.Graphics g,
                  int x,
                  int y,
                  int width,
                  int height)

clone

public Style clone()
Clones this style. Each component must have a local copy of template's style. Note: this method doesn't clone hashtable attributes because of fact that Object component in CLDC doesn't have clone method.

Overrides:
clone in class java.lang.Object
Returns:
cloned style