com.cc.framework.ui.painter.def.frame
Class DefTabbedFramePainter

java.lang.Object
  extended bycom.cc.framework.ui.painter.ControlPortionPainter
      extended bycom.cc.framework.ui.painter.def.frame.DefFramePainterBase
          extended bycom.cc.framework.ui.painter.def.frame.DefTabbedFramePainter
All Implemented Interfaces:
FramePainter

public class DefTabbedFramePainter
extends DefFramePainterBase

Painter for a tabbed frame

Version:
$Revision: 1.15 $
Author:
Harald Schulz

Field Summary
protected static int FLAG_DISABLED
          Tab is disabled
protected static int FLAG_FIRST
          This flag is set for the first visible tab
protected static int FLAG_LAST
          This flag is set for the last visible tab
protected static int FLAG_SELECTED
          Tab is selected
protected static int FLAG_STATES
          Tab State Mask
protected static int FLAG_UNSELECTED
          Tab is unselected
private  boolean overlapping
          This flag indicates if tabs should be drawn with overlapping
 
Fields inherited from class com.cc.framework.ui.painter.ControlPortionPainter
 
Constructor Summary
DefTabbedFramePainter(boolean overlapping)
          Creates a new FramePainter
 
Method Summary
 void addSection(Frame frame, FrameTitle title, boolean showFrame)
          Adds a new titled section to the given frame
protected  CompositeElement createBody()
          Creates the body element of the frame
 Frame createFrame(boolean showFrame)
          Creates a frame
 Frame createFrame(FrameTitle title, boolean showFrame)
          Creates a frame with a title bar
protected  org.apache.ecs.html.IMG createImage(int lstate, int rstate, Color bgcolor)
          Retrieves the corner image for two adjacent tabs
 Frame createInnerFrame(boolean showFrame)
          Creates a inner frame
 org.apache.ecs.ConcreteElement createTitle(FrameTitle title, boolean showFrame)
          Creates the title of the frame.
protected  org.apache.ecs.ConcreteElement doCreateNextButton(TabDesignModel scrollTo)
          Creates the scroll left Button
protected  org.apache.ecs.ConcreteElement doCreatePrevButton(TabDesignModel scrollTo)
          Creates the scroll left Button
protected  org.apache.ecs.ConcreteElement doCreateStackedTabs(TabDesignModel[] tabs)
          This method creates the tab stack
protected  org.apache.ecs.ConcreteElement doCreateTab(org.apache.ecs.ConcreteElement face, int lstate, int state, int rstate)
          This method creates the tab face
protected  org.apache.ecs.ConcreteElement doCreateTab(TabDesignModel tab, int lstate, int state, int rstate)
          This method creates the tab face
protected  org.apache.ecs.ConcreteElement doCreateTabs()
          Method createTabs
protected  org.apache.ecs.ConcreteElement doCreateTabs(TabDesignModel[] tabs, int startIndex, int stopIndex)
          This method creates the tab stripe
protected  Color getBgColor()
          Retrieves the Background color of the tabset
protected  ImageModel getBgImage(int state, Color bgcolor)
          Retrieves the background image for the specified style
protected  TabbarControl getCtrl()
          Retrieves the control for this painter
protected  java.lang.String getStyleClass(int state)
          Retrieves the style class for the specified tab state
protected  ImageModel getTabImage(TabDesignModel tab)
          Returns the optional image for the given tab
protected  int getTabState(TabDesignModel[] tabs, int index)
          Calculates the state flags for the given tab
 boolean isOverlapping()
          Checks if the tabs should be painted in overlapping mode
protected  boolean isSelected(TabDesignModel tab)
          Checks if the specified tab is selected
 
Methods inherited from class com.cc.framework.ui.painter.def.frame.DefFramePainterBase
createButtonList, createHelpButton, createInnerFrame, showButtons, showHelpButton
 
Methods inherited from class com.cc.framework.ui.painter.ControlPortionPainter
attr, attr, attr, createActionPainter, createActionPainter, createImage, createImage, createImage, createSpacer, getColor, getControlPainter, getElementClass, getFrameworkString, getFrameworkString, getImage, getImage, getImageSrc, getImageSrc, getLocale, getPageContext, getPainterContext, getPrincipal, getSafeLocale, html, html, html, isRunAtClient, localize, removeHtml, removeHtml, setControlPainter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cc.framework.ui.painter.FramePainter
setControlPainter
 

Field Detail

FLAG_STATES

protected static final int FLAG_STATES
Tab State Mask

See Also:
Constant Field Values

FLAG_UNSELECTED

protected static final int FLAG_UNSELECTED
Tab is unselected

See Also:
Constant Field Values

FLAG_SELECTED

protected static final int FLAG_SELECTED
Tab is selected

See Also:
Constant Field Values

FLAG_DISABLED

protected static final int FLAG_DISABLED
Tab is disabled

See Also:
Constant Field Values

FLAG_FIRST

protected static final int FLAG_FIRST
This flag is set for the first visible tab

See Also:
Constant Field Values

FLAG_LAST

protected static final int FLAG_LAST
This flag is set for the last visible tab

See Also:
Constant Field Values

overlapping

private boolean overlapping
This flag indicates if tabs should be drawn with overlapping

Constructor Detail

DefTabbedFramePainter

public DefTabbedFramePainter(boolean overlapping)
Creates a new FramePainter

Parameters:
overlapping - This flag indicates if tabs should be drawn with overlapping
Method Detail

getCtrl

