|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component net.sourceforge.webcompmath.draw.Drawable net.sourceforge.webcompmath.draw.Graph1D
public class Graph1D
A Graph1D represents the graph of a function of one variable, to be displayed in a given CoordinateRect. A Graph1D is a Computable. The data for the graph is recomputed when its compute() method is called. It will also be re- computed, before it is drawn, if the coordinate rect has changed in some way.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class net.sourceforge.webcompmath.draw.Drawable |
---|
canvas, coords |
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 | |
---|---|
Graph1D()
Create a Graph1D with no function to graph. |
|
Graph1D(Function func)
Create a graph of the specified function. |
Method Summary | |
---|---|
void |
compute()
Recompute data for the graph and make sure that the area of the display canvas that shows the graph is redrawn. |
void |
draw(java.awt.Graphics g,
boolean coordsChanged)
Draw the graph (possibly recomputing the data if the CoordinateRect has changed). |
java.awt.Color |
getColor()
Get the color that is used to draw the graph. |
Function |
getFunction()
Get the (possibly null) function whose graph is drawn. |
float |
getLineWidth()
Get the line width |
boolean |
isDashed()
Get whether or not to use dashed style |
boolean |
isInverse()
Get whether to invert the graph. |
void |
setColor(java.awt.Color c)
Set the color to be used for drawing the graph. |
void |
setDashed(boolean d)
Set whether or not to use dashed style |
void |
setFunction(Function f)
Set the function to be graphed. |
void |
setInverse(boolean inverse)
Set whether to invert the graph |
void |
setLineWidth()
setter of thickness of graph test pkhg 050422 |
void |
setLineWidth(float thickness)
Setter for thickness of graph, only between 0.0f and 10.0f. |
void |
setVariableInput(VariableInput varThickness)
to make thicknes of graph variable with the help of an VariableInput |
void |
setWithDash()
Deprecated. |
void |
setWithoutDash()
Deprecated. |
Methods inherited from class net.sourceforge.webcompmath.draw.Drawable |
---|
getVisible, needsRedraw, setOwnerData, setVisible |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, 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, paint, 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, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Graph1D()
public Graph1D(Function func)
func
- The function to be graphed. If func is null, nothing is drawn.
If func is non-null, it must be a function of one variable.Method Detail |
---|
public void setColor(java.awt.Color c)
c
- graph colorpublic java.awt.Color getColor()
public void setFunction(Function f)
f
- function to graphpublic Function getFunction()
public void compute()
compute
in interface Computable
public void setVariableInput(VariableInput varThickness)
varThickness
- the variableInput to usepublic void setLineWidth()
public void setLineWidth(float thickness)
thickness
- public float getLineWidth()
@Deprecated public void setWithDash()
@Deprecated public void setWithoutDash()
public boolean isDashed()
public void setDashed(boolean d)
d
- true for dashedpublic void draw(java.awt.Graphics g, boolean coordsChanged)
draw
in class Drawable
g
- graphics contextcoordsChanged
- true or falsepublic boolean isInverse()
public void setInverse(boolean inverse)
inverse
- true for inverse
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |