Class RMPaintbot
- java.lang.Object
-
- com.inductiveautomation.rm.base.RMListenerList
-
- com.inductiveautomation.rm.base.RMObject
-
- com.inductiveautomation.rm.graphics.RMPaintbot
-
- All Implemented Interfaces:
RMPropertyChanger,java.lang.Cloneable
public class RMPaintbot extends RMObject
An object to process painter shape operations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRMPaintbot.CurveToA path construction operation for painting a bezier curve.static classRMPaintbot.ForwardAn op class for moving a shape forward along the path of its current roll.static classRMPaintbot.JumpAn op class for moving a shape forward along the path of its current roll.static classRMPaintbot.LineToA path construction operation for painting a line.static classRMPaintbot.MoveToAn inner class for path move to.static classRMPaintbot.OpA class representing an operation to an painter shape, like MoveTo or LineTo.static classRMPaintbot.PathOperationAn inner class for path construction operations.static classRMPaintbot.QuadToA path construction operation for painting a quadratic curve.static classRMPaintbot.SetPaintColorAn operation to set paint color.static classRMPaintbot.SetPaintSpeedAn operation to set painting speed.static classRMPaintbot.SetStrokeWidthAn operation to set stroke width.static classRMPaintbot.TurnAn op class for turning a shape by a given number of degrees.
-
Constructor Summary
Constructors Constructor Description RMPaintbot()Creates a new painter shape painter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddOp(RMPaintbot.Op anOp)Adds a new operation.RMPaintbotclone()Standard clone implementation.voidclose()Closes a path.voidcurveTo(double anX1, double aY1, double anX2, double aY2, double anX3, double aY3)Paint a bezier curve with the given control points and end point.voidforward(double aDistance)Adds a forward instruction to cpu.RMRectgetBounds()Returns the bounds of the painter shape operations.floatgetExecutionTime()Returns the execution time for painter shape operations.<T extends RMPaintbot.Op>
TgetLastOpOfClass(java.lang.Class<T> aClass)Returns the first operation of given class.RMPaintbot.OpgetOp(int anIndex)Returns the individual operation at given index.intgetOpCount()Returns the number of painter shape operations.RMPaintbot.OpgetOpOfClass(java.lang.Class aClass)Returns the first operation of given class.java.util.List<RMPaintbot.Op>getOps()Returns the list of ops.floatgetPaintSpeedDefault()Returns the default paint speed.floatgetRoll()Returns this CPU's current roll.doublegetX()Returns this CPU's current x position.doublegetY()Returns this CPU's current y position.voidjump(double aDistance)Adds a Jump instruction to cpu.voidlineTo(double anX, double aY)Paint a line to given coordinates.voidmoveTo(double anX, double aY)Move to.RMLinepaint(java.awt.Graphics2D aGraphics, double aTime)Paint.voidquadTo(double anX1, double aY1, double anX2, double aY2)Paint a parabolic curve with the given control point and end point.voidsetPaintColor(java.awt.Color aColor)Sets the paint color for path operations.voidsetPaintSpeed(double aSpeed)Sets the paint speed for path operations.voidsetPaintStrokeWidth(double aWidth)Sets the paint stroke width for path operations.voidturn(double anAngle)Adds a turn instruction to cpu.-
Methods inherited from class com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange, toString
-
Methods inherited from class com.inductiveautomation.rm.base.RMListenerList
addListener, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
-
-
-
Method Detail
-
getOpCount
public int getOpCount()
Returns the number of painter shape operations.
-
getOp
public RMPaintbot.Op getOp(int anIndex)
Returns the individual operation at given index.
-
getOps
public java.util.List<RMPaintbot.Op> getOps()
Returns the list of ops.
-
addOp
public void addOp(RMPaintbot.Op anOp)
Adds a new operation.
-
getOpOfClass
public RMPaintbot.Op getOpOfClass(java.lang.Class aClass)
Returns the first operation of given class.
-
getLastOpOfClass
public <T extends RMPaintbot.Op> T getLastOpOfClass(java.lang.Class<T> aClass)
Returns the first operation of given class.
-
setPaintColor
public void setPaintColor(java.awt.Color aColor)
Sets the paint color for path operations.
-
setPaintStrokeWidth
public void setPaintStrokeWidth(double aWidth)
Sets the paint stroke width for path operations.
-
setPaintSpeed
public void setPaintSpeed(double aSpeed)
Sets the paint speed for path operations.
-
forward
public void forward(double aDistance)
Adds a forward instruction to cpu.
-
jump
public void jump(double aDistance)
Adds a Jump instruction to cpu.
-
turn
public void turn(double anAngle)
Adds a turn instruction to cpu.
-
moveTo
public void moveTo(double anX, double aY)Move to.
-
lineTo
public void lineTo(double anX, double aY)Paint a line to given coordinates.
-
quadTo
public void quadTo(double anX1, double aY1, double anX2, double aY2)Paint a parabolic curve with the given control point and end point.
-
curveTo
public void curveTo(double anX1, double aY1, double anX2, double aY2, double anX3, double aY3)Paint a bezier curve with the given control points and end point.
-
close
public void close()
Closes a path.
-
getPaintSpeedDefault
public float getPaintSpeedDefault()
Returns the default paint speed.
-
getX
public double getX()
Returns this CPU's current x position.
-
getY
public double getY()
Returns this CPU's current y position.
-
getRoll
public float getRoll()
Returns this CPU's current roll.
-
paint
public RMLine paint(java.awt.Graphics2D aGraphics, double aTime)
Paint.
-
getExecutionTime
public float getExecutionTime()
Returns the execution time for painter shape operations.
-
getBounds
public RMRect getBounds()
Returns the bounds of the painter shape operations.
-
clone
public RMPaintbot clone()
Standard clone implementation.- Overrides:
clonein classRMListenerList
-
-