Class DummyCalculationReport
java.lang.Object
megamek.client.ui.clientGUI.calculationReport.DummyCalculationReport
- All Implemented Interfaces:
- CalculationReport
This is a Calculation Report that can be used when the report that comes with a calculation isn't going to be used.
 It saves time and memory by doing nothing with any passed parameters. Its toString() and toJComponent() methods yield
 a short explanatory message as String and JLabel, respectively, and so can be called safely.
- 
Nested Class SummaryNested classes/interfaces inherited from interface megamek.client.ui.clientGUI.calculationReport.CalculationReportCalculationReport.LineType
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAdds an empty line to the CalculationReport.Adds a single line to the CalculationReport containing the header for the CalculationReport.Adds a single line to the CalculationReport.Adds a single line to the CalculationReport.Adds a single line to the CalculationReport.Adds a single line to the CalculationReport.Adds a single line to the CalculationReport.addResultLine(String resultPrefix, double result) Adds a single line to the CalculationReport in the way addLine() does, except the result has a line above it that may e.g.addResultLine(String type, String resultPrefix, double result) Adds a single line to the CalculationReport in the way addLine() does, except the result has a line above it that may e.g.addResultLine(String type, String calculation, String result) Adds a single line to the CalculationReport in the way addLine() does, except the result has a line above it that may e.g.addResultLine(String type, String calculation, String resultPrefix, double result) Adds a single line to the CalculationReport in the way addLine() does, except the result has a line above it that may e.g.addSubHeader(String text) Adds a single line to the CalculationReport containing a sub-header.voidDiscard all lines written to this section (all lines added to the report after callingCalculationReport.startTentativeSection()).voidEnd the current section of lines, writing them to the report normally.voidStarts a report section that is tentative, i.e.Returns the CalculationReport as a JComponent that can be added to a dialog or other Swing component.toString()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface megamek.client.ui.clientGUI.calculationReport.CalculationReportfinalizeTentativeSection
- 
Constructor Details- 
DummyCalculationReportpublic DummyCalculationReport()
 
- 
- 
Method Details- 
addLineDescription copied from interface:CalculationReportAdds a single line to the CalculationReport.- Specified by:
- addLinein interface- CalculationReport
- Parameters:
- type- The first element of this line, such as "Damage: "
- calculation- A calculation or other info, displayed after the type
- result- A result or other info, displayed on the right side
- Returns:
- The CalculationReport itself. Enables multiple stringed addLine calls
 
- 
addLinepublic CalculationReport addLine(String type, String calculation, String resultPrefix, double result) Description copied from interface:CalculationReportAdds a single line to the CalculationReport. This method performs rounding to a single decimal digit on the result and writes resultPrefix in front of it.- Specified by:
- addLinein interface- CalculationReport
- Parameters:
- type- The first element of this line, such as "Damage: "
- calculation- A calculation or other info, displayed after the type
- resultPrefix- A text to be display immediately in front of the result, such as "= "
- result- A numerical result which will be rounded to a single decimal, e.g. 25.1
- Returns:
- The CalculationReport itself. Enables multiple stringed addLine calls
 
- 
addLineDescription copied from interface:CalculationReportAdds a single line to the CalculationReport. This method performs rounding to a single decimal digit on the result and writes resultPrefix in front of it. This line has only two elements, the type ("Damage: ") and the result displayed on the right side.- Specified by:
- addLinein interface- CalculationReport
- Parameters:
- type- The first element of this line, such as "Damage: "
- resultPrefix- A text to be display immediately in front of the result, such as "= "
- result- A numerical result which will be rounded to a single decimal, e.g. 25.1
- Returns:
- The CalculationReport itself. Enables multiple stringed addLine calls
 
- 
addResultLinepublic CalculationReport addResultLine(String type, String calculation, String resultPrefix, double result) Description copied from interface:CalculationReportAdds a single line to the CalculationReport in the way addLine() does, except the result has a line above it that may e.g. indicate a summary of previous values. This method performs rounding to a single decimal digit on the result and writes resultPrefix in front of it.- Specified by:
- addResultLinein interface- CalculationReport
- Parameters:
- type- The first element of this line, such as "Damage: "
- calculation- A calculation or other info, displayed after the type
- resultPrefix- A text to be display immediately in front of the result, such as "= "
- result- A numerical result which will be rounded to a single decimal, e.g. 25.1
- Returns:
- The CalculationReport itself. Enables multiple stringed addLine calls
 
- 
addResultLineDescription copied from interface:CalculationReportAdds a single line to the CalculationReport in the way addLine() does, except the result has a line above it that may e.g. indicate a summary of previous values. This line has only two elements, the type ("Damage: ") and the result displayed on the right side. This method performs rounding to a single decimal digit on the result and writes resultPrefix in front of it.- Specified by:
- addResultLinein interface- CalculationReport
- Parameters:
- type- The first element of this line, such as "Damage: "
- resultPrefix- A text to be display immediately in front of the result, such as "= "
- result- A numerical result which will be rounded to a single decimal, e.g. 25.1
- Returns:
- The CalculationReport itself. Enables multiple stringed addLine calls
 
