show
Class GridDisplay

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--show.ComplexDisplay
                    |
                    +--show.GridDisplay
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class GridDisplay
extends ComplexDisplay

shows the values of a complex function (handed over in a Complex[][] array) by transforming a grid

See Also:
Serialized Form

Inner Class Summary
 class GridDisplay.GridCanvas
          this inner class represents the canvas on which everything is drawn.
 class GridDisplay.MouseCoordinateReader
          an inner class to read out mouse coordinates and calculate the corresponding values
 
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
protected  java.awt.Canvas canvas
          initialize canvas as GridCanvas in getCanvas(), when called the first time
protected  double cellHeight
          the height of a single cell in (logical) pixels
protected  double cellWidth
          the width of a single cell in (logical) pixels
protected  Complex[][] complexValues
          needed here for output only
protected  double imagDif
          imagRange[1] - imagRange[0], needed for transformation
protected  double[] imagRange
          the range in imaginary direction, needs to be stored for transformation
protected  GridDisplay.MouseCoordinateReader mouseCoordinateReader
          store the mouselistener used by this class, so that the subclass can remove it by reference
protected  double realDif
          realRange[1] - realRange[0], needed for transformation
protected  double[] realRange
          the range in real direction, needs to be stored for transformation
protected  java.awt.Label showCoords1
          a label showing the function value of the coordinate of the mouse
protected  java.awt.Label showCoords2
          a label showing the coordinates of the mouse in complex numbers
protected  java.awt.geom.AffineTransform transform
          the affine transformation applied to the Complex-Data for projecting it on the screen, its inverse is used by the MouseCoordinateReader to calculate the Complex coordinates from physical screen-coordinates
protected  double viewImagDif
          the imaginary diff in the view
protected  double[] viewImagRange
          the range in view, initialized to imagRange
protected  double viewRealDif
          the real diff in the view
protected  double[] viewRealRange
          the range in view, initialized to imagRange
 
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
GridDisplay()
           
 
Method Summary
 void determineCellSize()
          sets the cellwidth and -height, determined by realDif and imagDif
 void determineTransform(int width, int height)
          sets the affine transformation, determined by window-size and function range
 Complex getOriginValue(Complex o)
          returns for a given function value f the approximate origin value (i.e. the value in the grid whose function value best matches f)
 void setRange(double[] realRange, double[] imagRange)
          sets the ranges for both real and imaginary direction
 void setValues(Complex[][] inValues)
          sets the calculated values, that need to be displayed
 Complex transformXY(int x, int y)
          returns a Complex number with points which have been transformed from integer-physical graphics coordinates to double logical space coordinates using the inverse Transformation of the one used in paint()
 
Methods inherited from class show.ComplexDisplay
setCalculator
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addNotify, 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, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, 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, getAccessibleContext, 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

complexValues

protected Complex[][] complexValues
needed here for output only

realRange

protected double[] realRange
the range in real direction, needs to be stored for transformation

imagRange

protected double[] imagRange
the range in imaginary direction, needs to be stored for transformation

viewRealRange

protected double[] viewRealRange
the range in view, initialized to imagRange

viewImagRange

protected double[] viewImagRange
the range in view, initialized to imagRange

realDif

protected double realDif
realRange[1] - realRange[0], needed for transformation

imagDif

protected double imagDif
imagRange[1] - imagRange[0], needed for transformation

viewRealDif

protected double viewRealDif
the real diff in the view

viewImagDif

protected double viewImagDif
the imaginary diff in the view

showCoords1

protected java.awt.Label showCoords1
a label showing the function value of the coordinate of the mouse

showCoords2

protected java.awt.Label showCoords2
a label showing the coordinates of the mouse in complex numbers

canvas

protected java.awt.Canvas canvas
initialize canvas as GridCanvas in getCanvas(), when called the first time

transform

protected java.awt.geom.AffineTransform transform
the affine transformation applied to the Complex-Data for projecting it on the screen, its inverse is used by the MouseCoordinateReader to calculate the Complex coordinates from physical screen-coordinates

mouseCoordinateReader

protected GridDisplay.MouseCoordinateReader mouseCoordinateReader
store the mouselistener used by this class, so that the subclass can remove it by reference

cellWidth

protected double cellWidth
the width of a single cell in (logical) pixels

cellHeight

protected double cellHeight
the height of a single cell in (logical) pixels
Constructor Detail

GridDisplay

public GridDisplay()
Method Detail

determineCellSize

public void determineCellSize()
sets the cellwidth and -height, determined by realDif and imagDif

determineTransform

public void determineTransform(int width,
                               int height)
sets the affine transformation, determined by window-size and function range

transformXY

public Complex transformXY(int x,
                           int y)
returns a Complex number with points which have been transformed from integer-physical graphics coordinates to double logical space coordinates using the inverse Transformation of the one used in paint()

getOriginValue

public Complex getOriginValue(Complex o)
returns for a given function value f the approximate origin value (i.e. the value in the grid whose function value best matches f)

setRange

public void setRange(double[] realRange,
                     double[] imagRange)
sets the ranges for both real and imaginary direction
Overrides:
setRange in class ComplexDisplay

setValues

public void setValues(Complex[][] inValues)
Description copied from class: ComplexDisplay
sets the calculated values, that need to be displayed
Overrides:
setValues in class ComplexDisplay