Struct pn_editor_core::Editor[][src]

pub struct Editor { /* fields omitted */ }

This represents the editor you want to use to edit and display petri nets.

Implementations

impl Editor[src]

pub fn switch_mode(&mut self)[src]

Switches simulation mode.

pub fn start_nodes(&mut self)[src]

Adds a token to nodes if they are places.

pub fn remove_nodes(&mut self)[src]

Removes all selected nodes.

pub fn resize(&mut self, width: u32, height: u32)[src]

Should be called when the window is resized.

pub fn cycle(&mut self, forward: bool)[src]

Cycle through states.

pub fn add_state(&mut self)[src]

Adds a new simulation state.

pub fn toggle_snapping(&mut self)[src]

Toggles snapping.

pub fn toggle_editor(&mut self)[src]

Toggles the editor.

pub fn start_search_mode(&mut self)[src]

Enables the search bar.

pub fn load_new(&mut self)[src]

Loads in an empty net.

pub fn copy_selected(&mut self)[src]

Copy selected elements to clipboard.

pub fn cut_selected(&mut self)[src]

Cut selected elements to clipboard.

pub fn paste(&mut self, clear_old: bool)[src]

Pastes contents from clipboard.

pub fn escape(&mut self)[src]

Escapes from submenus.

pub fn set_view_mode(&mut self, view_mode: ViewMode)[src]

Changes the view mode. See ViewMode for more information about the view modes.

pub fn text_input(&mut self, character: char, skip: bool)[src]

Input text.

pub fn finish(&mut self, clear_old: bool, skip: bool)[src]

Finish the current action. Basically the user presses the enter key.

pub fn zoom(&mut self, factor: f32, zoom_scale: bool, zoom_distance: bool)[src]

Zoom in or out by a factor.

pub fn release(
    &mut self,
    primary: bool,
    allow_more: bool,
    clear_old: bool,
    select_new: bool
)
[src]

Release something.

pub fn fire_node(&mut self, forward: bool)[src]

Fire node.

pub fn grab(&mut self, primary: bool, clear_old: bool, create: bool)[src]

Grab something.

  • primary: specifies if the primary button is pressed.
  • clear_old: specifies if old selections should be deselected.
  • create: creates new nodes.

pub fn set_cursor(&mut self, x: f32, y: f32)[src]

Set cursor position.

pub fn save_progress(&mut self, force_path: bool)[src]

Saves the current progress of a simulation.

pub fn save(&mut self, force_path: bool)[src]

Saves the current net.

pub fn ensure_saved(&mut self, state_only: bool) -> bool[src]

Ensure the net be saved.

pub fn load_net(&mut self, path: String)[src]

Loads the net from a specified path.

pub fn load_progress(&mut self)[src]

Loads the some progress for the simulation.

pub fn load(&mut self, force_path: bool)[src]

Loads a new net.

pub fn move_text_cursor(&mut self, forward: bool, multiple: bool)[src]

Move the text cursor in line.

pub fn move_line(&mut self, down: bool)[src]

Move the text cursor by a line.

pub fn move_page(&mut self, down: bool)[src]

Move the text by a page.

pub fn move_text_cursor_border(&mut self, end: bool, all_lines: bool)[src]

Move the text to the start or end of line or file.

impl Editor[src]

pub fn new(width: u32, height: u32, node_settings: NodeSettings) -> Editor[src]

Creates a new editor, which contains a renderer and knows about the window size.

pub fn width(&self) -> u32[src]

Recieve the horizontal size of the editor.

pub fn height(&self) -> u32[src]

Recieve the vertical size of the editor.

Trait Implementations

impl<R: Renderer> Render<R> for Editor[src]

impl Update for Editor[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.