gui
Class CurvedCanvas

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Canvas
          extended bygui.CurvedCanvas
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable

public class CurvedCanvas
extends Canvas

This class displays the Bezier Curves on it.

Since:
1.00
Version:
1.10
Author:
Berend "Kirk" Wouda
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.awt.Canvas
Canvas.AccessibleAWTCanvas
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  Group currentmaingroup
          The currently displayed Group.
protected  int detail
          The detail of the curve (how many steps will be calculated).
 
Fields inherited from class java.awt.Canvas
 
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
CurvedCanvas()
           
 
Method Summary
protected  void drawCurve(Graphics g, Curve curve, Point origin, double multiplier)
          Draws the given curve on the given graphics context.
protected  void drawGroup(Graphics g, Group group, Point origin)
          Draws the given group on the given graphics context.
protected  void drawShape(Graphics g, Shape shape, Point origin)
          Draws the given shape on the given graphics context.
 void paint(Graphics g)
          This method draws all the curves on the Canvas.
 void refresh(Group group)
          This method clears anything that is displayed on this canvas, and fills it with the visual representation of the grouped curve hierarchy indicated by the given group.
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, 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, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currentmaingroup

protected Group currentmaingroup
The currently displayed Group.


detail

protected int detail
The detail of the curve (how many steps will be calculated).

Constructor Detail

CurvedCanvas

public CurvedCanvas()
Method Detail

paint

public void paint(Graphics g)
This method draws all the curves on the Canvas.

Parameters:
g - The graphics context of this Component.
See Also:
Component.paint(java.awt.Graphics)

drawGroup

protected void drawGroup(Graphics g,
                         Group group,
                         Point origin)
Draws the given group on the given graphics context.

Parameters:
g - The graphics context this method should draw on.
group - The Group to be drawn.
origin - The origin that has to be used when drawing.

drawShape

protected void drawShape(Graphics g,
                         Shape shape,
                         Point origin)
Draws the given shape on the given graphics context.

Parameters:
g - The graphics context this method should draw on.
shape - The Shape to be drawn.
origin - The origin that has to be used when drawing.

drawCurve

protected void drawCurve(Graphics g,
                         Curve curve,
                         Point origin,
                         double multiplier)
Draws the given curve on the given graphics context.

Parameters:
g - The graphics context this method should draw on.
curve - The Curve to be drawn.
origin - The origin that has to be used when drawing.
multiplier - The number to multiply every coordinate with.

refresh

public void refresh(Group group)
This method clears anything that is displayed on this canvas, and fills it with the visual representation of the grouped curve hierarchy indicated by the given group.

Parameters:
group - The main Group of the hierarchy to display.