public class JpdViewer
extends javax.swing.JComponent
implements javax.swing.event.HyperlinkListener
限定符和类型 | 字段和说明 |
---|---|
static int |
TYPE_DOC
查看器类型:文档
|
static int |
TYPE_IMG
查看器类型:图片
|
static int |
TYPE_SLIDE
查看器类型:幻灯片
|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
限定符和类型 | 方法和说明 |
---|---|
void |
about()
关于
|
com.hg.jpd.Canvas |
canvas(int pageIndex)
获取指定页面的画图板
|
void |
changeType()
文档和幻灯片模式切换
|
void |
clearItemsValue()
清除输入项值
|
java.lang.String |
getHrefPrefix()
获取超链接前缀(相对URL)
|
com.hg.jpd.Item |
getItem(java.lang.String name)
获取输入项
|
java.util.List |
getItems()
获取所有输入项
|
java.lang.String |
getItemValue(java.lang.String name)
获取输入项值
|
java.util.Map |
getItemValues()
获取所有输入项值
|
int |
getPageCount()
页数
|
int |
getPageHeight()
页面高度
|
int |
getPageWidth()
页面宽度
|
java.io.InputStream |
getSource()
获取源文件流
|
java.lang.String |
getTitle()
获取标题
|
java.lang.String |
getXData()
获取输入项xml数据
|
java.lang.String |
getXmlData()
获取输入项xml数据
|
void |
go(java.lang.String url)
跳转
|
void |
hyperlinkUpdate(javax.swing.event.HyperlinkEvent e) |
boolean |
isBarVisible()
工具栏是否显示
|
boolean |
isOpenEnable()
是否可打开
|
boolean |
isPrintEnable()
是否可打印
|
boolean |
isSaveEnable()
是否可保存
|
void |
mergeData()
合并数据
|
void |
mergeData(java.io.File file)
合并数据
|
void |
mergeData(java.io.OutputStream out,
java.lang.String format)
合并数据
|
void |
navTo(int page,
int x,
int y)
导航到
|
void |
navTo(java.lang.String[] heads)
导航到标题
|
void |
open()
打开
|
void |
open(java.io.File file)
打开文件
|
void |
open(java.io.InputStream in)
打开jpd流
|
void |
open(java.lang.String url)
打开指定url的xdoc
|
void |
print()
打印
|
int |
print(java.awt.Graphics g,
int pageIndex,
int w,
int h)
打印输出
|
int |
print(java.awt.Graphics g,
int pageIndex,
int x,
int y,
int width,
int height)
打印输出
|
void |
print(java.lang.String printer)
直接打印到指定打印机
|
void |
readState() |
void |
readXmlData(java.lang.String url)
设置输入项xml数据
|
java.awt.image.BufferedImage |
render(java.lang.String xdoc,
int width) |
void |
save()
保存
|
void |
save(java.io.File file)
保存
|
void |
save(java.io.OutputStream out,
java.lang.String format)
保存
|
void |
setBarVisible(boolean visible)
设置是否显示工具栏
|
void |
setFrame(javax.swing.JFrame frame)
设置所属frame
|
void |
setHrefPrefix(java.lang.String hrefPrefix)
设置超链接前缀(相对URL)
|
void |
setItem(java.lang.String name,
com.hg.jpd.Item item)
设置输入项
|
void |
setItemEnable(java.lang.String name,
boolean enable)
设置输入项是否启用
|
void |
setItemsEnable(boolean enable)
设置所有输入项是否启用
|
void |
setItemValue(java.lang.String name,
java.lang.String value)
设置输入项值
|
void |
setItemValues(java.util.Map map)
设置所有输入项值
|
void |
setItemVisible(java.lang.String name,
boolean visible)
设置输入项是否可视
|
void |
setMergeEnable(boolean mergeEnable)
设置是否可打开
|
void |
setNavVisible(boolean visible)
设置是否显示导航栏
|
void |
setOpenEnable(boolean openEnable)
设置是否可打开
|
void |
setPrintEnable(boolean printEnable)
设置是否可打印
|
void |
setReadFormat(java.lang.String readFormat) |
void |
setSaveEnable(boolean saveEnable)
设置是否可保存
|
void |
setStatus(java.lang.String msg)
设置消息
|
void |
setType(int type)
设置查看器类型
|
void |
setWriteFormat(java.lang.String writeFormat) |
void |
setXData(java.lang.String xml)
设置输入项xml数据
|
void |
setXDocServer(java.lang.String server)
设置XDocServer
|
void |
setXDocServer(java.lang.String server,
java.lang.String key)
设置XDocServer
|
void |
setXmlData(java.lang.String xml)
设置输入项xml数据
|
boolean |
validateItems()
校验输入值有效性
|
void |
writeState() |
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final int TYPE_DOC
public static final int TYPE_SLIDE
public static final int TYPE_IMG
public JpdViewer()
public JpdViewer(javax.swing.JApplet applet)
applet
- appletpublic java.lang.String getTitle()
public void setStatus(java.lang.String msg)
msg
- public void setXDocServer(java.lang.String server)
server
- public void setXDocServer(java.lang.String server, java.lang.String key)
server
- key
- public void setBarVisible(boolean visible)
visible
- 是否显示public boolean isBarVisible()
public void setNavVisible(boolean visible)
visible
- 是否显示public void setType(int type)
type
- 查看器类型public void changeType()
public void setFrame(javax.swing.JFrame frame)
frame
- 所属framepublic void print()
public void print(java.lang.String printer)
printer
- 打印机名称public void setReadFormat(java.lang.String readFormat)
public void setWriteFormat(java.lang.String writeFormat)
public void open()
public void open(java.io.File file)
file
- filepublic void open(java.lang.String url)
url
- urlpublic java.io.InputStream getSource()
public void open(java.io.InputStream in) throws java.io.IOException
in
- java.io.IOException
public int getPageWidth()
public int getPageHeight()
public int getPageCount()
public com.hg.jpd.Canvas canvas(int pageIndex)
public void save()
public void save(java.io.File file) throws java.lang.Exception
java.lang.Exception
public void save(java.io.OutputStream out, java.lang.String format) throws java.lang.Exception
out
- format
- java.lang.Exception
public void mergeData()
public void mergeData(java.io.File file) throws java.lang.Exception
file
- java.lang.Exception
public void mergeData(java.io.OutputStream out, java.lang.String format) throws java.lang.Exception
out
- java.lang.Exception
public void navTo(int page, int x, int y)
page
- 页x
- x坐标y
- y坐标public void navTo(java.lang.String[] heads)
heads
- 标题数组public void about()
public void go(java.lang.String url)
url
- public int print(java.awt.Graphics g, int pageIndex, int w, int h)
g
- pageIndex
- w
- h
- public int print(java.awt.Graphics g, int pageIndex, int x, int y, int width, int height)
g
- pageIndex
- x
- y
- width
- height
- public com.hg.jpd.Item getItem(java.lang.String name)
name
- public java.util.List getItems()
public void setItem(java.lang.String name, com.hg.jpd.Item item)
name
- item
- public java.lang.String getItemValue(java.lang.String name)
name
- public void setItemValue(java.lang.String name, java.lang.String value)
name
- value
- public java.util.Map getItemValues()
public void setItemValues(java.util.Map map)
map
- public void clearItemsValue()
public boolean validateItems()
public void setItemsEnable(boolean enable)
enable
- public void setItemEnable(java.lang.String name, boolean enable)
name
- enable
- public void setItemVisible(java.lang.String name, boolean visible)
name
- visible
- public java.lang.String getXmlData() throws java.lang.Exception
java.lang.Exception
public java.lang.String getXData() throws java.lang.Exception
java.lang.Exception
public void setXmlData(java.lang.String xml)
xml
- public void setXData(java.lang.String xml)
xml
- public void readXmlData(java.lang.String url)
url
- public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent e)
hyperlinkUpdate
在接口中 javax.swing.event.HyperlinkListener
public void readState()
public void writeState()
public boolean isOpenEnable()
public void setOpenEnable(boolean openEnable)
openEnable
- public void setMergeEnable(boolean mergeEnable)
mergeEnable
- public boolean isSaveEnable()
public void setSaveEnable(boolean saveEnable)
saveEnable
- public boolean isPrintEnable()
public void setPrintEnable(boolean printEnable)
printEnable
- public java.lang.String getHrefPrefix()
public void setHrefPrefix(java.lang.String hrefPrefix)
hrefPrefix
- public java.awt.image.BufferedImage render(java.lang.String xdoc, int width)