Skip to content

Commit 22b4f8d

Browse files
committed
PDFBOX-5660: split file to have one class per file, to avoid warning about auxiliary class
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1933990 13f79535-47bb-0310-9956-ffa450edef68
1 parent fd17f38 commit 22b4f8d

2 files changed

Lines changed: 52 additions & 33 deletions

File tree

debugger/src/main/java/org/apache/pdfbox/debugger/fontencodingpane/FontEncodingPaneController.java

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package org.apache.pdfbox.debugger.fontencodingpane;
1818

19-
import java.awt.geom.GeneralPath;
20-
import java.awt.geom.Rectangle2D;
2119
import java.io.IOException;
2220
import javax.swing.JPanel;
2321
import org.apache.logging.log4j.Logger;
@@ -30,37 +28,6 @@
3028
import org.apache.pdfbox.pdmodel.font.PDType0Font;
3129
import org.apache.pdfbox.pdmodel.font.PDType3Font;
3230

33-
abstract class FontPane
34-
{
35-
abstract JPanel getPanel();
36-
37-
/**
38-
* Calculate vertical bounds common to all rendered glyphs.
39-
*
40-
* @param tableData
41-
* @param glyphIndex the table index that has glyphs.
42-
* @return an array with two elements: min lower bound (but max 0), and max upper bound (but min
43-
* 0).
44-
*/
45-
double[] getYBounds(Object[][] tableData, int glyphIndex)
46-
{
47-
double minY = 0;
48-
double maxY = 0;
49-
for (Object[] aTableData : tableData)
50-
{
51-
GeneralPath path = (GeneralPath) aTableData[glyphIndex];
52-
Rectangle2D bounds2D = path.getBounds2D();
53-
if (bounds2D.isEmpty())
54-
{
55-
continue;
56-
}
57-
minY = Math.min(minY, bounds2D.getMinY());
58-
maxY = Math.max(maxY, bounds2D.getMaxY());
59-
}
60-
return new double[]{minY, maxY};
61-
}
62-
}
63-
6431
/**
6532
* @author Khyrul Bashar
6633
*
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright 2015 The Apache Software Foundation.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.apache.pdfbox.debugger.fontencodingpane;
18+
19+
import java.awt.geom.GeneralPath;
20+
import java.awt.geom.Rectangle2D;
21+
import javax.swing.JPanel;
22+
23+
abstract class FontPane
24+
{
25+
abstract JPanel getPanel();
26+
27+
/**
28+
* Calculate vertical bounds common to all rendered glyphs.
29+
*
30+
* @param tableData
31+
* @param glyphIndex the table index that has glyphs.
32+
* @return an array with two elements: min lower bound (but max 0), and max upper bound (but min
33+
* 0).
34+
*/
35+
double[] getYBounds(Object[][] tableData, int glyphIndex)
36+
{
37+
double minY = 0;
38+
double maxY = 0;
39+
for (Object[] aTableData : tableData)
40+
{
41+
GeneralPath path = (GeneralPath) aTableData[glyphIndex];
42+
Rectangle2D bounds2D = path.getBounds2D();
43+
if (bounds2D.isEmpty())
44+
{
45+
continue;
46+
}
47+
minY = Math.min(minY, bounds2D.getMinY());
48+
maxY = Math.max(maxY, bounds2D.getMaxY());
49+
}
50+
return new double[]{minY, maxY};
51+
}
52+
}

0 commit comments

Comments
 (0)