net.xoetrope.html
Class XPanel

java.lang.Object
  extended by net.xoetrope.html.XHtmlWidget
      extended by net.xoetrope.html.XPanel
All Implemented Interfaces:
XAttributedComponent

public class XPanel
extends XHtmlWidget
implements XAttributedComponent

A basic container for components. The panel can optional draw a border. By default no frame is displayed.

Copyright (c) Xoetrope Ltd., 1998-2003
License: see license.txt


Field Summary
protected  netscape.javascript.JSObject obj
           
 
Fields inherited from class net.xoetrope.html.XHtmlWidget
currentProject, divElement, htmlDoc, imageElement, inputElement, labelElement, metaElement, olElement, selectElement, tableElement, textareaElement, ulElement
 
Constructor Summary
XPanel()
          Constructs a new panel with a null layout
XPanel(org.w3c.dom.html.HTMLDivElement divElement)
          Create a new XPanel based on an existing HTML div element.
XPanel(java.lang.String value, java.lang.String id)
          Create a new XPanel with a value and an id attribute.
 
Method Summary
 void add(org.w3c.dom.html.HTMLElement element)
          Add an element in the XPanel
 java.lang.String getAlign()
          Get the align attribute of the XPanel.
 java.lang.String getAttribute(java.lang.String attribName)
          Get an attribute value
 java.lang.String getBackgroundColor()
          Get the background color of the XPanel.
 java.lang.String getFontColor()
          Get the font color of the XPanel's elements' text.
 java.lang.String getFontFace()
          Get the font face of the XPanel's elements' text.
 int getFontSize()
          Get the size of the XPanel's elements' text.
 org.w3c.dom.html.HTMLDivElement getHTMLElement()
          Get the HTML element at which refers the XPanel.
 void insertBefore(XPanel panel)
          Insert a new panel before the current one
 boolean isVisible()
          Method used to know if the XPanel is visible or hidden on the HTML page.
 void resetContent()
          Remove all the elements contained in the panel
 void setAlign(java.lang.String align)
          Set the align attribute of the XPanel
 int setAttribute(java.lang.String attribName, java.lang.Object attribValue)
          Set one or more attributes of the component.
 void setBackgroundColor(java.lang.String hexColor)
          Set the background color of the XPanel.
 void setFontColor(java.lang.String hexColor)
          Set the font color of the XPanel's elements' text.
 void setFontFace(java.lang.String fontFace)
          Set the font face of the XPanel's elements' text.
 void setFontSize(int fontsize)
          Set the size of the XPanel's elements' text.
 void setId(java.lang.String id)
          Set the id attribute of the XPanel
 void setVisible(boolean visible)
          Set the XPanel visible or invisible.
 
Methods inherited from class net.xoetrope.html.XHtmlWidget
addEvent, setObject, setObject, setObject, setObject, setObject, setObject, setObject, setObject, setObject, setObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

obj

protected netscape.javascript.JSObject obj
Constructor Detail

XPanel

public XPanel()
Constructs a new panel with a null layout


XPanel

public XPanel(java.lang.String value,
              java.lang.String id)
Create a new XPanel with a value and an id attribute.

Parameters:
value - the text to display in the panel
id - the id of the panel

XPanel

public XPanel(org.w3c.dom.html.HTMLDivElement divElement)
Create a new XPanel based on an existing HTML div element.

Parameters:
divElement - the HTML div tag the XPanel refers to
Method Detail

resetContent

public void resetContent()
Remove all the elements contained in the panel


add

public void add(org.w3c.dom.html.HTMLElement element)
Add an element in the XPanel

Parameters:
element - the element to add

setVisible

public void setVisible(boolean visible)
Set the XPanel visible or invisible.

Parameters:
visible - true if visible, false otherwise

isVisible

public boolean isVisible()
Method used to know if the XPanel is visible or hidden on the HTML page.

Returns:
true if the XPanel is visible, false otherwise

setAttribute

public int setAttribute(java.lang.String attribName,
                        java.lang.Object attribValue)
Set one or more attributes of the component.

Specified by:
setAttribute in interface XAttributedComponent
Parameters:
attribName - the attribute name
attribValue - the attribute value
Returns:
0 for success, non zero for failure or to require some further action

getAttribute

public java.lang.String getAttribute(java.lang.String attribName)
Get an attribute value

Parameters:
attribName - the attribute which value is requested
Returns:
the value of this attribute

getFontSize

public int getFontSize()
Get the size of the XPanel's elements' text.

Returns:
the int value of the font size

setFontSize

public void setFontSize(int fontsize)
Set the size of the XPanel's elements' text.

Parameters:
fontsize - the int value of the font size

getBackgroundColor

public java.lang.String getBackgroundColor()
Get the background color of the XPanel.

Returns:
the hexadecimal value of the background color

setBackgroundColor

public void setBackgroundColor(java.lang.String hexColor)
Set the background color of the XPanel.

Parameters:
hexColor - the hexadecimal value of the background color

getFontColor

public java.lang.String getFontColor()
Get the font color of the XPanel's elements' text.

Returns:
the hexadecimal value of the font color

setFontColor

public void setFontColor(java.lang.String hexColor)
Set the font color of the XPanel's elements' text.

Parameters:
hexColor - the hexadecimal value of the font color

setFontFace

public void setFontFace(java.lang.String fontFace)
Set the font face of the XPanel's elements' text.

Parameters:
fontFace - the font face

getFontFace

public java.lang.String getFontFace()
Get the font face of the XPanel's elements' text.

Returns:
the font face

setAlign

public void setAlign(java.lang.String align)
Set the align attribute of the XPanel

Parameters:
align - the alignment of the XPanel (left, right, center, justified)

getAlign

public java.lang.String getAlign()
Get the align attribute of the XPanel.

Returns:
the alignment of this XPanel

setId

public void setId(java.lang.String id)
Set the id attribute of the XPanel

Parameters:
id - the id of the panel

insertBefore

public void insertBefore(XPanel panel)
Insert a new panel before the current one

Parameters:
panel - the panel that is to be inserted

getHTMLElement

public org.w3c.dom.html.HTMLDivElement getHTMLElement()
Get the HTML element at which refers the XPanel.

Returns:
the HTML element.