amber.awt
Class DrawPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--amber.awt.DrawPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class DrawPanel
extends java.awt.Panel

This class extends panel. It is used to allow the normal Amber panel based controls access to functions which normally would not be possible.

See Also:
Serialized Form

Inner classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static int BorderDown
           
static int BorderNone
          A constant defining the type of border to draw.
static int BorderUp
           
static int BottomAligned
           
static int Centre
           
static int CentreAligned
           
static int Default
          Constants for DrawString which defines where the text will be rendered.
static int DrawArc
           
static int DrawImage
          A constant defining the operation to perform.
static int DrawLine
           
static int DrawOval
           
static int DrawPolygon
           
static int DrawPolyline
           
static int DrawRect
           
static int DrawString
           
static int Filled
           
static int Filled3D
           
static int Left
           
static int None
          Constants for DrawRect which defines the type of rectangle.
static int None3D
           
static int RectDown
           
static int RectUp
           
protected  boolean redrawState
          The current autoredraw state.
static int Right
           
static int Round
           
static int RoundFilled
           
static int SetClip
           
static int SetColour
           
static int SetFont
           
static int SetPaintMode
           
static int SetXorMode
           
static int TopAligned
           
 
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
 
Constructor Summary
DrawPanel()
           
 
Method Summary
 void addOperation(java.lang.Object data, int[] drawInfo)
          Calling this function adds an operation into the cache of operations.
protected  void drawBorder(int type, java.awt.Dimension d, java.awt.Graphics g)
           
protected  void drawImage(java.awt.Image image, java.awt.Dimension d, int[] info, java.awt.Graphics g, int xOffset, int yOffset)
           
 void insertOperation(java.lang.Object data, int[] drawInfo, int location)
          Calling this function inserts an operation into the cache of operations at the specified location in the operations sequence.
 void paint(java.awt.Graphics g)
          The actual paint function.
 void removeAllOperations()
          Calling this function removes all existing operations from the cache of operations.
 void removeOperation(int index)
          Calling this function removes an existing operation from the cache of operations.
protected  void render(java.awt.Graphics drawGraphics, java.awt.Dimension d)
          This is the function called to render the draw operations onto the draw panel.
 void renderOperation(java.awt.Graphics drawGraphics, java.awt.Dimension d, int[] drawInfo, java.lang.Object drawObject, int x, int y)
          This function renders one individual operation to the specified graphics context.
 void replaceOperation(java.lang.Object data, int[] drawInfo, int location)
          Calling this function modifies the specified operation and replaces it with the input operation.
 void setAutoRepaint(boolean state)
          This sets the state of the automatic repaint functionality.
 void setBorder(int type)
          This function sets the border on the panel.
 void update(java.awt.Graphics g)
          Overrides the update function to turn off background drawing.
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BorderNone

public static final int BorderNone
A constant defining the type of border to draw.

BorderUp

public static final int BorderUp

BorderDown

public static final int BorderDown

DrawImage

public static final int DrawImage
A constant defining the operation to perform.

DrawString

public static final int DrawString

SetColour

public static final int SetColour

DrawLine

public static final int DrawLine

DrawRect

public static final int DrawRect

DrawOval

public static final int DrawOval

DrawArc

public static final int DrawArc

DrawPolygon

public static final int DrawPolygon

DrawPolyline

public static final int DrawPolyline

SetClip

public static final int SetClip

SetPaintMode

public static final int SetPaintMode

SetXorMode

public static final int SetXorMode

SetFont

public static final int SetFont

None

public static final int None
Constants for DrawRect which defines the type of rectangle.

Filled

public static final int Filled

None3D

public static final int None3D

Filled3D

public static final int Filled3D

Round

public static final int Round

RoundFilled

public static final int RoundFilled

RectUp

public static final int RectUp

RectDown

public static final int RectDown

Default

public static final int Default
Constants for DrawString which defines where the text will be rendered.

Left

public static final int Left

Centre

public static final int Centre

Right

public static final int Right

TopAligned

public static final int TopAligned

CentreAligned

public static final int CentreAligned

BottomAligned

public static final int BottomAligned

redrawState

protected boolean redrawState
The current autoredraw state.
Constructor Detail

DrawPanel

public DrawPanel()
Method Detail

setAutoRepaint

public void setAutoRepaint(boolean state)
This sets the state of the automatic repaint functionality. If this flag is true (the default) then any draw operation will invoke a repaint operation on the client.
Parameters:
state - boolean if true then auto repaint is enabled.

addOperation

public void addOperation(java.lang.Object data,
                         int[] drawInfo)
Calling this function adds an operation into the cache of operations.
Parameters:
data - The Object required for the operation.
drawInfo - int array of drawing information. The array always has at least two elements: the operation and a flags int in that order. Other data in the array depend on the operation being performed.

insertOperation

public void insertOperation(java.lang.Object data,
                            int[] drawInfo,
                            int location)
Calling this function inserts an operation into the cache of operations at the specified location in the operations sequence.
Parameters:
data - The Object required for the operation.
drawInfo - int array of drawing information. The array always has at least two elements: the operation and a flags int in that order. Other data in the array depend on the operation being performed.
location - int location in the sequence of operations to insert the operation at.

replaceOperation

public void replaceOperation(java.lang.Object data,
                             int[] drawInfo,
                             int location)
Calling this function modifies the specified operation and replaces it with the input operation.
Parameters:
data - The Object required for the operation.
drawInfo - int array of drawing information. The array always has at least two elements: the operation and a flags int in that order. Other data in the array depend on the operation being performed.
location - int location in the sequence of operations of the operation to replace.

removeOperation

public void removeOperation(int index)
Calling this function removes an existing operation from the cache of operations.
Parameters:
index - int index of the operation to remove.

removeAllOperations

public void removeAllOperations()
Calling this function removes all existing operations from the cache of operations.

setBorder

public void setBorder(int type)
This function sets the border on the panel.
Parameters:
type - int containing the type of panel. This is one of the constants specified here.

update

public void update(java.awt.Graphics g)
Overrides the update function to turn off background drawing.
Overrides:
update in class java.awt.Container
Parameters:
g - Graphics context to draw on.

paint

public void paint(java.awt.Graphics g)
The actual paint function. This does all the work of drawing etc.
Overrides:
paint in class java.awt.Container
Parameters:
g - Graphics context to render in.

render

protected void render(java.awt.Graphics drawGraphics,
                      java.awt.Dimension d)
This is the function called to render the draw operations onto the draw panel. It usually works on the double buffered graphics context.
Parameters:
drawGraphics - Graphics context to render to.
d - Dimension size of the rendering area.

renderOperation

public void renderOperation(java.awt.Graphics drawGraphics,
                            java.awt.Dimension d,
                            int[] drawInfo,
                            java.lang.Object drawObject,
                            int x,
                            int y)
This function renders one individual operation to the specified graphics context.
Parameters:
drawGraphics - Graphics context to render to.
d - Dimension of the Graphics context.
drawInfo - int array containing the parameters of the operation and the operation itself.
drawObject - Object which is additional information required by the operation.
x - int horizontal offset to add to the operation.
y - int vertical offset to add to the operation.

drawImage

protected void drawImage(java.awt.Image image,
                         java.awt.Dimension d,
                         int[] info,
                         java.awt.Graphics g,
                         int xOffset,
                         int yOffset)

drawBorder

protected void drawBorder(int type,
                          java.awt.Dimension d,
                          java.awt.Graphics g)


Copyright © 2002 Clearfield Research Ltd. All Rights Reserved.