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
public interface Block extends IChartObject
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:
LayoutPackage.getBlock()
-
Method Summary
Modifier and Type Method Description void
add(Block bl)
Adds a block into the children hierarchyjava.util.Enumeration<Block>
children(boolean bRecursive)
Block
copyInstance()
Anchor
getAnchor()
Returns the value of the 'Anchor' attribute.Fill
getBackground()
Returns the value of the 'Background' containment reference.Bounds
getBounds()
Returns the value of the 'Bounds' containment reference.org.eclipse.emf.common.util.EList<Block>
getChildren()
Returns the value of the 'Children' containment reference list.int
getColumn()
Returns the value of the 'Column' attribute.int
getColumnspan()
Returns the value of the 'Columnspan' attribute.Cursor
getCursor()
Returns the value of the 'Cursor' containment reference.double
getHeightHint()
Returns the value of the 'Height Hint' attribute.Insets
getInsets()
Returns the value of the 'Insets' containment reference.Size
getMinSize()
Returns the value of the 'Min Size' containment reference.LineAttributes
getOutline()
Returns the value of the 'Outline' containment reference.Size
getPreferredSize(IDisplayServer xs, Chart cm, RunTimeContext rtc)
Computes and returns the size of the title block based on the text content and its attributesint
getRow()
Returns the value of the 'Row' attribute.int
getRowspan()
Returns the value of the 'Rowspan' attribute.Stretch
getStretch()
Returns the value of the 'Stretch' attribute.org.eclipse.emf.common.util.EList<Trigger>
getTriggers()
Returns the value of the 'Triggers' containment reference list.double
getWidthHint()
Returns the value of the 'Width Hint' attribute.boolean
isCustom()
boolean
isLegend()
boolean
isPlot()
boolean
isSetAnchor()
Returns whether the value of the 'Anchor
' attribute is set.boolean
isSetColumn()
Returns whether the value of the 'Column
' attribute is set.boolean
isSetColumnspan()
Returns whether the value of the 'Columnspan
' attribute is set.boolean
isSetHeightHint()
Returns whether the value of the 'Height Hint
' attribute is set.boolean
isSetRow()
Returns whether the value of the 'Row
' attribute is set.boolean
isSetRowspan()
Returns whether the value of the 'Rowspan
' attribute is set.boolean
isSetStretch()
Returns whether the value of the 'Stretch
' attribute is set.boolean
isSetVisible()
Returns whether the value of the 'Visible
' attribute is set.boolean
isSetWidthHint()
Returns whether the value of the 'Width Hint
' attribute is set.boolean
isText()
boolean
isTitle()
boolean
isVisible()
Returns the value of the 'Visible' attribute.void
remove(Block bl)
Removes a block from the children hierarchyvoid
setAnchor(Anchor value)
Sets the value of the 'Anchor
' attribute.void
setBackground(Fill value)
Sets the value of the 'Background
' containment reference.void
setBounds(Bounds value)
Sets the value of the 'Bounds
' containment reference.void
setColumn(int value)
Sets the value of the 'Column
' attribute.void
setColumnspan(int value)
Sets the value of the 'Columnspan
' attribute.void
setCursor(Cursor value)
Sets the value of the 'Cursor
' containment reference.void
setHeightHint(double value)
Sets the value of the 'Height Hint
' attribute.void
setInsets(Insets value)
Sets the value of the 'Insets
' containment reference.void
setMinSize(Size value)
Sets the value of the 'Min Size
' containment reference.void
setOutline(LineAttributes value)
Sets the value of the 'Outline
' containment reference.void
setRow(int value)
Sets the value of the 'Row
' attribute.void
setRowspan(int value)
Sets the value of the 'Rowspan
' attribute.void
setStretch(Stretch value)
Sets the value of the 'Stretch
' attribute.void
setVisible(boolean value)
Sets the value of the 'Visible
' attribute.void
setWidthHint(double value)
Sets the value of the 'Width Hint
' attribute.void
unsetAnchor()
Unsets the value of the 'Anchor
' attribute.void
unsetColumn()
Unsets the value of the 'Column
' attribute.void
unsetColumnspan()
Unsets the value of the 'Columnspan
' attribute.void
unsetHeightHint()
Unsets the value of the 'Height Hint
' attribute.void
unsetRow()
Unsets the value of the 'Row
' attribute.void
unsetRowspan()
Unsets the value of the 'Rowspan
' attribute.void
unsetStretch()
Unsets the value of the 'Stretch
' attribute.void
unsetVisible()
Unsets the value of the 'Visible
' attribute.void
unsetWidthHint()
Unsets the value of the 'Width Hint
' attribute.
-
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:
LayoutPackage.getBlock_Children()
-
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(Bounds)
,LayoutPackage.getBlock_Bounds()
-
setBounds
Sets the value of the 'Bounds
' containment reference.- Parameters:
value
- the new value of the 'Bounds' containment reference.- See Also:
getBounds()
-
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:
Anchor
,isSetAnchor()
,unsetAnchor()
,setAnchor(Anchor)
,LayoutPackage.getBlock_Anchor()
-
setAnchor
Sets the value of the 'Anchor
' attribute.- Parameters:
value
- the new value of the 'Anchor' attribute.- See Also:
Anchor
,isSetAnchor()
,unsetAnchor()
,getAnchor()
-
unsetAnchor
void unsetAnchor()Unsets the value of the 'Anchor
' attribute.- See Also:
isSetAnchor()
,getAnchor()
,setAnchor(Anchor)
-
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:
unsetAnchor()
,getAnchor()
,setAnchor(Anchor)
-
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:
Stretch
,isSetStretch()
,unsetStretch()
,setStretch(Stretch)
,LayoutPackage.getBlock_Stretch()
-
setStretch
Sets the value of the 'Stretch
' attribute.- Parameters:
value
- the new value of the 'Stretch' attribute.- See Also:
Stretch
,isSetStretch()
,unsetStretch()
,getStretch()
-
unsetStretch
void unsetStretch()Unsets the value of the 'Stretch
' attribute.- See Also:
isSetStretch()
,getStretch()
,setStretch(Stretch)
-
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:
unsetStretch()
,getStretch()
,setStretch(Stretch)
-
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(Insets)
,LayoutPackage.getBlock_Insets()
-
setInsets
Sets the value of the 'Insets
' containment reference.- Parameters:
value
- the new value of the 'Insets' containment reference.- See Also:
getInsets()
-
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:
isSetRow()
,unsetRow()
,setRow(int)
,LayoutPackage.getBlock_Row()
-
setRow
void setRow(int value)Sets the value of the 'Row
' attribute.- Parameters:
value
- the new value of the 'Row' attribute.- See Also:
isSetRow()
,unsetRow()
,getRow()
-
unsetRow
void unsetRow()Unsets the value of the 'Row
' attribute.- See Also:
isSetRow()
,getRow()
,setRow(int)
-
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:
unsetRow()
,getRow()
,setRow(int)
-
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:
isSetColumn()
,unsetColumn()
,setColumn(int)
,LayoutPackage.getBlock_Column()
-
setColumn
void setColumn(int value)Sets the value of the 'Column
' attribute.- Parameters:
value
- the new value of the 'Column' attribute.- See Also:
isSetColumn()
,unsetColumn()
,getColumn()
-
unsetColumn
void unsetColumn()Unsets the value of the 'Column
' attribute.- See Also:
isSetColumn()
,getColumn()
,setColumn(int)
-
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:
unsetColumn()
,getColumn()
,setColumn(int)
-
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:
isSetRowspan()
,unsetRowspan()
,setRowspan(int)
,LayoutPackage.getBlock_Rowspan()
-
setRowspan
void setRowspan(int value)Sets the value of the 'Rowspan
' attribute.- Parameters:
value
- the new value of the 'Rowspan' attribute.- See Also:
isSetRowspan()
,unsetRowspan()
,getRowspan()
-
unsetRowspan
void unsetRowspan()Unsets the value of the 'Rowspan
' attribute.- See Also:
isSetRowspan()
,getRowspan()
,setRowspan(int)
-
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:
unsetRowspan()
,getRowspan()
,setRowspan(int)
-
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:
isSetColumnspan()
,unsetColumnspan()
,setColumnspan(int)
,LayoutPackage.getBlock_Columnspan()
-
setColumnspan
void setColumnspan(int value)Sets the value of the 'Columnspan
' attribute.- Parameters:
value
- the new value of the 'Columnspan' attribute.- See Also:
isSetColumnspan()
,unsetColumnspan()
,getColumnspan()
-
unsetColumnspan
void unsetColumnspan()Unsets the value of the 'Columnspan
' attribute.- See Also:
isSetColumnspan()
,getColumnspan()
,setColumnspan(int)
-
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:
unsetColumnspan()
,getColumnspan()
,setColumnspan(int)
-
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(Size)
,LayoutPackage.getBlock_MinSize()
-
setMinSize
Sets the value of the 'Min Size
' containment reference.- Parameters:
value
- the new value of the 'Min Size' containment reference.- See Also:
getMinSize()
-
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(LineAttributes)
,LayoutPackage.getBlock_Outline()
-
setOutline
Sets the value of the 'Outline
' containment reference.- Parameters:
value
- the new value of the 'Outline' containment reference.- See Also:
getOutline()
-
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(Fill)
,LayoutPackage.getBlock_Background()
-
setBackground
Sets the value of the 'Background
' containment reference.- Parameters:
value
- the new value of the 'Background' containment reference.- See Also:
getBackground()
-
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:
isSetVisible()
,unsetVisible()
,setVisible(boolean)
,LayoutPackage.getBlock_Visible()
-
setVisible
void setVisible(boolean value)Sets the value of the 'Visible
' attribute.- Parameters:
value
- the new value of the 'Visible' attribute.- See Also:
isSetVisible()
,unsetVisible()
,isVisible()
-
unsetVisible
void unsetVisible()Unsets the value of the 'Visible
' attribute.- See Also:
isSetVisible()
,isVisible()
,setVisible(boolean)
-
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:
unsetVisible()
,isVisible()
,setVisible(boolean)
-
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:
LayoutPackage.getBlock_Triggers()
-
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:
isSetWidthHint()
,unsetWidthHint()
,setWidthHint(double)
,LayoutPackage.getBlock_WidthHint()
-
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:
isSetWidthHint()
,unsetWidthHint()
,getWidthHint()
-
unsetWidthHint
void unsetWidthHint()Unsets the value of the 'Width Hint
' attribute.- See Also:
isSetWidthHint()
,getWidthHint()
,setWidthHint(double)
-
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:
unsetWidthHint()
,getWidthHint()
,setWidthHint(double)
-
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:
isSetHeightHint()
,unsetHeightHint()
,setHeightHint(double)
,LayoutPackage.getBlock_HeightHint()
-
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:
isSetHeightHint()
,unsetHeightHint()
,getHeightHint()
-
unsetHeightHint
void unsetHeightHint()Unsets the value of the 'Height Hint
' attribute.- See Also:
isSetHeightHint()
,getHeightHint()
,setHeightHint(double)
-
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:
unsetHeightHint()
,getHeightHint()
,setHeightHint(double)
-
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(Cursor)
,LayoutPackage.getBlock_Cursor()
-
setCursor
Sets the value of the 'Cursor
' containment reference.- Parameters:
value
- the new value of the 'Cursor' containment reference.- See Also:
getCursor()
-
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:
GenerationException
ChartException
-
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:
copyInstance
in interfaceIChartObject
-