|
JPedal Java PDF library 4.01b15 API Documentation - http://www.jpedal.org | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jpedal.examples.simpleviewer.gui.GUI
org.jpedal.examples.simpleviewer.gui.SwingGUI
public class SwingGUI
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 |
|---|
public boolean useNewLayout
public boolean messageShown
public static final int GRAB_CURSOR
public static final int GRABBING_CURSOR
public static final int DEFAULT_CURSOR
public static final int CURSOR
public static final int MEMORY
public static final int PROGRESS
public boolean addUniqueIconToFileAttachment
public int glowThickness
public java.awt.Color glowOuterColor
public java.awt.Color glowInnerColor
public javax.swing.JTextField pageCounter2
public GUIButton nextSearch
public GUIButton previousSearch
public GUIButton mouseMode
public Commands currentCommands
| Constructor Detail |
|---|
public SwingGUI(PdfDecoder decode_pdf,
Values commonValues,
GUIThumbnailPanel thumbnails,
PropertiesFile properties)
| Method Detail |
|---|
public static void setStartSize(int startSize)
public javax.swing.JComponent getDisplayPane()
public javax.swing.JDesktopPane getMultiViewerFrames()
public void setPdfDecoder(PdfDecoder decode_pdf)
public void closeMultiViewerWindow(java.lang.String selectedFile)
public int AdjustForAlignment(int cx)
public java.lang.String getBookmark(java.lang.String bookmark)
public void reinitialiseTabs(boolean showVisible)
public void stopThumbnails()
public void reinitThumbnails()
public void resetNavBar()
resetNavBar in interface org.jpedal.gui.GUIFactorypublic void setNoPagesDecoded()
setNoPagesDecoded in interface org.jpedal.gui.GUIFactorypublic void setBackNavigationButtonsEnabled(boolean flag)
public void setForwardNavigationButtonsEnabled(boolean flag)
public void setPageLayoutButtonsEnabled(boolean flag)
public void setSearchLayoutButtonsEnabled()
public void alignLayoutMenuOption(int mode)
public void setDisplayMode(java.lang.Integer mode)
public boolean isSingle()
public void initLayoutMenus(javax.swing.JMenu pageLayout,
java.lang.String[] descriptions,
int[] value)
initLayoutMenus in interface org.jpedal.gui.GUIFactorypublic void getInfoBox()
getInfoBox in interface org.jpedal.gui.GUIFactorypublic void resetRotationBox()
resetRotationBox in interface org.jpedal.gui.GUIFactory
public void showDocumentProperties(java.lang.String selectedFile,
java.lang.String inputDir,
long size,
int pageCount,
int currentPage)
showDocumentProperties in interface org.jpedal.gui.GUIFactorypublic void searchInTab(GUISearchWindow searchFrame)
public void searchInMenu(GUISearchWindow searchFrame)
public void clearRecentDocuments()
public void init(java.lang.String[] scalingValues,
java.lang.Object currentCommands,
java.lang.Object currentPrinter)
init in interface org.jpedal.gui.GUIFactorypublic PdfDecoder getPdfDecoder()
public void addCursor()
addCursor in interface org.jpedal.gui.GUIFactorypublic void setMultibox(int option)
public void addButton(int line,
java.lang.String toolTip,
java.lang.String path,
int ID)
addButton in interface org.jpedal.gui.GUIFactory
public void addMenuItem(javax.swing.JMenu parentMenu,
java.lang.String text,
java.lang.String toolTip,
int ID)
addMenuItem in interface org.jpedal.gui.GUIFactory
public void addCombo(java.lang.String title,
java.lang.String tooltip,
int ID)
addCombo in interface org.jpedal.gui.GUIFactorypublic void setViewerTitle(java.lang.String title)
setViewerTitle in interface org.jpedal.gui.GUIFactorypublic void resetComboBoxes(boolean value)
resetComboBoxes in interface org.jpedal.gui.GUIFactory
public final javax.swing.JScrollPane createPane(javax.swing.JTextPane text_pane,
java.lang.String content,
boolean useXML)
throws javax.swing.text.BadLocationException
createPane in interface org.jpedal.gui.GUIFactoryjavax.swing.text.BadLocationExceptionpublic int getSelectedComboIndex(int ID)
getSelectedComboIndex in interface org.jpedal.gui.GUIFactory
public void setSelectedComboIndex(int ID,
int index)
setSelectedComboIndex in interface org.jpedal.gui.GUIFactorypublic GUICombo getCombo(int ID)
ID -
public void setSelectedComboItem(int ID,
java.lang.String index)
setSelectedComboItem in interface org.jpedal.gui.GUIFactorypublic java.lang.Object getSelectedComboItem(int ID)
getSelectedComboItem in interface org.jpedal.gui.GUIFactorypublic void zoom(boolean Rotated)
zoom in interface org.jpedal.gui.GUIFactorypublic void rotate()
rotate in interface org.jpedal.gui.GUIFactorypublic void scrollToPage(int page)
public void decodePage(boolean resizePanel)
decodePage in interface org.jpedal.gui.GUIFactorypublic void addFormsListeners()
public void setupThumbnailPanel()
public void setBookmarks(boolean alwaysGenerate)
public void initStatus()
initStatus in interface org.jpedal.gui.GUIFactorypublic void resetStatus()
resetStatus in interface org.jpedal.gui.GUIFactory
public void initThumbnails(int itemSelectedCount,
Vector_Int pageUsed)
initThumbnails in interface org.jpedal.gui.GUIFactorypublic void checkformSavedMessage()
public void setCoordText(java.lang.String string)
setCoordText in interface org.jpedal.gui.GUIFactorypublic void hideRedundentNavButtons()
public void setPageNumber()
setPageNumber in interface org.jpedal.gui.GUIFactorypublic int getPageNumber()
public void setPage(int page)
setPage in interface org.jpedal.gui.GUIFactorypublic void resetPageNav()
public void setRotation()
public void setRotationFromExternal(int rot)
public void setScalingFromExternal(java.lang.String scale)
public void createMainMenu(boolean includeAll)
public void addToMainMenu(javax.swing.JMenu fileMenuList)
addToMainMenu in interface org.jpedal.gui.GUIFactorypublic java.awt.Container getFrame()
getFrame in interface org.jpedal.gui.GUIFactorypublic javax.swing.JToolBar getTopButtonBar()
getTopButtonBar in interface org.jpedal.gui.GUIFactorypublic javax.swing.JToolBar getDisplaySettingsBar()
public javax.swing.JMenuBar getMenuBar()
public void showMessageDialog(java.lang.Object message1)
showMessageDialog in interface org.jpedal.gui.GUIFactory
public void showMessageDialog(java.lang.Object message,
java.lang.String title,
int type)
showMessageDialog in interface org.jpedal.gui.GUIFactory
public java.lang.String showInputDialog(java.lang.Object message,
java.lang.String title,
int type)
showInputDialog in interface org.jpedal.gui.GUIFactorypublic java.lang.String showInputDialog(java.lang.String message)
showInputDialog in interface org.jpedal.gui.GUIFactory
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)
showOptionDialog in interface org.jpedal.gui.GUIFactory
public int showConfirmDialog(java.lang.String message,
java.lang.String message2,
int option)
showConfirmDialog in interface org.jpedal.gui.GUIFactory
public int showOverwriteDialog(java.lang.String file,
boolean yesToAllPresent)
showOverwriteDialog in interface org.jpedal.gui.GUIFactorypublic void showMessageDialog(javax.swing.JTextArea info)
showMessageDialog in interface org.jpedal.gui.GUIFactorypublic void showItextPopup()
showItextPopup in interface org.jpedal.gui.GUIFactorypublic void showFirstTimePopup()
showFirstTimePopup in interface org.jpedal.gui.GUIFactory
public int showConfirmDialog(java.lang.Object message,
java.lang.String title,
int optionType,
int messageType)
showConfirmDialog in interface org.jpedal.gui.GUIFactorypublic void updateStatusMessage(java.lang.String message)
updateStatusMessage in interface org.jpedal.gui.GUIFactorypublic void resetStatusMessage(java.lang.String message)
resetStatusMessage in interface org.jpedal.gui.GUIFactorypublic void setStatusProgress(int size)
setStatusProgress in interface org.jpedal.gui.GUIFactorypublic boolean isPDFOutlineVisible()
isPDFOutlineVisible in interface org.jpedal.gui.GUIFactorypublic void setPDFOutlineVisible(boolean visible)
setPDFOutlineVisible in interface org.jpedal.gui.GUIFactorypublic void setSplitDividerLocation(int size)
setSplitDividerLocation in interface org.jpedal.gui.GUIFactory
public java.lang.Object printDialog(java.lang.String[] printersList,
java.lang.String defaultPrinter)
printDialog in interface org.jpedal.gui.GUIFactorypublic void setQualityBoxVisible(boolean visible)
setQualityBoxVisible in interface org.jpedal.gui.GUIFactorypublic void setSearchText(javax.swing.JTextField searchText)
public void setResults(SearchList results)
public SearchList getResults()
public javax.swing.JToolBar getNavigationBar()
public javax.swing.JTabbedPane getSideTabBar()
public javax.swing.ButtonGroup getSearchLayoutGroup()
public void setSearchFrame(GUISearchWindow searchFrame)
public void removeSearchWindow(boolean justHide)
public void showPreferencesDialog()
public void setFrame(java.awt.Container frame)
public void getRSSBox()
public void alterProperty(java.lang.String value,
boolean set)
public void getHelpBox()
public void dispose()
dispose in class GUIpublic java.util.Map getHotspots()
public java.awt.Point convertPDFto2D(int cx,
int cy)
public boolean getFormsDirtyFlag()
public void setFormsDirtyFlag(boolean dirty)
public int getCurrentPage()
public boolean getPageTurnScalingAppropriate()
public boolean getDragLeft()
public boolean getDragTop()
public void setDragCorner(int a)
public void setCursor(int type)
|
JPedal Java PDF library 4.01b15 API Documentation - http://www.jpedal.org | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||