show
Class Field2DDisplay

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--show.ComplexDisplay
                    |
                    +--show.Field2DDisplay
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
Direct Known Subclasses:
AltitudeDisplay, VectorFieldDisplay

public abstract class Field2DDisplay
extends ComplexDisplay

the base class for a 2-dimensional view of complex functions it implements the functionality needed for transforming the value-canvas to the chosen size. This is done by using the Java2D-API

See Also:
Serialized Form

Inner Class Summary
 class Field2DDisplay.MouseCoordinateReader
          an inner class, which reads the coordinates of the mouse and transforms them to complex coordinates.
 
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  Calculator calculator
          stores the calculator frontend to compute function values independent of the value-grid
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  java.awt.Point circleCenter
          the last chosen point (by MouseCoordinateReader)
protected  java.awt.Point circleOuter
          the last coordinate used in MouseCoordinateReader.mouseDragged (for reversing)
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  Field2DDisplay.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 showCoords
          a label showing the complex coordinates of the mouse
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  Complex[][] values
          needed here for output only
 
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
Field2DDisplay()
           
 
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 readDif, imagDif
abstract  java.awt.Canvas getCanvas()
           
 int[] getIndices(Complex c)
          return the index pair for a given complex number using the ranges and gridsize
 Complex getValue(Complex c)
          return the computed function value for a given complex number using the grid of values (warning: is inaccurate compared to calculator.calculateForCurrentFunction()!)
 void setCalculator(Calculator calculator)
          sets the calculator frontend
 void setRange(double[] realRange, double[] imagRange)
          sets the ranges for both real and imaginary direction
 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
setValues
 
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

values

protected Complex[][] values
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

showCoords

protected java.awt.Label showCoords
a label showing the complex coordinates of the mouse

realDif

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

imagDif

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

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

circleCenter

protected java.awt.Point circleCenter
the last chosen point (by MouseCoordinateReader)

circleOuter

protected java.awt.Point circleOuter
the last coordinate used in MouseCoordinateReader.mouseDragged (for reversing)

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 Field2DDisplay.MouseCoordinateReader mouseCoordinateReader
store the mouselistener used by this class, so that the subclass can remove it by reference

calculator

protected Calculator calculator
stores the calculator frontend to compute function values independent of the value-grid
Constructor Detail

Field2DDisplay

public Field2DDisplay()
Method Detail

setCalculator

public void setCalculator(Calculator calculator)
sets the calculator frontend
Overrides:
setCalculator in class ComplexDisplay

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()

getValue

public Complex getValue(Complex c)
return the computed function value for a given complex number using the grid of values (warning: is inaccurate compared to calculator.calculateForCurrentFunction()!)

getIndices

public int[] getIndices(Complex c)
return the index pair for a given complex number using the ranges and gridsize

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 readDif, imagDif

setRange

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

getCanvas

public abstract java.awt.Canvas getCanvas()