public class ScalableXHTMLPanel extends XHTMLPanel
XHTMLPanel to allow zoom on output.JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
static int |
SCALE_POLICY_FIT_HEIGHT |
static int |
SCALE_POLICY_FIT_WHOLE |
static int |
SCALE_POLICY_FIT_WIDTH |
static int |
SCALE_POLICY_NONE |
formSubmissionListeneractive_element, doc, documentListeners, enclosingScrollPane, focus_element, hovered_element, sharedContextaccessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
ScalableXHTMLPanel()
Instantiates an XHTMLPanel with no
Document loaded by default. |
ScalableXHTMLPanel(UserAgentCallback uac)
Instantiates a panel with a custom
UserAgentCallback
implementation. |
| Modifier and Type | Method and Description |
|---|---|
void |
addScaleChangeListener(ScaleChangeListener scl) |
protected void |
calculateScaleAccordingToPolicy(Dimension layoutSize) |
protected Point |
convertFromScaled(int x,
int y) |
protected Point |
convertFromScaled(Point origin) |
protected Point |
convertToScaled(int x,
int y) |
protected Point |
convertToScaled(Point origin) |
protected void |
doRender(RenderingContext c,
Layer root)
Renders according to scale factor
|
Box |
find(int x,
int y)
Search Box according to scale factor
|
double |
getScale() |
int |
getScalePolicy() |
void |
removeScaleChangeListener(ScaleChangeListener scl) |
void |
setDocument(Document doc,
String url)
Renders a Document using a URL as a base URL for relative
paths.
|
void |
setDocument(InputStream stream,
String url)
Renders a Document read from an InputStream using a URL
as a base URL for relative paths.
|
void |
setScale(double newScale)
Force scale to use
|
void |
setScalePolicy(int scalePolicy) |
decrementFontSize, getMaxFontScale, getMinFontScale, incrementFontSize, relayout, resetFontSize, setDocument, setDocument, setDocument, setFontScalingFactor, setMaxFontScale, setMinFontScale, setSharedContextaddDocumentListener, addMouseTrackingListener, assignPagePrintPositions, getDocument, getDocumentTitle, getFixedRectangle, getMouseTrackingListeners, getSharedContext, getURL, isActive, isCenteredPagedView, isFocus, isHover, isInteractive, isOpaque, loadDocument, paintComponent, paintPage, printTree, reloadDocument, reloadDocument, removeDocumentListener, removeMouseTrackingListener, resetMouseTracker, scrollTo, setCenteredPagedView, setDocument, setDocument, setDocumentFromString, setDocumentRelative, setFormSubmissionListener, setInteractive, setLayout, setOpaque, setSize, submitaddNotify, componentHidden, componentMoved, componentResized, componentShown, doDocumentLayout, find, fireDocumentLoaded, fireDocumentStarted, fireOnLayoutException, fireOnRenderException, getCellRendererPane, getLayoutContext, getLayoutWidth, getRootBox, getRootLayer, getScreenExtents, init, isDefaultFontFromComponent, isExtentsHaveChanged, isNeedRelayout, isPrintView, newLayoutContext, newRenderingContext, removeNotify, repaintRequested, resetScrollPosition, setDefaultFontFromComponent, setDocument, setEnclosingScrollPane, setNeedRelayout, setRootBox, validategetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, 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, hide, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic static final int SCALE_POLICY_NONE
public static final int SCALE_POLICY_FIT_WIDTH
public static final int SCALE_POLICY_FIT_HEIGHT
public static final int SCALE_POLICY_FIT_WHOLE
public ScalableXHTMLPanel()
Document loaded by default.public ScalableXHTMLPanel(UserAgentCallback uac)
UserAgentCallback
implementation.uac - The custom UserAgentCallback implementation.public void setDocument(Document doc, String url)
setDocument in class XHTMLPaneldoc - The new document valueurl - The new document valuepublic void setDocument(InputStream stream, String url) throws Exception
setDocument in class XHTMLPanelstream - The stream to read the Document from.url - The URL used to resolve relative path references.Exceptionpublic Box find(int x, int y)
public void setScale(double newScale)
throws IllegalArgumentException
newScale - The scale to useIllegalArgumentException - If newScale <= 0.0d.public double getScale()
public void addScaleChangeListener(ScaleChangeListener scl)
public void removeScaleChangeListener(ScaleChangeListener scl)
protected void doRender(RenderingContext c, Layer root)
doRender in class BasicPanelc - the RenderingContext to useroot - The Layer to renderprotected void calculateScaleAccordingToPolicy(Dimension layoutSize)
protected Point convertToScaled(int x, int y)
protected Point convertFromScaled(int x, int y)
public int getScalePolicy()
public void setScalePolicy(int scalePolicy)
Copyright © 2011-2013. All Rights Reserved.