Author: tilman
Date: Sat May  9 15:27:44 2026
New Revision: 1933991

Log:
PDFBOX-5660: split file to have one class per file, to avoid warning about 
auxiliary class

Added:
   
pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/fontencodingpane/FontPane.java
      - copied, changed from r1933042, 
pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/fontencodingpane/FontEncodingPaneController.java
Modified:
   
pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/fontencodingpane/FontEncodingPaneController.java

Modified: 
pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/fontencodingpane/FontEncodingPaneController.java
==============================================================================
--- 
pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/fontencodingpane/FontEncodingPaneController.java
      Sat May  9 15:27:40 2026        (r1933990)
+++ 
pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/fontencodingpane/FontEncodingPaneController.java
      Sat May  9 15:27:44 2026        (r1933991)
@@ -16,8 +16,6 @@
 
 package org.apache.pdfbox.debugger.fontencodingpane;
 
-import java.awt.geom.GeneralPath;
-import java.awt.geom.Rectangle2D;
 import java.io.IOException;
 import javax.swing.JPanel;
 import org.apache.commons.logging.Log;
@@ -30,37 +28,6 @@ import org.apache.pdfbox.pdmodel.font.PD
 import org.apache.pdfbox.pdmodel.font.PDType0Font;
 import org.apache.pdfbox.pdmodel.font.PDType3Font;
 
-abstract class FontPane
-{
-    abstract JPanel getPanel();
-
-    /**
-     * Calculate vertical bounds common to all rendered glyphs.
-     *
-     * @param tableData
-     * @param glyphIndex the table index that has glyphs.
-     * @return an array with two elements: min lower bound (but max 0), and 
max upper bound (but min
-     * 0).
-     */
-    double[] getYBounds(Object[][] tableData, int glyphIndex)
-    {
-        double minY = 0;
-        double maxY = 0;
-        for (Object[] aTableData : tableData)
-        {
-            GeneralPath path = (GeneralPath) aTableData[glyphIndex];
-            Rectangle2D bounds2D = path.getBounds2D();
-            if (bounds2D.isEmpty())
-            {
-                continue;
-            }
-            minY = Math.min(minY, bounds2D.getMinY());
-            maxY = Math.max(maxY, bounds2D.getMaxY());
-        }
-        return new double[]{minY, maxY};
-    }
-}
-
 /**
  * @author Khyrul Bashar
  *

Copied and modified: 
pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/fontencodingpane/FontPane.java
 (from r1933042, 
pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/fontencodingpane/FontEncodingPaneController.java)
==============================================================================
--- 
pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/fontencodingpane/FontEncodingPaneController.java
      Tue Apr 14 05:57:06 2026        (r1933042, copy source)
+++ 
pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/fontencodingpane/FontPane.java
        Sat May  9 15:27:44 2026        (r1933991)
@@ -18,17 +18,7 @@ package org.apache.pdfbox.debugger.fonte
 
 import java.awt.geom.GeneralPath;
 import java.awt.geom.Rectangle2D;
-import java.io.IOException;
 import javax.swing.JPanel;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.pdfbox.cos.COSDictionary;
-import org.apache.pdfbox.cos.COSName;
-import org.apache.pdfbox.pdmodel.PDResources;
-import org.apache.pdfbox.pdmodel.font.PDFont;
-import org.apache.pdfbox.pdmodel.font.PDSimpleFont;
-import org.apache.pdfbox.pdmodel.font.PDType0Font;
-import org.apache.pdfbox.pdmodel.font.PDType3Font;
 
 abstract class FontPane
 {
@@ -60,60 +50,3 @@ abstract class FontPane
         return new double[]{minY, maxY};
     }
 }
-
-/**
- * @author Khyrul Bashar
- *
- * A class that shows the glyph table or CIDToGID map depending on the font 
type. PDSimple and
- * PDType0Font are supported.
- */
-public class FontEncodingPaneController
-{
-    private static final Log LOG = 
LogFactory.getLog(FontEncodingPaneController.class);
-
-    private FontPane fontPane;
-
-    /**
-     * Constructor.
-     * @param fontName COSName instance, Font name in the fonts dictionary.
-     * @param dictionary COSDictionary instance for resources which resides 
the font.
-     */
-    public FontEncodingPaneController(COSName fontName, COSDictionary 
dictionary)
-    {
-        PDResources resources = new PDResources(dictionary);
-        try
-        {
-            PDFont font = resources.getFont(fontName);
-            if (font instanceof PDType3Font)
-            {
-                fontPane = new Type3Font((PDType3Font) font, resources);
-            }
-            else if (font instanceof PDSimpleFont)
-            {
-                fontPane = new SimpleFont((PDSimpleFont) font);
-            }
-            else if (font instanceof PDType0Font)
-            {
-                fontPane = new Type0Font(((PDType0Font) 
font).getDescendantFont(), (PDType0Font) font);
-            }
-        }
-        catch (IOException e)
-        {
-            LOG.error(e.getMessage(), e);
-        }
-    }
-
-    /**
-     * Return a pane to display details of a font.
-     * 
-     * @return a pane for font information, or null if that font type is not 
supported.
-     */
-    public JPanel getPane()
-    {
-        if (fontPane != null)
-        {
-            return fontPane.getPanel();
-        }
-        return null;
-    }
-}

Reply via email to