www.element4solution.com

e4s.html
Class E4BoxRoundCorners

java.lang.Object
  extended by e4s.util.E4Object
      extended by e4s.html.E4HtmlObject
          extended by e4s.html.E4HtmlElementGeneral
              extended by e4s.html.E4HtmlElement
                  extended by e4s.html.E4HtmlContentElement
                      extended by e4s.html.E4BoxRoundCorners
All Implemented Interfaces:
E4HtmlElement_Intf

public class E4BoxRoundCorners
extends E4HtmlContentElement
implements E4HtmlElement_Intf

Draw a box with rounded corners. The rounded corners are defined as GIF images with a transparent section and a white section. The transparent section is in foreground of the getBorderColor(). This results, that this component cannot be used on other rather than white backgrounds.

See Also:
E4Box,

Example_BoxRoundCorners.java


Field Summary
static int IMG_HEIGHT
          Default image height for the corner images.
static int IMG_HEIGHT_SPACER
          Default image height for the left/right spacer images.
static int IMG_WIDTH
          Default image width for the corner images.
static IMG LEFT_BOTTOM
          Default image for the left-bottom corner.
static IMG LEFT_MIDDLE
          Default image for the left-middle corner.
static IMG LEFT_TOP
          Default image for the left-top corner.
static IMG LEFT_TOP_FILLED
          Default image for the left-border corner.
static IMG RIGHT_BOTTOM
          Default image for the right-bottom corner.
static IMG RIGHT_MIDDLE
          Default image for the right-middle corner.
static IMG RIGHT_TOP
          Default image for the right-top corner.
static IMG RIGHT_TOP_FILLED
          Default image for the right-bottom corner.
 
Fields inherited from class e4s.html.E4HtmlContentElement
BOOL_STR_FALSE, BOOL_STR_TRUE
 
Fields inherited from class e4s.html.E4HtmlElementGeneral
m_elements, m_needed_scripts
 
Fields inherited from class e4s.html.E4HtmlObject
m_parent_e4sID
 
Fields inherited from class e4s.util.E4Object
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET
 
Constructor Summary
E4BoxRoundCorners()
          Construct a box with rounded corners but no caption.
E4BoxRoundCorners(E4HtmlElement_Intf caption)
          Construct a box with rounded corners and a caption.
E4BoxRoundCorners(E4Label_Intf caption)
          Construct a box with rounded corners and a caption.
E4BoxRoundCorners(java.lang.String caption)
          Construct a box with rounded corners and a caption.
 
Method Summary
static java.lang.String _getSVNVersionString()
          Get version info string from subversion.
 void collectScripts(E4ScriptsVec v, E4ServletImplementation_Intf servlet)
          Get a vector of used scripts from all subelements.
 void collectStylesForEditing(E4StylesHash v, E4ServletImplementation_Intf servlet)
          Build a list (Vector) with style definitions used so far during display of this page.
 void collectTranslationsForEditing(E4TranslationsVec v, E4ServletImplementation_Intf servlet)
          Build a list (Vector) with text definitions used so far during display of this page for translations
 E4Color getBgColor()
          Get the background color.
 E4Color getBorderColor()
          Get the color for the border.
 E4Label_Intf getCaption()
          Get the caption.
 java.lang.String getHeight()
          Get the height.
 java.lang.String getWidth()
          Get the width.
 void setBgColor(E4Color color)
          Set the color for the background - this requires custom images with this color to be defined using setImages(e4s.html.IMG, e4s.html.IMG, e4s.html.IMG, e4s.html.IMG).
 void setBorderColor(E4Color color)
          Set the color for the border.
 void setCaption(E4HtmlElement_Intf caption)
          Set the caption.
 void setCaption(E4Label_Intf caption)
          Set the caption.
 void setCaption(FONT font, boolean bold, E4Label_Intf caption)
          Set the caption.
 void setCaption(FONT font, boolean bold, java.lang.String caption)
          Set the caption.
 void setCaption(java.lang.String caption)
          Set the caption.
 void setHeight(int height)
          Set the inner height of the table in pixels.
 void setHeight(java.lang.String height)
          Set the inner height of the table.
 void setHeightMax()
          Set the inner height of the table to the maximum.
 void setImages(IMG left_top, IMG right_top, IMG right_bottom, IMG left_bottom)
          Set the images for the rounded corners.
 void setSmallLineAfterCaption(boolean mode)
          Add a small, 2px hight line after the caption but before the content.
 void setWidth(int width)
          Set the inner width of the table in pixels.
 void setWidth(java.lang.String width)
          Set the inner width of the table.
 void setWidthMax()
          Set the inner width of the table to the maximum.
