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

Public Member Functions

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

Private Attributes

int index
final Shape shape
final List< Shapeshapes

Detailed Description

Command for removing a shape from a collection. This is an implementation of the Command pattern.

Definition at line 10 of file RemoveShapeCommand.java.

Constructor & Destructor Documentation

◆ RemoveShapeCommand()

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

Constructor for the RemoveShapeCommand

Parameters
shapesthe collection of shapes to modify
shapethe shape to remove

Definition at line 20 of file RemoveShapeCommand.java.

References shape, and shapes.

Member Function Documentation

◆ execute()

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

Execute the command

Implements com.example.graphics.command.Command.

Definition at line 26 of file RemoveShapeCommand.java.

References index, shape, and shapes.

◆ undo()

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

Undo the command

Implements com.example.graphics.command.Command.

Definition at line 34 of file RemoveShapeCommand.java.

References index, shape, and shapes.

Member Data Documentation

◆ index

int com.example.graphics.command.RemoveShapeCommand.index
private

Definition at line 13 of file RemoveShapeCommand.java.

Referenced by execute(), and undo().

◆ shape

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

Definition at line 12 of file RemoveShapeCommand.java.

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

◆ shapes

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

Definition at line 11 of file RemoveShapeCommand.java.

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


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