Class ScalableXHTMLPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable, FSCanvas, UserInterface, FormSubmissionListener, RepaintListener

@ParametersAreNonnullByDefault public class ScalableXHTMLPanel extends XHTMLPanel
ScalableXHTMLPanel extends XHTMLPanel to allow zoom on output.
See Also:
  • Field Details

    • SCALE_POLICY_NONE

      public static final int SCALE_POLICY_NONE
      See Also:
    • SCALE_POLICY_FIT_WIDTH

      public static final int SCALE_POLICY_FIT_WIDTH
      See Also:
    • SCALE_POLICY_FIT_HEIGHT

      public static final int SCALE_POLICY_FIT_HEIGHT
      See Also:
    • SCALE_POLICY_FIT_WHOLE

      public static final int SCALE_POLICY_FIT_WHOLE
      See Also:
    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • scalePolicy

      private int scalePolicy
    • scale

      private double scale
    • scListeners

      private final List<ScaleChangeListener> scListeners
    • lastLayoutSize

      private Dimension lastLayoutSize
      The lastly calculated layout size
  • Constructor Details

    • 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 Details

    • setDocument

      public void setDocument(Document doc, @Nullable 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(InputStream stream, String url)
      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.
    • resetScaleAccordingToPolicy

      private void resetScaleAccordingToPolicy()
    • 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 IllegalArgumentException
      Force scale to use
      Parameters:
      newScale - The scale to use
      Throws:
      IllegalArgumentException - If newScale <= <tt>0.0d</tt>.
    • getScale

      public double getScale()
    • addScaleChangeListener

      public void addScaleChangeListener(ScaleChangeListener scl)
    • removeScaleChangeListener

      public void removeScaleChangeListener(ScaleChangeListener scl)
    • scaleChanged

      private void scaleChanged()
    • doRender

      protected void doRender(RenderingContext c, Layer root)
      Renders according to scale factor
      Overrides:
      doRender in class BasicPanel
      Parameters:
      c - the RenderingContext to use
      root - The Layer to render
    • calculateScaleAccordingToPolicy

      protected void calculateScaleAccordingToPolicy(Dimension layoutSize)
    • convertToScaled

      protected Point convertToScaled(Point origin)
    • convertFromScaled

      protected Point convertFromScaled(Point origin)
    • convertToScaled

      protected Point convertToScaled(int x, int y)
    • convertFromScaled

      protected Point convertFromScaled(int x, int y)
    • getScalePolicy

      public int getScalePolicy()
    • setScalePolicy

      public void setScalePolicy(int scalePolicy)