static void toHtml_BottomRow(TABLE table, int colspan_data, E4Color col, E4Color bgcol, java.lang.String width, IMG left_bottom, IMG right_bottom)
           
static void toHtml_CaptionRow(TABLE table, int colspan_data, E4Color col, E4Color bgcol, java.lang.String width, E4HtmlElement_Intf caption, FONT font, boolean bold, boolean small_line_after_caption)
           
static TD[] toHtml_DataRow(TABLE table, int colspan_data, E4Color col, E4Color bgcol)
           
static void toHtml_SpacerRow(TABLE table, int colspan_data, E4Color col, E4Color bgcol, java.lang.String width, java.lang.String height, IMG left_spacer, IMG right_spacer)
           
static void toHtml_TopRow(TABLE table, int colspan_data, E4Color col, E4Color bgcol, java.lang.String width, E4HtmlElement_Intf caption, IMG left_top, IMG right_top)
           
 void toHtml(E4StringBufferHtml buf, E4ServletImplementation_Intf servlet)
          Render this component.
 
Methods inherited from class e4s.html.E4HtmlContentElement
A_Email, A_Email, A_Multiple, A_Popup, A_Popup, A_Popup, A_Popup, A_Popup, A_Popup, A_Popup, A_Reference, A_Reference, A_Reference, A_Reference, A_Reference, A_ReturnValue, A_ReturnValue, A_ReturnValue, A_ReturnValue, A, A, A, A, A, A, A, AjaxElement, AjaxElement, AjaxElement, B, B, BIG, Box, Box, Box, BoxRoundCorners, BoxRoundCorners, BoxRoundCorners, BR, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, BUTTON, CENTER, DEL, DIV, DIV, DIV, DIV, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FONT, FullSizeE4Message, H1, H2, H3, H4, Hint, HR, I, I, IMG, IMG, IMG, IMG, IMG, IMG, IMG, IMG, INS, Message, Message, Message, Message, Message, NBSP, NOBR, P_NBSP, P, PRE, print, print, print, print, print, print, print, print, print, print, print, print, print, print, print, print, print, println, println, println, println, println, println, println, rem, rem, rem, rem, rem, rem, SMALL, SPAN, STRIKE, strike, SystemError, SystemError, SystemError, SystemError, TABLE, TABLE, trace, trace, trace, trace, trace, trace, translate_Sys, translate, U, UL
 
Methods inherited from class e4s.html.E4HtmlElement
addElement, addElement, addElement, copyElements, print
 
Methods inherited from class e4s.html.E4HtmlElementGeneral
addScript, addScript, addScript, addStyleForEditing, addTranslationForEditing, buildStyleAttribute, buildStyleClassReference, collectStylesForEditing, collectStylesForEditing, collectTranslationsForEditing, createScript, createScript, debugToString, findElement, findElement, findElement, findElement, getElements, getElementsVec, getField, getId, getLastElement, getStringContent, getStyle, getSTYLE, getStyle, hasScripts, hasSTYLE, isContentClass, isE4InputField_Intf, openTag, removeAll, removeElementById, removeElements, removeElements, removeStyle, setId, setReadOnly, setStyle, setStyle, setSTYLE, setValue, Style, Style, toHtml_hidden, validate
 
Methods inherited from class e4s.html.E4HtmlObject
E4ID, E4ID, set_e4sID
 
Methods inherited from class e4s.util.E4Object
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, finalize, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, toString, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface e4s.html.E4HtmlElement_Intf
addScript, addScript, addScript, debugToString, findElement, findElement, getElements, getElementsVec, getField, getId, getStringContent, isContentClass, removeAll, removeElementById, removeElements, set_e4sID, setId, setReadOnly, setValue, toHtml_hidden, validate
 

