Package g3.project.ui

Class MainController


  • public final class MainController
    extends java.lang.Object
    Author:
    Group 3
    • Constructor Summary

      Constructors 
      Constructor Description
      MainController()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCardButton​(java.lang.String friendlyName, java.lang.String id)
      Add navigation button for specified card/page.
      void addTool​(java.lang.String toolname, java.lang.String toolID, java.lang.String iconPath)
      Add tool to tool-list.
      void clearCard​(java.lang.String id)
      Clear the page/card.
      void clearCardButtons()
      Remove all card nav buttons.
      void configCard​(java.util.Optional<SizeObj> size, java.util.Optional<javafx.scene.paint.Color> colour, java.lang.String id)
      Configure the page/card.
      void drawImage​(java.lang.String id, java.lang.String path, java.lang.Boolean refreshCache)
      Show or update image on screen.
      javafx.scene.layout.Pane getPagePane()
      Return the Pane pagePane For testing.
      void gracefulExit()
      Handle all the exit stuff.
      void handleTogEdit()
      Allows editing elements - FXML.
      void initialize()
      Initialise the main UI.
      void moveElement​(java.lang.String id, LocObj loc)
      Moves the given element to the specified location.
      void playerSetControls​(java.lang.String id, java.lang.Boolean shown)
      Show/hide player controls.
      void playerSetPlaying​(java.lang.String id, java.lang.Boolean playing)
      Set play/pause on player.
      void remove​(java.lang.String id)
      Remove an element by ID.
      void remove​(javafx.scene.Node el)
      Remove an element.
      void resizeElement​(java.lang.String id, SizeObj size)
      Resize a Visual Element.
      void setCursorType​(javafx.scene.Cursor cType)
      Set the cursor type.
      void setElementVisible​(java.lang.String id, java.lang.Boolean visible)
      Show/Hide an element.
      void setElShadow​(java.lang.String id, java.lang.Double radius)
      Set a basic shadow on an element.
      void setElVisualProps​(java.lang.String id, VisualProps props)
      Set props on Visual Element.
      void showBlockingMessage​(java.lang.String message)
      Show a blocking message to the user.
      void showConsole()
      Show the Python console.
      void showDocPicker()
      Shows a new-doc file picker, then loads selected doc.
      void showNonBlockingMessage​(java.lang.String message)
      Show a non-blocking message to the user.
      void showPlayable​(java.lang.String id, java.lang.String path, java.lang.Boolean showPlayer, java.lang.Boolean loopPlay, java.lang.Boolean autoPlay, java.lang.Double seekOffset)
      Show some playable media.
      void showSavePicker()
      Shows a document save window, then saves the doc.
      void toggleBubble​(java.lang.Boolean bubble)
      Toggle if events are consumed at the source.
      void toggleEditable​(java.lang.Boolean editable)
      Allows editing elements.
      void togglePlayerPlaying​(java.lang.String id, java.lang.Boolean play)
      Make a player play/pause.
      void updatePropsList​(javafx.scene.Node node)
      Update the list of properties.
      void updateShape​(java.lang.String id, java.lang.String shapeType, StrokeProps stroke, java.util.ArrayList<StyledTextSeg> text, java.util.ArrayList<java.lang.Double> segments)
      Draw/Redraw shape on screen.
      void updateShapeColour​(java.lang.String id, javafx.scene.paint.Color col)
      Change a shape's colour.
      void updateShapeStroke​(java.lang.String id, StrokeProps props)
      Change Shape stroke.
      void updateShapeText​(java.lang.String id, java.util.ArrayList<StyledTextSeg> text)
      Update the text on a shape.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MainController

        public MainController()
    • Method Detail

      • showConsole

        public void showConsole()
        Show the Python console.
      • showDocPicker

        public void showDocPicker()
        Shows a new-doc file picker, then loads selected doc.
      • showSavePicker

        public void showSavePicker()
        Shows a document save window, then saves the doc.
      • gracefulExit

        public void gracefulExit()
        Handle all the exit stuff.
      • updateShape

        public void updateShape​(java.lang.String id,
                                java.lang.String shapeType,
                                StrokeProps stroke,
                                java.util.ArrayList<StyledTextSeg> text,
                                java.util.ArrayList<java.lang.Double> segments)
        Draw/Redraw shape on screen.
        Parameters:
        id - Shape ID.
        shapeType - Type of shape.
        stroke - Stroke properties.
        text - Text segments.
        segments - Segments for a line or polygon.
      • updateShapeStroke

        public void updateShapeStroke​(java.lang.String id,
                                      StrokeProps props)
        Change Shape stroke.
        Parameters:
        id - Shape ID.
        props - Stroke Props.
      • updateShapeColour

        public void updateShapeColour​(java.lang.String id,
                                      javafx.scene.paint.Color col)
        Change a shape's colour.
        Parameters:
        id - Target ID.
        col - colour.
      • updateShapeText

        public void updateShapeText​(java.lang.String id,
                                    java.util.ArrayList<StyledTextSeg> text)
        Update the text on a shape.
        Parameters:
        id - Shape ID.
        text - Text.
      • setElementVisible

        public void setElementVisible​(java.lang.String id,
                                      java.lang.Boolean visible)
        Show/Hide an element.
        Parameters:
        id - Target ID.
        visible - Visibility.
      • moveElement

        public void moveElement​(java.lang.String id,
                                LocObj loc)
        Moves the given element to the specified location.
        Parameters:
        id - Element ID.
        loc - Location to go to.
      • setElVisualProps

        public void setElVisualProps​(java.lang.String id,
                                     VisualProps props)
        Set props on Visual Element.
        Parameters:
        id - Element ID.
        props - Properties.
      • setElShadow

        public void setElShadow​(java.lang.String id,
                                java.lang.Double radius)
        Set a basic shadow on an element.
        Parameters:
        id - Target ID.
        radius - Shadow radius.
      • resizeElement

        public void resizeElement​(java.lang.String id,
                                  SizeObj size)
        Resize a Visual Element.
        Parameters:
        id - Element ID.
        size - Element Size.
      • remove

        public void remove​(java.lang.String id)
        Remove an element by ID.
        Parameters:
        id - ID of element to remove.
      • remove

        public void remove​(javafx.scene.Node el)
        Remove an element.
        Parameters:
        el - element.
      • setCursorType

        public void setCursorType​(javafx.scene.Cursor cType)
        Set the cursor type.
        Parameters:
        cType - Cursor.
      • configCard

        public void configCard​(java.util.Optional<SizeObj> size,
                               java.util.Optional<javafx.scene.paint.Color> colour,
                               java.lang.String id)
        Configure the page/card.
        Parameters:
        size - Page size
        colour - Page colour
        id - Page ID
      • clearCard

        public void clearCard​(java.lang.String id)
        Clear the page/card.
        Parameters:
        id - page to clear
      • addCardButton

        public void addCardButton​(java.lang.String friendlyName,
                                  java.lang.String id)
        Add navigation button for specified card/page.
        Parameters:
        friendlyName - Card human name.
        id - Card ID.
      • clearCardButtons

        public void clearCardButtons()
        Remove all card nav buttons.
      • addTool

        public void addTool​(java.lang.String toolname,
                            java.lang.String toolID,
                            java.lang.String iconPath)
        Add tool to tool-list.
        Parameters:
        toolname - Name of tool.
        toolID - Tool ID.
        iconPath - Path to tool icon.
      • updatePropsList

        public void updatePropsList​(javafx.scene.Node node)
        Update the list of properties.
        Parameters:
        node - Node to show props for.
      • showPlayable

        public void showPlayable​(java.lang.String id,
                                 java.lang.String path,
                                 java.lang.Boolean showPlayer,
                                 java.lang.Boolean loopPlay,
                                 java.lang.Boolean autoPlay,
                                 java.lang.Double seekOffset)
        Show some playable media.
        Parameters:
        id - media object ID.
        path - Path to media.
        showPlayer - Show player controls.
        loopPlay - Loop the media.
        autoPlay - Auto-play the media.
        seekOffset - Start seek offset.
      • playerSetPlaying

        public void playerSetPlaying​(java.lang.String id,
                                     java.lang.Boolean playing)
        Set play/pause on player.
        Parameters:
        id - Player.
        playing - Play/Pause.
      • playerSetControls

        public void playerSetControls​(java.lang.String id,
                                      java.lang.Boolean shown)
        Show/hide player controls.
        Parameters:
        id - Player.
        shown - Show controls?
      • togglePlayerPlaying

        public void togglePlayerPlaying​(java.lang.String id,
                                        java.lang.Boolean play)
        Make a player play/pause.
        Parameters:
        id - Player ID.
        play - Play/Pause.
      • drawImage

        public void drawImage​(java.lang.String id,
                              java.lang.String path,
                              java.lang.Boolean refreshCache)
        Show or update image on screen. The image will be cached based on its' path.
        Parameters:
        id - Image ID.
        path - Image Path/URL/URI.
        refreshCache - Should I refresh the cache?
      • showNonBlockingMessage

        public void showNonBlockingMessage​(java.lang.String message)
        Show a non-blocking message to the user.
        Parameters:
        message - message to show.
      • showBlockingMessage

        public void showBlockingMessage​(java.lang.String message)
        Show a blocking message to the user.
        Parameters:
        message - message to show.
      • handleTogEdit

        public void handleTogEdit()
        Allows editing elements - FXML.
      • toggleEditable

        public void toggleEditable​(java.lang.Boolean editable)
        Allows editing elements.
        Parameters:
        editable - Is editable?
      • toggleBubble

        public void toggleBubble​(java.lang.Boolean bubble)
        Toggle if events are consumed at the source.
        Parameters:
        bubble - Bubble events?
      • initialize

        public void initialize()
        Initialise the main UI.
      • getPagePane

        public javafx.scene.layout.Pane getPagePane()
        Return the Pane pagePane For testing.
        Returns:
        Pane containing all elements.