com.sas.awt.print
Class AnnotationView

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--com.sas.awt.CanvasVisualComponent
                    |
                    +--com.sas.awt.Canvas
                          |
                          +--com.sas.awt.print.AnnotationView
All Implemented Interfaces:
Alignment, ComponentInterface, LinkPropertiesInterface, ModelInterface, MultipleValueEventSourceInterface, PrintableInterface, com.sas.beans.PropertyChangeSource, VetoableChangeSource, ViewInterface, VisualInterface

public class AnnotationView
extends Canvas
implements Alignment

The AnnotationView class is used to view an Annotation

See Also:
Serialized Form

Inner classes inherited from class java.awt.Canvas
Canvas.AccessibleAWTCanvas
 
Inner classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected static Color defaultColor
           
protected static Font defaultFont
           
protected  StaticAnnotationInterface mAnnotation
           
protected  int mPageNumber
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.sas.visuals.Alignment
BEGIN, CENTER, END
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AnnotationView()
          Constructors
AnnotationView(ModelInterface model)
           
 
Method Summary
 void attachModel(ModelInterface model)
          Framework method; call setModelInterface(model) instead.
 void detachModel(ModelInterface model)
          Framework method; call setModelInterface(null) instead.
protected  Font getFont(int lineNumber, int align)
          get the Font for a specific line in the annotation at the specific Alignment
protected  Color getForeground(int lineNumber, int align)
          get the color for the text for a specific line in the annotation at the specific position (Alignment)
 Rectangle getPageBounds(Graphics graphics, int pageNumber, int height, int width)
          Returns the bounds of a given page.
protected  String getText(int lineNumber, int align)
          get the text to be displayed at the requested Alignment on the page for a given line; any subsitution (formatting) is performed
 boolean pageExists(int pageNumber)
          implementation of the Printable interface.
 void paint(Graphics graphics)
           
 void printFinalize()
          Notification that printing is complete.
 
Methods inherited from class com.sas.awt.Canvas
addNotify, getDefaultHeight, getDefaultWidth, getExtendedBeanInfo, getMinimumSize, setDefaultHeight, setDefaultWidth
 
Methods inherited from class com.sas.awt.CanvasVisualComponent
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachView, clone, computePreferredSize, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getBackgroundColor, getBorder, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getFont, getForegroundColor, getHeight, getHorizontalPosition, getLinkInfo, getModelInterface, getPreferredSize, getPrePainter, getPrintOptionsPanel, getRequiredInterfaces, getVerticalPosition, getViewInterfaceSupportInfo, getVisualInterfaceSupportInfo, getWidth, initialize, initializeComponent, isDesignTime, isEnabled, isFocus, isLinked, isTransparent, isVisible, print, printInitialize, propertyChange, queryLinks, queryLinks, refresh, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setBackgroundColor, setBorder, setBounds, setComponentDescription, setComponentSupportInfo, setDefaultValues, setEnabled, setFocus, setFont, 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 class java.awt.Canvas
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

defaultFont

protected static final Font defaultFont

defaultColor

protected static final Color defaultColor

mAnnotation

protected StaticAnnotationInterface mAnnotation

mPageNumber

protected int mPageNumber
Constructor Detail

AnnotationView

public AnnotationView()
Constructors

AnnotationView

public AnnotationView(ModelInterface model)
Method Detail

attachModel

public void attachModel(ModelInterface model)
Framework method; call setModelInterface(model) instead.

Associates a model with this view. This view can only be associated with a single model at a time, therefore detachModel() must be called between two calls to attachModel().

Overrides:
attachModel in class CanvasVisualComponent
Parameters:
model - The model to attach. It must implement StaticAnnotationInterface.

detachModel

public void detachModel(ModelInterface model)
Framework method; call setModelInterface(null) instead.

Disassociates a model from this view.

Overrides:
detachModel in class CanvasVisualComponent
Parameters:
model - The model to detach. Must have been previously attached via attachModel(model) instead.

paint

public void paint(Graphics graphics)
Overrides:
paint in class CanvasVisualComponent
Following copied from class: com.sas.awt.CanvasVisualComponent
See Also:
VisualInterfaceSupport.paint(com.sas.ComponentInterface, com.sas.awt.VisualInterface, java.awt.Component, java.awt.Graphics)

pageExists

public boolean pageExists(int pageNumber)
implementation of the Printable interface. Tells us if the pageExists.
Overrides:
pageExists in class CanvasVisualComponent
Parameters:
int - - pageNumber of Page to be printed
Returns:
boolean - AnnotationView will always return true

printFinalize

public void printFinalize()
Description copied from class: CanvasVisualComponent
Notification that printing is complete.

This implementation is simply a method stub, so subclasses that have print-specific resources should free them in an override.

Overrides:
printFinalize in class CanvasVisualComponent
Following copied from class: com.sas.awt.CanvasVisualComponent
See Also:
PrintableInterface.printFinalize()

getText

protected String getText(int lineNumber,
                         int align)
get the text to be displayed at the requested Alignment on the page for a given line; any subsitution (formatting) is performed
Parameters:
int - - line number
int - - Alignment value
Returns:
String formatted text string

getFont

protected Font getFont(int lineNumber,
                       int align)
get the Font for a specific line in the annotation at the specific Alignment
Parameters:
int - - the line number of the annotation
int - - Alignment value
Returns:
the font for the specifed line.

getForeground

protected Color getForeground(int lineNumber,
                              int align)
get the color for the text for a specific line in the annotation at the specific position (Alignment)
Parameters:
int - - the line number of the message
int - - alignment value
Returns:
the color asked for

getPageBounds

public Rectangle getPageBounds(Graphics graphics,
                               int pageNumber,
                               int height,
                               int width)
Description copied from class: CanvasVisualComponent
Returns the bounds of a given page.

Subclasses that don't completely fill a given page should override this method to indicate that.

Overrides:
getPageBounds in class CanvasVisualComponent
Following copied from class: com.sas.awt.CanvasVisualComponent
Parameters:
g - The graphics context to use for printing.
pageNumber - The one-based index of the page to measure.
pageWidth - The width of the page (in pixels) being printed to.
pageHeight - The height of the page (in pixels) being printed to.
Returns:
A new rectangle whose top-left corner is at (0,0) and whose height and width are specified by pageHeight and pageWidth.
See Also:
PrintableInterface.getPageBounds(java.awt.Graphics, int, int, int)




Copyright © 2005 SAS Institute Inc. All Rights Reserved.
javadoc generated Thu, 16 Feb 2006 01:47:05