Field Detail

LEFT_TOP

public static final IMG LEFT_TOP
Default image for the left-top corner.


RIGHT_TOP

public static final IMG RIGHT_TOP
Default image for the right-top corner.


LEFT_MIDDLE

public static final IMG LEFT_MIDDLE
Default image for the left-middle corner.


RIGHT_MIDDLE

public static final IMG RIGHT_MIDDLE
Default image for the right-middle corner.


LEFT_BOTTOM

public static final IMG LEFT_BOTTOM
Default image for the left-bottom corner.


RIGHT_BOTTOM

public static final IMG RIGHT_BOTTOM
Default image for the right-bottom corner.


LEFT_TOP_FILLED

public static final IMG LEFT_TOP_FILLED
Default image for the left-border corner.


RIGHT_TOP_FILLED

public static final IMG RIGHT_TOP_FILLED
Default image for the right-bottom corner.


IMG_WIDTH

public static final int IMG_WIDTH
Default image width for the corner images.

See Also:
Constant Field Values

IMG_HEIGHT

public static final int IMG_HEIGHT
Default image height for the corner images.

See Also:
Constant Field Values

IMG_HEIGHT_SPACER

public static final int IMG_HEIGHT_SPACER
Default image height for the left/right spacer images.

See Also:
Constant Field Values
Constructor Detail

E4BoxRoundCorners

public E4BoxRoundCorners()
Construct a box with rounded corners but no caption.

See Also:
E4BoxRoundCorners(String), E4BoxRoundCorners(e4s.translate.E4Label_Intf)

E4BoxRoundCorners

public E4BoxRoundCorners(E4Label_Intf caption)
Construct a box with rounded corners and a caption.

Parameters:
caption - the caption
See Also:
E4BoxRoundCorners(), E4BoxRoundCorners(String), setCaption(e4s.translate.E4Label_Intf)

E4BoxRoundCorners

public E4BoxRoundCorners(E4HtmlElement_Intf caption)
Construct a box with rounded corners and a caption.

Parameters:
caption - the caption
See Also:
E4BoxRoundCorners(), E4BoxRoundCorners(String), setCaption(e4s.translate.E4Label_Intf)

E4BoxRoundCorners

public E4BoxRoundCorners(java.lang.String caption)
Construct a box with rounded corners and a caption.

Parameters:
caption - the caption
See Also:
E4BoxRoundCorners(), E4BoxRoundCorners(e4s.translate.E4Label_Intf), setCaption(String)
Method Detail

setSmallLineAfterCaption

public void setSmallLineAfterCaption(boolean mode)
Add a small, 2px hight line after the caption but before the content.

Parameters:
mode - true (default) add this small line

setWidth

public void setWidth(int width)
Set the inner width of the table in pixels. For the outer width, add a value of 2x IMG_WIDTH.

Parameters:
width - the inner width in pixels.
See Also:
setWidthMax(), getWidth()

setHeight

public void setHeight(int height)
Set the inner height of the table in pixels. For the outer width, add a value of 2x IMG_WIDTH.

Parameters:
width - the inner width in pixels.
See Also:
setWidthMax(), getWidth()

setWidth

public void setWidth(java.lang.String width)
Set the inner width of the table.

See Also:
setWidth(int), getWidth()

setHeight

public void setHeight(java.lang.String height)
Set the inner height of the table.

See Also:
setHeight(int), getHeight()

setWidthMax

public void setWidthMax()
Set the inner width of the table to the maximum.

See Also:
setWidth(int), getWidth()

setHeightMax

public void setHeightMax()
Set the inner height of the table to the maximum.

See Also:
setHeight(int), getHeight()

getWidth

public java.lang.String getWidth()
Get the width.

Returns:
an integer formatted as String or "100%"
See Also:
setWidthMax(), setWidth(int)

getHeight

public java.lang.String getHeight()
Get the height.

Returns:
an integer formatted as String or "100%"
See Also:
setHeightMax(), setHeight(int)

