Package OpenCAGE.GUI.Displays.Edge_Displays

This package provides data structure and methods to Display Edges on the screen

Class Edge_Display

extends OpenCAGE.GUI.Displays.Object_Displays.Object_Display

throws No_Point_To_Draw_Edge_Exception .

This class holds the data needed for the visualization, e.g. visibility, the assigned pixmaps, etc. Each Edge_Display has its own Edge_Model.

Attributes

private OpenCAGE.GUI.Displays.Node_Displays.Node_Display Start_Node_Display 

private OpenCAGE.GUI.Displays.Node_Displays.Node_Display End_Node_Display 

private OpenCAGE.GIF.Edge_Model Edge_Model 

private Ada.Strings.Unbounded.Unbounded_String Color 

The Color, in which the Edge is drawn

private OpenCAGE.GUI.Displays.Edge_Displays.Model_Observer Model_Observer 

private Graphics.Points.Point Old_Start_Position 

Stores the Position of the Start_Node. Use this, if you need the position when the edge is not Drawable any more.

private Graphics.Points.Point Old_End_Position 

Stores the Position of the End_Node. Use this, if you need the position when the edge is not Drawable any more.

Operations

public Draw( Graphics.Graphic_Component.Graphic_Component GC);

Draws the edge if it is drawable, i.e. if both nodes exist. If this is the case, Draw_Really (implemented by subclass) is called.

public Draw_Really( Graphics.Graphic_Component.Graphic_Component GC);

Is called by draw. Don't ever called from somewhere else unless you know what you're doing. This method is protected, i.e. it should not be called from outside. Unfortunatly Ada doesn't support this feature.

public Draw_Sketch( Graphics.Graphic_Component.Graphic_Component GC);

Does nothing, we don't want edges in a sketch.

public Update_Display_Really(void);

Is called by Update. Don't ever called from somewhere else unless you know what you're doing. This method is protected, i.e. it should not be called from outside. Unfortunatly Ada doesn't support this feature. [This description is adopted from 'OpenCAGE.GUI.Displays.Object_Displays.Object_Display'.]

public Graphics.Points.Point Get_Position(void);

returns the position of the object. Returns null if it has not a particular position e.g. an edge. This is not a very nice solution. The null value is used to calculate the Used_Area in Object_Display_Containers. [This description is adopted from 'OpenCAGE.GUI.Displays.Object_Displays.Object_Display'.]

public Take( OpenCAGE.GUI.Displays.Object_Displays.Object_Visitor Visitor);

see Visitor Pattern [This description is adopted from 'OpenCAGE.GUI.Displays.Object_Displays.Object_Display'.]

public Graphics.Area_Sizes.Area_Size Get_Size(void);

returns the size of the object [This description is adopted from 'OpenCAGE.GUI.Displays.Object_Displays.Object_Display'.]

public Graphics.Area_Sizes.Area_Size Get_Half_Size(void);

returns the size/2 of the object [This description is adopted from 'OpenCAGE.GUI.Displays.Object_Displays.Object_Display'.]

public Set_Node_Display( OpenCAGE.GUI.Displays.Node_Displays.Node_Display Node);

If Start_Node hasn't been set, the given node is set as start node. If Start_Node has already been set, but End_Node hasn't, the given node is set as End_Node. Otherwise, nothing is done.

public Update_Drawable(void);

Self.Drawable := both Start_Node and End_Node are not null

Class Model_Observer

extends OpenCAGE.GIF.Edge_Model_Observer

Attributes

private OpenCAGE.GUI.Displays.Edge_Displays.Edge_Display Edge 

holds a pointer to the edge display to notify

Operations

public Destroying( OpenCAGE.GIF.Edge_Model Edge);

Is called by the observerd edge, when it is asked to destroy itself. [This description is adopted from 'OpenCAGE.GIF.Edge_Model_Observer'.]

public Changed( OpenCAGE.GIF.Edge_Model Edge);

Is called by the observed edge when it has changed. [This description is adopted from 'OpenCAGE.GIF.Edge_Model_Observer'.]