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
,java.awt.Paint
,java.awt.PaintContext
,java.awt.Transparency
,java.lang.Cloneable
public class RMContourFill extends RMFill implements java.awt.PaintContext, java.awt.Paint
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.
-
-
Constructor Summary
Constructors Constructor Description RMContourFill()
Creates a contour fill.RMContourFill(float height)
Creates a contour fill with given height.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.PaintContext
createContext(java.awt.image.ColorModel cm, java.awt.Rectangle deviceBounds, java.awt.geom.Rectangle2D userBounds, java.awt.geom.AffineTransform xform, java.awt.RenderingHints hints)
Paint & PaintContext interfaces.void
dispose()
PaintContext method.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].java.awt.image.ColorModel
getColorModel()
PaintContext method.java.awt.image.BufferedImage
getMaskImage(int width, int height)
Draws the path into a buffered image to use as a maskjava.awt.Paint
getPaint()
Paint & PaintContext interface methods.java.awt.image.Raster
getRaster(int x, int y, int w, int h)
Creates a new raster.int
getTransparency()
PaintContext method.void
paint(RMShapePainter aPntr, RMShape aShape)
Paint method.RXElement
toXML(RXArchiver anArchiver)
XML archival.-
Methods inherited from class com.inductiveautomation.rm.graphics.RMFill
clone, deriveFill, equals, fromXML, getBounds, getColor, getName, hasAlpha, readAttributes, setColor, toString
-
Methods inherited from class com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange
-
Methods inherited from class com.inductiveautomation.rm.base.RMListenerList
addListener, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
-
-
-
Method Detail
-
getPaint
public java.awt.Paint getPaint()
Paint & PaintContext interface methods.
-
getTransparency
public int getTransparency()
PaintContext method.- Specified by:
getTransparency
in interfacejava.awt.Transparency
-
getColorModel
public java.awt.image.ColorModel getColorModel()
PaintContext method.- Specified by:
getColorModel
in interfacejava.awt.PaintContext
-
dispose
public void dispose()
PaintContext method.- Specified by:
dispose
in interfacejava.awt.PaintContext
-
createContext
public java.awt.PaintContext createContext(java.awt.image.ColorModel cm, java.awt.Rectangle deviceBounds, java.awt.geom.Rectangle2D userBounds, java.awt.geom.AffineTransform xform, java.awt.RenderingHints hints)
Paint & PaintContext interfaces.- Specified by:
createContext
in interfacejava.awt.Paint
-
getRaster
public java.awt.image.Raster getRaster(int x, int y, int w, int h)
Creates a new raster.- Specified by:
getRaster
in interfacejava.awt.PaintContext
-
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
public void paint(RMShapePainter aPntr, RMShape aShape)
Paint method.
-
getMaskImage
public java.awt.image.BufferedImage getMaskImage(int width, int height)
Draws the path into a buffered image to use as a mask
-
toXML
public RXElement toXML(RXArchiver anArchiver)
XML archival.- Specified by:
toXML
in interfaceArchivable
- Overrides:
toXML
in classRMFill
-
-