setCaption

public void setCaption(FONT font,
                       boolean bold,
                       E4Label_Intf caption)
Set the caption. A caption is optionally and will be displayed as table cell using the background color getBgColor().

Parameters:
font - the font to be used for the caption (the default is ARIAL)
bold - make the caption in bold letters (default)
caption - the text to be displayed, a value of null turns off the caption display
See Also:
getCaption(), setCaption(e4s.translate.E4Label_Intf), setCaption(String), setCaption(e4s.html.FONT,boolean,String)

setCaption

public void setCaption(java.lang.String caption)
Set the caption. A caption is optionally and will be displayed as table cell using the background color getBorderColor().

Parameters:
caption - the text to be displayed, a value of null turns off the caption display
See Also:
getCaption(), setCaption(e4s.translate.E4Label_Intf), setCaption(e4s.html.FONT,boolean,e4s.translate.E4Label_Intf), setCaption(e4s.html.FONT,boolean,String)

setCaption

public void setCaption(E4Label_Intf caption)
Set the caption. A caption is optionally and will be displayed as table cell using the background color getBgColor().

Parameters:
caption - the text to be displayed, a value of null turns off the caption display
See Also:
getCaption(), setCaption(String), setCaption(e4s.html.FONT,boolean,e4s.translate.E4Label_Intf), setCaption(e4s.html.FONT,boolean,String)

setCaption

public void setCaption(E4HtmlElement_Intf caption)
Set the caption. A caption is optionally and will be displayed as table cell using the background color getBgColor().

Parameters:
caption - the text to be displayed, a value of null turns off the caption display
See Also:
getCaption(), setCaption(String), setCaption(e4s.html.FONT,boolean,e4s.translate.E4Label_Intf), setCaption(e4s.html.FONT,boolean,String)

setCaption

public void setCaption(FONT font,
                       boolean bold,
                       java.lang.String caption)
Set the caption. A caption is optionally and will be displayed as table cell using the background color getBgColor().

Parameters:
font - the font to be used for the caption (the default is ARIAL)
bold - make the caption in bold letters (default)
caption - the text to be displayed, a value of null turns off the caption display
See Also:
getCaption(), setCaption(e4s.translate.E4Label_Intf), setCaption(e4s.html.FONT,boolean,e4s.translate.E4Label_Intf), setCaption(String)

getCaption

public E4Label_Intf getCaption()
Get the caption. A caption is optionally and will be displayed as table cell using the background color getBgColor(). By default, there will be no caption.

Returns:
the text to be displayed or null if no text will be displayed
See Also:
setCaption(e4s.translate.E4Label_Intf), setCaption(e4s.html.FONT,boolean,e4s.translate.E4Label_Intf), setCaption(e4s.html.FONT,boolean,String), setCaption(String)

setBgColor

public void setBgColor(E4Color color)
Set the color for the background - this requires custom images with this color to be defined using setImages(e4s.html.IMG, e4s.html.IMG, e4s.html.IMG, e4s.html.IMG).

Parameters:
color - the background color, a value of null indicates no background color.
See Also:
getBgColor(), setImages(e4s.html.IMG, e4s.html.IMG, e4s.html.IMG, e4s.html.IMG)

getBgColor

public E4Color getBgColor()
Get the background color.

Returns:
the background color or null if no background color is specified.
See Also:
setBgColor(e4s.html.E4Color)

setBorderColor

public void setBorderColor(E4Color color)
Set the color for the border. There must be a color specified.

