indexing
description: "Abstraction for objects onto which graphical primitives may beapplied."
note: "When line style is dashed and line width is bigger than one,lines are not guaranteed to be dashed on all platforms.All drawing operations are performed in the currentforeground color unless otherwise stated. i.e. `clear_rectangle' uses the current background color."
status: "See notice at end of class"
keywords: "figure, primitive, drawing, line, point, ellipse"
date: "$Date$"
revision: "$Revision$"
deferred class interface
EV_DRAWABLE
feature
background_color: EV_COLOR
EV_COLORIZABLE
require EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure EV_COLORIZABLE
bridge_ok: Result.is_equal (implementation.background_color)
clip_area: EV_RECTANGLE
require
not_destroyed: not is_destroyed
ensure
bridge_ok: (Result = void) = (implementation.clip_area = void)
dashed_line_style: BOOLEAN
require
not_destroyed: not is_destroyed
ensure
bridge_ok: Result = implementation.dashed_line_style
data: ANY
EV_ANY
drawing_mode: INTEGER
require
not_destroyed: not is_destroyed
ensure
bridge_ok: Result = implementation.drawing_mode
font: EV_FONT
Current
EV_FONTABLE
require EV_FONTABLE
not_destroyed: not is_destroyed
ensure EV_FONTABLE
not_void: Result /= void
bridge_ok: Result.is_equal (implementation.font)
foreground_color: EV_COLOR
EV_COLORIZABLE
require EV_COLORIZABLE
not_destroyed: not is_destroyed
ensure EV_COLORIZABLE
bridge_ok: Result.is_equal (implementation.foreground_color)
line_width: INTEGER
require
not_destroyed: not is_destroyed
ensure
bridge_ok: Result = implementation.line_width
tile: EV_PIXMAP
foreground_color
require
not_destroyed: not is_destroyed
ensure
bridge_ok: (Result = void) = (implementation.tile = void)
feature
height: INTEGER
require
not_destroyed: not is_destroyed
width: INTEGER
require
not_destroyed: not is_destroyed
feature
set_default_colors
EV_COLORIZABLE
require EV_COLORIZABLE
not_destroyed: not is_destroyed
feature
disable_dashed_line_style
require
not_destroyed: not is_destroyed
ensure
dashed_line_style_disabled: not dashed_line_style
enable_dashed_line_style
require
not_destroyed: not is_destroyed
ensure
dashed_line_style_enabled: dashed_line_style
remove_clip_area
require
not_destroyed: not is_destroyed
ensure
clip_area_void: clip_area = void
remove_tile
require
not_destroyed: not is_destroyed
ensure
tile_void: tile = void
set_background_color (a_color: like background_color)
a_colorforeground_color
EV_COLORIZABLE
require EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure EV_COLORIZABLE
background_color_assigned: background_color.is_equal (a_color)
set_clip_area (an_area: EV_RECTANGLE)
require
not_destroyed: not is_destroyed
an_area_not_void: an_area /= void
ensure
clip_area_assigned: clip_area.is_equal (an_area)
set_data (some_data: like data)
some_datadata
EV_ANY
require EV_ANY
not_destroyed: not is_destroyed
ensure EV_ANY
data_assigned: data = some_data
set_drawing_mode (a_mode: INTEGER)
a_logical_mode
require
not_destroyed: not is_destroyed
a_mode_valid: valid_drawing_mode (a_mode)
ensure
drawing_mode_assigned: drawing_mode = a_mode
set_font (a_font: EV_FONT)
a_fontfont
EV_FONTABLE
require EV_FONTABLE
not_destroyed: not is_destroyed
a_font_not_void: a_font /= void
ensure EV_FONTABLE
font_assigned: font.is_equal (a_font)
set_foreground_color (a_color: like foreground_color)
a_colorforeground_color
EV_COLORIZABLE
require EV_COLORIZABLE
not_destroyed: not is_destroyed
a_color_not_void: a_color /= void
ensure EV_COLORIZABLE
foreground_color_assigned: foreground_color.is_equal (a_color)
set_line_width (a_width: INTEGER)
a_widthline_width
require
not_destroyed: not is_destroyed
a_width_positive_or_zero: a_width >= 0
ensure
line_width_assigned: line_width = a_width
set_tile (a_pixmap: EV_PIXMAP)
background_color
require
not_destroyed: not is_destroyed
a_pixmap_not_void: a_pixmap /= void
ensure
tile_assigned: tile /= void
feature
copy (other: like Current)
other
EV_ANY
require ANY
other_not_void: other /= void
type_identity: same_type (other)
ensure ANY
is_equal: is_equal (other)
feature
clear
Currentbackground_color
require
not_destroyed: not is_destroyed
clear_rectangle (x, y, a_width, a_height: INTEGER)
xy
a_widtha_heightbackground_color
require
not_destroyed: not is_destroyed
a_width_positive_or_zero: a_width >= 0
a_height_positive_or_zero: a_height >= 0
feature
destroy
Current
EV_ANY
ensure EV_ANY
is_destroyed: is_destroyed
feature
valid_drawing_mode (a_mode: INTEGER): BOOLEAN
a_mode
EV_DRAWABLE_CONSTANTS
feature
set_and_mode
drawing_mode
require
not_destroyed: not is_destroyed
ensure
drawing_mode_assigned: drawing_mode = drawing_mode_and
set_copy_mode
drawing_mode
require
not_destroyed: not is_destroyed
ensure
drawing_mode_assigned: drawing_mode = drawing_mode_copy
set_invert_mode
drawing_mode
require
not_destroyed: not is_destroyed
ensure
drawing_mode_assigned: drawing_mode = drawing_mode_invert
set_or_mode
drawing_mode
require
not_destroyed: not is_destroyed
ensure
drawing_mode_assigned: drawing_mode = drawing_mode_or
set_xor_mode
drawing_mode
require
not_destroyed: not is_destroyed
ensure
drawing_mode_assigned: drawing_mode = drawing_mode_xor
feature
draw_arc (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
xya_bounding_width
a_bounding_height
a_start_anglea_start_anglean_aperture
require
not_destroyed: not is_destroyed
a_bounding_width_positive_or_zero: a_bounding_width >= 0
a_bounding_height_positive_or_zero: a_bounding_width >= 0
draw_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
xya_bounding_width
a_bounding_height
require
not_destroyed: not is_destroyed
a_bounding_width_positive_or_zero: a_bounding_width >= 0
a_bounding_height_positive_or_zero: a_bounding_height >= 0
draw_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
xya_bounding_width
a_bounding_height
a_start_anglea_start_anglean_aperture
x
require
not_destroyed: not is_destroyed
a_bounding_width_positive_or_zero: a_bounding_width >= 0
a_bounding_height_positive_or_zero: a_bounding_height >= 0
draw_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP)
a_pixmapxy
require
not_destroyed: not is_destroyed
a_pixmap_not_void: a_pixmap /= void
draw_point (x, y: INTEGER)
xy
require
not_destroyed: not is_destroyed
draw_polyline (points: ARRAY [EV_COORDINATE]; is_closed: BOOLEAN)
pointsis_closed
points
require
not_destroyed: not is_destroyed
points_not_void: points /= void
draw_rectangle (x, y, a_width, a_height: INTEGER)
xy
a_widtha_height
require
not_destroyed: not is_destroyed
a_width_positive_or_zero: a_width >= 0
a_height_positive_or_zero: a_height >= 0
draw_segment (x1, y1, x2, y2: INTEGER)
x1y1x2y2
require
not_destroyed: not is_destroyed
draw_straight_line (x1, y1, x2, y2: INTEGER)
x1y1
x2y2
require
not_destroyed: not is_destroyed
draw_sub_pixmap (x, y: INTEGER; a_pixmap: EV_PIXMAP; area: EV_RECTANGLE)
areaa_pixmapxy
require
not_destroyed: not is_destroyed
a_pixmap_not_void: a_pixmap /= void
area_not_void: area /= void
draw_text (x, y: INTEGER; a_text: STRING)
a_textxyfont
require
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
draw_text_top_left (x, y: INTEGER; a_text: STRING)
a_textxyfont
require
not_destroyed: not is_destroyed
a_text_not_void: a_text /= void
feature
fill_ellipse (x, y, a_bounding_width, a_bounding_height: INTEGER)
xya_bounding_width
a_bounding_height
require
not_destroyed: not is_destroyed
a_bounding_width_positive_or_zero: a_bounding_width >= 0
a_bounding_height_positive_or_zero: a_bounding_height >= 0
fill_pie_slice (x, y, a_bounding_width, a_bounding_height: INTEGER; a_start_angle, an_aperture: REAL)
xya_bounding_width
a_bounding_height
a_start_anglea_start_anglean_aperture
x
require
not_destroyed: not is_destroyed
a_bounding_width_positive_or_zero: a_bounding_width >= 0
a_bounding_height_positive_or_zero: a_bounding_height >= 0
fill_polygon (points: ARRAY [EV_COORDINATE])
points
require
not_destroyed: not is_destroyed
points_not_void: points /= void
fill_rectangle (x, y, a_width, a_height: INTEGER)
xy
a_widtha_height
require
not_destroyed: not is_destroyed
a_width_positive_or_zero: a_width >= 0
a_height_positive_or_zero: a_height >= 0
feature
is_destroyed: BOOLEAN
Current
EV_ANY
ensure EV_ANY
bridge_ok: Result = implementation.is_destroyed
invariant
line_width_positive_or_zero: is_usable implies line_width >= 0
drawing_mode_valid: is_usable implies valid_drawing_mode (drawing_mode)
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= void and then implementation.interface = Current
default_create_called: default_create_called
EV_COLORIZABLE
background_color_not_void: is_usable implies background_color /= void
foreground_color_not_void: is_usable implies foreground_color /= void
end -- EV_DRAWABLE