Struct pn_editor_core::Editor
source · [−]pub struct Editor { /* private fields */ }
Expand description
This represents the editor you want to use to edit and display petri nets.
Implementations
sourceimpl Editor
impl Editor
sourcepub fn copy_selected(&mut self)
pub fn copy_selected(&mut self)
Copy selected elements to clipboard.
sourcepub fn cut_selected(&mut self)
pub fn cut_selected(&mut self)
Cut selected elements to clipboard.
sourceimpl Editor
impl Editor
sourcepub fn save_progress(&mut self, force_path: bool)
pub fn save_progress(&mut self, force_path: bool)
Saves the current progress of a simulation.
sourcepub fn load_progress(&mut self)
pub fn load_progress(&mut self)
Loads the some progress for the simulation.
sourceimpl Editor
impl Editor
sourcepub fn grab(&mut self, primary: bool, clear_old: bool, create: bool)
pub fn grab(&mut self, primary: bool, clear_old: bool, create: bool)
Grab something.
primary
: specifies if the primary button is pressed.clear_old
: specifies if old selections should be deselected.create
: creates new nodes.
sourcepub fn release(
&mut self,
primary: bool,
allow_more: bool,
clear_old: bool,
select_new: bool
)
pub fn release(
&mut self,
primary: bool,
allow_more: bool,
clear_old: bool,
select_new: bool
)
Release something.
sourcepub fn set_cursor(&mut self, x: f32, y: f32)
pub fn set_cursor(&mut self, x: f32, y: f32)
Set cursor position.
sourceimpl Editor
impl Editor
sourcepub fn text_input(&mut self, character: char, skip: bool)
pub fn text_input(&mut self, character: char, skip: bool)
Input text.
sourcepub fn finish(&mut self, clear_old: bool, skip: bool)
pub fn finish(&mut self, clear_old: bool, skip: bool)
Finish the current action. Basically the user presses the enter key.
sourcepub fn move_text_cursor(&mut self, forward: bool, skip: bool)
pub fn move_text_cursor(&mut self, forward: bool, skip: bool)
Move the text cursor in line.
sourcepub fn move_text_cursor_border(&mut self, end: bool, all_lines: bool)
pub fn move_text_cursor_border(&mut self, end: bool, all_lines: bool)
Move the text to the start or end of line or file.
sourceimpl Editor
impl Editor
sourcepub fn switch_mode(&mut self)
pub fn switch_mode(&mut self)
Switches simulation mode.
sourcepub fn start_nodes(&mut self)
pub fn start_nodes(&mut self)
Adds a token to nodes if they are places.
sourcepub fn remove_nodes(&mut self)
pub fn remove_nodes(&mut self)
Removes all selected nodes.
sourcepub fn toggle_snapping(&mut self)
pub fn toggle_snapping(&mut self)
Toggles snapping.
sourcepub fn toggle_editor(&mut self)
pub fn toggle_editor(&mut self)
Toggles the editor.
sourcepub fn start_search_mode(&mut self)
pub fn start_search_mode(&mut self)
Enables the search bar.
sourcepub fn set_view_mode(&mut self, view_mode: ViewMode)
pub fn set_view_mode(&mut self, view_mode: ViewMode)
Changes the view mode.
See ViewMode
for more information about the view modes.
sourcepub fn zoom(&mut self, factor: f32, zoom_scale: bool, zoom_distance: bool)
pub fn zoom(&mut self, factor: f32, zoom_scale: bool, zoom_distance: bool)
Zoom in or out by a factor.
sourcepub fn ensure_saved(&mut self, state_only: bool) -> bool
pub fn ensure_saved(&mut self, state_only: bool) -> bool
Ensure the net be saved.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Editor
impl !Send for Editor
impl !Sync for Editor
impl Unpin for Editor
impl !UnwindSafe for Editor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.