com.softsynth.jsyn.view102
Class XYController

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by com.softsynth.jsyn.view102.XYController
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
InternalBarGraphEditor, XYController

public class XYController
extends java.awt.Canvas

Internal class for 2 dimensional X,Y controller for wave editors, Theremins, etc. Maps pixel coordinates into "world" coordinates.

Author:
(C) 1997 Phil Burk, SoftSynth.com, All Rights Reserved
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
 
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
XYController()
           
XYController(double minWX, double minWY, double maxWX, double maxWY)
           
 
Method Summary
 double clipWorldX(double wx)
          Clip wx to the min & max World X values.
 double clipWorldY(double wy)
          Clip wy to the min & max World Y values.
 double convertGXtoWX(int gx)
          Convert from graphics coordinates (pixels) to world coordinates.
 double convertGYtoWY(int gy)
           
 int convertWXtoGX(double wx)
          Convert from world coordinates to graphics coordinates (pixels).
 int convertWYtoGY(double wy)
           
 double getMaxWorldX()
           
 double getMaxWorldY()
           
 double getMinWorldX()
           
 double getMinWorldY()
           
 void setMaxWorldX(double maxWX)
          Set maximum World coordinate value for the horizontal X dimension.
 void setMaxWorldY(double maxWY)
          Set maximum World coordinate value for the vertical Y dimension.
 void setMinWorldX(double minWX)
          Set minimum World coordinate value for the horizontal X dimension.
 void setMinWorldY(double minWY)
          Set minimum World coordinate value for the vertical Y dimension.
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, paint, 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, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, 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, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XYController

public XYController()

XYController

public XYController(double minWX,
                    double minWY,
                    double maxWX,
                    double maxWY)
Method Detail

setMinWorldX

public void setMinWorldX(double minWX)
Set minimum World coordinate value for the horizontal X dimension. The minimum value corresponds to the left of the component.


getMinWorldX

public double getMinWorldX()

setMaxWorldX

public void setMaxWorldX(double maxWX)
Set maximum World coordinate value for the horizontal X dimension. The minimum value corresponds to the right of the component.


getMaxWorldX

public double getMaxWorldX()

setMinWorldY

public void setMinWorldY(double minWY)
Set minimum World coordinate value for the vertical Y dimension. The minimum value corresponds to the bottom of the component.


getMinWorldY

public double getMinWorldY()

setMaxWorldY

public void setMaxWorldY(double maxWY)
Set maximum World coordinate value for the vertical Y dimension. The maximum value corresponds to the top of the component.


getMaxWorldY

public double getMaxWorldY()

convertGXtoWX

public double convertGXtoWX(int gx)
Convert from graphics coordinates (pixels) to world coordinates.


convertGYtoWY

public double convertGYtoWY(int gy)

convertWXtoGX

public int convertWXtoGX(double wx)
Convert from world coordinates to graphics coordinates (pixels).


convertWYtoGY

public int convertWYtoGY(double wy)

clipWorldX

public double clipWorldX(double wx)
Clip wx to the min & max World X values.


clipWorldY

public double clipWorldY(double wy)
Clip wy to the min & max World Y values.