Package com.inet.report
Class Area
- java.lang.Object
-
- com.inet.report.ReportComponent
-
- com.inet.report.Region
-
- com.inet.report.Area
-
- All Implemented Interfaces:
NodeParser
,com.inet.report.ReferenceHolder
,java.io.Serializable
public class Area extends Region
TheArea
element of the Runtime Designer Component. TheArea
class summarizes theSection
element(s) into anArea
, which makes it possible to change the behavior of all sections together. All sections in anArea
have the same characteristics, but eachSection
in anArea
can have a different format. EachArea
contains a singleSection
by default. The name of theSection
is based on the name of the enclosingArea
, i.e. "D" if there is only oneSection
in the detailArea
. If anArea
has more than oneSection
the names are formed by appending letters of the alphabet, e.g. "Da" for the firstSection
in the detailArea
, "Db" for the second, "Dc" for the third and so on.
` TheSection
with index "0" in anArea
is always the defaultSection
and cannot be removed if it is the onlysection
in theArea
, because eachArea
needs at least oneSection
.
Add sections with theaddSection()
method and remove sections with theremoveSection(int)
method. You can access aSection
with the index of theSection
, using the methodgetSection(int)
. You can get the number of sections in anArea
withgetSectionCount()
. You can merge aSection
with theSection
below with methodmergeSectionBelow(int)
.
This class is part of the RDC.- Since:
- 1.0
- See Also:
Section
,Engine.getArea(int)
,Engine.getArea(String)
,Engine.getAreaCount()
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
Area.AttributeTag
FOR INTERNAL USE ONLY Attributes for the XML format
-
Field Summary
-
Fields inherited from class com.inet.report.Region
DETAIL, GROUP_FOOTER, GROUP_HEADER, PAGE_FOOTER, PAGE_HEADER, REPORT_FOOTER, REPORT_HEADER
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Section
addSection()
Adds a newSection
to the area.int
getBackColor()
ReturnsRDC.COLOR_NO_COLOR
since an Area does not have a background color.FormulaField
getBackColorFormula()
Returns null since an Area does not have a background color formula.java.lang.Object
getParent()
Returns the parent Group if there is one, or null if there is not.java.util.List<FormulaField>
getPropertyFormulas()
Returns a list with all property formulas that are set for this report element.Section
getSection(int idx)
Returns a SectionElement of the area.int
getSectionCount()
Returns the number of Sections in this Area.java.util.List<Section>
getSubComponents()
Returns allReportComponent
s that are descendants of this one.int
indexOf()
Returns the current index of this area in the engine.void
mergeSectionBelow(int idx)
When you have multiple sections in an area you can merge aSection
with theSection
below, i.e. when you have sections Da, Db, Dc you can mergeSection
Da with Db andSection
Db with Dc.void
moveSection(int srcIdx, int destIdx)
When you have multiple sections in an area you can move aSection
to a place below or above an otherSection
.java.lang.String
paramString()
Returns a string identifying this report component.NodeParser
parseElement(com.inet.report.parser.XMLTag group, java.lang.String tag, org.xml.sax.Attributes atts, java.util.Map<java.lang.String,java.lang.Object> parserMap)
FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XMLvoid
parseEndElement(com.inet.report.parser.XMLTag group, java.lang.String tag, java.util.Map<java.lang.String,java.lang.Object> parserMap)
FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XMLvoid
parseText(java.lang.String text, java.util.Map<java.lang.String,java.lang.Object> parserMap)
FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XMLSection
removeSection(int idx)
Removes theSection
with specified index from area.void
resetReferences()
FOR INTERNAL USE ONLYvoid
setBackColor(int backColor)
Does nothing since an Area does not have a background color.void
setBackColorFormula(FormulaField newFormula)
Does nothing since an Area does not have a background color formula.void
setKeepGroupTogether(boolean newValue)
Sets the value of the property 'keep group together'.void
setReferences()
FOR INTERNAL USE ONLY-
Methods inherited from class com.inet.report.Region
getAtBottomOfPageFormula, getNewPageAfterFormula, getNewPageBeforeFormula, getResetPageNumberFormula, getSuppressOnDrillDownFormula, getType, getTypeAsString, isAtBottomOfPage, isHeader, isNewPageAfter, isNewPageBefore, isResetPageNumber, isSuppressOnDrillDown, setAtBottomOfPage, setAtBottomOfPageFormula, setNewPageAfter, setNewPageAfterFormula, setNewPageBefore, setNewPageBeforeFormula, setResetPageNumber, setResetPageNumberFormula, setSuppressOnDrillDown, setSuppressOnDrillDownFormula
-
Methods inherited from class com.inet.report.ReportComponent
addPropertyChangeListener, addPropertyChangeListener, addReferencedObject, addVetoableChangeListener, addVetoableChangeListener, getCustomData, getHeight, getKeepTogetherFormula, getRealReferencedObjectCount, getReferencedObjectCount, getReferencedObjects, getSuppressFormula, getWidth, getX, getY, isDOMParser, isKeepTogether, isSuppress, parseDOM, removePropertyChangeListener, removePropertyChangeListener, removeReferencedObject, removeVetoableChangeListener, removeVetoableChangeListener, setCustomData, setHeight, setKeepTogether, setKeepTogetherFormula, setSuppress, setSuppressFormula, setWidth, setX, setY
-
-
-
-
Method Detail
-
getParent
public java.lang.Object getParent()
Returns the parent Group if there is one, or null if there is not.- Returns:
- the parent Group if there is one, or null if there is not.
- Since:
- 3.0
- See Also:
Group
-
indexOf
public int indexOf()
Returns the current index of this area in the engine.- Specified by:
indexOf
in classReportComponent
- Returns:
- The current index of this area in the engine.
- Throws:
java.lang.IllegalStateException
- Thrown if this area was not found in parent engine.- Since:
- 6.0
- See Also:
Engine.getArea(int)
-
getBackColor
public int getBackColor()
ReturnsRDC.COLOR_NO_COLOR
since an Area does not have a background color. However, Sections have background colors.- Overrides:
getBackColor
in classReportComponent
- Returns:
- Always
RDC.COLOR_NO_COLOR
since an Area does not have a background color - Since:
- 3.0
- See Also:
ReportComponent.getBackColor()
-
getBackColorFormula
public FormulaField getBackColorFormula()
Returns null since an Area does not have a background color formula. However, Sections have a background color formula.- Overrides:
getBackColorFormula
in classReportComponent
- Returns:
- null since an Area does not have a background color formula
- Since:
- 3.0
- See Also:
ReportComponent.getBackColorFormula()
-
setBackColor
public void setBackColor(int backColor)
Does nothing since an Area does not have a background color. However, Sections have background colors.- Overrides:
setBackColor
in classReportComponent
- Parameters:
backColor
- Background color (will be ignored)- Since:
- 3.0
- See Also:
ReportComponent.setBackColor(int)
-
setBackColorFormula
public void setBackColorFormula(FormulaField newFormula)
Does nothing since an Area does not have a background color formula. However, Sections have a background color formula.- Overrides:
setBackColorFormula
in classReportComponent
- Parameters:
newFormula
- Formula field (will be ignored)- Since:
- 3.0
- See Also:
ReportComponent.setBackColorFormula(FormulaField)
-
paramString
public java.lang.String paramString()
Returns a string identifying this report component. This method is useful for logging and for debugging.- Overrides:
paramString
in classReportComponent
- Returns:
- a string identifying the ReportComponent
-
setKeepGroupTogether
public void setKeepGroupTogether(boolean newValue)
Sets the value of the property 'keep group together'. Use this property to keep the group from breaking across pages.- Parameters:
newValue
- The new value of the property 'keep group together'.- Since:
- 3.0
-
getSection
public Section getSection(int idx) throws java.lang.IndexOutOfBoundsException
Returns a SectionElement of the area. The index specifies the returned SectionElement.- Parameters:
idx
- The index of theSection
which should be returned- Returns:
Section
specified by the 0-based index.- Throws:
java.lang.IndexOutOfBoundsException
- Thrown if the given index is less than 0 or is greater than the number of sections in this Area.- Since:
- 1.0
-
getSectionCount
public int getSectionCount()
Returns the number of Sections in this Area.- Returns:
- The number of all Sections in this Area.
- Since:
- 3.0
-
addSection
public Section addSection()
Adds a newSection
to the area. The MethodaddSection()
creates a newSection
and adds this to the area's sections set. The type (kind) of theSection
is the same as the type (kind) of the area. The createdSection
is returned, if creation was successful, else an exception is thrown and a null reference is returned.- Returns:
- Returns the added Section.
- Since:
- 1.0
- See Also:
Section
-
removeSection
public Section removeSection(int idx) throws ReportException, java.lang.IndexOutOfBoundsException
Removes theSection
with specified index from area. The methodremove
returns a reference to the removedSection
, if removal was succsessful. Elseremove
throws an exception and returns a null reference.- Parameters:
idx
- The 0-based index of theSection
, which should be removed. Should an index into this sections set.- Returns:
- Returns the Section which was removed from sections set.
- Throws:
ReportException
- is thrown ifSection
set was empty or lastSection
in set should be removed.java.lang.IndexOutOfBoundsException
- Thrown if the given index is less than 0 or is greater than the number of sections in this Area.- Since:
- 1.0
- See Also:
Section
-
mergeSectionBelow
public void mergeSectionBelow(int idx)
When you have multiple sections in an area you can merge aSection
with theSection
below, i.e. when you have sections Da, Db, Dc you can mergeSection
Da with Db andSection
Db with Dc. The elements of theSection
below will be placed below the elements of theSection
with the given index. The resulting area has oneSection
less after merge. Calling the method with the index of the lastSection
in area, a ReportException will be thrown.- Parameters:
idx
- The 0-based index of theSection
, which should be merged with theSection
below (idx+1).- Throws:
java.lang.IllegalArgumentException
- is thrown ifSection
set was empty or lastSection
in set should be merged.- Since:
- 2.0
-
moveSection
public void moveSection(int srcIdx, int destIdx)
When you have multiple sections in an area you can move aSection
to a place below or above an otherSection
.- Parameters:
srcIdx
- The index of theSection
, which should be moved.destIdx
- The index of theSection
where theSection
(at srcIdx) should be placed.- Throws:
java.lang.IndexOutOfBoundsException
- If one of the indexes is greater than the number of sections.- Since:
- 2.0
-
setReferences
public void setReferences()
FOR INTERNAL USE ONLY- Specified by:
setReferences
in interfacecom.inet.report.ReferenceHolder
- Overrides:
setReferences
in classReportComponent
- Since:
- 6.0
-
resetReferences
public void resetReferences()
FOR INTERNAL USE ONLY- Specified by:
resetReferences
in interfacecom.inet.report.ReferenceHolder
- Overrides:
resetReferences
in classReportComponent
- Since:
- 6.0
-
parseElement
public NodeParser parseElement(com.inet.report.parser.XMLTag group, java.lang.String tag, org.xml.sax.Attributes atts, java.util.Map<java.lang.String,java.lang.Object> parserMap) throws FatalParserException
FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XMLParses an XML node with the given information, and returns either a sub-element which was created as a result, or null if no sub-element was created, i.e. the information was applied to the ReportComponent itself. Note that the parsing is highly tolerant, i.e. exceptions are intercepted and suppressed if at all possible.
- Specified by:
parseElement
in interfaceNodeParser
- Overrides:
parseElement
in classRegion
- Parameters:
group
- XMLTag of the current node to be parsed, or null if there is no such current group. An XMLTag is a group of nodes bundled together, usually it is a Properties node such as CommonProperties, BorderProperties, etc.tag
- The XMLTag to be parsedatts
- The set of attributes in the current XMLTagparserMap
- The map of current Parser.- Returns:
- The NodeParser sub-element if one needed to be created, or null if none was created.
- Throws:
FatalParserException
- if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
-
parseEndElement
public void parseEndElement(com.inet.report.parser.XMLTag group, java.lang.String tag, java.util.Map<java.lang.String,java.lang.Object> parserMap) throws FatalParserException
FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XMLReceive notification of the end of an XML tag.
- Specified by:
parseEndElement
in interfaceNodeParser
- Overrides:
parseEndElement
in classReportComponent
- Parameters:
group
- XMLTag of the current node to be parsed, or null if there is no such current group.tag
- The XMLTag to be parsedparserMap
- The map of current Parser.- Throws:
FatalParserException
- if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
-
parseText
public void parseText(java.lang.String text, java.util.Map<java.lang.String,java.lang.Object> parserMap)
FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XMLThis method is called if text was encountered in the context of this node. (Examples would be a formula's text or a text element's text)
- Specified by:
parseText
in interfaceNodeParser
- Overrides:
parseText
in classReportComponent
- Parameters:
text
- text encountered and to be storedparserMap
- The map of current Parser.
-
getSubComponents
public java.util.List<Section> getSubComponents()
Returns allReportComponent
s that are descendants of this one. E.G. this will return all Element of aSection
. But it's as well useful forCrossTab
s orText
elements which have additional elements.- Specified by:
getSubComponents
in classReportComponent
- Returns:
- a list with all sub components which can be empty as well; will be
null
if the component has no descendants
-
getPropertyFormulas
public java.util.List<FormulaField> getPropertyFormulas()
Returns a list with all property formulas that are set for this report element. This includes property formulas for any type of sub-component but excludes formulas for any descendantReportComponent
of this one. To get the property formulas for descendantReportComponent
useReportComponent.getSubComponents()
- Overrides:
getPropertyFormulas
in classRegion
- Returns:
- List of property formulas
-
-