| |
- builtins.object
-
- Shape
-
- Oval
- Rectangle
- Triangle
class Oval(Shape) |
| |
- Method resolution order:
- Oval
- Shape
- builtins.object
Methods defined here:
- draw(self)
- Draws an oval on the canvas. The properties of the oval
can be set using the getter and setter methods in Shape
Methods inherited from Shape:
- __init__(self, width=50, height=50, x=None, y=None, color='black')
- Creates a generic 'shape' which contains properties common to all
shapes such as height, width, x y coordinates and colour.
- get_color(self)
- Returns the colour of the shape
- randomise(self, width=20, height=200)
- Randomly generates width, height, position and colour for a shape
- set_color(self, color)
- Sets the colour of the shape
- set_height(self, height)
- Sets the height of the shape
- set_width(self, width)
- Sets the width of the shape
- set_x(self, x)
- Sets the x position of the shape
- set_y(self, y)
- Sets the y position of the shape
Data descriptors inherited from Shape:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes inherited from Shape:
- paper = <shapes.Paper object .>
|
class Rectangle(Shape) |
|
# Rectangle class is a subclass of Shape |
|
- Method resolution order:
- Rectangle
- Shape
- builtins.object
Methods defined here:
- draw(self)
- Draws a rectangle on the canvas. The properties of the rectangle
can be set using the getter and setter methods in Shape
Methods inherited from Shape:
- __init__(self, width=50, height=50, x=None, y=None, color='black')
- Creates a generic 'shape' which contains properties common to all
shapes such as height, width, x y coordinates and colour.
- get_color(self)
- Returns the colour of the shape
- randomise(self, width=20, height=200)
- Randomly generates width, height, position and colour for a shape
- set_color(self, color)
- Sets the colour of the shape
- set_height(self, height)
- Sets the height of the shape
- set_width(self, width)
- Sets the width of the shape
- set_x(self, x)
- Sets the x position of the shape
- set_y(self, y)
- Sets the y position of the shape
Data descriptors inherited from Shape:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes inherited from Shape:
- paper = <shapes.Paper object .>
|
class Shape(builtins.object) |
| |
Methods defined here:
- __init__(self, width=50, height=50, x=None, y=None, color='black')
- Creates a generic 'shape' which contains properties common to all
shapes such as height, width, x y coordinates and colour.
- get_color(self)
- Returns the colour of the shape
- randomise(self, width=20, height=200)
- Randomly generates width, height, position and colour for a shape
- set_color(self, color)
- Sets the colour of the shape
- set_height(self, height)
- Sets the height of the shape
- set_width(self, width)
- Sets the width of the shape
- set_x(self, x)
- Sets the x position of the shape
- set_y(self, y)
- Sets the y position of the shape
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- paper = <shapes.Paper object .>
|
class Triangle(Shape) |
| |
- Method resolution order:
- Triangle
- Shape
- builtins.object
Methods defined here:
- __init__(self, x1=0, y1=0, x2=20, y2=0, x3=20, y3=20, color='black')
- Overrides the Shape constructor because triangles require three
coordinate points to be drawn, unlike rectangles and ovals.
- draw(self)
- Draws a triangle on the canvas. The properties of the triangle
can be set using the getter and setter methods in Shape
- randomise(self)
- Randomly chooses the location of all 3 triangle points as well
as the colour of the triangle
- set_height(self, height)
- Overrides the setter method for height
- set_width(self, width)
- Overrides the setter method for width
Methods inherited from Shape:
- get_color(self)
- Returns the colour of the shape
- set_color(self, color)
- Sets the colour of the shape
- set_x(self, x)
- Sets the x position of the shape
- set_y(self, y)
- Sets the y position of the shape
Data descriptors inherited from Shape:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes inherited from Shape:
- paper = <shapes.Paper object .>
| |