public class PDFEditor extends JFrame implements AutoMenuBarUser, ActionListener
It does it all in Java (no native code calls) and its FREE!
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Modifier and Type | Class and Description |
---|---|
private class |
PDFEditor.aboutActionListener |
private class |
PDFEditor.bottomCropActionListener
Listener for the bottomCrop drop Down JComboBox.
|
private class |
PDFEditor.closeActionListener |
private class |
PDFEditor.debuglevelActionListener |
private class |
PDFEditor.exitActionListener |
private class |
PDFEditor.helpActionListener |
private class |
PDFEditor.jlfActionListener |
private class |
PDFEditor.leftCropActionListener
Listener for the leftCrop drop Down JComboBox.
|
private class |
PDFEditor.mlfActionListener |
private class |
PDFEditor.openActionListener |
private class |
PDFEditor.plfActionListener |
private class |
PDFEditor.printActionListener |
private class |
PDFEditor.rightCropActionListener
Listener for the leftCrop drop Down JComboBox.
|
private class |
PDFEditor.saveActionListener |
private class |
PDFEditor.topCropActionListener
Listener for the leftCrop drop Down JComboBox.
|
JFrame.AccessibleJFrame
Frame.AccessibleAWTFrame
Window.AccessibleAWTWindow, Window.Type
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
(package private) static int |
ABOUT_MENUREF
A class constant representing an ID value for the About Menuitem.
|
private static String |
APP_NAME
The application name string
|
(package private) JCheckBox |
bindingPageMargins_
A Checkbox to select if the Two Up page will have alternating even/odd top
page margin to allow for a twosided binding offset on the long side
of the page.
|
(package private) JPanel |
borderCropControlPanel1_
A control panel/holder for the control buttons at the top of the original
PDF view screen.
|
(package private) JPanel |
borderCropControlPanel2_
A control panel/holder for the control buttons at the top of the Cropped
PDF view screen.
|
(package private) JPanel |
borderCropControlPanel3_
A control panel/holder for the control buttons at the top of the Cropped2Up
PDF view screen.
|
(package private) JPanel |
borderCropControlPanel4_
A control panel/holder for the control buttons at the top of the 4th tab
pane.
|
private float |
bottomCrop_
The class holder for the amount to crop of the bottom edge of the original
PDF documen when creating the Cropped PDF.
|
private static String |
className_
A Class holder for its name (used in Logging).
|
(package private) static int |
CLOSE_MENUREF
A class constant representing an ID value for the Close Menuitem.
|
(package private) com.pdfgo.pdf.Document |
cropped2UpPDFDoc_
The instance object that represents the original Cropped 2Up PDF document.
|
(package private) com.pdfgo.pdf.Document |
croppedPDFDoc_
The instance object that represents the original Cropped PDF document.
|
protected CropPDF |
cropper_
The Crop PDF helper object that abstracts and performs the cropping.
|
(package private) static int |
DEBUGLEVEL_MENUREF
A class constant representing an ID value for the Debug Level Menuitem.
|
(package private) static int |
EXIT_MENUREF
A class constant representing an ID value for the Exit Menuitem.
|
(package private) JCheckBox |
facingPageMargins_
A Checkbox to select if the page cropping will alternate left/right
margins given that the original doc had even/odd page margins for a
binding offset.
|
(package private) static int |
HELP_MENUREF
A class constant representing an ID value for the Help Menuitem.
|
(package private) String |
inputPDF_
The class holder for the filename of the current PDF being manipulated.
|
(package private) URL |
inputPDFURL_
The class holder for the URL of the current PDF being manipulated.
|
(package private) Document |
iTextDoc
The iText PDF Document object.
|
(package private) static int |
JLF_MENUREF
A class constant representing an ID value for the Java Look And Feel Menuitem.
|
private float |
leftCrop_
The class holder for the amount to crop of the left edge of the original
PDF documen when creating the Cropped PDF.
|
protected static Logger |
logger_
The log4j logger object.
|
private AutoMenuBar |
menuBar_
The MenuBar.
|
(package private) static int |
MLF_MENUREF
A class constant representing an ID value for the Motif Look And Feel Menuitem.
|
protected ColouredLabel |
myDebugLabel_
A generic Class accessable Label that is used throughout for Debug
Stmnts to the screen.
|
(package private) static int |
OPEN_MENUREF
A class constant representing an ID value for the Open Menuitem.
|
(package private) com.pdfgo.pdf.Document |
originalPDFDoc_
The instance object that represents the original PDF document.
|
(package private) static int |
PLF_MENUREF
A class constant representing an ID value for the Platform Look And Feel Menuitem.
|
(package private) static int |
PRINT_MENUREF
A class constant representing an ID value for the Print Menuitem.
|
private float |
rightCrop_
The class holder for the amount to crop of the right edge of the original
PDF documen when creating the Cropped PDF.
|
(package private) static int |
SAVE_MENUREF
A class constant representing an ID value for the Save Menuitem.
|
private static String |
SYSTEM_FILE_SEPERATOR
Constant holding the users file seperator. ("/" or "\")
|
private static String |
SYSTEM_LINE_SEPERATOR
Constant holding the users file seperator. ("/" or "\")
|
private float |
topCrop_
The class holder for the amount to crop of the top edge of the original
PDF documen when creating the Cropped PDF.
|
protected TwoUpPDF |
twoUpper_
The 2Up Crop PDF helper object that abstracts and performs the creation
of the 2Up doc.
|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
PDFEditor()
Basic constructor for this Object that only gets the frame title setup..
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e)
Handles all the Actions originating from the Control Buttons.
|
void |
addListener(JMenuItem menuItem)
Adds an ActionListener to the JMenuItem that is supplied in the passed
param.
|
private void |
do2Up()
Perform the actual conversion of the Cropped Doc to the 2Up Doc.
|
private void |
doCrop()
Perform the actual cropping of the Doc.
|
private boolean |
doInitialLoadAndCrop()
Does the initial loading of the document and then gets the cropped
versions done and ready for initial display and editing.
|
private String |
get2UpCroppedPDFName()
Returns the String representing the filename of the Cropped-2up file that
is based on the input PDF filename.
|
float |
getBottomCrop_()
Getter for the bottomCrop_ field.
|
private String |
getCroppedPDFName()
Returns the String representing the filename of the Cropped file that
is based on the input PDF filename.
|
String |
getInputPDF_()
Getter for the inputPDF_ field.
|
float |
getLeftCrop_()
Getter for the leftCrop_ field.
|
Logger |
getLogger()
Gets the Log object that the class instance is using.
|
float |
getRightCrop_()
Getter for the rightCrop_ field.
|
float |
getTopCrop_()
Getter for the topCrop_ field.
|
private JPanel |
init2UpCroppedPDFPanel()
Initializes the GUI Main Area Panel (the tabbed pane, the
inner panels etc.)
|
private JPanel |
initCroppedPDFPanel()
Initializes the GUI Main Area Panel (the tabbed pane, the
inner panels etc.)
|
private void |
initGui()
Initializes the GUI upon startup.
|
private JPanel |
initMainArea()
Initializes the GUI Main Area Panel (the tabbed pane, the
inner panels etc.)
|
private JPanel |
initOriginalPDFPanel()
Initializes the original PDF Document view panel.
|
static void |
main(String[] args)
The main entrypoint for this class. class
|
private void |
refresh2UpView()
Initializes the GUI Main Area Panel (the tabbed pane, the
inner panels etc.)
|
private void |
refreshCroppedView()
Initializes the GUI Main Area Panel (the tabbed pane, the
inner panels etc.)
|
private void |
repaintMenuBar()
Forces a repaint to this apps menubar.
|
void |
setBottomCrop_(float bottomCrop)
Setter for the bottomCrop_ field.
|
void |
setInputPDF_(String inputPDF)
Setter for the inputPDF_ field.
|
void |
setLeftCrop_(float leftCrop)
Setter for the leftCrop_ field.
|
void |
setRightCrop_(float rightCrop)
Setter for the rightCrop_ field.
|
void |
setTopCrop_(float topCrop)
Setter for the topCrop_ field.
|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFont, postEvent
private static final String SYSTEM_FILE_SEPERATOR
private static final String SYSTEM_LINE_SEPERATOR
private static final String APP_NAME
private static String className_
protected CropPDF cropper_
protected TwoUpPDF twoUpper_
protected ColouredLabel myDebugLabel_
URL inputPDFURL_
JPanel borderCropControlPanel1_
JPanel borderCropControlPanel2_
JPanel borderCropControlPanel3_
JPanel borderCropControlPanel4_
JCheckBox facingPageMargins_
JCheckBox bindingPageMargins_
private float leftCrop_
private float rightCrop_
private float topCrop_
private float bottomCrop_
com.pdfgo.pdf.Document originalPDFDoc_
com.pdfgo.pdf.Document croppedPDFDoc_
com.pdfgo.pdf.Document cropped2UpPDFDoc_
private AutoMenuBar menuBar_
AutoMenuBar
static final int OPEN_MENUREF
static final int SAVE_MENUREF
static final int PRINT_MENUREF
static final int CLOSE_MENUREF
static final int EXIT_MENUREF
static final int DEBUGLEVEL_MENUREF
static final int JLF_MENUREF
static final int PLF_MENUREF
static final int MLF_MENUREF
static final int HELP_MENUREF
static final int ABOUT_MENUREF
public PDFEditor()
public void setInputPDF_(String inputPDF)
public String getInputPDF_()
public void setLeftCrop_(float leftCrop)
public float getLeftCrop_()
public void setRightCrop_(float rightCrop)
public float getRightCrop_()
public void setTopCrop_(float topCrop)
public float getTopCrop_()
public void setBottomCrop_(float bottomCrop)
public float getBottomCrop_()
private String get2UpCroppedPDFName()
private String getCroppedPDFName()
private void doCrop()
private void do2Up()
private JPanel init2UpCroppedPDFPanel()
private JPanel initCroppedPDFPanel()
private void refreshCroppedView()
private void refresh2UpView()
private JPanel initOriginalPDFPanel()
private JPanel initMainArea()
private void initGui()
private void repaintMenuBar()
public void addListener(JMenuItem menuItem)
addListener
in interface AutoMenuBarUser
menuItem
- The feature to be added to the Listener attributeprivate boolean doInitialLoadAndCrop()
public Logger getLogger()
public static void main(String[] args)
arg
- The command line argumentspublic void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
e
- Description of ParameterWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses