net.sourceforge.webcompmath.draw
Class DisplayCanvas

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by net.sourceforge.webcompmath.draw.DisplayCanvas
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.io.Serializable, javax.accessibility.Accessible, Computable, ErrorReporter, InputObject
Direct Known Subclasses:
WCMDisplayCanvasBean

public class DisplayCanvas
extends javax.swing.JPanel
implements ErrorReporter, InputObject, Computable, java.awt.print.Printable

A DisplayCanvas is a drawing area that can contain one or more CoordinateRects. Each CoordinateRect can, in turn, contain Drawable items. If you only want one CoordinateRect that fills the whole canvas, you can for the most part ignore the CoordinateRect and work only with the canvas. The option of using an offscreen image for double buffering is provided. By default, this option is on.

If a DisplayCanvas is added to a Controller, then it will take care of calling the checkInput() and compute() methods of the InputObjects and Computables that it contains, so there is no need to add them individually to the Controller. If the DisplayCanvas is added to a JCMPanel, it is automatically added to the Controller for that JCMPanel. (On the other hand, if a DisplayCanvas is added to a Controller, this means that all the items in the DisplayCanvas will be recomputed, even if only some of them need to be.)

The canvas can display an error message that goes away when the canvas is clicked or when clearErrorMessage() is called. This allows the Canvas to be used as an ErrorReporter for a Controller or LimitControlPanel.

When any changes are made to the contents of the Canvas, doRedraw() must be called for those changes to take effect. Normally, doRedraw() is called by the CoordinateRect or by one of the Drawables in a CoordinateRect. Use doRedraw(CoordinateRect c) or doRedraw(int index) to redraw a single CoordinateRect. Note that repainting the canvas is not enough, because this will not automatically refresh the off-screen image.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DisplayCanvas()
          Create a DisplayCanvas with a white background containing no CoordinateRects.
DisplayCanvas(CoordinateRect c)
          Create a DisplayCanvas with a white background and containing the specified CoordinateRect.
 
Method Summary
 void add(Drawable d)
          Add the specified Drawable item to the first CoordinateRect in this DisplayCanvas.
 void add(Drawable d, int coordRectIndex)
          Add a Drawable item to one of the CoordinateRects associated with the Canvas.
 void addCoordinateRect(CoordinateRect c)
          Add the specified CoordinateRect to this DisplayCanvas, filling the entire canvas, and with background color equal to the background color of the canvas.
 void addCoordinateRect(CoordinateRect coords, double hmin, double hmax, double vmin, double vmax, java.awt.Color background)
          Add a CoordinateRect to the canvas, occupying a specified region of the canvas.
 void addImpl(java.awt.Component c, java.lang.Object constraints, int index)
          This method overrides Container.addImpl so that Eclipse VE will display Drawables properly.
 int addNewCoordinateRect(double hmin, double hmax, double vmin, double vmax)
          Add a newly created CoordinateRect covering the specified section of the canvas.
 int addNewCoordinateRect(double hmin, double hmax, double vmin, double vmax, java.awt.Color background)
          Add a newly created CoordinateRect covering the specified section of the canvas, with the specfied background color.
 void checkInput()
          This is generally called by a Controller.
 void clearErrorMessage()
          Clear the error message, if any, that is currently displayed on the canvas.
 void compute()
          This is generally called by a Controller.
 void doRedraw()
          Should be called whenever the contents of the canvas have changed and so it needs to need to be redrawn.
 void doRedraw(CoordinateRect coords)
          To be called when the contents of one of the CordinateRects have changed and so it needs to need to be redrawn.
 void doRedraw(int coordRectIndex)
          To be called when the contents of one of the CordinateRects have changed and so it needs to need to be redrawn.
 void drawTemp(DrawTemp drawItem)
          Draws the specified item in the first CoordinateRect in this canvas.
 void drawTemp(DrawTemp drawItem, int coordRectIndex)
          Draws the specified item in the specified CoordinateRect in this canvas.
 CoordinateRect findCoordinateRectAt(int pixelX, int pixelY)
          Return CoordinateRect that contains the specified pixel, or null if there is none.
 CoordinateRect getCoordinateRect()
          Get the first CoordinateRect in this canvas.
 CoordinateRect getCoordinateRect(int i)
          Get the i-th CoordinateRect in this DisplayCanvas.
 java.awt.Color getErrorBackground()
          Get color that is used as a background when the canvas displays an error message.
 java.awt.Color getErrorForeground()
          Get color that is used for the text when the canvas displays an error message.
 java.lang.String getErrorMessage()
          Get the error message that is currently displayed on the canvas.
 boolean getHandleMouseZooms()
          Get the "handleMouseZooms" property of this DisplayCanvas, which determines whether the canvas reacts to mouse events by zooming the CoordinateRect that is clicked.
 java.awt.Dimension getPreferredSize()
          This has been overridden to return a default size of 350-by-350 pixels.
 boolean isCTRLRequired()
          Get whether CTRL key is required for mouse zooms.
 void notifyControllerOnChange(Controller c)
          Method required by InputObject interface; in this class, calls the same method recursively on any CoordinateRects contained in this DisplayCanvas.
 void paintComponent(java.awt.Graphics g)
          Draw the contents of the DisplayCanvas.
 int print(java.awt.Graphics g, java.awt.print.PageFormat pageFormat, int pageIndex)
          Print the contents of the displayCanvas
 void processMouseEvent(java.awt.event.MouseEvent evt)
          This has been overridden to handle the mouse zoom feature.
 void processMouseMotionEvent(java.awt.event.MouseEvent evt)
          This has been overridden to handle the mouse zoom feature.
 void setCTRLRequired(boolean CTRLRequired)
          Set whether the CTRL key is required for mouse zooms.
 void setErrorBackground(java.awt.Color c)
          Set color to be used as a background when the canvas displays an error message.
 void setErrorForeground(java.awt.Color c)
          Set color to be used for the text when the canvas displays an error message.
 void setErrorMessage(Controller c, java.lang.String message)
          Set an error message to be displayed on the canvas.
 void setHandleMouseZooms(boolean handle)
          Set the "handleMouseZooms" property of this DisplayCanvas.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, 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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, 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, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, 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, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DisplayCanvas

public DisplayCanvas()
Create a DisplayCanvas with a white background containing no CoordinateRects.


DisplayCanvas

public DisplayCanvas(CoordinateRect c)
Create a DisplayCanvas with a white background and containing the specified CoordinateRect. The CoordinateRect fills the entire canvas.

Parameters:
c - The CoordinateRect that will fill the canvas. If c is null, no CoordinateRect is added to the canvas.
Method Detail

setHandleMouseZooms

public void setHandleMouseZooms(boolean handle)
Set the "handleMouseZooms" property of this DisplayCanvas. IF the value is true, then clicking on the canvas will zoom in on the point that is clicked and shift-clicking will zoom out from that point. Only the CoordinateRect, if any, that contains the point is zoomed. Furthermore, if the user clicks-and-drags, a rectangle is drawn. When the mouse is released, the interior of the rectangle is zoomed to fill the CoordinateRect. This property is false by default.

Parameters:
handle - true or false

getHandleMouseZooms

public boolean getHandleMouseZooms()
Get the "handleMouseZooms" property of this DisplayCanvas, which determines whether the canvas reacts to mouse events by zooming the CoordinateRect that is clicked.

Returns:
true or false

add

public void add(Drawable d)
Add the specified Drawable item to the first CoordinateRect in this DisplayCanvas. If no CoordinateRect is associated with the canvas, one is created to fill the entire canvas.

Parameters:
d - the item to add

add

public void add(Drawable d,
                int coordRectIndex)
Add a Drawable item to one of the CoordinateRects associated with the Canvas.

Parameters:
d - The Drawable item to be added to a CoordinateRect
coordRectIndex - The index of the CoordinateRect, where the index of the first CoordinateRect that was added to the cavas is zero, the index of the second is one, and so on. A CoordinateRect with the specified index must already exist in the canvas, or an IllegalArgumentException is thrown.

addCoordinateRect

public void addCoordinateRect(CoordinateRect c)
Add the specified CoordinateRect to this DisplayCanvas, filling the entire canvas, and with background color equal to the background color of the canvas.

Parameters:
c - the CoordinateRect to be added. If null, an IllegalArgumentException is thrown.

addCoordinateRect

public void addCoordinateRect(CoordinateRect coords,
                              double hmin,
                              double hmax,
                              double vmin,
                              double vmax,
                              java.awt.Color background)
Add a CoordinateRect to the canvas, occupying a specified region of the canvas.

