------------------------------------------------------------------ -- -- NAME: SET_INDIVIDUAL_ATTRIBUTES - BODY -- DISCREPANCY REPORTS: -- ------------------------------------------------------------------ -- file: set_indv_attr_ma_b.ada -- level: all levels with WSM; with CGI_SUBTYPES_A; with ERROR_HANDLING; with GKS_OPERATING_STATE_LIST; with GKS_ERRORS; with GKS_STATE_LIST; with GKS_ERROR_STATE_LIST; use WSM; use CGI_SUBTYPES_A; use GKS_OPERATING_STATE_LIST; use GKS_ERRORS; use GKS_ERROR_STATE_LIST; package body SET_INDIVIDUAL_ATTRIBUTES_MA is -- This is the package body for setting individual attributes. -- -- All of the procedures in this package first inquire the -- GKS_OPERATING_STATE_LIST to check if GKS is in one of -- the states GKOP, WSOP, WSAC, or SGOP. If it is not, error -- 8 occurs and the procedure ERROR_HANDLING is called. -- No error indicators above 0 are expected from the -- workstation manager for these procedures. -- -- If error indicator 8 occurs, these procedures call the -- ERROR_HANDLING procedure with the error indicator and -- the name of the procedure. procedure SET_LINETYPE (TYPE_OF_LINE : in LINETYPE) is -- This procedure sets the value of the current linetype in the -- GKS_STATE_LIST and then sends the value to the WS_MANAGER. -- -- TYPE_OF_LINE - Indicates the line style to be used for subsequent -- polylines. GKS_INSTR : CGI_SET_LINETYPE; begin -- Check the GKS_ERROR_STATE_LIST to see that the ERROR_STATE -- is not ON before continuing. if GKS_ERROR_STATE_LIST.ERROR_STATE = ON then return; end if; -- The following if inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (NOT_GKOP_WSOP_WSAC_SGOP, "SET_LINETYPE"); -- Error 8 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; elsif TYPE_OF_LINE = 0 then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (LINETYPE_IS_ZERO,"SET_LINETYPE"); -- Error 63 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else GKS_STATE_LIST.CURRENT_LINETYPE := TYPE_OF_LINE; -- Call to WS_MANAGER with the new line type. GKS_INSTR.LINETYPE_SET := TYPE_OF_LINE; WS_MANAGER (GKS_INSTR); end if; exception when GKS_ERROR => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; when OTHERS => begin GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (UNKNOWN, "SET_LINETYPE"); -- Error 2501 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_LINETYPE; procedure SET_POLYLINE_COLOUR_INDEX (LINE_COLOUR : in COLOUR_INDEX) is -- This procedure sets the value of the current polyline colour -- index GKS_STATE_LIST and then sends the value to the WS_MANAGER. -- -- LINE_COLOUR - Indicates the colour to be used for subsequent polylines. GKS_INSTR : CGI_SET_POLYLINE_COLOUR_INDEX; begin -- Check the GKS_ERROR_STATE_LIST to see that the ERROR_STATE -- is not ON before continuing. if GKS_ERROR_STATE_LIST.ERROR_STATE = ON then return; end if; -- The following if inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (NOT_GKOP_WSOP_WSAC_SGOP, "SET_POLYLINE_COLOUR_INDEX"); -- Error 8 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else GKS_STATE_LIST.CURRENT_POLYLINE_COLOUR_INDEX := LINE_COLOUR; -- Call to WS_MANAGER with the new line colour. GKS_INSTR.POLYLINE_COLOUR_INDEX_SET := LINE_COLOUR; WS_MANAGER (GKS_INSTR); end if; exception when GKS_ERROR => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; when OTHERS => begin GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (UNKNOWN,"SET_POLYLINE_COLOUR_INDEX"); -- Error 2501 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_POLYLINE_COLOUR_INDEX; procedure SET_MARKER_TYPE (TYPE_OF_MARKER : in MARKER_TYPE) is -- This procedure sets the value of the current marker type in -- the GKS_STATE_LIST and then sends the value to the WS_MANAGER. -- -- TYPE_OF_MARKER - Indicates the marker style to be used for subsequent -- polymarkers. GKS_INSTR : CGI_SET_MARKER_TYPE; begin -- Check the GKS_ERROR_STATE_LIST to see that the ERROR_STATE -- is not ON before continuing. if GKS_ERROR_STATE_LIST.ERROR_STATE = ON then return; end if; -- The following if inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (NOT_GKOP_WSOP_WSAC_SGOP,"SET_MARKER_TYPE"); -- Error 8 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; elsif TYPE_OF_MARKER = 0 then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (MARKER_TYPE_IS_ZERO,"SET_MARKER_TYPE");-- Error 69 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else GKS_STATE_LIST.CURRENT_MARKER_TYPE := TYPE_OF_MARKER; -- Call to WS_MANAGER with the new marker type. GKS_INSTR.MARKER_TYPE_SET := TYPE_OF_MARKER; WS_MANAGER (GKS_INSTR); end if; exception when GKS_ERROR => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; when OTHERS => begin GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (UNKNOWN, "SET_MARKER_TYPE"); -- Error 2501 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_MARKER_TYPE; procedure SET_POLYMARKER_COLOUR_INDEX (MARKER_COLOUR : in COLOUR_INDEX) is -- This procedure sets the value of the current polymarker -- colour index in the GKS_STATE_LIST and then sends the -- value to the WS_MANAGER. -- -- MARKER_COLOUR - Indicates the colour to be used for subsequent -- polymarkers. GKS_INSTR : CGI_SET_POLYMARKER_COLOUR_INDEX; begin -- Check the GKS_ERROR_STATE_LIST to see that the ERROR_STATE -- is not ON before continuing. if GKS_ERROR_STATE_LIST.ERROR_STATE = ON then return; end if; -- The following if inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (NOT_GKOP_WSOP_WSAC_SGOP, "SET_POLYMARKER_COLOUR_INDEX"); -- Error 8 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else GKS_STATE_LIST.CURRENT_POLYMARKER_COLOUR_INDEX := MARKER_COLOUR; -- Call to WS_MANAGER with the new marker colour. GKS_INSTR.POLYMARKER_COLOUR_INDEX_SET := MARKER_COLOUR; WS_MANAGER (GKS_INSTR); end if; exception when GKS_ERROR => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; when OTHERS => begin GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (UNKNOWN, "SET_POLYMARKER_COLOUR_INDEX"); -- Error 2501 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_POLYMARKER_COLOUR_INDEX; procedure SET_TEXT_COLOUR_INDEX (TEXT_COLOUR : in COLOUR_INDEX) is -- This procedure sets the value of the current text colour index -- in the GKS_STATE_LIST and then sends the value to the WS_MANAGER. -- -- TEXT_COLOUR - Indicates the colour of subsequent text primitives. GKS_INSTR : CGI_SET_TEXT_COLOUR_INDEX; begin -- Check the GKS_ERROR_STATE_LIST to see that the ERROR_STATE -- is not ON before continuing. if GKS_ERROR_STATE_LIST.ERROR_STATE = ON then return; end if; -- The following if inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (NOT_GKOP_WSOP_WSAC_SGOP, "SET_TEXT_COLOUR_INDEX"); -- Error 8 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else GKS_STATE_LIST.CURRENT_TEXT_COLOUR_INDEX := TEXT_COLOUR; -- Call to WS_MANAGER with the new text colour. GKS_INSTR.TEXT_COLOUR_INDEX_SET := TEXT_COLOUR; WS_MANAGER (GKS_INSTR); end if; exception when GKS_ERROR => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; when OTHERS => begin GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (UNKNOWN, "SET_TEXT_COLOUR_INDEX"); -- Error 2501 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_TEXT_COLOUR_INDEX; procedure SET_FILL_AREA_INTERIOR_STYLE (INTERIOR : in INTERIOR_STYLE) is -- This procedure sets the value of the current fill area interior -- style in the GKS_STATE_LIST and then sends the value to the -- WS_MANAGER. -- -- INTERIOR - Indicates the interior style to be used for fill area -- primitives. The values may be HOLLOW, SOLID, PATTERN, or -- HATCH. GKS_INSTR : CGI_SET_FILL_AREA_INTERIOR_STYLE; begin -- Check the GKS_ERROR_STATE_LIST to see that the ERROR_STATE -- is not ON before continuing. if GKS_ERROR_STATE_LIST.ERROR_STATE = ON then return; end if; -- The following if inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (NOT_GKOP_WSOP_WSAC_SGOP, "SET_FILL_AREA_INTERIOR_STYLE"); -- Error 8 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else GKS_STATE_LIST.CURRENT_FILL_AREA_INTERIOR_STYLE := INTERIOR; -- Call to WS_MANAGER with the new interior style. GKS_INSTR.FILL_AREA_INTERIOR_STYLE_SET := INTERIOR; WS_MANAGER (GKS_INSTR); end if; exception when GKS_ERROR => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; when OTHERS => begin GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (UNKNOWN, "SET_FILL_AREA_INTERIOR_STYLE"); -- Error 2501 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_FILL_AREA_INTERIOR_STYLE; procedure SET_FILL_AREA_COLOUR_INDEX (FILL_AREA_COLOUR : in COLOUR_INDEX) is -- This procedure sets the value of the current fill area colour -- index in the GKS_STATE_LIST and then sends the value to the -- WS_MANAGER. -- -- FILL_AREA_COLOUR - Indicates the colour to be used in subsequent -- fill area primitives. GKS_INSTR : CGI_SET_FILL_AREA_COLOUR_INDEX; begin -- Check the GKS_ERROR_STATE_LIST to see that the ERROR_STATE -- is not ON before continuing. if GKS_ERROR_STATE_LIST.ERROR_STATE = ON then return; end if; -- The following if inquires the GKS_OPERATING_STATE_LIST -- to see if GKS is in the proper state before proceeding. if CURRENT_OPERATING_STATE = GKCL then GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (NOT_GKOP_WSOP_WSAC_SGOP, "SET_FILL_AREA_COLOUR_INDEX"); -- Error 8 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; else GKS_STATE_LIST.CURRENT_FILL_AREA_COLOUR_INDEX := FILL_AREA_COLOUR; -- Call to WS_MANAGER with the new fill area colour. GKS_INSTR.FILL_AREA_COLOUR_INDEX_SET := FILL_AREA_COLOUR; WS_MANAGER (GKS_INSTR); end if; exception when GKS_ERROR => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; when OTHERS => begin GKS_ERROR_STATE_LIST.ERROR_STATE := ON; ERROR_HANDLING (UNKNOWN, "SET_FILL_AREA_COLOUR_INDEX"); -- Error 2501 GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; exception when OTHERS => GKS_ERROR_STATE_LIST.ERROR_STATE := OFF; raise; end; end SET_FILL_AREA_COLOUR_INDEX; end SET_INDIVIDUAL_ATTRIBUTES_MA;