Package OpenCAGE.Controller.Command.Open_Graph

Contains Command and Command_Factory that implement opening a graph.

Class Open_Graph_Cmd

extends OpenCAGE.Controller.Command.Abstract_Command

throws Cannot_Open_Error .

This Command opens a graph.

Attributes

private OpenCAGE.GIF.Factories.Graph_Factory.Graph_Factory Graph_Factory 

private Ada.Strings.Unbounded.Unbounded_String File_Name 

private OpenCAGE.Dialogs.File_Dialogs.File_Dialog Dialog 

Operations

public Execute(void);

Executes the Command. May raise Illegal_State_Exception if precondition is not met, i.e. if the state is not "Collect_Data, Done". [This description is adopted from 'OpenCAGE.Controller.Command.Command'.]

Precondition: Collect_Data has been performed before and Execute is called the first time. [This precondition is adopted from 'OpenCAGE.Controller.Command.Command'.]

public Collect_Data(void);

Collects the data. It simply calls Start_Collect_Data, Do_Collect_Data and End_Collect_Data. [This description is adopted from 'OpenCAGE.Controller.Command.Abstract_Command'.]

Precondition: Initialization completed and Collect_Data was not called before. [This precondition is adopted from 'OpenCAGE.Controller.Command.Command'.]

Postcondition: The Command knows the data necessary for its execution. [This postcondition is adopted from 'OpenCAGE.Controller.Command.Command'.]

public Ada.Strings.Unbounded.Unbounded_String To_String(void);

Returns a string that tells what the Command does in a human readable format. This operation is used for debugging. [This description is adopted from 'OpenCAGE.Controller.Command.Command'.]

public Ada.Strings.Unbounded.Unbounded_String Get_Name(void);

Returns the name of the Command. This operation is used for writing the script. [This description is adopted from 'OpenCAGE.Controller.Command.Command'.]

Class Open_Graph_Cmd_Fty

extends OpenCAGE.Controller.Command.Abstract_Command_Factory

This Command Factory builds a Command that opens a graph.

Attributes

private OpenCAGE.GIF.Factories.Graph_Factory.Graph_Factory Graph_Factory 

Operations

public OpenCAGE.Controller.Command.Command Create_Command( FET.Data_Source Data);

Creates a new command object and initializes it with the given data source. The factory may add other data sources (e.g. dialogs) to the command. The factory may (but is not required to) check if the given data source contains all data required. It is recommanded to first check with Can_Excecute if the created command will get all data required. [This description is adopted from 'OpenCAGE.Controller.Command.Command_Factory'.]

public Ada.Strings.Unbounded.Unbounded_String Get_Name(void);

Returns the name of the command this factory creates. [This description is adopted from 'OpenCAGE.Controller.Command.Command_Factory'.]

Postcondition: Nothing is changed. [This postcondition is adopted from 'OpenCAGE.Controller.Command.Command_Factory'.]

public Boolean Can_Execute( FET.Data_Source Data);

Computes all necessary conditions and tells whether the Command is executable or not. Probably the Command_Factory needs a data_source first. [This description is adopted from 'OpenCAGE.Controller.Command.Command_Factory'.]