JPedal Java PDF library 4.01b15 API Documentation - http://www.jpedal.org

org.jpedal.examples.simpleviewer.gui
Class SwingGUI

java.lang.Object
  extended by org.jpedal.examples.simpleviewer.gui.GUI
      extended by org.jpedal.examples.simpleviewer.gui.SwingGUI
All Implemented Interfaces:
org.jpedal.gui.GUIFactory

public class SwingGUI
extends GUI
implements org.jpedal.gui.GUIFactory


Description: Swing GUI functions in Viewer


Field Summary
 boolean addUniqueIconToFileAttachment
           
 Commands currentCommands
           
static int CURSOR
           
static int DEFAULT_CURSOR
           
 java.awt.Color glowInnerColor
           
 java.awt.Color glowOuterColor
           
 int glowThickness
          Constants for glowing border
static int GRAB_CURSOR
           
static int GRABBING_CURSOR
           
static int MEMORY
           
 boolean messageShown
           
 GUIButton mouseMode
           
 GUIButton nextSearch
           
 javax.swing.JTextField pageCounter2
           
 GUIButton previousSearch
           
static int PROGRESS
           
 boolean useNewLayout
           
 
Fields inherited from class org.jpedal.examples.simpleviewer.gui.GUI
back, continuousButton, continuousFacingButton, cropH, cropW, cropX, cropY, end, facingButton, fback, fforward, first, forward, mediaH, mediaW, pageFlowButton, singleButton
 
Fields inherited from interface org.jpedal.gui.GUIFactory
BUTTONBAR, MULTIPAGE, NAVBAR, PAGES
 
Constructor Summary
SwingGUI(PdfDecoder decode_pdf, Values commonValues, GUIThumbnailPanel thumbnails, PropertiesFile properties)
           
 
Method Summary
 void addButton(int line, java.lang.String toolTip, java.lang.String path, int ID)
           
 void addCombo(java.lang.String title, java.lang.String tooltip, int ID)
           
 void addCursor()
           
 void addFormsListeners()
          this method adds listeners to GUI widgets to track changes
 void addMenuItem(javax.swing.JMenu parentMenu, java.lang.String text, java.lang.String toolTip, int ID)
           
 void addToMainMenu(javax.swing.JMenu fileMenuList)
           
 int AdjustForAlignment(int cx)
          adjusty x co-ordinate shown in display for user to include any page centering
 void alignLayoutMenuOption(int mode)
           
 void alterProperty(java.lang.String value, boolean set)
           
 void checkformSavedMessage()
           
 void clearRecentDocuments()
           
 void closeMultiViewerWindow(java.lang.String selectedFile)
           
 java.awt.Point convertPDFto2D(int cx, int cy)
           
 void createMainMenu(boolean includeAll)
           
 javax.swing.JScrollPane createPane(javax.swing.JTextPane text_pane, java.lang.String content, boolean useXML)
           
 void decodePage(boolean resizePanel)
           
 void dispose()
           
 java.lang.String getBookmark(java.lang.String bookmark)
           
 GUICombo getCombo(int ID)
          return comboBox or nul if not (QUALITY, SCALING or ROTATION
 int getCurrentPage()
           
 javax.swing.JComponent getDisplayPane()
           
 javax.swing.JToolBar getDisplaySettingsBar()
           
 boolean getDragLeft()
           
 boolean getDragTop()
           
 boolean getFormsDirtyFlag()
           
 java.awt.Container getFrame()
           
 void getHelpBox()
           
 java.util.Map getHotspots()
          get Map containing Form Objects setup for Unique Annotations
 void getInfoBox()
           
 javax.swing.JMenuBar getMenuBar()
           
 javax.swing.JDesktopPane getMultiViewerFrames()
           
 javax.swing.JToolBar getNavigationBar()
          Method incorrectly named.
 int getPageNumber()
           
 boolean getPageTurnScalingAppropriate()
           
 PdfDecoder getPdfDecoder()
           
 SearchList getResults()
           
 void getRSSBox()
           
 javax.swing.ButtonGroup getSearchLayoutGroup()
           
 int getSelectedComboIndex(int ID)
           
 java.lang.Object getSelectedComboItem(int ID)
           
 javax.swing.JTabbedPane getSideTabBar()
           
 javax.swing.JToolBar getTopButtonBar()
           
 void hideRedundentNavButtons()
           
 void init(java.lang.String[] scalingValues, java.lang.Object currentCommands, java.lang.Object currentPrinter)
           
 void initLayoutMenus(javax.swing.JMenu pageLayout, java.lang.String[] descriptions, int[] value)
           
 void initStatus()
           
 void initThumbnails(int itemSelectedCount, Vector_Int pageUsed)
           
 boolean isPDFOutlineVisible()
           
 boolean isSingle()
           
 java.lang.Object printDialog(java.lang.String[] printersList, java.lang.String defaultPrinter)
           
 void reinitialiseTabs(boolean showVisible)
           
 void reinitThumbnails()
           
 void removeSearchWindow(boolean justHide)
          example of a custom draw object private static class ExampleCustomDrawObject implements JPedalCustomDrawObject { private boolean isVisible=true; private int page = 0; public int medX = 0; public int medY = 0; public ExampleCustomDrawObject(){ } public ExampleCustomDrawObject(Integer option){ if(option.equals(JPedalCustomDrawObject.ALLPAGES)) page=-1; else throw new RuntimeException("Only valid setting is JPedalCustomDrawObject.ALLPAGES"); } public int getPage(){ return page; } public void print(Graphics2D g2, int x) { //custom code or just pass through if(page==x || page ==-1 || page==0) paint(g2); } public void paint(Graphics2D g2) { if(isVisible){ //your code here //if you alter something, put it back Paint paint=g2.getPaint(); //loud shape we can see g2.setPaint(Color.orange); g2.fillRect(100+medX,100+medY,100,100); // PDF co-ordinates due to transform g2.setPaint(Color.RED); g2.drawRect(100+medX,100+medY,100,100); // PDF co-ordinates due to transform //put back values g2.setPaint(paint); } } /**example onto rotated page public void paint(Graphics2D g2) { if(isVisible){ //your code here AffineTransform aff=g2.getTransform(); //allow for 90 degrees - detect of G2 double[] matrix=new double[6]; aff.getMatrix(matrix); //System.out.println("0="+matrix[0]+" 1="+matrix[1]+" 2="+matrix[2]+" 3="+matrix[3]+" 4="+matrix[4]+" 5="+matrix[5]); if(matrix[1]>0 && matrix[2]>0){ //90 g2.transform(AffineTransform.getScaleInstance(-1, 1)); g2.transform(AffineTransform.getRotateInstance(90 *Math.PI/180)); //BOTH X and Y POSITIVE!!!! g2.drawString("hello world", 60,60); }else if(matrix[0]<0 && matrix[3]>0){ //180 degrees (origin now top right) g2.transform(AffineTransform.getScaleInstance(-1, 1)); g2.drawString("hello world", -560,60);//subtract cropW from first number to use standard values }else if(matrix[1]<0 && matrix[2]<0){ //270 g2.transform(AffineTransform.getScaleInstance(-1, 1)); g2.transform(AffineTransform.getRotateInstance(-90 *Math.PI/180)); //BOTH X and Y NEGATIVE!!!! g2.drawString("hello world", -560,-60); //subtract CropW and CropH if you want standard values }else{ //0 degress g2.transform(AffineTransform.getScaleInstance(1, -1)); // X ONLY POSITIVE!!!! g2.drawString("hello world", 60,-60); } //restore!!! g2.setTransform(aff); } } public void setVisible(boolean isVisible) { this.isVisible=isVisible; } public void setMedX(int medX) { this.medX = medX; } public void setMedY(int medY) { this.medY = medY; } }/
 void resetComboBoxes(boolean value)
           
 void resetNavBar()
          reset so appears closed
 void resetPageNav()
           
 void resetRotationBox()
           
 void resetStatus()
           
 void resetStatusMessage(java.lang.String message)
           
 void rotate()
           
 void scrollToPage(int page)
           
 void searchInMenu(GUISearchWindow searchFrame)
           
 void searchInTab(GUISearchWindow searchFrame)
           
 void setBackNavigationButtonsEnabled(boolean flag)
           
 void setBookmarks(boolean alwaysGenerate)
           
 void setCoordText(java.lang.String string)
           
 void setCursor(int type)
           
 void setDisplayMode(java.lang.Integer mode)
           
 void setDragCorner(int a)
           
 void setFormsDirtyFlag(boolean dirty)
           
 void setForwardNavigationButtonsEnabled(boolean flag)
           
 void setFrame(java.awt.Container frame)
           
 void setMultibox(int option)
           
 void setNoPagesDecoded()
           
 void setPage(int page)
           
 void setPageLayoutButtonsEnabled(boolean flag)
           
 void setPageNumber()
           
 void setPdfDecoder(PdfDecoder decode_pdf)
           
 void setPDFOutlineVisible(boolean visible)
           
 void setQualityBoxVisible(boolean visible)
           
 void setResults(SearchList results)
           
 void setRotation()
           
 void setRotationFromExternal(int rot)
           
 void setScalingFromExternal(java.lang.String scale)
           
 void setSearchFrame(GUISearchWindow searchFrame)
           
 void setSearchLayoutButtonsEnabled()
           
 void setSearchText(javax.swing.JTextField searchText)
           
 void setSelectedComboIndex(int ID, int index)
           
 void setSelectedComboItem(int ID, java.lang.String index)
           
 void setSplitDividerLocation(int size)
           
static void setStartSize(int startSize)
           
 void setStatusProgress(int size)
           
 void setupThumbnailPanel()
          put the outline data into a display panel which we can pop up for the user - outlines, thumbnails private void createOutlinePanels() { //boolean hasNavBars=false; // set up first 10 thumbnails by default.
 void setViewerTitle(java.lang.String title)
           
 int showConfirmDialog(java.lang.Object message, java.lang.String title, int optionType, int messageType)
           
 int showConfirmDialog(java.lang.String message, java.lang.String message2, int option)
           
 void showDocumentProperties(java.lang.String selectedFile, java.lang.String inputDir, long size, int pageCount, int currentPage)
           
 void showFirstTimePopup()
           
 java.lang.String showInputDialog(java.lang.Object message, java.lang.String title, int type)
           
 java.lang.String showInputDialog(java.lang.String message)
           
 void showItextPopup()
           
 void showMessageDialog(javax.swing.JTextArea info)
           
 void showMessageDialog(java.lang.Object message1)
           
 void showMessageDialog(java.lang.Object message, java.lang.String title, int type)
           
 int showOptionDialog(java.lang.Object displayValue, java.lang.String message, int option, int type, java.lang.Object icon, java.lang.Object[] options, java.lang.Object initial)
           
 int showOverwriteDialog(java.lang.String file, boolean yesToAllPresent)
           
 void showPreferencesDialog()
           
 void stopThumbnails()
           
 void updateStatusMessage(java.lang.String message)
           
 void zoom(boolean Rotated)
           
 
Methods inherited from class org.jpedal.examples.simpleviewer.gui.GUI
allowScrolling, createUniqueAnnotationIcons, getAnnotTypes, getPDFDisplayInset, getProperties, getPropertiesFileLocation, getRectangle, getRotation, getScaling, isUseDownloadWindow, setAutoScrolling, setDpi, setHiResPrinting, setPreferences, setProperties, setPropertiesFileLocation, setRectangle, setScaling, setUseDownloadWindow, toogleAutoScrolling, useHiResPrinting
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jpedal.gui.GUIFactory
allowScrolling, getAnnotTypes, getRectangle, getRotation, getScaling, setAutoScrolling, setRectangle, toogleAutoScrolling
 

Field Detail

useNewLayout

public boolean useNewLayout

messageShown

public boolean messageShown

GRAB_CURSOR

public static final int GRAB_CURSOR
See Also:
Constant Field Values

GRABBING_CURSOR

public static final int GRABBING_CURSOR
See Also:
Constant Field Values

DEFAULT_CURSOR

public static final int DEFAULT_CURSOR
See Also:
Constant Field Values

CURSOR

public static final int CURSOR
See Also:
Constant Field Values

MEMORY

public static final int MEMORY
See Also:
Constant Field Values

PROGRESS

public static final int PROGRESS
See Also:
Constant Field Values

addUniqueIconToFileAttachment

public boolean addUniqueIconToFileAttachment

glowThickness

public int glowThickness
Constants for glowing border


glowOuterColor

public java.awt.Color glowOuterColor

glowInnerColor

public java.awt.Color glowInnerColor

pageCounter2

public javax.swing.JTextField pageCounter2

nextSearch

public GUIButton nextSearch

previousSearch

public GUIButton previousSearch

mouseMode

public GUIButton mouseMode

currentCommands

public Commands currentCommands
Constructor Detail

SwingGUI

public SwingGUI(PdfDecoder decode_pdf,
                Values commonValues,
                GUIThumbnailPanel thumbnails,
                PropertiesFile properties)
Method Detail

setStartSize

public static void setStartSize(int startSize)

getDisplayPane

public javax.swing.JComponent getDisplayPane()

getMultiViewerFrames

public javax.swing.JDesktopPane getMultiViewerFrames()

setPdfDecoder

public void setPdfDecoder(PdfDecoder decode_pdf)

closeMultiViewerWindow

public void closeMultiViewerWindow(java.lang.String selectedFile)

AdjustForAlignment

public int AdjustForAlignment(int cx)
adjusty x co-ordinate shown in display for user to include any page centering


getBookmark

public java.lang.String getBookmark(java.lang.String bookmark)

reinitialiseTabs

public void reinitialiseTabs(boolean showVisible)

stopThumbnails

public void stopThumbnails()

reinitThumbnails

public void reinitThumbnails()

resetNavBar

public void resetNavBar()
reset so appears closed

Specified by:
resetNavBar in interface org.jpedal.gui.GUIFactory

setNoPagesDecoded

public void setNoPagesDecoded()
Specified by:
setNoPagesDecoded in interface org.jpedal.gui.GUIFactory

setBackNavigationButtonsEnabled

public void setBackNavigationButtonsEnabled(boolean flag)

setForwardNavigationButtonsEnabled

public void setForwardNavigationButtonsEnabled(boolean flag)

setPageLayoutButtonsEnabled

public void setPageLayoutButtonsEnabled(boolean flag)

setSearchLayoutButtonsEnabled

public void setSearchLayoutButtonsEnabled()

alignLayoutMenuOption

public void alignLayoutMenuOption(int mode)

setDisplayMode

public void setDisplayMode(java.lang.Integer mode)

isSingle

public boolean isSingle()

initLayoutMenus

public void initLayoutMenus(javax.swing.JMenu pageLayout,
                            java.lang.String[] descriptions,
                            int[] value)
Specified by:
initLayoutMenus in interface org.jpedal.gui.GUIFactory

getInfoBox

public void getInfoBox()
Specified by:
getInfoBox in interface org.jpedal.gui.GUIFactory

resetRotationBox

public void resetRotationBox()
Specified by:
resetRotationBox in interface org.jpedal.gui.GUIFactory

showDocumentProperties

public void showDocumentProperties(java.lang.String selectedFile,
                                   java.lang.String inputDir,
                                   long size,
                                   int pageCount,
                                   int currentPage)
Specified by:
showDocumentProperties in interface org.jpedal.gui.GUIFactory

searchInTab

public void searchInTab(GUISearchWindow searchFrame)

searchInMenu

public void searchInMenu(GUISearchWindow searchFrame)

clearRecentDocuments

public void clearRecentDocuments()

init

public void init(java.lang.String[] scalingValues,
                 java.lang.Object currentCommands,
                 java.lang.Object currentPrinter)
Specified by:
init in interface org.jpedal.gui.GUIFactory

getPdfDecoder

public PdfDecoder getPdfDecoder()

addCursor

public void addCursor()
Specified by:
addCursor in interface org.jpedal.gui.GUIFactory

setMultibox

public void setMultibox(int option)

addButton

public void addButton(int line,
                      java.lang.String toolTip,
                      java.lang.String path,
                      int ID)
Specified by:
addButton in interface org.jpedal.gui.GUIFactory

addMenuItem

public void addMenuItem(javax.swing.JMenu parentMenu,
                        java.lang.String text,
                        java.lang.String toolTip,
                        int ID)
Specified by:
addMenuItem in interface org.jpedal.gui.GUIFactory

addCombo

public void addCombo(java.lang.String title,
                     java.lang.String tooltip,
                     int ID)
Specified by:
addCombo in interface org.jpedal.gui.GUIFactory

setViewerTitle

public void setViewerTitle(java.lang.String title)
Specified by:
setViewerTitle in interface org.jpedal.gui.GUIFactory

resetComboBoxes

public void resetComboBoxes(boolean value)
Specified by:
resetComboBoxes in interface org.jpedal.gui.GUIFactory

createPane

public final javax.swing.JScrollPane createPane(javax.swing.JTextPane text_pane,
                                                java.lang.String content,
                                                boolean useXML)
                                         throws javax.swing.text.BadLocationException
Specified by:
createPane in interface org.jpedal.gui.GUIFactory
Throws:
javax.swing.text.BadLocationException

getSelectedComboIndex

public int getSelectedComboIndex(int ID)
Specified by:
getSelectedComboIndex in interface org.jpedal.gui.GUIFactory

setSelectedComboIndex

public void setSelectedComboIndex(int ID,
                                  int index)
Specified by:
setSelectedComboIndex in interface org.jpedal.gui.GUIFactory

getCombo

public GUICombo getCombo(int ID)
return comboBox or nul if not (QUALITY, SCALING or ROTATION

Parameters:
ID -
Returns:

setSelectedComboItem

public void setSelectedComboItem(int ID,
                                 java.lang.String index)
Specified by:
setSelectedComboItem in interface org.jpedal.gui.GUIFactory

getSelectedComboItem

public java.lang.Object getSelectedComboItem(int ID)
Specified by:
getSelectedComboItem in interface org.jpedal.gui.GUIFactory

zoom

public void zoom(boolean Rotated)
Specified by:
zoom in interface org.jpedal.gui.GUIFactory

rotate

public void rotate()
Specified by:
rotate in interface org.jpedal.gui.GUIFactory

scrollToPage

public void scrollToPage(int page)

decodePage

public void decodePage(boolean resizePanel)
Specified by:
decodePage in interface org.jpedal.gui.GUIFactory

addFormsListeners

public void addFormsListeners()
this method adds listeners to GUI widgets to track changes


setupThumbnailPanel

public void setupThumbnailPanel()
put the outline data into a display panel which we can pop up for the user - outlines, thumbnails private void createOutlinePanels() { //boolean hasNavBars=false; // set up first 10 thumbnails by default. Rest created as needed. //add if statement or comment out this section to remove thumbnails setupThumbnailPanel(); // add any outline setBookmarks(false); /** resize to show if there are nav bars if(hasNavBars){ if(!thumbnails.isShownOnscreen()){ if( !commonValues.isContentExtractor()) navOptionsPanel.setVisible(true); displayPane.setDividerLocation(divLocation); //displayPane.invalidate(); //displayPane.repaint(); } } }/


setBookmarks

public void setBookmarks(boolean alwaysGenerate)

initStatus

public void initStatus()
Specified by:
initStatus in interface org.jpedal.gui.GUIFactory

resetStatus

public void resetStatus()
Specified by:
resetStatus in interface org.jpedal.gui.GUIFactory

initThumbnails

public void initThumbnails(int itemSelectedCount,
                           Vector_Int pageUsed)
Specified by:
initThumbnails in interface org.jpedal.gui.GUIFactory

checkformSavedMessage

public void checkformSavedMessage()

setCoordText

public void setCoordText(java.lang.String string)
Specified by:
setCoordText in interface org.jpedal.gui.GUIFactory

hideRedundentNavButtons

public void hideRedundentNavButtons()

setPageNumber

public void setPageNumber()
Specified by:
setPageNumber in interface org.jpedal.gui.GUIFactory

getPageNumber

public int getPageNumber()

setPage

public void setPage(int page)
Specified by:
setPage in interface org.jpedal.gui.GUIFactory

resetPageNav

public void resetPageNav()

setRotation

public void setRotation()

setRotationFromExternal

public void setRotationFromExternal(int rot)

setScalingFromExternal

public void setScalingFromExternal(java.lang.String scale)

createMainMenu

public void createMainMenu(boolean includeAll)

addToMainMenu

public void addToMainMenu(javax.swing.JMenu fileMenuList)
Specified by:
addToMainMenu in interface org.jpedal.gui.GUIFactory

getFrame

public java.awt.Container getFrame()
Specified by:
getFrame in interface org.jpedal.gui.GUIFactory

getTopButtonBar

public javax.swing.JToolBar getTopButtonBar()
Specified by:
getTopButtonBar in interface org.jpedal.gui.GUIFactory

getDisplaySettingsBar

public javax.swing.JToolBar getDisplaySettingsBar()

getMenuBar

public javax.swing.JMenuBar getMenuBar()

showMessageDialog

public void showMessageDialog(java.lang.Object message1)
Specified by:
showMessageDialog in interface org.jpedal.gui.GUIFactory

showMessageDialog

public void showMessageDialog(java.lang.Object message,
                              java.lang.String title,
                              int type)
Specified by:
showMessageDialog in interface org.jpedal.gui.GUIFactory

showInputDialog

public java.lang.String showInputDialog(java.lang.Object message,
                                        java.lang.String title,
                                        int type)
Specified by:
showInputDialog in interface org.jpedal.gui.GUIFactory

showInputDialog

public java.lang.String showInputDialog(java.lang.String message)
Specified by:
showInputDialog in interface org.jpedal.gui.GUIFactory

showOptionDialog

public int showOptionDialog(java.lang.Object displayValue,
                            java.lang.String message,
                            int option,
                            int type,
                            java.lang.Object icon,
                            java.lang.Object[] options,
                            java.lang.Object initial)
Specified by:
showOptionDialog in interface org.jpedal.gui.GUIFactory

showConfirmDialog

public int showConfirmDialog(java.lang.String message,
                             java.lang.String message2,
                             int option)
Specified by:
showConfirmDialog in interface org.jpedal.gui.GUIFactory

showOverwriteDialog

public int showOverwriteDialog(java.lang.String file,
                               boolean yesToAllPresent)
Specified by:
showOverwriteDialog in interface org.jpedal.gui.GUIFactory

showMessageDialog

public void showMessageDialog(javax.swing.JTextArea info)
Specified by:
showMessageDialog in interface org.jpedal.gui.GUIFactory

showItextPopup

public void showItextPopup()
Specified by:
showItextPopup in interface org.jpedal.gui.GUIFactory

showFirstTimePopup

public void showFirstTimePopup()
Specified by:
showFirstTimePopup in interface org.jpedal.gui.GUIFactory

showConfirmDialog

public int showConfirmDialog(java.lang.Object message,
                             java.lang.String title,
                             int optionType,
                             int messageType)
Specified by:
showConfirmDialog in interface org.jpedal.gui.GUIFactory

updateStatusMessage

public void updateStatusMessage(java.lang.String message)
Specified by:
updateStatusMessage in interface org.jpedal.gui.GUIFactory

resetStatusMessage

public void resetStatusMessage(java.lang.String message)
Specified by:
resetStatusMessage in interface org.jpedal.gui.GUIFactory

setStatusProgress

public void setStatusProgress(int size)
Specified by:
setStatusProgress in interface org.jpedal.gui.GUIFactory

isPDFOutlineVisible

public boolean isPDFOutlineVisible()
Specified by:
isPDFOutlineVisible in interface org.jpedal.gui.GUIFactory

setPDFOutlineVisible

public void setPDFOutlineVisible(boolean visible)
Specified by:
setPDFOutlineVisible in interface org.jpedal.gui.GUIFactory

setSplitDividerLocation

public void setSplitDividerLocation(int size)
Specified by:
setSplitDividerLocation in interface org.jpedal.gui.GUIFactory

printDialog

public java.lang.Object printDialog(java.lang.String[] printersList,
                                    java.lang.String defaultPrinter)
Specified by:
printDialog in interface org.jpedal.gui.GUIFactory

setQualityBoxVisible

public void setQualityBoxVisible(boolean visible)
Specified by:
setQualityBoxVisible in interface org.jpedal.gui.GUIFactory

setSearchText

public void setSearchText(javax.swing.JTextField searchText)

setResults

public void setResults(SearchList results)

getResults

public SearchList getResults()

getNavigationBar

public javax.swing.JToolBar getNavigationBar()
Method incorrectly named. New named method is getNavigationBar()

Returns:
JToolBar containing all navigation buttons public JToolBar getComboBar() { return navButtons; }/

getSideTabBar

public javax.swing.JTabbedPane getSideTabBar()

getSearchLayoutGroup

public javax.swing.ButtonGroup getSearchLayoutGroup()

setSearchFrame

public void setSearchFrame(GUISearchWindow searchFrame)

removeSearchWindow

public void removeSearchWindow(boolean justHide)
example of a custom draw object private static class ExampleCustomDrawObject implements JPedalCustomDrawObject { private boolean isVisible=true; private int page = 0; public int medX = 0; public int medY = 0; public ExampleCustomDrawObject(){ } public ExampleCustomDrawObject(Integer option){ if(option.equals(JPedalCustomDrawObject.ALLPAGES)) page=-1; else throw new RuntimeException("Only valid setting is JPedalCustomDrawObject.ALLPAGES"); } public int getPage(){ return page; } public void print(Graphics2D g2, int x) { //custom code or just pass through if(page==x || page ==-1 || page==0) paint(g2); } public void paint(Graphics2D g2) { if(isVisible){ //your code here //if you alter something, put it back Paint paint=g2.getPaint(); //loud shape we can see g2.setPaint(Color.orange); g2.fillRect(100+medX,100+medY,100,100); // PDF co-ordinates due to transform g2.setPaint(Color.RED); g2.drawRect(100+medX,100+medY,100,100); // PDF co-ordinates due to transform //put back values g2.setPaint(paint); } } /**example onto rotated page public void paint(Graphics2D g2) { if(isVisible){ //your code here AffineTransform aff=g2.getTransform(); //allow for 90 degrees - detect of G2 double[] matrix=new double[6]; aff.getMatrix(matrix); //System.out.println("0="+matrix[0]+" 1="+matrix[1]+" 2="+matrix[2]+" 3="+matrix[3]+" 4="+matrix[4]+" 5="+matrix[5]); if(matrix[1]>0 && matrix[2]>0){ //90 g2.transform(AffineTransform.getScaleInstance(-1, 1)); g2.transform(AffineTransform.getRotateInstance(90 *Math.PI/180)); //BOTH X and Y POSITIVE!!!! g2.drawString("hello world", 60,60); }else if(matrix[0]<0 && matrix[3]>0){ //180 degrees (origin now top right) g2.transform(AffineTransform.getScaleInstance(-1, 1)); g2.drawString("hello world", -560,60);//subtract cropW from first number to use standard values }else if(matrix[1]<0 && matrix[2]<0){ //270 g2.transform(AffineTransform.getScaleInstance(-1, 1)); g2.transform(AffineTransform.getRotateInstance(-90 *Math.PI/180)); //BOTH X and Y NEGATIVE!!!! g2.drawString("hello world", -560,-60); //subtract CropW and CropH if you want standard values }else{ //0 degress g2.transform(AffineTransform.getScaleInstance(1, -1)); // X ONLY POSITIVE!!!! g2.drawString("hello world", 60,-60); } //restore!!! g2.setTransform(aff); } } public void setVisible(boolean isVisible) { this.isVisible=isVisible; } public void setMedX(int medX) { this.medX = medX; } public void setMedY(int medY) { this.medY = medY; } }/


showPreferencesDialog

public void showPreferencesDialog()

setFrame

public void setFrame(java.awt.Container frame)

getRSSBox

public void getRSSBox()

alterProperty

public void alterProperty(java.lang.String value,
                          boolean set)

getHelpBox

public void getHelpBox()

dispose

public void dispose()
Overrides:
dispose in class GUI

getHotspots

public java.util.Map getHotspots()
get Map containing Form Objects setup for Unique Annotations

Returns:
Map

convertPDFto2D

public java.awt.Point convertPDFto2D(int cx,
                                     int cy)

getFormsDirtyFlag

public boolean getFormsDirtyFlag()

setFormsDirtyFlag

public void setFormsDirtyFlag(boolean dirty)

getCurrentPage

public int getCurrentPage()

getPageTurnScalingAppropriate

public boolean getPageTurnScalingAppropriate()

getDragLeft

public boolean getDragLeft()

getDragTop

public boolean getDragTop()

setDragCorner

public void setDragCorner(int a)

setCursor

public void setCursor(int type)

JPedal Java PDF library 4.01b15 API Documentation - http://www.jpedal.org

JPedal Java PDF library 4.01b15 API Documentation - http://www.jpedal.org