Class WFigure
- java.lang.Object
-
- com.github.bordertech.wcomponents.AbstractWComponent
-
- com.github.bordertech.wcomponents.AbstractContainer
-
- com.github.bordertech.wcomponents.AbstractNamingContextContainer
-
- com.github.bordertech.wcomponents.WFigure
-
- All Implemented Interfaces:
AjaxInternalTrigger
,AjaxTarget
,Container
,Marginable
,NamingContextable
,SubordinateTarget
,WComponent
,WebComponent
,Serializable
public class WFigure extends AbstractNamingContextContainer implements AjaxInternalTrigger, AjaxTarget, SubordinateTarget, Marginable
WFigure represents a container that is used to associate a large graphical element with its text description. For example, a graph and its description.
Various
modes of operation
are supported, which allow developers to tune performance by only loading content when it is needed.- Since:
- 1.0.0
- Author:
- Jonathan Austin
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WFigure.FigureMode
The available types of AJAX mode.static class
WFigure.FigureModel
Holds the extrinsic state information of a WFigure.-
Nested classes/interfaces inherited from class com.github.bordertech.wcomponents.AbstractWComponent
AbstractWComponent.WComponentRef
-
-
Field Summary
-
Fields inherited from interface com.github.bordertech.wcomponents.WComponent
DEFAULT_APPLICATION_ID, DEFAULT_INTERNAL_ID, DEFAULT_NO_ID, ID_CONTEXT_SEPERATOR, ID_FRAMEWORK_ASSIGNED_SEPERATOR, ID_VALIDATION_PATTERN
-
-
Constructor Summary
Constructors Constructor Description WFigure(WComponent content, WDecoratedLabel label)
Creates a WFigure with the given content and heading.WFigure(WComponent content, String heading)
Creates a WFigure with the given content and heading.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected WFigure.FigureModel
getComponentModel()
Returns the effective component model for this component.WComponent
getContent()
WDecoratedLabel
getDecoratedLabel()
Margin
getMargin()
Get the margin for the component, or null if not set.WFigure.FigureMode
getMode()
protected WFigure.FigureModel
getOrCreateComponentModel()
Retrieves the model for this component so that it can be modified.protected WFigure.FigureModel
newComponentModel()
Creates a new component model appropriate for this component.void
setMargin(Margin margin)
Set the margin for the component, or null for no margin.void
setMode(WFigure.FigureMode mode)
Sets this WFigure's mode of operation.String
toString()
Creates a String representation of this component; usually for debugging purposes.-
Methods inherited from class com.github.bordertech.wcomponents.AbstractNamingContextContainer
getNamingContextId, isNamingContext, setNamingContext
-
Methods inherited from class com.github.bordertech.wcomponents.AbstractContainer
getChildAt, getChildCount, getChildren, getIndexOfChild
-
Methods inherited from class com.github.bordertech.wcomponents.AbstractWComponent
addHtmlClass, addHtmlClass, addNotify, afterPaint, assertAddSupported, beforePaint, createErrorDiagnostic, createErrorDiagnostic, forward, getAccessibleText, getAttribute, getBaseUrl, getDefaultModel, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getId, getIdName, getInternalId, getLabel, getName, getParent, getScratchMap, getTabIndex, getTag, getTemplate, getTemplateMarkUp, getToolTip, handleRequest, hasNoComponentModel, hasTabIndex, initialiseComponentModel, invokeLater, invokeLaters, isDebugStructure, isDefaultState, isFlagSet, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, paintComponent, preparePaint, preparePaintComponent, removeAttribute, removeComponentModel, removeHtmlClass, removeHtmlClass, removeNotify, replaceWComponent, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFlag, setFocussed, setHidden, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicators, showErrorIndicatorsForComponent, showWarningIndicators, showWarningIndicatorsForComponent, tidyUpUIContext, tidyUpUIContextForTree, validate, validateComponent, writeReplace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.bordertech.wcomponents.Container
getChildAt, getChildCount, getChildren, getIndexOfChild
-
Methods inherited from interface com.github.bordertech.wcomponents.WComponent
addHtmlClass, addHtmlClass, forward, getAccessibleText, getAttribute, getBaseUrl, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getId, getIdName, getInternalId, getLabel, getName, getParent, getTabIndex, getTag, getToolTip, handleRequest, hasTabIndex, invokeLater, isDefaultState, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, preparePaint, removeAttribute, removeHtmlClass, removeHtmlClass, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFocussed, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicators, showWarningIndicators, tidyUpUIContextForTree, validate
-
-
-
-
Constructor Detail
-
WFigure
public WFigure(WComponent content, String heading)
Creates a WFigure with the given content and heading.- Parameters:
content
- the content for the figureheading
- the figure's heading.
-
WFigure
public WFigure(WComponent content, WDecoratedLabel label)
Creates a WFigure with the given content and heading.- Parameters:
content
- the content for the figure.label
- the figure's heading.
-
-
Method Detail
-
getMode
public WFigure.FigureMode getMode()
- Returns:
- this WFigure's mode of operation
-
setMode
public void setMode(WFigure.FigureMode mode)
Sets this WFigure's mode of operation.- Parameters:
mode
- the mode of operation.
-
getContent
public WComponent getContent()
- Returns:
- the content of this figure
-
getDecoratedLabel
public WDecoratedLabel getDecoratedLabel()
- Returns:
- the decorated label that is used to render the figure heading.
-
setMargin
public void setMargin(Margin margin)
Set the margin for the component, or null for no margin.- Specified by:
setMargin
in interfaceMarginable
- Parameters:
margin
- the margin for the component
-
getMargin
public Margin getMargin()
Get the margin for the component, or null if not set.- Specified by:
getMargin
in interfaceMarginable
- Returns:
- the margin for the component, or null if not set
-
toString
public String toString()
Description copied from class:AbstractWComponent
Creates a String representation of this component; usually for debugging purposes.- Overrides:
toString
in classAbstractWComponent
- Returns:
- a String representation of this component, for debugging purposes.
-
newComponentModel
protected WFigure.FigureModel newComponentModel()
Creates a new component model appropriate for this component.- Overrides:
newComponentModel
in classAbstractWComponent
- Returns:
- a new FigureModel.
-
getComponentModel
protected WFigure.FigureModel getComponentModel()
Returns the effective component model for this component. Subclass may override this method to narrow the return type to their specific model type.- Overrides:
getComponentModel
in classAbstractWComponent
- Returns:
- the effective component model
-
getOrCreateComponentModel
protected WFigure.FigureModel getOrCreateComponentModel()
Retrieves the model for this component so that it can be modified. If this method is called during request processing, and a session specific model does not yet exist, then a new model is created. Subclasses may override this method to narrow the return type to their specific model type.- Overrides:
getOrCreateComponentModel
in classAbstractWComponent
- Returns:
- the model for this component
-
-