Class RMContourFill
java.lang.Object
com.inductiveautomation.rm.base.RMListenerList
com.inductiveautomation.rm.base.RMObject
com.inductiveautomation.rm.graphics.RMFill
com.inductiveautomation.rm.graphics.RMContourFill
- All Implemented Interfaces:
Archivable,RMPropertyChanger,Paint,PaintContext,Transparency,Cloneable
RMFill implementation of a shape-burst gradient. Implements Paint & PaintContext methods for scan converting the
gradient into an ARGB raster. Can be used on its own for a vaguely-interesting fill, or to create a bump map for the
emboss effect. Currently the edge profile is a 45 degree straight line, but other edge profiles (rounded, cove,
whatever) can easily be added.
-
Field Summary
Fields inherited from interface java.awt.Transparency
BITMASK, OPAQUE, TRANSLUCENT -
Constructor Summary
ConstructorsConstructorDescriptionCreates a contour fill.RMContourFill(float height) Creates a contour fill with given height. -
Method Summary
Modifier and TypeMethodDescriptioncreateContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints) Paint & PaintContext interfaces.voiddispose()PaintContext method.voiddoShading(int[] samples, int offset, int devicex, int devicey, int w, int h, int rowbytes) Replaces image samples with distance from pixel scaled to the range [0-1].PaintContext method.getMaskImage(int width, int height) Draws the path into a buffered image to use as a maskgetPaint()Paint & PaintContext interface methods.getRaster(int x, int y, int w, int h) Creates a new raster.intPaintContext method.voidpaint(RMShapePainter aPntr, RMShape aShape) Paint method.toXML(RXArchiver anArchiver) XML archival.Methods inherited from class com.inductiveautomation.rm.graphics.RMFill
clone, deriveFill, equals, fromXML, getBounds, getColor, getName, hasAlpha, readAttributes, setColor, toStringMethods inherited from class com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChangeMethods inherited from class com.inductiveautomation.rm.base.RMListenerList
addListener, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
Constructor Details
-
RMContourFill
public RMContourFill()Creates a contour fill. -
RMContourFill
public RMContourFill(float height) Creates a contour fill with given height.
-
-
Method Details
-
getPaint
Paint & PaintContext interface methods. -
getTransparency
public int getTransparency()PaintContext method.- Specified by:
getTransparencyin interfaceTransparency
-
getColorModel
PaintContext method.- Specified by:
getColorModelin interfacePaintContext
-
dispose
public void dispose()PaintContext method.- Specified by:
disposein interfacePaintContext
-
createContext
public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints) Paint & PaintContext interfaces.- Specified by:
createContextin interfacePaint
-
getRaster
Creates a new raster.- Specified by:
getRasterin interfacePaintContext
-
doShading
public void doShading(int[] samples, int offset, int devicex, int devicey, int w, int h, int rowbytes) Replaces image samples with distance from pixel scaled to the range [0-1]. We scale every distance by the maximum. This means that the color of each edge will change with the same slope, and thicker sections will therefore be taller (if edge color is thought of as height). Another possibility would be to scale each edge by its local max, so each section ultimately reaches same height. -
paint
Paint method. -
getMaskImage
Draws the path into a buffered image to use as a mask -
toXML
XML archival.- Specified by:
toXMLin interfaceArchivable- Overrides:
toXMLin classRMFill
-