Parameters:
color - (if null, the default color E4Color.GRAY will be used.
See Also:
getBorderColor()

getBorderColor

public E4Color getBorderColor()
Get the color for the border.

Returns:
the border color
See Also:
setBgColor(e4s.html.E4Color)

setImages

public void setImages(IMG left_top,
                      IMG right_top,
                      IMG right_bottom,
                      IMG left_bottom)
Set the images for the rounded corners. Unless, you do not specify a background color for the box or the background of the element the box is included in is other than white there is no need to specify these images. The width of the images shall be IMG_WIDTH and the height shall be IMG_HEIGHT.

Parameters:
left_top - left-top image, default is LEFT_TOP or LEFT_TOP_FILLED in the case of a caption defined.
right_top - right-top image, default is RIGHT_TOP or RIGHT_TOP_FILLED in the case of a caption defined.
right_bottom - right-bottom image, default is RIGHT_BOTTOM
left_bottom - left-bottom image, default is LEFT_BOTTOM

toHtml

public void toHtml(E4StringBufferHtml buf,
                   E4ServletImplementation_Intf servlet)
            throws java.lang.Exception
Render this component.

Specified by:
toHtml in interface E4HtmlElement_Intf
Overrides:
toHtml in class E4HtmlElementGeneral
Parameters:
servlet - a valid server context.
Throws:
java.lang.Exception

toHtml_DataRow

public static TD[] toHtml_DataRow(TABLE table,
                                  int colspan_data,
                                  E4Color col,
                                  E4Color bgcol)

toHtml_BottomRow

public static void toHtml_BottomRow(TABLE table,
                                    int colspan_data,
                                    E4Color col,
                                    E4Color bgcol,
                                    java.lang.String width,
                                    IMG left_bottom,
                                    IMG right_bottom)
                             throws java.lang.Exception
Throws:
java.lang.Exception

toHtml_CaptionRow

public static void toHtml_CaptionRow(TABLE table,
                                     int colspan_data,
                                     E4Color col,
                                     E4Color bgcol,
                                     java.lang.String width,
                                     E4HtmlElement_Intf caption,
                                     FONT font,
                                     boolean bold,
                                     boolean small_line_after_caption)
                              throws java.lang.Exception
Throws:
java.lang.Exception

toHtml_TopRow

public static void toHtml_TopRow(TABLE table,
                                 int colspan_data,
                                 E4Color col,
                                 E4Color bgcol,
                                 java.lang.String width,
                                 E4HtmlElement_Intf caption,
                                 IMG left_top,
                                 IMG right_top)
                          throws java.lang.Exception
Throws:
java.lang.Exception

toHtml_SpacerRow

public static void toHtml_SpacerRow(TABLE table,
                                    int colspan_data,
                                    E4Color col,
                                    E4Color bgcol,
                                    java.lang.String width,
                                    java.lang.String height,
                                    IMG left_spacer,
                                    IMG right_spacer)
                             throws java.lang.Exception
Throws:
java.lang.Exception

collectStylesForEditing

public void collectStylesForEditing(E4StylesHash v,
                                    E4ServletImplementation_Intf servlet)
Build a list (Vector) with style definitions used so far during display of this page.

Specified by:
collectStylesForEditing in interface E4HtmlElement_Intf
Overrides:
collectStylesForEditing in class E4HtmlElementGeneral
Parameters:
v - the Vector where the styles will be collected
servlet - the servlet context
See Also:
E4ServletImplementation_Intf.sessionCanEditStyles(), #collectStylesForEditing(e4s.html.style.E4StylesHash, STYLE_Name, boolean)

collectScripts

public void collectScripts(E4ScriptsVec v,
                           E4ServletImplementation_Intf servlet)
Description copied from class: E4HtmlElementGeneral
Get a vector of used scripts from all subelements.

Specified by:
collectScripts in interface E4HtmlElement_Intf
Overrides:
collectScripts in class E4HtmlElementGeneral
Parameters:
v - collect the names of all scripts
servlet - the servlet context
See Also:
E4JavaScript

collectTranslationsForEditing

public void collectTranslationsForEditing(E4TranslationsVec v,
                                          E4ServletImplementation_Intf servlet)
Build a list (Vector) with text definitions used so far during display of this page for translations

Specified by:
collectTranslationsForEditing in interface E4HtmlElement_Intf
Overrides:
collectTranslationsForEditing in class E4HtmlElementGeneral
Parameters:
v - the Vector where the translations will be collected
servlet - the servlet context
See Also:
E4Label_Intf

_getSVNVersionString

public static java.lang.String _getSVNVersionString()
Get version info string from subversion.

Returns:
the version info string.
See Also:
E4Util.getRevisionCodeFromSVN(Class)

www.element4solution.com