Use the fonts defined in PrintUtilities instead of constructing a new font every time.
This commit is contained in:
parent
9552b2de86
commit
473300fa11
@ -194,9 +194,9 @@ public class PartsDetailVisitorStrategy {
|
|||||||
grid.addCell(createMaterialCell(tran.getMaterial()));
|
grid.addCell(createMaterialCell(tran.getMaterial()));
|
||||||
|
|
||||||
Chunk fore = new Chunk(FORE_DIAMETER + toLength(tran.getForeRadius() * 2));
|
Chunk fore = new Chunk(FORE_DIAMETER + toLength(tran.getForeRadius() * 2));
|
||||||
fore.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.NORMAL_FONT_SIZE));
|
fore.setFont(PrintUtilities.NORMAL);
|
||||||
Chunk aft = new Chunk(AFT_DIAMETER + toLength(tran.getAftRadius() * 2));
|
Chunk aft = new Chunk(AFT_DIAMETER + toLength(tran.getAftRadius() * 2));
|
||||||
aft.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.NORMAL_FONT_SIZE));
|
aft.setFont(PrintUtilities.NORMAL);
|
||||||
final PdfPCell cell = ITextHelper.createCell();
|
final PdfPCell cell = ITextHelper.createCell();
|
||||||
cell.addElement(fore);
|
cell.addElement(fore);
|
||||||
cell.addElement(aft);
|
cell.addElement(aft);
|
||||||
@ -387,17 +387,17 @@ public class PartsDetailVisitorStrategy {
|
|||||||
result.setVerticalAlignment(Element.ALIGN_TOP);
|
result.setVerticalAlignment(Element.ALIGN_TOP);
|
||||||
result.setBorder(Rectangle.BOTTOM);
|
result.setBorder(Rectangle.BOTTOM);
|
||||||
Chunk c = new Chunk();
|
Chunk c = new Chunk();
|
||||||
c.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.NORMAL_FONT_SIZE));
|
c.setFont(PrintUtilities.NORMAL);
|
||||||
c.append(DIAMETER);
|
c.append(DIAMETER);
|
||||||
p.add(c);
|
p.add(c);
|
||||||
|
|
||||||
c = new Chunk();
|
c = new Chunk();
|
||||||
c.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.SMALL_FONT_SIZE));
|
c.setFont(PrintUtilities.SMALL);
|
||||||
c.append(OUTER);
|
c.append(OUTER);
|
||||||
p.add(c);
|
p.add(c);
|
||||||
|
|
||||||
c = new Chunk();
|
c = new Chunk();
|
||||||
c.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.NORMAL_FONT_SIZE));
|
c.setFont(PrintUtilities.NORMAL);
|
||||||
c.append(" " + toLength(diameter));
|
c.append(" " + toLength(diameter));
|
||||||
p.add(c);
|
p.add(c);
|
||||||
result.addElement(p);
|
result.addElement(p);
|
||||||
@ -417,12 +417,12 @@ public class PartsDetailVisitorStrategy {
|
|||||||
result.setVerticalAlignment(Element.ALIGN_TOP);
|
result.setVerticalAlignment(Element.ALIGN_TOP);
|
||||||
result.setBorder(Rectangle.BOTTOM);
|
result.setBorder(Rectangle.BOTTOM);
|
||||||
Chunk c = new Chunk();
|
Chunk c = new Chunk();
|
||||||
c.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.NORMAL_FONT_SIZE));
|
c.setFont(PrintUtilities.NORMAL);
|
||||||
c.append(LENGTH);
|
c.append(LENGTH);
|
||||||
p.add(c);
|
p.add(c);
|
||||||
|
|
||||||
c = new Chunk();
|
c = new Chunk();
|
||||||
c.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.NORMAL_FONT_SIZE));
|
c.setFont(PrintUtilities.NORMAL);
|
||||||
c.append(" " + toLength(component.getStripLength()));
|
c.append(" " + toLength(component.getStripLength()));
|
||||||
p.add(c);
|
p.add(c);
|
||||||
result.addElement(p);
|
result.addElement(p);
|
||||||
@ -430,12 +430,12 @@ public class PartsDetailVisitorStrategy {
|
|||||||
Phrase pw = new Phrase();
|
Phrase pw = new Phrase();
|
||||||
pw.setLeading(14f);
|
pw.setLeading(14f);
|
||||||
c = new Chunk();
|
c = new Chunk();
|
||||||
c.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.NORMAL_FONT_SIZE));
|
c.setFont(PrintUtilities.NORMAL);
|
||||||
c.append(WIDTH);
|
c.append(WIDTH);
|
||||||
pw.add(c);
|
pw.add(c);
|
||||||
|
|
||||||
c = new Chunk();
|
c = new Chunk();
|
||||||
c.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.NORMAL_FONT_SIZE));
|
c.setFont(PrintUtilities.NORMAL);
|
||||||
c.append(" " + toLength(component.getStripWidth()));
|
c.append(" " + toLength(component.getStripWidth()));
|
||||||
pw.add(c);
|
pw.add(c);
|
||||||
result.addElement(pw);
|
result.addElement(pw);
|
||||||
@ -483,17 +483,17 @@ public class PartsDetailVisitorStrategy {
|
|||||||
result.setVerticalAlignment(Element.ALIGN_TOP);
|
result.setVerticalAlignment(Element.ALIGN_TOP);
|
||||||
result.setBorder(Rectangle.BOTTOM);
|
result.setBorder(Rectangle.BOTTOM);
|
||||||
Chunk c = new Chunk();
|
Chunk c = new Chunk();
|
||||||
c.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.NORMAL_FONT_SIZE));
|
c.setFont(PrintUtilities.NORMAL);
|
||||||
c.append(DIAMETER);
|
c.append(DIAMETER);
|
||||||
p.add(c);
|
p.add(c);
|
||||||
|
|
||||||
c = new Chunk();
|
c = new Chunk();
|
||||||
c.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.SMALL_FONT_SIZE));
|
c.setFont(PrintUtilities.SMALL);
|
||||||
c.append(OUTER);
|
c.append(OUTER);
|
||||||
p.add(c);
|
p.add(c);
|
||||||
|
|
||||||
c = new Chunk();
|
c = new Chunk();
|
||||||
c.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.NORMAL_FONT_SIZE));
|
c.setFont(PrintUtilities.NORMAL);
|
||||||
c.append(" " + toLength(outerRadius * 2));
|
c.append(" " + toLength(outerRadius * 2));
|
||||||
p.add(c);
|
p.add(c);
|
||||||
createInnerDiaCell(innerRadius, result, innerLabel);
|
createInnerDiaCell(innerRadius, result, innerLabel);
|
||||||
@ -512,17 +512,17 @@ public class PartsDetailVisitorStrategy {
|
|||||||
Phrase p = new Phrase();
|
Phrase p = new Phrase();
|
||||||
p.setLeading(14f);
|
p.setLeading(14f);
|
||||||
Chunk c = new Chunk();
|
Chunk c = new Chunk();
|
||||||
c.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.NORMAL_FONT_SIZE));
|
c.setFont(PrintUtilities.NORMAL);
|
||||||
c.append(DIAMETER);
|
c.append(DIAMETER);
|
||||||
p.add(c);
|
p.add(c);
|
||||||
|
|
||||||
c = new Chunk();
|
c = new Chunk();
|
||||||
c.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.SMALL_FONT_SIZE));
|
c.setFont(PrintUtilities.SMALL);
|
||||||
c.append(innerLabel);
|
c.append(innerLabel);
|
||||||
p.add(c);
|
p.add(c);
|
||||||
|
|
||||||
c = new Chunk();
|
c = new Chunk();
|
||||||
c.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.NORMAL_FONT_SIZE));
|
c.setFont(PrintUtilities.NORMAL);
|
||||||
c.append(" " + toLength(innerRadius * 2));
|
c.append(" " + toLength(innerRadius * 2));
|
||||||
p.add(c);
|
p.add(c);
|
||||||
cell.addElement(p);
|
cell.addElement(p);
|
||||||
@ -621,7 +621,7 @@ public class PartsDetailVisitorStrategy {
|
|||||||
Paragraph para = new Paragraph();
|
Paragraph para = new Paragraph();
|
||||||
para.setLeading(12f, 0);
|
para.setLeading(12f, 0);
|
||||||
Chunk c = new Chunk();
|
Chunk c = new Chunk();
|
||||||
c.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.NORMAL_FONT_SIZE));
|
c.setFont(PrintUtilities.NORMAL);
|
||||||
Chunk tab1 =
|
Chunk tab1 =
|
||||||
new Chunk(new VerticalPositionMark(), (level - 2) * 10, true);
|
new Chunk(new VerticalPositionMark(), (level - 2) * 10, true);
|
||||||
|
|
||||||
@ -638,7 +638,7 @@ public class PartsDetailVisitorStrategy {
|
|||||||
if (withIndent) {
|
if (withIndent) {
|
||||||
para.add(new Chunk(tab1));
|
para.add(new Chunk(tab1));
|
||||||
}
|
}
|
||||||
c.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.SMALL_FONT_SIZE));
|
c.setFont(PrintUtilities.SMALL);
|
||||||
c.append(preset.toString());
|
c.append(preset.toString());
|
||||||
para.add(c);
|
para.add(c);
|
||||||
}
|
}
|
||||||
@ -658,11 +658,11 @@ public class PartsDetailVisitorStrategy {
|
|||||||
cell.setLeading(13f, 0);
|
cell.setLeading(13f, 0);
|
||||||
|
|
||||||
Chunk c = new Chunk();
|
Chunk c = new Chunk();
|
||||||
c.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.NORMAL_FONT_SIZE));
|
c.setFont(PrintUtilities.NORMAL);
|
||||||
c.append(toMaterialName(material));
|
c.append(toMaterialName(material));
|
||||||
cell.addElement(c);
|
cell.addElement(c);
|
||||||
Chunk density = new Chunk();
|
Chunk density = new Chunk();
|
||||||
density.setFont(new Font(Font.FontFamily.HELVETICA, PrintUtilities.SMALL_FONT_SIZE));
|
density.setFont(PrintUtilities.SMALL);
|
||||||
density.append(toMaterialDensity(material));
|
density.append(toMaterialDensity(material));
|
||||||
cell.addElement(density);
|
cell.addElement(density);
|
||||||
return cell;
|
return cell;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user