- 
addResultLineDescription copied from interface:CalculationReportAdds a single line to the CalculationReport in the way addLine() does, except the result has a line above it that may e.g. indicate a summary of previous values. This line has only one element, the result displayed on the right side. This method performs rounding to a single decimal digit on the result and writes resultPrefix in front of it.- Specified by:
- addResultLinein interface- CalculationReport
- Parameters:
- resultPrefix- A text to be display immediately in front of the result, such as "= "
- result- A numerical result which will be rounded to a single decimal, e.g. 25.1
- Returns:
- The CalculationReport itself. Enables multiple stringed addLine calls
 
- 
addEmptyLineDescription copied from interface:CalculationReportAdds an empty line to the CalculationReport.- Specified by:
- addEmptyLinein interface- CalculationReport
- Returns:
- The CalculationReport itself. Enables multiple stringed addLine calls
 
- 
addLineDescription copied from interface:CalculationReportAdds a single line to the CalculationReport. This line has only two elements, the type ("Damage: ") and a result displayed on the right side.- Specified by:
- addLinein interface- CalculationReport
- Parameters:
- type- The first element of this line, such as "Damage: "
- result- A result or other info, displayed on the right side
- Returns:
- The CalculationReport itself. Enables multiple stringed addLine calls
 
- 
addLineDescription copied from interface:CalculationReportAdds a single line to the CalculationReport. This line only has one element displayed on the right side.- Specified by:
- addLinein interface- CalculationReport
- Parameters:
- result- A result or other info, displayed on the right side
- Returns:
- The CalculationReport itself. Enables multiple stringed addLine calls
 
- 
addSubHeaderDescription copied from interface:CalculationReportAdds a single line to the CalculationReport containing a sub-header.- Specified by:
- addSubHeaderin interface- CalculationReport
- Parameters:
- text- The header text
- Returns:
- The CalculationReport itself. Enables multiple stringed addLine calls
 
- 
addHeaderDescription copied from interface:CalculationReportAdds a single line to the CalculationReport containing the header for the CalculationReport. This would typically be used as the first line but can be used anywhere in the CalculationReport and multiple times.- Specified by:
- addHeaderin interface- CalculationReport
- Parameters:
- text- The header text
- Returns:
- The CalculationReport itself. Enables multiple stringed addLine calls
 
- 
addResultLineDescription copied from interface:CalculationReportAdds a single line to the CalculationReport in the way addLine() does, except the result has a line above it that may e.g. indicate a summary of previous values.- Specified by:
- addResultLinein interface- CalculationReport
- Parameters:
- type- The first element of this line, such as "Damage: "
- calculation- A calculation or other info, displayed after the type
- result- A result or other info, displayed on the right side
- Returns:
- The CalculationReport itself. Enables multiple stringed addLine calls
 
- 
toJComponentDescription copied from interface:CalculationReportReturns the CalculationReport as a JComponent that can be added to a dialog or other Swing component.- Specified by:
- toJComponentin interface- CalculationReport
- Returns:
- The CalculationReport wrapped in a JComponent form.
 
- 
startTentativeSectionpublic void startTentativeSection()Description copied from interface:CalculationReportStarts a report section that is tentative, i.e. that may be added or discarded depending on whetherCalculationReport.endTentativeSection()orCalculationReport.discardTentativeSection()is called at a later point. All lines added to the report after calling this method are kept separate until eitherCalculationReport.endTentativeSection()orCalculationReport.discardTentativeSection()is called. When subsequentlyCalculationReport.endTentativeSection()is called, the lines of the section are written to the report normally. When subsequentlyCalculationReport.discardTentativeSection()is called, all lines in the section are discarded (not written to the report). Note that calling this method multiple times has no further effect. The first consecutive call of this method stays the one that marks the start of the section. Not more than a single section is maintained at any time.- Specified by:
- startTentativeSectionin interface- CalculationReport
 
- 
endTentativeSectionpublic void endTentativeSection()Description copied from interface:CalculationReportEnd the current section of lines, writing them to the report normally. Note that when a section has been ended and no new section begun, calling this method again has no effect.- Specified by:
- endTentativeSectionin interface- CalculationReport
 
- 
discardTentativeSectionpublic void discardTentativeSection()Description copied from interface:CalculationReportDiscard all lines written to this section (all lines added to the report after callingCalculationReport.startTentativeSection()). Note that when a section has been ended and no new section begun, calling this method again has no effect.- Specified by:
- discardTentativeSectionin interface- CalculationReport
 
- 
toString
 
-