From 95a18f4cd3bbe34b9f4afd93bcea2600f04eca19 Mon Sep 17 00:00:00 2001 From: SiboVG Date: Tue, 28 Feb 2023 02:50:17 +0100 Subject: [PATCH] [#2084] Include parts details for pods and boosters --- .../print/visitor/PartsDetailVisitorStrategy.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/swing/src/net/sf/openrocket/gui/print/visitor/PartsDetailVisitorStrategy.java b/swing/src/net/sf/openrocket/gui/print/visitor/PartsDetailVisitorStrategy.java index fbc56feb6..33757f2f5 100644 --- a/swing/src/net/sf/openrocket/gui/print/visitor/PartsDetailVisitorStrategy.java +++ b/swing/src/net/sf/openrocket/gui/print/visitor/PartsDetailVisitorStrategy.java @@ -8,6 +8,7 @@ import java.util.Set; import javax.swing.ImageIcon; +import net.sf.openrocket.rocketcomponent.ComponentAssembly; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -150,18 +151,20 @@ public class PartsDetailVisitorStrategy { private void handle (RocketComponent component) { //This ugly if-then-else construct is not object oriented. Originally it was an elegant, and very OO savy, design //using the Visitor pattern. Unfortunately, it was misunderstood and was removed. - if (component instanceof AxialStage) { + if (component instanceof ComponentAssembly) { try { if (grid != null) { document.add(grid); } - document.add(ITextHelper.createPhrase(component.getName())); + if (level > 1) { + Chunk tab = new Chunk(new VerticalPositionMark(), (level - 1) * 10, false); + document.add(tab); + } + document.add(ITextHelper.createPhrase(component.getComponentName() + ": " + component.getName())); grid = new PdfPTable(TABLE_COLUMNS); grid.setWidthPercentage(100); grid.setHorizontalAlignment(Element.ALIGN_LEFT); - } - catch (DocumentException e) { - } + } catch (DocumentException ignored) { } List rc = component.getChildren(); goDeep(rc);