Package cnuphys.splot.plot
Class Gradient
java.lang.Object
java.awt.geom.RectangularShape
java.awt.geom.Rectangle2D
java.awt.Rectangle
cnuphys.splot.plot.DraggableRectangle
cnuphys.splot.plot.Gradient
- All Implemented Interfaces:
Draggable,Shape,Serializable,Cloneable
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D
Rectangle2D.Double, Rectangle2D.Float -
Field Summary
Fields inherited from class cnuphys.splot.plot.DraggableRectangle
_beenMoved, _currentPoint, _dragging, _draggingPrimedFields inherited from class java.awt.geom.Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP -
Constructor Summary
ConstructorsConstructorDescriptionGradient(PlotCanvas canvas) Create a gradient rectangle rectangle using the standard blue to red gradient with 0 to 1 value range relative range -
Method Summary
Modifier and TypeMethodDescriptionvoidDraw the gradientgetColor(double value) Get the color for the give value.protected intGet the height of the gradientprotected intMethods inherited from class cnuphys.splot.plot.DraggableRectangle
getCurrentPoint, isDragging, isDraggingPrimed, setCurrentPoint, setDragging, setDraggingPrimedMethods inherited from class java.awt.Rectangle
add, add, add, contains, contains, contains, contains, createIntersection, createUnion, equals, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, toString, translate, unionMethods inherited from class java.awt.geom.Rectangle2D
add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, unionMethods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonalMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.Shape
contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects
-
Constructor Details
-
Gradient
Create a gradient rectangle rectangle using the standard blue to red gradient with 0 to 1 value range relative range- Parameters:
canvas- the parent plot canvas
-
-
Method Details
-
draw
Draw the gradient- Parameters:
g- the Graphics context
-
getGradientHeight
protected int getGradientHeight()Get the height of the gradient- Returns:
- the height of the gradient
-
getGradientWidth
protected int getGradientWidth() -
getColor
Get the color for the give value. Interpolation is used.- Parameters:
value- the vale- Returns:
- the color
-