| KeggShape | R Documentation |
A class for representing a shape.
A class for representing a shape.
This abstract class represents a shape, used for graphical representation.
Arguments to the constructor are:
label: A text label to associate with the shape.
color: A color, as a character string.
new()Initialize new instance.
KeggShape$new(label = NA_character_, color = NA_character_)
labelThe text label to display.
colorThe color to use.
Nothing.
equals()Test if this shape is the same as another.
KeggShape$equals(other)
otherThe other shape to compare with.
TRUE or FALSE.
getLabel()Gets the label associated with this shape.
KeggShape$getLabel()
The label.
getColor()Gets the color associated with this shape.
KeggShape$getColor()
The color name as a string.
getRgbColor()Gets the RGB color associated with this shape.
KeggShape$getRgbColor(alpha = 255)
alphaThe value to use for the alpha channel when building the RGB color object.
The color as an RGB color object.
draw()Draw the shape on the current image.
KeggShape$draw()
None.
clone()The objects of this class are cloneable with this method.
KeggShape$clone(deep = FALSE)
deepWhether to make a deep clone.
KeggRect, KeggCircle.
# Create a circle instance c <- KeggCircle$new(x=12, y=5, r=3, label='MyCircle') # Create a rectangle instance r <- KeggRect$new(left=10, top=10, bottom=20, right=30, color='yellow')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.