1. Find all objects and the corrensponding function of each object.
2. Extract the classes from the above objects.
2.1 List multiple objects of a same class,and find out their common characteristics and behaviors.
2.1.1 Canvas
2.1.2 Geometry
2.1.3 Style
Painter
3. not yet
4. Situation test
situation 1: Draw a line
1. Find all objects and the corrensponding function of each object.
- Canvas
- Geometry
- Style
- Painter
2. Extract the classes from the above objects.
2.1 List multiple objects of a same class,and find out their common characteristics and behaviors.
2.1.1 Canvas
- Multiple objects of Canvas:
- screen (include pdf) – using graphics card.
- wall
- paper
we just need to care ‘screen’.
- common characteristics and behaviors
- width
- height
- backgroundColor
2.1.2 Geometry
- Multiple objects of Geometry
- triangle
- rectangle
- circle
- point
- Common characteristics and behaviors
- perimeter
- area
2.1.3 Style
- Multiple objects of Style
- lineStyle – Pen
- regionStyle – Brush
- Common characteristics and behaviors
- color
- width
Painter
- Multiple objects of Style
- projector
- printer
- painter
- Common characteristics and behaviors
- DrawPolygon
- DrawLine
- DrawPoint
- FillPolygon
2.1 List multiple objects of a same class,and find out their common characteristics and behaviors.
2.1.1 Canvas
- Multiple objects of Canvas:
- screen (include pdf) – using graphics card.
- wall
- paper
we just need to care ‘screen’.
- common characteristics and behaviors
- width
- height
- backgroundColor
2.1.2 Geometry
- Multiple objects of Geometry
- triangle
- rectangle
- circle
- point
- Common characteristics and behaviors
- perimeter
- area
2.1.3 Style
- Multiple objects of Style
- lineStyle – Pen
- regionStyle – Brush
- Common characteristics and behaviors
- color
- width
Painter
- Multiple objects of Style
- projector
- printer
- painter
- Common characteristics and behaviors
- DrawPolygon
- DrawLine
- DrawPoint
- FillPolygon
You can view the results of this phase now.
3. not yet
4. Situation test
situation 1: Draw a line
- new Canvas(width,height,bgcolor);
- new LineStyle(lineType,width);
- List points = new List(new Point(),new Point());
- Geometry geo = new Polygon(points);
- Painter.Draw(canvas,style,geo);
situation 1: Draw a line
- new Canvas(width,height,bgcolor);
- new LineStyle(lineType,width);
- List points = new List(new Point(),new Point());
- Geometry geo = new Polygon(points);
- Painter.Draw(canvas,style,geo);
时间: 2024-08-02 11:03:00