protected TabbarControl getCtrl()
Retrieves the control for this painter

Returns:
Control

isSelected

protected boolean isSelected(TabDesignModel tab)
Checks if the specified tab is selected

Parameters:
tab - the tab to check
Returns:
true if the tab is selected

isOverlapping

public boolean isOverlapping()
Checks if the tabs should be painted in overlapping mode

Returns:
true when overlapping tabs should be drawn

getBgColor

protected Color getBgColor()
Retrieves the Background color of the tabset

Returns:
Background color

getTabImage

protected ImageModel getTabImage(TabDesignModel tab)
Returns the optional image for the given tab

Parameters:
tab - the tab
Returns:
ImageModel

getTabState

protected int getTabState(TabDesignModel[] tabs,
                          int index)
Calculates the state flags for the given tab

Parameters:
tabs - The list of all visible Tabs
index - The tabs index
Returns:
State flags

getStyleClass

protected java.lang.String getStyleClass(int state)
Retrieves the style class for the specified tab state

Parameters:
state - the tabs state
Returns:
Style class

getBgImage

protected ImageModel getBgImage(int state,
                                Color bgcolor)
Retrieves the background image for the specified style

Parameters:
state - the tabs state
bgcolor - the tabsets background color
Returns:
Background image

createImage

protected org.apache.ecs.html.IMG createImage(int lstate,
                                              int rstate,
                                              Color bgcolor)
Retrieves the corner image for two adjacent tabs

Parameters:
lstate - State of the left tab
rstate - State of the right tab
bgcolor - the tabsets background color
Returns:
Corner image

doCreateTab

protected org.apache.ecs.ConcreteElement doCreateTab(org.apache.ecs.ConcreteElement face,
                                                     int lstate,
                                                     int state,
                                                     int rstate)
This method creates the tab face

Parameters:
face - The tabs face content
lstate - State of the left neighbor
state - State of the tab
rstate - State of the right neighbor
Returns:
Tabs face element

doCreateTab

protected org.apache.ecs.ConcreteElement doCreateTab(TabDesignModel tab,
                                                     int lstate,
                                                     int state,
                                                     int rstate)
This method creates the tab face

Parameters:
tab - The tab design model
lstate - State of the left neighbor
state - State of the tab
rstate - State of the right neighbor
Returns:
Tab HTML element

doCreatePrevButton

protected org.apache.ecs.ConcreteElement doCreatePrevButton(TabDesignModel scrollTo)
Creates the scroll left Button

Parameters:
scrollTo - The tab to scroll to
Returns:
ConcreteElement

doCreateNextButton

protected org.apache.ecs.ConcreteElement doCreateNextButton(TabDesignModel scrollTo)
Creates the scroll left Button

Parameters:
scrollTo - The tab to scroll to
Returns:
ConcreteElement

doCreateTabs

protected org.apache.ecs.ConcreteElement doCreateTabs()
Method createTabs

Returns:
ConcreteElement

doCreateTabs

protected org.apache.ecs.ConcreteElement doCreateTabs(TabDesignModel[] tabs,
                                                      int startIndex,
                                                      int stopIndex)
This method creates the tab stripe

Parameters:
tabs - Collection with all Tabs
startIndex - Index of the first visible Tab
stopIndex - Index of the last visible Tab
Returns:
ConcreteElement

doCreateStackedTabs

protected org.apache.ecs.ConcreteElement doCreateStackedTabs(TabDesignModel[] tabs)
This method creates the tab stack

Parameters:
tabs - Collection with all Tabs
Returns:
ConcreteElement

createBody

protected CompositeElement createBody()
Creates the body element of the frame

Returns:
Body Table element

createFrame

public Frame createFrame(boolean showFrame)
Description copied from interface: FramePainter
Creates a frame

Parameters:
showFrame - This flag indicates if the painter should create a visible or invisible frame
Returns:
Frame element
See Also:
FramePainter.createFrame(boolean)

createFrame

public Frame createFrame(FrameTitle title,
                         boolean showFrame)
Description copied from interface: FramePainter
Creates a frame with a title bar

Parameters:
title - The frames title
showFrame - This flag indicates if the painter should create a visible or invisible frame
Returns:
Frame element
See Also:
FramePainter.createFrame(com.cc.framework.ui.model.FrameTitle, boolean)

createInnerFrame

public Frame createInnerFrame(boolean showFrame)
Description copied from interface: FramePainter
Creates a inner frame

Parameters:
showFrame - This flag indicates if the painter should create a visible or invisible frame
Returns:
Frame element
See Also:
FramePainter.createInnerFrame(boolean)

createTitle

public org.apache.ecs.ConcreteElement createTitle(FrameTitle title,
                                                  boolean showFrame)
Description copied from interface: FramePainter
Creates the title of the frame.

Parameters:
title - The frames title
showFrame - This flag indicates if the painter should create a visible or invisible frame
Returns:
ConcreteElement
See Also:
FramePainter.createTitle(com.cc.framework.ui.model.FrameTitle, boolean)

addSection

public void addSection(Frame frame,
                       FrameTitle title,
                       boolean showFrame)
Description copied from interface: FramePainter
Adds a new titled section to the given frame

Parameters:
frame - the frame where to add a new section
title - The frames title
showFrame - This flag indicates if the painter should create a visible or invisible frame
See Also:
FramePainter.addSection(com.cc.framework.ui.painter.Frame, com.cc.framework.ui.model.FrameTitle, boolean)


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.