Class ScalableXHTMLPanel

  • All Implemented Interfaces:
    java.awt.event.ComponentListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, UserInterface, FormSubmissionListener

    public class ScalableXHTMLPanel
    extends XHTMLPanel
    ScalableXHTMLPanel extends {@see XHTMLPanel} to allow zoom on output.
    Author:
    chm
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.swing.JComponent

        javax.swing.JComponent.AccessibleJComponent
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.BaselineResizeBehavior
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int SCALE_POLICY_FIT_HEIGHT  
      static int SCALE_POLICY_FIT_WHOLE  
      static int SCALE_POLICY_FIT_WIDTH  
      static int SCALE_POLICY_NONE  
      • Fields inherited from class javax.swing.JComponent

        TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
      • Fields inherited from class java.awt.Component

        BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addScaleChangeListener​(ScaleChangeListener scl)  
      Box find​(int x, int y)
      Search Box according to scale factor
      double getScale()  
      int getScalePolicy()  
      void removeScaleChangeListener​(ScaleChangeListener scl)  
      void setDocument​(java.io.InputStream stream, java.lang.String url)
      Renders a Document read from an InputStream using a URL as a base URL for relative paths.
      void setDocument​(org.w3c.dom.Document doc, java.lang.String url)
      Renders a Document using a URL as a base URL for relative paths.
      void setScale​(double newScale)
      Force scale to use
      void setScalePolicy​(int scalePolicy)  
      • Methods inherited from class javax.swing.JPanel

        getAccessibleContext, getUI, getUIClassID, setUI, updateUI
      • Methods inherited from class javax.swing.JComponent

        addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
      • Methods inherited from class java.awt.Container

        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, transferFocusDownCycle, validate
      • Methods inherited from class java.awt.Component

        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, 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, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ScalableXHTMLPanel

        public ScalableXHTMLPanel()
        Instantiates an XHTMLPanel with no Document loaded by default.
      • ScalableXHTMLPanel

        public ScalableXHTMLPanel​(UserAgentCallback uac)
        Instantiates a panel with a custom UserAgentCallback implementation.
        Parameters:
        uac - The custom UserAgentCallback implementation.
    • Method Detail

      • setDocument

        public void setDocument​(org.w3c.dom.Document doc,
                                java.lang.String url)
        Renders a Document using a URL as a base URL for relative paths.
        Overrides:
        setDocument in class XHTMLPanel
        Parameters:
        doc - The new document value
        url - The new document value
      • setDocument

        public void setDocument​(java.io.InputStream stream,
                                java.lang.String url)
                         throws java.lang.Exception
        Renders a Document read from an InputStream using a URL as a base URL for relative paths.
        Overrides:
        setDocument in class XHTMLPanel
        Parameters:
        stream - The stream to read the Document from.
        url - The URL used to resolve relative path references.
        Throws:
        java.lang.Exception
      • find

        public Box find​(int x,
                        int y)
        Search Box according to scale factor
        Overrides:
        find in class RootPanel
        Parameters:
        x - The displayed x position
        y - the displayed y position
      • setScale

        public void setScale​(double newScale)
                      throws java.lang.IllegalArgumentException
        Force scale to use
        Parameters:
        newScale - The scale to use
        Throws:
        java.lang.IllegalArgumentException - If newScale <= 0.0d.
      • getScale

        public double getScale()
      • removeScaleChangeListener

        public void removeScaleChangeListener​(ScaleChangeListener scl)
      • getScalePolicy

        public int getScalePolicy()
      • setScalePolicy

        public void setScalePolicy​(int scalePolicy)