Parameters:
coords - The CoordinateRect to be added. If this is null, an IllegalArgumentExceptionis thrown.
hmin - Specifies the left edge of the CoordinateRect in the canvas, as a fraction of the size of the canvas. This must be in the range form 0 to 1, or an IllegalArgumentException is thrown.
hmax - Specifies the right edge of the CoordinateRect in the canvas, as a fraction of the size of the canvas. This must be in the range form 0 to 1 and must be strictly greater than hmin, or an IllegalArgumentException is thrown.
vmin - Specifies the top edge of the CoordinateRect in the canvas, as a fraction of the size of the canvas. This must be in the range form 0 to 1, or an IllegalArgumentException is thrown.
vmax - Specifies the bottom edge of the CoordinateRect in the canvas, as a fraction of the size of the canvas. This must be in the range form 0 to 1 and must be strictly greater than vmin, or an IllegalArgumentException is thrown.
background - The background color of the CoordinateRect. The CoordinateRect is filled with this color before the Drawables that it contains are drawn. If background is null, no filling takes place and the canvas shows through.

addNewCoordinateRect

public int addNewCoordinateRect(double hmin,
                                double hmax,
                                double vmin,
                                double vmax)
Add a newly created CoordinateRect covering the specified section of the canvas. Parameters hmin, hmax, vmin, vmax must be in the range 0 to 1. The index of the new CoordinateRect is returned.

Parameters:
hmin - 0 to 1
hmax - 0 to 1
vmin - 0 to 1
vmax - 0 to 1
Returns:
index of new CoordinateRect

addNewCoordinateRect

public int addNewCoordinateRect(double hmin,
                                double hmax,
                                double vmin,
                                double vmax,
                                java.awt.Color background)
Add a newly created CoordinateRect covering the specified section of the canvas, with the specfied background color. Parameters hmin, hmax, vmin, vmax must be in the range 0 to 1. The index of the new CoordinateRect is returned.

Parameters:
hmin - 0 to 1
hmax - 0 to 1
vmin - 0 to 1
vmax - 0 to 1
background - background color
Returns:
index of new CoordinateRect

getCoordinateRect

public CoordinateRect getCoordinateRect()
Get the first CoordinateRect in this canvas. (If none exists, one is created and added to the canvas.)

Returns:
first CoordinateRect

getCoordinateRect

public CoordinateRect getCoordinateRect(int i)
Get the i-th CoordinateRect in this DisplayCanvas. They are numbered staring from zero. If there is no i-th rect, null is returned, except that if there are NO coordinate rects and a request for rect 0 is received, then a new CoordinateRect is added to fill the entire canvas.

Parameters:
i - index of desired CoordinateRect
Returns:
the CoordinateRect

findCoordinateRectAt

public CoordinateRect findCoordinateRectAt(int pixelX,
                                           int pixelY)
Return CoordinateRect that contains the specified pixel, or null if there is none. The CoordinateRects are searched in reverse order, so that the "top" CoordinateRect at that point is returned. Note that this method only makes sense if the canvas has already been displayed. (Mostly, this is for internal use in this class.)

Parameters:
pixelX - pixel horizontal location
pixelY - pixel vertical location
Returns:
CoordinateRect containing the pixel

doRedraw

public void doRedraw()
Should be called whenever the contents of the canvas have changed and so it needs to need to be redrawn. If only one CoordinateRect needs to be repainted, you can call doRedraw(int i) or or doRedraw(CoordinateRect c), which can be more efficient than redrawing the whole canvas. If an error message is displayed, it will be cleared.


doRedraw

public void doRedraw(int coordRectIndex)
To be called when the contents of one of the CordinateRects have changed and so it needs to need to be redrawn. If an error message is displayed, it will be cleared.

Parameters:
coordRectIndex - The index of the CoordinateRect to be redrawn, where the first CoordinateRect is at index zero. If there is no such CoordinateRect, then nothing is done.

doRedraw

public void doRedraw(CoordinateRect coords)
To be called when the contents of one of the CordinateRects have changed and so it needs to need to be redrawn. If an error message is displayed, it will be cleared.

Parameters:
coords - The CoordinateRect to be redrawn. If coords is not in this DisplayCanvas, nothing is done.

checkInput

public void checkInput()
This is generally called by a Controller. It calls the checkInput() method of any InputObject displayed on this Canvas.

Specified by:
checkInput in interface InputObject

compute

public void compute()
This is generally called by a Controller. It calls the compute() method of any InputObject displayed on this Canvas.

Specified by:
compute in interface Computable

notifyControllerOnChange

public void notifyControllerOnChange(Controller c)
Method required by InputObject interface; in this class, calls the same method recursively on any CoordinateRects contained in this DisplayCanvas. This is meant to be called by JCMPanel.gatherInputs().

Specified by:
notifyControllerOnChange in interface InputObject
Parameters:
c - controller to notify

getErrorBackground

public java.awt.Color getErrorBackground()
Get color that is used as a background when the canvas displays an error message.

Returns:
error background color

setErrorBackground

public void setErrorBackground(java.awt.Color c)
Set color to be used as a background when the canvas displays an error message. The default is a light green. If the specified Color value is null, nothing is done.

