All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Components |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sas.visuals
Class LabelView

    com.sas.visuals.LabelView

All Implemented Interfaces:
  com.sas.awt.print.PrintableInterface, VisualInterface, com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, ComponentInterface, com.sas.lang.StringDataInterface, LinkPropertiesInterface, ModelInterface, com.sas.PublicClonable, ViewDefaultModelInterface, ViewInterface, Alignment, com.sas.visuals.IconInterface, MultipleValueEventSourceInterface, com.sas.visuals.PainterInterface, ResizeToFitInterface, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

Direct Known Subclasses:
  StyledLabelView

    public class LabelView

implements com.sas.lang.StringDataInterface, com.sas.visuals.IconInterface, Alignment, ResizeToFitInterface, com.sas.PublicClonable, ViewDefaultModelInterface

LabelView is a class that displays lines of text. The text can be single or multiline. The text can also be horizontally or vertically aligned.
Notes:

- The text lines require '\n' to signal a different line.
- The LabelView also supports being used as an IconInterface object where just the text is painted.
- Sample code:

       //use default constructor
       LabelView labelView1 = new LabelView();
       labelView1.setText("labelView");

       //or set text in constructor
       LabelView labelView2 = new LabelView("labelView");

Sample Code:

- Setting LabelView size to a specific size using word wrapping in a layout manager:

       //Intialize layout manager
       //This labelView component will be the specified Preferred size of 150 x 200 with word wrapping.
       //The true in the AutoSizingGridLayout specifies FillCell.
       Container container1 = new Container();
       container1.setLayout( new AutoSizingGridLayout( 0, 1, 10 ,10 , true, false, false) );
       LabelView label1 = new LabelView();
       label1.initialize();

       label1.setPreferredSize( new java.awt.Dimension( 150, 200 ));
       label1.setText("This is a LabelView with long text and with wordWrapping on!");
       label1.setWordWrap( true );
       label1.setResizeToFit( true );

- Setting LabelView to fill cell using word wrapping in a layout manager.

       //This sample code demonstrates a label view component that will fill the cell
       //in a layout manager with word wrapping on.
       Container container2 = new Container();
       container2.setLayout( new AutoSizingGridLayout( 0, 1, 10 ,10 , true, false, false) );
       LabelView label2 = new LabelView();
       label2.initialize();

       //The set Size is arbitrary but nesseccary for the the Label to size correctly.
       //See **below for LabelView behaviour when neither setSize nor setPreferredSize is set.
       label2.setSize( new java.awt.Dimension( 150, 200 ) );
       label2.setText("This labelView will fill a cell in a layout manager using word wrapping!");

       //NOTE* SetFont is neccessary in this case or the label will not size itself correctly.
       label2.setFont( new java.awt.Font( "Dialog", java.awt.Font.PLAIN, 12 ) );
       label2.setWordWrap( true );
       label2.setResizetoFit( false );

  Setting the Width of the LabelView to a Fixed Value

       //NOTE* Referring to the previous example, if setResizeToFit is set to true, the
       //label will appear as wide as specified in setSize but the height will be
       //computed to fit the wrapped text. This is a particularly useful option
       //when displaying text that will be translated.

  **When neither size nor preferredSize is set, the LabelView has a different behaviour if placed in the sample code above. The behaviour varies whether the Font is set or not. If the Font is set, and resizeToFit is set to True, the LabelView will size itself to have the width of the widest single word and with the height of the wrapped text.
  If the font is not set, and resizeToFit is true, the LabelView will resize itself just as it would if word wrapping were false. Thus the label will appear undully wide.

  See Also:
    Serialized Form

  Field Summary
  `static int` | `BOTTOM` BOTTOM vertical alignment
  `static int` | `CENTER_LEFT` CENTER LEFT horizontal alignment.
  `static int` | `CENTER_RIGHT` CENTER RIGHT horizontal alignment.
  `static int` | `LEFT` LEFT horizontal alignment
  `static int` | `RIGHT` RIGHT horizontal alignment
  `static int` | `TOP` TOP vertical alignment

  Fields inherited from interface com.sas.visuals.Alignment
  `BEGIN, CENTER, END`

  Constructor Summary
  `LabelView()` Default constructor.
  `LabelView(java.lang.String text)` Constructor that sets the text to be displayed.

  Method Summary
  `void` | `addNotify()` Makes this Component displayable by connecting it to a native screen resource.
  `void` | `attachModel(ModelInterface model)` Attaches a model to the LabelView.
  `protected java.awt.Dimension` | `calculateTextDisplay()` Calculates the location and size of the text to display.
  `java.lang.Object` | `clone()` Returns an object that is a clone of this LabelView.
  `java.awt.Dimension` | `computePreferredSize()` Returns the minimum size in pixels.
  `void` | `detachModel(ModelInterface model)` Detach the specified model from the LabelView.
  `static int` | `getDefaultHeight()` Returns default height in pixels.
  `static int` | `getDefaultWidth()` Returns default width in pixels.
  `static com.sas.beans.ExtendedBeanInfo` | `getExtendedBeanInfo()` Returns information used by the `com.sas.beans.Introspector` to augment the automatically introspected information about a LabelView.
  `int` | `getHorizontalAlignment()` Returns the horizontal alignment of the text.
  `java.awt.Insets` | `getInsets()` Returns the insets in pixels for the LabelView.
  `java.awt.Dimension` | `getMinimumSize()` Returns the minimum size in pixels necessary to display the text.
  `java.util.Vector` | `getRequiredInterfaces()` Returns the required interfaces Vector for this component.
  `int` | `getTabSpace()` Returns the number of spaces a tab or a `\t` will contribute to the text string in this LabelView
  `java.lang.String` | `getText()` Returns the text to be displayed.
  `int` | `getVerticalAlignment()` Returns the vertical alignment of the text.
  `boolean` | `isDefaultModelAttached()` Returns whether the default model is attached.
  `boolean` | `isResizeToFit()` Returns whether or not the resize to fit property is set.
  `boolean` | `isWordWrap()` Returns whether or not word wrapping is set on the LabelView.
  `void` | `paint(java.awt.Component component, java.awt.Graphics g, int x, int y, int width, int height)` Paint of the text on the component.
  `void` | `paint(java.awt.Graphics g)` Paint this LabelView
  `protected void` | `parseText()` Parses the text returned from `getText()` into the appropriate elements for display.
  `void` | `print(java.awt.Graphics g)`
  `void` | `print(java.awt.Graphics g, int pageNumber, int pageWidth, int pageHeight)` Prints the requested page.
  `void` | `propertyChange(java.beans.PropertyChangeEvent event)` Handle `PropertyChangeEvent` from the model.
  `void` | `refresh()` Refreshes this `LabelView`.
  `void` | `refresh(ModelInterface model)` Refresh the displayed text based on the model changing.
  `void` | `resizeToFit()` Resets the size of the LabelView to the preferred size of this component.
  `void` | `setBounds(int x, int y, int width, int height)` Calls the super `setBounds` and then repaints the entire component.
  `static void` | `setDefaultHeight(int newHeight)` Sets the default height in pixels.
  `void` | `setDefaultValues()` Sets the default internal values for the LabelView.
  `static void` | `setDefaultWidth(int newWidth)` Sets the default width in pixels.
  `void` | `setEnabled(boolean enabled)` Calls the super `setEnabled` to repaint the LabelView when this `enabled` property is changed.
  `void` | `setFont(java.awt.Font newFont)` Sets the font of the LabelView.
  `void` | `setHorizontalAlignment(int align)` Sets the horizontal alignment of the text.
  `void` | `setInsets(java.awt.Insets margins)` Sets the inset margins for the LabelView object.
  `void` | `setResizeToFit(boolean resize)` Sets the value of the `resizeToFit` property
  `void` | `setTabSpace(int space)` Sets the number of spaces in a tab to be displayed in the LabelView.
  `void` | `setText(java.lang.String label)` Sets the text to be displayed.
  `void` | `setVerticalAlignment(int align)` Sets the vertical alignment of the text.
  `void` | `setWordWrap(boolean wrap)` Sets the value of wordWrap.
  `protected void` | `wordWrap(java.lang.String string)` Wraps text to the beginning of next line if the current text size is greater than the width of the LabelView.

  Methods inherited from class com.sas.awt.ComponentVisualComponent
  `addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachView, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getBackgroundColor, getBorder, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getFont, getForegroundColor, getHeight, getHorizontalPosition, getLinkInfo, getModelInterface, getPageBounds, getPreferredSize, getPrePainter, getPrintOptionsPanel, getVerticalPosition, getViewInterfaceSupportInfo, getVisualInterfaceSupportInfo, getWidth, initialize, initializeComponent, isDesignTime, isEnabled, isFocus, isLinked, isTransparent, isVisible, pageExists, printFinalize, printInitialize, queryLinks, queryLinks, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setBackgroundColor, setBorder, setComponentDescription, setComponentSupportInfo, setFocus, setForegroundColor, setHeight, setHorizontalPosition, setLinkInfo, setModelInterface, setPreferredSize, setPrePainter, setRequiredInterfaces, setTransparent, setVerticalPosition, setViewInterfaceSupportInfo, setVisible, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, update, validateObject`

  Methods inherited from interface com.sas.visuals.IconInterface
  `getPreferredSize`

  Methods inherited from interface com.sas.ViewInterface
  `getModelInterface, getViewInterfaceSupportInfo, removeInterfaceTraps, setModelInterface, setRequiredInterfaces, setViewInterfaceSupportInfo, supportsRequiredInterfaces, trapInterfaceEvents`

  Field Detail

  ### TOP

      public static final int TOP

    TOP vertical alignment

    See Also:
      `Orientations.TOP`, Constant Field Values

  ### BOTTOM

      public static final int BOTTOM

    BOTTOM vertical alignment

    See Also:
      `Orientations.BOTTOM`, Constant Field Values

  ### LEFT

      public static final int LEFT

    LEFT horizontal alignment

    See Also:
      `Orientations.LEFT`, Constant Field Values

  ### RIGHT

      public static final int RIGHT

    RIGHT horizontal alignment

    See Also:
      `Orientations.RIGHT`, Constant Field Values

  ### CENTER_LEFT

      public static final int CENTER_LEFT

    CENTER LEFT horizontal alignment. CENTER_LEFT is a hint that will align the text to the left side if the text width is greater than LabelView width, otherwise the text will be centered.

    See Also:
      `Orientations.CENTER_LEFT`, Constant Field Values

  ### CENTER_RIGHT

      public static final int CENTER_RIGHT

    CENTER RIGHT horizontal alignment. CENTER_RIGHT is a hint that will align the text to the right side if the text width is greater than LabelView width, otherwise the text will be centered.

    See Also:
      `Orientations.CENTER_RIGHT`, Constant Field Values

  Constructor Detail

  ### LabelView

      public LabelView()

    Default constructor.

  ### LabelView

      public LabelView(java.lang.String text)

    Constructor that sets the text to be displayed.

    Parameters:
      `text` - the string that is to be set in the LabelView

  Method Detail

  ### getExtendedBeanInfo

      public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()

    Returns information used by the `com.sas.beans.Introspector` to augment the automatically introspected information about a LabelView.

    Returns:
      the ExtendedBeanInfo for this class

  ### getDefaultHeight

      public static int getDefaultHeight()

    Returns default height in pixels.

    Returns:
      default height in pixels

  ### getDefaultWidth

      public static int getDefaultWidth()

    Returns default width in pixels.

    Returns:
      default width in pixels

  ### setDefaultHeight

      public static void setDefaultHeight(int newHeight)

    Sets the default height in pixels.

    Parameters:
      `newHeight` - the new default height in pixels

  ### setDefaultWidth

      public static void setDefaultWidth(int newWidth)

    Sets the default width in pixels.

    Parameters:
      `newWidth` - the new default width in pixels

  ### attachModel

      public void attachModel(ModelInterface model)

    Attaches a model to the LabelView. Listens for `PropertyChangeEvent` from the model.

    Specified by:
      `attachModel` in interface `ViewInterface`
    Overrides:
      `attachModel` in class `ComponentVisualComponent`
    Parameters:
      `model` - Model to attach to
    See Also:
      `ViewInterface.attachModel(com.sas.ModelInterface)`

  ### detachModel

      public void detachModel(ModelInterface model)

    Detach the specified model from the LabelView. The `defaultModel` will be attached if the model is set to null.

    Specified by:
      `detachModel` in interface `ViewInterface`
    Overrides:
      `detachModel` in class `ComponentVisualComponent`
    Parameters:
      `model` - the `ModelInterface` to be detached
    See Also:
      `ViewInterface.detachModel(com.sas.ModelInterface)`

  ### clone

      public java.lang.Object clone()
                             throws java.lang.CloneNotSupportedException

    Returns an object that is a clone of this LabelView. All properties will be identical to the LabelView and if a model is attached, then a clone of the model is created as well.

    Specified by:
      `clone` in interface `com.sas.PublicClonable`
    Overrides:
      `clone` in class `ComponentVisualComponent`
    Returns:
      an object that is an identical copy to this LabelView
    Throws:
      `java.lang.CloneNotSupportedException` - if clone creation fails

  ### addNotify

      public void addNotify()

    Makes this Component displayable by connecting it to a native screen resource. This method is called internally by the toolkit and should not be called directly by programs. Overridden to call resizeToFit() to resize a component after it has been added to its parent.

    Overrides:
      `addNotify` in class `java.awt.Component`

  ### getHorizontalAlignment

      public int getHorizontalAlignment()

    Returns the horizontal alignment of the text.

    Returns:
      an alignment value: LEFT, RIGHT, or CENTER.
    See Also:
      `setHorizontalAlignment(int)`, `Orientations`

  ### getInsets

      public java.awt.Insets getInsets()

    Returns the insets in pixels for the LabelView.

    Specified by:
      `getInsets` in interface `com.sas.visuals.PainterInterface`
    Returns:
      the greater of the border insets and those set on the LabelView.
    See Also:
      `setInsets(java.awt.Insets)`

  ### getMinimumSize

      public java.awt.Dimension getMinimumSize()

    Returns the minimum size in pixels necessary to display the text.

    Specified by:
      `getMinimumSize` in interface `VisualInterface`
    Overrides:
      `getMinimumSize` in class `Component`
    Returns:
      The minimum size
    See Also:
      `computePreferredSize()`

  ### getRequiredInterfaces

      public java.util.Vector getRequiredInterfaces()

    Returns the required interfaces Vector for this component.

    Specified by:
      `getRequiredInterfaces` in interface `ViewInterface`
    Overrides:
      `getRequiredInterfaces` in class `ComponentVisualComponent`
    Returns:
      the required interfaces Vector for this component.
    See Also:
      `ViewInterface.getRequiredInterfaces()`

  ### computePreferredSize

      public java.awt.Dimension computePreferredSize()

    Returns the minimum size in pixels.

    Specified by:
      `computePreferredSize` in interface `VisualInterface`
    Overrides:
      `computePreferredSize` in class `ComponentVisualComponent`
    Returns:
      The preferred size of the component
    See Also:
      `getMinimumSize()`

  ### getTabSpace

      public int getTabSpace()

    Returns the number of spaces a tab or a `\t` will contribute to the text string in this LabelView

    Returns:
      the number of spaces a tab will contribute
    See Also:
      `setTabSpace(int)`

  ### getText

      public java.lang.String getText()

    Returns the text to be displayed.

    Specified by:
      `getText` in interface `com.sas.lang.StringDataInterface`
    See Also:
      `StringDataInterface`, `setText(java.lang.String)`

  ### getVerticalAlignment

      public int getVerticalAlignment()

    Returns the vertical alignment of the text.

    Returns:
      an alignment value: TOP, BOTTOM, or CENTER.
    See Also:
      `setVerticalAlignment(int)`, `Orientations`

  ### isDefaultModelAttached

      public boolean isDefaultModelAttached()

    Returns whether the default model is attached. Alias for `(getDefaultModel() == getModelInterface() && (getDefaultModel() != null)`

    Specified by:
      `isDefaultModelAttached` in interface `ViewDefaultModelInterface`
    Returns:
      `true` if the component is using the default model, and `false` otherwise.
    See Also:
      `ViewInterface.getModelInterface()`

  ### isResizeToFit

      public boolean isResizeToFit()

    Returns whether or not the resize to fit property is set. If the property is set to `true`, then the LabelView will size itself to just fit all the text in the component, which is the same size as the minimum size.

    Specified by:
      `isResizeToFit` in interface `ResizeToFitInterface`
    Returns:
      `true` if the resize to fit property is set on, else returns `false`
    See Also:
      `setResizeToFit(boolean)`, `resizeToFit`

  ### isWordWrap

      public boolean isWordWrap()

    Returns whether or not word wrapping is set on the LabelView. If word wrapping is on, then the text set will wrap within the size of the LabelView if its length is greater than the width of the component.

    Returns:
      `true` if word wrapping is on, else `false` if word wrapping is off.
    See Also:
      `setWordWrap(boolean)`, `wordWrap`

  ### paint

      public void paint(java.awt.Component component,
                        java.awt.Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)

    Paint of the text on the component.

    Specified by:
      `paint` in interface `com.sas.visuals.PainterInterface`
    Parameters:
      `comp` - the Component to paint the IconInterface with.
      `g` - Graphics context
      `x` - the x coordinate
      `y` - the y coordinate
      `width` - the width to be painted.
      `height` - the height to be painted.

  ### paint

      public void paint(java.awt.Graphics g)

    Paint this LabelView

    Overrides:
      `paint` in class `ComponentVisualComponent`
    Parameters:
      `g` - the specified Graphics context
    See Also:
      `VisualInterfaceSupport.paint(com.sas.ComponentInterface, com.sas.awt.VisualInterface, java.awt.Component, java.awt.Graphics)`

  ### propertyChange

      public void propertyChange(java.beans.PropertyChangeEvent event)

    Handle `PropertyChangeEvent` from the model.

    Specified by:
      `propertyChange` in interface `java.beans.PropertyChangeListener`
    Overrides:
      `propertyChange` in class `ComponentVisualComponent`
    Parameters:
      `event` - the event from the model indicating what property changed.
    See Also:
      `PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)`

  ### refresh

      public void refresh(ModelInterface model)

    Refresh the displayed text based on the model changing.

    Specified by:
      `refresh` in interface `ViewInterface`
    Overrides:
      `refresh` in class `ComponentVisualComponent`
    Parameters:
      `model` - the current model refresh to refresh from
    See Also:
      `ViewInterface.refresh(com.sas.ModelInterface)`

  ### refresh

      public void refresh()

    Refreshes this `LabelView`. LabelView will reread the data from its model and discard any previous data

  ### parseText

      protected void parseText()

    Parses the text returned from `getText()` into the appropriate elements for display.

  ### wordWrap

      protected void wordWrap(java.lang.String string)

    Wraps text to the beginning of next line if the current text size is greater than the width of the LabelView.

    Parameters:
      `string` - text of the label, usually returned from `getText()`
    See Also:
      `isWordWrap()`, `setWordWrap(boolean)`

  ### calculateTextDisplay

      protected java.awt.Dimension calculateTextDisplay()

    Calculates the location and size of the text to display.

    Returns:
      the overall text size in `Dimension`.

  ### resizeToFit

      public void resizeToFit()

    Resets the size of the LabelView to the preferred size of this component. If the `isResizeToFit()` returns `true`, the LabelView will be resized.

    See Also:
      `setResizeToFit(boolean)`, `isResizeToFit()`

  ### setBounds

      public void setBounds(int x,
                            int y,
                            int width,
                            int height)

    Calls the super `setBounds` and then repaints the entire component.

    Specified by:
      `setBounds` in interface `VisualInterface`
    Overrides:
      `setBounds` in class `ComponentVisualComponent`
    Parameters:
      `x` - the desired x position relative to the frame or panel the LabelView is in.
      `y` - the desired y position relative to the frame or panel the LabelView is in.
      `width` - the desired width in pixels of the LabelView.
      `height` - the desired height in pixels of the LabelView.
    See Also:
      `VisualInterface.setBounds(int, int, int, int)`

  ### setDefaultValues

      public void setDefaultValues()

    Sets the default internal values for the LabelView.

    Specified by:
      `setDefaultValues` in interface `VisualInterface`
    Specified by:
      `setDefaultValues` in interface `ComponentInterface`
    Overrides:
      `setDefaultValues` in class `Component`
    See Also:
      `ComponentInterface.setDefaultValues()`

  ### setEnabled

      public void setEnabled(boolean enabled)

    Calls the super `setEnabled` to repaint the LabelView when this `enabled` property is changed.

    Specified by:
      `setEnabled` in interface `VisualInterface`
    Overrides:
      `setEnabled` in class `ComponentVisualComponent`
    Parameters:
      `enabled` - `true` to enable the LabelView for interaction. Set to `false` to disable this LabelView component.
    See Also:
      `VisualInterface.setEnabled(boolean)`

  ### setFont

      public void setFont(java.awt.Font newFont)

    Sets the font of the LabelView. Calculates the new text dimensions after this new font has been set.

    Specified by:
      `setFont` in interface `VisualInterface`
    Overrides:
      `setFont` in class `ComponentVisualComponent`
    Parameters:
      `newFont` - the font to be used when displaying text in this LabelView
    See Also:
      `VisualInterface.setFont(java.awt.Font)`

  ### setHorizontalAlignment

      public void setHorizontalAlignment(int align)

    Sets the horizontal alignment of the text.

    Parameters:
      `align` - the horizontal alignment values: LEFT, RIGHT, or CENTER.
    See Also:
      `getHorizontalAlignment()`, `Orientations`

  ### setInsets

      public void setInsets(java.awt.Insets margins)

    Sets the inset margins for the LabelView object.

    Parameters:
      `margin` - the new inset values to be used as the margin of this LabelView
    See Also:
      `getInsets()`

  ### setResizeToFit

      public void setResizeToFit(boolean resize)

    Sets the value of the `resizeToFit` property

    Specified by:
      `setResizeToFit` in interface `ResizeToFitInterface`
    Parameters:
      `resize` - `true` to automatically set the size of the LabelView object based on the dimensions of the text being displayed.
    See Also:
      `isResizeToFit()`

  ### setTabSpace

      public void setTabSpace(int space)

    Sets the number of spaces in a tab to be displayed in the LabelView. Default is 4 spaces.

    Parameters:
      `space` - the number of spaces desired in a tab
    See Also:
      `getTabSpace()`

  ### setVerticalAlignment

      public void setVerticalAlignment(int align)

    Sets the vertical alignment of the text.

    Parameters:
      `align` - an alignment value: TOP, BOTTOM, or CENTER.
    See Also:
      `getVerticalAlignment()`, `Orientations`

  ### setWordWrap

      public void setWordWrap(boolean wrap)

    Sets the value of wordWrap. Calls parseText to update after selection made

    Parameters:
      `wordWrap` - boolean value
    See Also:
      `isWordWrap()`, `wordWrap`

  ### setText

      public void setText(java.lang.String label)

    Sets the text to be displayed. The model will also be set with the new text value. If the text is multiline it must contain \n characters to distinquish between lines.

    Specified by:
      `setText` in interface `com.sas.lang.StringDataInterface`
    Parameters:
      `label` - the text string that is to be displayed in the LabelView object

  ### print

      public void print(java.awt.Graphics g)

    Overrides:
      `print` in class `java.awt.Component`

  ### print

      public void print(java.awt.Graphics g,
                        int pageNumber,
                        int pageWidth,
                        int pageHeight)
                 throws com.sas.awt.print.PrintException

    Description copied from class: `ComponentVisualComponent`
    Prints the requested page.

    This implementation temporarily resizes the component via `setSize(pageWidth, pageHeight)` and calls the standard print method, `print(g)`. Therefore, subclasses should make sure that their paint method, which is called by the default implementation of standard print, is synchronized, as print is here, to guard against an independent call to paint, due to a window refresh for example, inadvertently using this size change.

    Subclasses with multiple pages will have to override `pageExists()` since it returns `false` for page numbers other than one which will cause the implementation of this method to throw an IndexOutOfBoundsException. Such subclasses will also need to override this method in order to change pages.

    Specified by:
      `print` in interface `com.sas.awt.print.PrintableInterface`
    Overrides:
      `print` in class `ComponentVisualComponent`
    Parameters:
      `g` - The graphics context to use for printing.
      `pageNumber` - The one-based index of the page to be printed.
      `pageWidth` - The width of the page (in pixels) being printed to.
      `pageHeight` - The height of the page (in pixels) being printed to.
    Throws:
      `com.sas.awt.print.PrintException` - Thrown if a failure occurred while printing.
    See Also:
      `PrintableInterface.print(java.awt.Graphics, int, int, int)`

  All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
  |  | Components |
  PREV CLASS NEXT CLASS | FRAMES NO FRAMES
  SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

  Copyright © 2009 SAS Institute Inc. All Rights Reserved.