Graphic Rendering System 1.0
A Java-based graphic rendering system implementing various design patterns
Loading...
Searching...
No Matches
com.example.graphics.command.AddShapeCommand Class Reference
Inheritance diagram for com.example.graphics.command.AddShapeCommand:
Inheritance graph
Collaboration diagram for com.example.graphics.command.AddShapeCommand:
Collaboration graph

Public Member Functions

 AddShapeCommand (List< Shape > shapes, Shape shape)
void execute ()
void undo ()

Private Attributes

final Shape shape
final List< Shapeshapes

Detailed Description

Command for adding a shape to a collection. This is an implementation of the Command pattern.

Definition at line 10 of file AddShapeCommand.java.

Constructor & Destructor Documentation

◆ AddShapeCommand()

com.example.graphics.command.AddShapeCommand.AddShapeCommand ( List< Shape > shapes,
Shape shape )
inline

Constructor for the AddShapeCommand

Parameters
shapesthe collection of shapes to modify
shapethe shape to add

Definition at line 19 of file AddShapeCommand.java.

References shape, and shapes.

Member Function Documentation

◆ execute()

void com.example.graphics.command.AddShapeCommand.execute ( )
inline

Execute the command

Implements com.example.graphics.command.Command.

Definition at line 25 of file AddShapeCommand.java.

References shape, and shapes.

◆ undo()

void com.example.graphics.command.AddShapeCommand.undo ( )
inline

Undo the command

Implements com.example.graphics.command.Command.

Definition at line 30 of file AddShapeCommand.java.

References shape, and shapes.

Member Data Documentation

◆ shape

final Shape com.example.graphics.command.AddShapeCommand.shape
private

Definition at line 12 of file AddShapeCommand.java.

Referenced by AddShapeCommand(), execute(), and undo().

◆ shapes

final List<Shape> com.example.graphics.command.AddShapeCommand.shapes
private

Definition at line 11 of file AddShapeCommand.java.

Referenced by AddShapeCommand(), execute(), and undo().


The documentation for this class was generated from the following file: