Skip to content

Commit

Permalink
PDFBOX-5911: add -1 value to print dpi menu, improve menu texts
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1922299 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
THausherr committed Dec 4, 2024
1 parent e4efb05 commit 5f994c1
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private static class PrintDpiMenuItem extends JRadioButtonMenuItem
}
}

private static final int[] DPIS = { 0, 100, 200, 300, 600, 1200 };
private static final int[] DPIS = { 0, 100, 200, 300, 600, 1200, -1 };

private static PrintDpiMenu instance;
private final JMenu menu;
Expand All @@ -51,11 +51,24 @@ private static class PrintDpiMenuItem extends JRadioButtonMenuItem
*/
private PrintDpiMenu()
{
menu = new JMenu("Print dpi");
menu = new JMenu("Print rastering");
ButtonGroup bg = new ButtonGroup();
for (int dpi : DPIS)
{
PrintDpiMenuItem printDpiMenuItem = new PrintDpiMenuItem(dpi == 0 ? "auto" : "" + dpi, dpi);
String text;
switch (dpi)
{
case 0:
text = "off";
break;
case -1:
text = "printer dpi";
break;
default:
text = dpi + " dpi";
break;
}
PrintDpiMenuItem printDpiMenuItem = new PrintDpiMenuItem(text, dpi);
bg.add(printDpiMenuItem);
menu.add(printDpiMenuItem);
}
Expand Down

0 comments on commit 5f994c1

Please sign in to comment.