Parameters:
c - error background color

getErrorForeground

public java.awt.Color getErrorForeground()
Get color that is used for the text when the canvas displays an error message.

Returns:
error foreground color

setErrorForeground

public void setErrorForeground(java.awt.Color c)
Set color to be used for the text when the canvas displays an error message. The default is a dark green. If the specified Color value is null, nothing is done.

Parameters:
c - error foreground color

getErrorMessage

public java.lang.String getErrorMessage()
Get the error message that is currently displayed on the canvas. If no error is displyed, the return value is null.

Specified by:
getErrorMessage in interface ErrorReporter
Returns:
error text

setErrorMessage

public void setErrorMessage(Controller c,
                            java.lang.String message)
Set an error message to be displayed on the canvas. This method is generally called by a Controller or a LimitControlPanel. If you call it directly, use null as the first parameter.

Specified by:
setErrorMessage in interface ErrorReporter
Parameters:
c - The Controller, if any, that is calling this routine. This controller will be notified when the error message is cleared. If the method is not being called by a contrller, this parameter should be set to null.
message - The error message to be displayed. If the value is null or is a blank string, the current message, if any, is cleared.

clearErrorMessage

public void clearErrorMessage()
Clear the error message, if any, that is currently displayed on the canvas.

Specified by:
clearErrorMessage in interface ErrorReporter

processMouseEvent

public void processMouseEvent(java.awt.event.MouseEvent evt)
This has been overridden to handle the mouse zoom feature. Not meant to be called directly.

Overrides:
processMouseEvent in class javax.swing.JComponent
Parameters:
evt - the event created when user presses or releases the mouse button

processMouseMotionEvent

public void processMouseMotionEvent(java.awt.event.MouseEvent evt)
This has been overridden to handle the mouse zoom feature. Not meant to be called directly.

Overrides:
processMouseMotionEvent in class javax.swing.JComponent
Parameters:
evt - event created when user drags the mouse

getPreferredSize

public java.awt.Dimension getPreferredSize()
This has been overridden to return a default size of 350-by-350 pixels. Not usually called directly.

Overrides:
getPreferredSize in class javax.swing.JComponent
Returns:
the dimension

paintComponent

public void paintComponent(java.awt.Graphics g)
Draw the contents of the DisplayCanvas. Not usually called directly.

Overrides:
paintComponent in class javax.swing.JComponent
Parameters:
g - graphics context

drawTemp

public void drawTemp(DrawTemp drawItem)
Draws the specified item in the first CoordinateRect in this canvas. It is drawn on screen. However, no information is kept about this item, so the drawing will disappear the next time the canvas is repainted. If the canvas contains no CoordinateRect when this is called, a new one is added. Note that this method should only be called after the canvas has appeared on the screen.

Parameters:
drawItem - item to draw

drawTemp

public void drawTemp(DrawTemp drawItem,
                     int coordRectIndex)
Draws the specified item in the specified CoordinateRect in this canvas. It is drawn on screen and on the off-screen canvas, if there is one. However, no information is kept about this item, so the drawing will disappear the next time the off-screen canvas is re-drawn (if there is an off-screen canvas) or the next time the canvas is repainted (is there is no off-screen canvas). Note that this method should only be called after the canvas has appeared on the screen.

Parameters:
drawItem - The non-null object that is to be drawn
coordRectIndex - The index of the CoordinateRect in which it is to be drawn, where the index of the fist CoordinateRect added to the canvas is zero, and so on. If there is no CoordinateRect with the specified index, an IllegalArgumentException is thrown.

addImpl

public void addImpl(java.awt.Component c,
                    java.lang.Object constraints,
                    int index)
This method overrides Container.addImpl so that Eclipse VE will display Drawables properly.

Overrides:
addImpl in class java.awt.Container
Parameters:
c -
constraints -
index -

isCTRLRequired

public boolean isCTRLRequired()
Get whether CTRL key is required for mouse zooms. The default is false

Returns:
true if required

setCTRLRequired

public void setCTRLRequired(boolean CTRLRequired)
Set whether the CTRL key is required for mouse zooms. The default is false

Parameters:
CTRLRequired - true for required.

print

public int print(java.awt.Graphics g,
                 java.awt.print.PageFormat pageFormat,
                 int pageIndex)
          throws java.awt.print.PrinterException
Print the contents of the displayCanvas

Specified by:
print in interface java.awt.print.Printable
Throws:
java.awt.print.PrinterException
See Also:
Printable.print(java.awt.Graphics, java.awt.print.PageFormat, int)