Gav
Class JPView

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--Gav.JPView
Direct Known Subclasses:
CFitView, CGavView, CGenBitView, CGenView

class JPView
extends java.awt.Canvas

JPView : Views. Gives a Canvas to a panel and manages sizing and double buffering. To use this class, just create inheriting classes for each canvas you need and define only the paint function (optionnaly a constructor to initiate background color.)

See Also:
Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
(package private)  java.awt.Graphics GrBuff
          Graphics context for double buffering
(package private)  int Height
          View size
(package private)  java.awt.Image ImgBuff
          Image for double buffering
(package private)  float lHeight
          Logical size for calculation
(package private)  float lWidth
          Logical size for calculation
(package private)  int Width
          View size
 
Fields inherited from class java.awt.Canvas
base, graphicsConfig, nameCounter, serialVersionUID
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, assert, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, serialVersionUID, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
JPView()
          Default constructor
JPView(java.awt.Color c)
          Construct a View with a bkgrd color
 
Method Summary
(package private)  void ClearBkg()
          Clear Background.
 void destroy()
          remove buffer
 void paint(java.awt.Graphics g)
           
 void repaint()
           
(package private)  void ResizeGrBuff()
          Modify the size of the view
(package private)  java.awt.Dimension SetDim()
          Set the dimension variables, returns the Dimension
(package private)  void SetLogicalSize(float w, float h)
          Set the logical size
 
Methods inherited from class java.awt.Canvas
, addNotify, constructComponentName, postsOldMouseEvents
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, doLayout, enable, enable, enableEvents, enableInputMethods, eventEnabled, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, initIDs, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, lightweightPrint, 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, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, readObject, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate, writeObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

ImgBuff

java.awt.Image ImgBuff
Image for double buffering

GrBuff

java.awt.Graphics GrBuff
Graphics context for double buffering

Height

int Height
View size

Width

int Width
View size

lHeight

float lHeight
Logical size for calculation

lWidth

float lWidth
Logical size for calculation
Constructor Detail

JPView

public JPView()
Default constructor

JPView

public JPView(java.awt.Color c)
Construct a View with a bkgrd color
Method Detail

destroy

public void destroy()
remove buffer

SetDim

java.awt.Dimension SetDim()
Set the dimension variables, returns the Dimension

SetLogicalSize

void SetLogicalSize(float w,
                    float h)
Set the logical size

ResizeGrBuff

void ResizeGrBuff()
Modify the size of the view

ClearBkg

void ClearBkg()
Clear Background. WNG : doesn't manage repaint to limit multiple calls.

repaint

public void repaint()
Overrides:
repaint in class java.awt.Component

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Canvas