Class HTMLCalculationReport
java.lang.Object
megamek.client.ui.clientGUI.calculationReport.HTMLCalculationReport
- All Implemented Interfaces:
- CalculationReport
This is a Calculation Report that builds its output as an HTML text which can be obtained from toString() as a String
 or from toJComponent() inside a JEditorPane.
- 
Nested Class SummaryNested classes/interfaces inherited from interface megamek.client.ui.clientGUI.calculationReport.CalculationReportCalculationReport.LineType
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionAdds a single line to the CalculationReport containing the header for the CalculationReport.Adds a single line to the CalculationReport.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.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.CalculationReportaddEmptyLine, addLine, addLine, addLine, addLine, addResultLine, addResultLine, addResultLine, finalizeTentativeSection
- 
Constructor Details- 
HTMLCalculationReportpublic HTMLCalculationReport()
 
- 
- 
Method Details- 
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
 
- 
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
 
- 
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
 
- 
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
 
- 
toString
 
-