Methods
|
|
|
|
__init__
|
__init__ (
self,
master=None,
file_name={},
**kw,
)
|
|
add_bindings
|
add_bindings ( self, active_names=() )
|
|
add_molecule
|
add_molecule ( self, mol )
|
|
add_object_from_package
|
add_object_from_package ( self, package )
|
|
align_selected
|
align_selected ( self, mode )
aligns selected items according to mode - t=top, b=bottom,
l=left, r=right, h=horizontal center, v=vertical center
|
|
any_color_to_rgb_string
|
any_color_to_rgb_string ( self, color )
|
|
apply_current_standard
|
apply_current_standard (
self,
objects=[],
old_standard=None,
template_mode=0,
)
if no objects are given all are used, if old_standard is given only the values
that have changed are applied; in template mode no changes of paper format are made
|
|
arrows_to_update
|
arrows_to_update ( self )
|
|
atoms_to_update
|
atoms_to_update ( self )
|
|
before_undo_record
|
before_undo_record ( self )
this method is place where periodical checks and other things that should be done before
undo is recorded should be done
|
|
bonds_to_update
|
bonds_to_update ( self, exclude_selected_bonds=True )
|
|
check_chemistry_of_selected
|
check_chemistry_of_selected ( self )
|
|
clean_paper
|
clean_paper ( self )
removes all items from paper and deletes them from molecules and items
|
|
clean_selected
|
clean_selected ( self )
cleans the geomerty of all selected molecules, the position of atoms that are selected will not be changed.
The selection must define a continuos subgraph of the molecule(s) otherwise the coords generation would not be possible,
at least two atoms (one bond) must be selected for the program to give some meaningfull result
|
|
config_selected
|
config_selected ( self )
|
|
create_background
|
create_background ( self )
|
|
create_window_name
|
create_window_name ( name_dict )
|
|
del_container
|
del_container ( self, container )
|
|
delete_selected
|
delete_selected ( self )
|
|
display_info_on_selected
|
display_info_on_selected ( self )
|
|
display_weight_of_selected
|
display_weight_of_selected ( self )
|
|
enter_item
|
enter_item ( self, event )
|
|
expand_groups
|
expand_groups ( self, selected=1 )
expands groups, if selected==1 only for selected, otherwise for all
|
|
fix_current_cropping_bbox
|
fix_current_cropping_bbox ( self )
|
|
flush_first_selected_mol_to_graph_file
|
flush_first_selected_mol_to_graph_file ( self )
|
|
get_base_name
|
get_base_name ( self )
|
|
get_cropping_bbox
|
get_cropping_bbox ( self )
|
|
get_package
|
get_package ( self )
|
|
get_paper_property
|
get_paper_property ( self, name )
|
|
get_personal_standard
|
get_personal_standard ( self )
|
|
handle_overlap
|
handle_overlap ( self )
puts overlaping molecules together to one and then calles handle_overlap(a1, a2) for that molecule
|
|
id_to_object
|
id_to_object ( self, id )
|
|
is_registered_id
|
is_registered_id ( self, id )
|
|
is_registered_object
|
is_registered_object ( self, o )
has this object a registered id?
|
|
key_pressed
|
key_pressed ( self, event )
|
|
key_released
|
key_released ( self, event )
|
|
leave_item
|
leave_item ( self, event )
|
|
lift_selected_to_top
|
lift_selected_to_top ( self )
|
|
list_bbox
|
list_bbox ( self, items )
extension of Canvas.bbox to provide support for lists of items
|
|
lower_selected_to_bottom
|
lower_selected_to_bottom ( self )
|
|
mrproper
|
mrproper ( self )
|
|
new_arrow
|
new_arrow (
self,
points=[],
spline=0,
)
|
|
new_circle
|
new_circle ( self, coords )
|
|
new_molecule
|
new_molecule ( self )
|
|
new_oval
|
new_oval ( self, coords )
|
|
new_plus
|
new_plus (
self,
x,
y,
)
|
|
new_polygon
|
new_polygon ( self, coords )
|
|
new_polyline
|
new_polyline ( self, coords )
|
|
new_rect
|
new_rect ( self, coords )
|
|
new_square
|
new_square ( self, coords )
|
|
new_text
|
new_text (
self,
x,
y,
text='',
)
|
|
object_to_id
|
object_to_id ( self, obj )
|
|
onread_id_sandbox_activate
|
onread_id_sandbox_activate ( self )
For reading we provide a new, clean id_manager as a sandbox to prevent
clashes between ids that might be already on the paper and ids that are in the file.
This is especialy needed for copying and template addition (although this is done somewhere else)
|
|
onread_id_sandbox_finish
|
onread_id_sandbox_finish ( self, apply_to=None )
|
|
paste_clipboard
|
paste_clipboard ( self, xy )
pastes items from clipboard to position xy
|
|
read_package
|
read_package (
self,
CDML,
draw=True,
)
|
|
read_standard_from_dom
|
read_standard_from_dom ( self, d )
|
|
real_to_screen_coords
|
real_to_screen_coords ( self, coords )
transforms set of x,y coordinates to screen coordinates, input list must have even length
Exceptions
|
|
ValueError, "only even number of coordinates could be transformed"
|
|
|
real_to_screen_ratio
|
real_to_screen_ratio ( self )
|
|
redo
|
redo ( self )
|
|
register_id
|
register_id (
self,
id,
object,
)
|
|
remove_bindings
|
remove_bindings ( self, ids=() )
|
|
save_personal_standard
|
save_personal_standard ( self, st )
|
|
scale_object
|
scale_object (
self,
o,
tr,
ratio,
scale_font=1,
)
scale_font now also refers to scaling of marks
|
|
scale_selected
|
scale_selected (
self,
ratio_x,
ratio_y,
scale_font=1,
fix_centers=0,
)
|
|
screen_to_real_coords
|
screen_to_real_coords ( self, coords )
transforms set of x,y coordinates to real coordinates, input list must have even length
Exceptions
|
|
ValueError, "only even number of coordinates could be transformed"
|
|
|
screen_to_real_ratio
|
screen_to_real_ratio ( self )
|
|
select
|
select ( self, items )
adds an object to the list of other selected objects and calls their select() method
|
|
select_all
|
select_all ( self )
|
|
selected_to_clipboard
|
selected_to_clipboard (
self,
delete_afterwards=0,
strict=0,
)
strict means that only what is selected is copied, not the whole molecule
|
|
selected_to_real_clipboard_as_SVG
|
selected_to_real_clipboard_as_SVG ( self )
exports selected top_levels as SVG to system clipboard
|
|
selected_to_unique_top_levels
|
selected_to_unique_top_levels ( self )
maps all items in self.selected to their top_levels (atoms->molecule etc.),
filters them to be unique and returns tuple of (unique_top_levels, unique)
where unique is true when there was only one item from each container
|
|
set_bindings
|
set_bindings ( self )
|
|
set_cropping_bbox
|
set_cropping_bbox ( self, coords )
|
|
set_default_paper_properties
|
set_default_paper_properties ( self )
|
|
set_name_to_selected
|
set_name_to_selected (
self,
name,
interpret=1,
)
sets name to all selected atoms and texts,
also records it in an undo !!!
|
|
set_paper_properties
|
set_paper_properties (
self,
type=None,
orientation=None,
x=None,
y=None,
crop_svg=None,
all=None,
crop_margin=None,
use_real_minus=None,
replace_minus=None,
)
|
|
set_viewport
|
set_viewport ( self, view=( 0, 0, 640, 480 ) )
|
|
start_new_undo_record
|
start_new_undo_record ( self, name='' )
|
|
swap_selected_on_stack
|
swap_selected_on_stack ( self )
|
|
swap_sides_of_selected
|
swap_sides_of_selected ( self, mode="vertical" )
mirrors the selected things, vertical uses y-axis as a mirror plane,
horizontal x-axis
|
|
take_focus
|
take_focus ( self, event )
|
|
toggle_center_for_selected
|
toggle_center_for_selected ( self )
|
|
undo
|
undo ( self )
|
|
unregister_id
|
unregister_id ( self, id )
|
|
unselect
|
unselect ( self, items )
reverse of select()
|
|
unselect_all
|
unselect_all ( self )
|