Interface Block
- All Superinterfaces:
org.eclipse.emf.ecore.EObject,IChartObject,org.eclipse.emf.common.notify.Notifier
- All Known Subinterfaces:
LabelBlock,Legend,Plot,TitleBlock
- All Known Implementing Classes:
BlockImpl,LabelBlockImpl,LegendImpl,PlotImpl,TitleBlockImpl
A representation of the model object '
Block'.
Block is the most important component to layout the
contents of a chart. It represents a rectangular area that bounds an
individual chart element, which is used to determine the layout of the chart.
The user can define its Bounds, Insets, Outline and Background among other
properties. A Block can also contain other Blocks as its children. Use
Block.getChildren( ) which returns a list of type Block to navigate through
the children hierarchy of Blocks.
Chart.getTitle( );
Chart.getPlot( );
Chart.getLegend( );
The most important block is the chart's block, all contents of a chart are
rendered inside this block, we can get the instance of a chart's block
using:
Chart.getBlock( );
Chart.getTitle( );
Chart.getPlot( );
Chart.getLegend( );
The following features are supported:
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a block into the children hierarchychildren(boolean bRecursive) Returns the value of the 'Anchor' attribute.Returns the value of the 'Background' containment reference.Returns the value of the 'Bounds' containment reference.org.eclipse.emf.common.util.EList<Block>Returns the value of the 'Children' containment reference list.intReturns the value of the 'Column' attribute.intReturns the value of the 'Columnspan' attribute.Returns the value of the 'Cursor' containment reference.doubleReturns the value of the 'Height Hint' attribute.Returns the value of the 'Insets' containment reference.Returns the value of the 'Min Size' containment reference.Returns the value of the 'Outline' containment reference.getPreferredSize(IDisplayServer xs, Chart cm, RunTimeContext rtc) Computes and returns the size of the title block based on the text content and its attributesintgetRow()Returns the value of the 'Row' attribute.intReturns the value of the 'Rowspan' attribute.Returns the value of the 'Stretch' attribute.org.eclipse.emf.common.util.EList<Trigger>Returns the value of the 'Triggers' containment reference list.doubleReturns the value of the 'Width Hint' attribute.booleanisCustom()booleanisLegend()booleanisPlot()booleanReturns whether the value of the 'Anchor' attribute is set.booleanReturns whether the value of the 'Column' attribute is set.booleanReturns whether the value of the 'Columnspan' attribute is set.booleanReturns whether the value of the 'Height Hint' attribute is set.booleanisSetRow()Returns whether the value of the 'Row' attribute is set.booleanReturns whether the value of the 'Rowspan' attribute is set.booleanReturns whether the value of the 'Stretch' attribute is set.booleanReturns whether the value of the 'Visible' attribute is set.booleanReturns whether the value of the 'Width Hint' attribute is set.booleanisText()booleanisTitle()booleanReturns the value of the 'Visible' attribute.voidRemoves a block from the children hierarchyvoidSets the value of the 'Anchor' attribute.voidsetBackground(Fill value) Sets the value of the 'Background' containment reference.voidSets the value of the 'Bounds' containment reference.voidsetColumn(int value) Sets the value of the 'Column' attribute.voidsetColumnspan(int value) Sets the value of the 'Columnspan' attribute.voidSets the value of the 'Cursor' containment reference.voidsetHeightHint(double value) Sets the value of the 'Height Hint' attribute.voidSets the value of the 'Insets' containment reference.voidsetMinSize(Size value) Sets the value of the 'Min Size' containment reference.voidsetOutline(LineAttributes value) Sets the value of the 'Outline' containment reference.voidsetRow(int value) Sets the value of the 'Row' attribute.voidsetRowspan(int value) Sets the value of the 'Rowspan' attribute.voidsetStretch(Stretch value) Sets the value of the 'Stretch' attribute.voidsetVisible(boolean value) Sets the value of the 'Visible' attribute.voidsetWidthHint(double value) Sets the value of the 'Width Hint' attribute.voidUnsets the value of the 'Anchor' attribute.voidUnsets the value of the 'Column' attribute.voidUnsets the value of the 'Columnspan' attribute.voidUnsets the value of the 'Height Hint' attribute.voidunsetRow()Unsets the value of the 'Row' attribute.voidUnsets the value of the 'Rowspan' attribute.voidUnsets the value of the 'Stretch' attribute.voidUnsets the value of the 'Visible' attribute.voidUnsets the value of the 'Width Hint' attribute.Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnsetMethods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
-
Method Details
-
getChildren
org.eclipse.emf.common.util.EList<Block> getChildren()Returns the value of the 'Children' containment reference list. The list contents are of typeBlock. Gets the blocks contained within this block.- Returns:
- the value of the 'Children' containment reference list.
- See Also:
-
getBounds
Bounds getBounds()Returns the value of the 'Bounds' containment reference. Gets the bounds for the block. Bounds of a block are only used if it is added to a block that has the Null layout. Defines the position and size of the block. (These will usually be relative to the TLC of the container block.- Returns:
- the value of the 'Bounds' containment reference.
- See Also:
-
setBounds
Sets the value of the 'Bounds' containment reference.- Parameters:
value- the new value of the 'Bounds' containment reference.- See Also:
-
getAnchor
Anchor getAnchor()Returns the value of the 'Anchor' attribute. The default value is"North". The literals are from the enumerationAnchor. Specifies where the content of the block is anchored.- Returns:
- the value of the 'Anchor' attribute.
- See Also:
-
setAnchor
Sets the value of the 'Anchor' attribute.- Parameters:
value- the new value of the 'Anchor' attribute.- See Also:
-
unsetAnchor
void unsetAnchor()Unsets the value of the 'Anchor' attribute.- See Also:
-
isSetAnchor
boolean isSetAnchor()Returns whether the value of the 'Anchor' attribute is set.- Returns:
- whether the value of the 'Anchor' attribute is set.
- See Also:
-
getStretch
Stretch getStretch()Returns the value of the 'Stretch' attribute. The default value is"Horizontal". The literals are from the enumerationStretch. Specifies how the content of the block fills up available space.- Returns:
- the value of the 'Stretch' attribute.
- See Also:
-
setStretch
Sets the value of the 'Stretch' attribute.- Parameters:
value- the new value of the 'Stretch' attribute.- See Also:
-
unsetStretch
void unsetStretch()Unsets the value of the 'Stretch' attribute.- See Also:
-
isSetStretch
boolean isSetStretch()Returns whether the value of the 'Stretch' attribute is set.- Returns:
- whether the value of the 'Stretch' attribute is set.
- See Also:
-
getInsets
Insets getInsets()Returns the value of the 'Insets' containment reference. Defines the insets to be used for this block's contents.- Returns:
- the value of the 'Insets' containment reference.
- See Also:
-
setInsets
Sets the value of the 'Insets' containment reference.- Parameters:
value- the new value of the 'Insets' containment reference.- See Also:
-
getRow
int getRow()Returns the value of the 'Row' attribute. Defines the row index for the block.- Returns:
- the value of the 'Row' attribute.
- See Also:
-
setRow
void setRow(int value) Sets the value of the 'Row' attribute.- Parameters:
value- the new value of the 'Row' attribute.- See Also:
-
unsetRow
void unsetRow()Unsets the value of the 'Row' attribute.- See Also:
-
isSetRow
boolean isSetRow()Returns whether the value of the 'Row' attribute is set.- Returns:
- whether the value of the 'Row' attribute is set.
- See Also:
-
getColumn
int getColumn()Returns the value of the 'Column' attribute. Defines the column index for the block.- Returns:
- the value of the 'Column' attribute.
- See Also:
-
setColumn
void setColumn(int value) Sets the value of the 'Column' attribute.- Parameters:
value- the new value of the 'Column' attribute.- See Also:
-
unsetColumn
void unsetColumn()Unsets the value of the 'Column' attribute.- See Also:
-
isSetColumn
boolean isSetColumn()Returns whether the value of the 'Column' attribute is set.- Returns:
- whether the value of the 'Column' attribute is set.
- See Also:
-
getRowspan
int getRowspan()Returns the value of the 'Rowspan' attribute. Gets the rowspan value for the block. This specifies the number of rows that the block spans in its container's layout. Defines the rowspan value for the block.- Returns:
- the value of the 'Rowspan' attribute.
- See Also:
-
setRowspan
void setRowspan(int value) Sets the value of the 'Rowspan' attribute.- Parameters:
value- the new value of the 'Rowspan' attribute.- See Also:
-
unsetRowspan
void unsetRowspan()Unsets the value of the 'Rowspan' attribute.- See Also:
-
isSetRowspan
boolean isSetRowspan()Returns whether the value of the 'Rowspan' attribute is set.- Returns:
- whether the value of the 'Rowspan' attribute is set.
- See Also:
-
getColumnspan
int getColumnspan()Returns the value of the 'Columnspan' attribute. Gets the columnspan value for the block. This specifies the number of columns that the block spans in its container's layout. Defines the columnspan value for the block.- Returns:
- the value of the 'Columnspan' attribute.
- See Also:
-
setColumnspan
void setColumnspan(int value) Sets the value of the 'Columnspan' attribute.- Parameters:
value- the new value of the 'Columnspan' attribute.- See Also:
-
unsetColumnspan
void unsetColumnspan()Unsets the value of the 'Columnspan' attribute. -
isSetColumnspan
boolean isSetColumnspan()Returns whether the value of the 'Columnspan' attribute is set.- Returns:
- whether the value of the 'Columnspan' attribute is set.
- See Also:
-
getMinSize
Size getMinSize()Returns the value of the 'Min Size' containment reference. Gets the minimum size for the block. This used to determine the minimum size required to render this block without degradation in quality of output. It is used when the block is added to a container with Elastic layout. Defines the minimum size for the block.- Returns:
- the value of the 'Min Size' containment reference.
- See Also:
-
setMinSize
Sets the value of the 'Min Size' containment reference.- Parameters:
value- the new value of the 'Min Size' containment reference.- See Also:
-
getOutline
LineAttributes getOutline()Returns the value of the 'Outline' containment reference. Gets the line properties of the border for the block. Defines the outline for the chart element.- Returns:
- the value of the 'Outline' containment reference.
- See Also:
-
setOutline
Sets the value of the 'Outline' containment reference.- Parameters:
value- the new value of the 'Outline' containment reference.- See Also:
-
getBackground
Fill getBackground()Returns the value of the 'Background' containment reference. Background for the Block...Can be transparent, solid color, gradient, pattern OR image- Returns:
- the value of the 'Background' containment reference.
- See Also:
-
setBackground
Sets the value of the 'Background' containment reference.- Parameters:
value- the new value of the 'Background' containment reference.- See Also:
-
isVisible
boolean isVisible()Returns the value of the 'Visible' attribute. Specifies whether the block is visible.- Returns:
- the value of the 'Visible' attribute.
- See Also:
-
setVisible
void setVisible(boolean value) Sets the value of the 'Visible' attribute.- Parameters:
value- the new value of the 'Visible' attribute.- See Also:
-
unsetVisible
void unsetVisible()Unsets the value of the 'Visible' attribute.- See Also:
-
isSetVisible
boolean isSetVisible()Returns whether the value of the 'Visible' attribute is set.- Returns:
- whether the value of the 'Visible' attribute is set.
- See Also:
-
getTriggers
org.eclipse.emf.common.util.EList<Trigger> getTriggers()Returns the value of the 'Triggers' containment reference list. The list contents are of typeTrigger. Holds the actions for the block.- Returns:
- the value of the 'Triggers' containment reference list.
- See Also:
-
getWidthHint
double getWidthHint()Returns the value of the 'Width Hint' attribute. The default value is"-1". WidthHint specifies a hinted width for the block.- Returns:
- the value of the 'Width Hint' attribute.
- See Also:
-
setWidthHint
void setWidthHint(double value) Sets the value of the 'Width Hint' attribute.- Parameters:
value- the new value of the 'Width Hint' attribute.- See Also:
-
unsetWidthHint
void unsetWidthHint()Unsets the value of the 'Width Hint' attribute. -
isSetWidthHint
boolean isSetWidthHint()Returns whether the value of the 'Width Hint' attribute is set.- Returns:
- whether the value of the 'Width Hint' attribute is set.
- See Also:
-
getHeightHint
double getHeightHint()Returns the value of the 'Height Hint' attribute. The default value is"-1". HeightHint pecifies a hinted height for the block.- Returns:
- the value of the 'Height Hint' attribute.
- See Also:
-
setHeightHint
void setHeightHint(double value) Sets the value of the 'Height Hint' attribute.- Parameters:
value- the new value of the 'Height Hint' attribute.- See Also:
-
unsetHeightHint
void unsetHeightHint()Unsets the value of the 'Height Hint' attribute. -
isSetHeightHint
boolean isSetHeightHint()Returns whether the value of the 'Height Hint' attribute is set.- Returns:
- whether the value of the 'Height Hint' attribute is set.
- See Also:
-
getCursor
Cursor getCursor()Returns the value of the 'Cursor' containment reference. Element "Cursor" represents cursor for the block.- Returns:
- the value of the 'Cursor' containment reference.
- See Also:
-
setCursor
Sets the value of the 'Cursor' containment reference.- Parameters:
value- the new value of the 'Cursor' containment reference.- See Also:
-
children
- Parameters:
bRecursive-
-
getPreferredSize
Computes and returns the size of the title block based on the text content and its attributes- Parameters:
xs- The Xserver used in computing the scaling factor (pixels => points)cm- The chart model instance (if needed)rtc-- Returns:
- The preferred size of the title block 'in points'
- Throws:
GenerationExceptionChartException
-
isCustom
boolean isCustom()- Returns:
- 'true' if this block type is 'a custom defined block'
-
isPlot
boolean isPlot()- Returns:
- 'true' if this block type is 'the plot block'
-
isLegend
boolean isLegend()- Returns:
- 'true' if this block type is 'the legend block'
-
isText
boolean isText()- Returns:
- 'true' if this block type is 'a text block'
-
isTitle
boolean isTitle()- Returns:
- 'true' if this block type is 'the title block'
-
add
Adds a block into the children hierarchy- Parameters:
bl-
-
remove
Removes a block from the children hierarchy- Parameters:
bl-
-
copyInstance
Block copyInstance()- Specified by:
copyInstancein interfaceIChartObject
-