|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--graph3d.GraphView
A graph view. This class is threadsafe, ie. one can send all kind of state setter methods in the context of any thread. Note: this explicitly excludes paint() and listener methods, which are not meant to be invoked immediately anyway.
Inner classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
static int |
AXES
Mode bit: indicates usage of x,y,z axis display. |
static int |
CONTOURS
Mode bit: draw contour colors. |
static int |
LIGHTS
Mode bit: indicates usage of lighting. |
static int |
LINES
Mode bit: indicates graph shading as lines. |
static int |
POINTS
Mode bit: indicates graph shading as point set. |
static int |
SMOOTH
Mode bit: indicates smooth shading of graph. |
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 | |
GraphView(Function function)
Create a graph from a function. |
Method Summary | |
void |
componentHidden(java.awt.event.ComponentEvent event)
Not used. |
void |
componentMoved(java.awt.event.ComponentEvent event)
Not used. |
void |
componentResized(java.awt.event.ComponentEvent event)
Invokes a reshape. |
void |
componentShown(java.awt.event.ComponentEvent event)
Not used. |
void |
finalize()
|
float |
getLightBlueValue(int n)
Returns the blue component of light #n color. |
float |
getLightGreenValue(int n)
Returns the green component of light #n color. |
float |
getLightRedValue(int n)
Returns the red component of light #n color. |
double |
getRangeX0()
Returns the X range low boundary. |
double |
getRangeX1()
Returns the X range high boundary. |
double |
getRangeY0()
Returns the Y range low boundary. |
double |
getRangeY1()
Returns the Y range high boundary. |
boolean |
hasZ()
Checks, if this is a f(x,y,z)-style function. |
int |
mode(int m)
Checks mode bits. |
void |
mouseClicked(java.awt.event.MouseEvent event)
Not used. |
void |
mouseDragged(java.awt.event.MouseEvent event)
Reacts on mouse drags. |
void |
mouseMoved(java.awt.event.MouseEvent event)
Not used. |
void |
paint(java.awt.Graphics g)
Paint the view. |
void |
rotateX(double ax)
Rotate scene around X axis. |
void |
rotateY(double ay)
Rotate scene around Y axis. |
void |
rotateZ(double az)
Rotate scene around Z axis. |
void |
setDefaultMode(int mode)
Set default rendering mode. |
void |
setLightColor(int n,
float r,
float g,
float b)
Set light #n color. |
void |
setMode(int mode)
Set rendering mode. |
void |
setRangeX(double x0,
double x1)
Set plot range of X axis. |
void |
setRangeY(double y0,
double y1)
Set plot range of Y axis. |
void |
setZ(double z)
Set Z value for a f(x,y,z)-style function. |
void |
unsetMode(int mode)
Unset a rendering mode bit. |
void |
zoom(double tz)
Zooms the graph in or out. |
Methods inherited from class java.awt.Canvas |
addNotify, getAccessibleContext |
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, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, 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 |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int POINTS
public static final int LINES
public static final int SMOOTH
public static final int LIGHTS
public static final int AXES
public static final int CONTOURS
Constructor Detail |
public GraphView(Function function) throws java.lang.IllegalArgumentException, RuntimeException, TypeMismatchException
function
- the function to graphIllegalArgumentException,
- if the function is not plottable
RuntimeException, if the function causes a stack machine errorMethod Detail |
public void componentHidden(java.awt.event.ComponentEvent event)
componentHidden
in interface java.awt.event.ComponentListener
public void componentMoved(java.awt.event.ComponentEvent event)
componentMoved
in interface java.awt.event.ComponentListener
public void componentResized(java.awt.event.ComponentEvent event)
componentResized
in interface java.awt.event.ComponentListener
public void componentShown(java.awt.event.ComponentEvent event)
componentShown
in interface java.awt.event.ComponentListener
public void mouseClicked(java.awt.event.MouseEvent event)
public void mouseDragged(java.awt.event.MouseEvent event)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent event)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void paint(java.awt.Graphics g)
paint
in class java.awt.Canvas
g
- the Graphics objectIllegalArgumentException,
- if invoked from another threadpublic float getLightRedValue(int n)
IllegalArgumentException,
- if n does not match a valid lightpublic float getLightGreenValue(int n)
IllegalArgumentException,
- if n does not match a valid lightpublic float getLightBlueValue(int n)
IllegalArgumentException,
- if n does not match a valid lightpublic double getRangeX0()
public double getRangeX1()
public double getRangeY0()
public double getRangeY1()
public boolean hasZ()
public int mode(int m)
m
- the mode bit(s) to check for.public void rotateX(double ax)
ax
- angle to applypublic void rotateY(double ay)
ay
- angle to applypublic void rotateZ(double az)
az
- angle to applypublic void setLightColor(int n, float r, float g, float b) throws java.lang.IllegalArgumentException
n
- number of lightr
- red value of colorg
- green value of colorb
- blue value of colorIllegalArgumentException,
- if n is not a valid lightpublic void setDefaultMode(int mode)
public void setMode(int mode)
mode
- POINTS: draws the grid as a point set
LINES : draws the grid as a wireframe mesh
SMOOTH: applies smooth shading on the grid
LIGHTS: uses lighting
AXES : draws x,y,z axespublic void setRangeX(double x0, double x1) throws java.lang.IllegalArgumentException
x0
- low bound of X rangex1
- high bound of X rangeIllegalArgumentException,
- if y0 >= y1public void setRangeY(double y0, double y1) throws java.lang.IllegalArgumentException
y0
- low bound of Y rangey1
- high bound of Y rangeIllegalArgumentException,
- if y0 >= y1public void setZ(double z)
z
- Z value to use for f(x,y,z)public void unsetMode(int mode)
mode
- POINTS: draws the grid as a point set
LINES : draws the grid as a wireframe mesh
SMOOTH: applies smooth shading on the grid
LIGHTS: uses lighting
AXES : draws x,y,z axespublic void zoom(double tz)
tz
- - values larger 0 zoom out
values less than 0 zoom inpublic void finalize()
finalize
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |