Package g3.project.ui
Class MainController
- java.lang.Object
-
- g3.project.ui.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 voidaddCardButton(java.lang.String friendlyName, java.lang.String id)Add navigation button for specified card/page.voidaddTool(java.lang.String toolname, java.lang.String toolID, java.lang.String iconPath)Add tool to tool-list.voidclearCard(java.lang.String id)Clear the page/card.voidclearCardButtons()Remove all card nav buttons.voidconfigCard(java.util.Optional<SizeObj> size, java.util.Optional<javafx.scene.paint.Color> colour, java.lang.String id)Configure the page/card.voiddrawImage(java.lang.String id, java.lang.String path, java.lang.Boolean refreshCache)Show or update image on screen.javafx.scene.layout.PanegetPagePane()Return the Pane pagePane For testing.voidgracefulExit()Handle all the exit stuff.voidhandleTogEdit()Allows editing elements - FXML.voidinitialize()Initialise the main UI.voidmoveElement(java.lang.String id, LocObj loc)Moves the given element to the specified location.voidplayerSetControls(java.lang.String id, java.lang.Boolean shown)Show/hide player controls.voidplayerSetPlaying(java.lang.String id, java.lang.Boolean playing)Set play/pause on player.voidremove(java.lang.String id)Remove an element by ID.voidremove(javafx.scene.Node el)Remove an element.voidresizeElement(java.lang.String id, SizeObj size)Resize a Visual Element.voidsetCursorType(javafx.scene.Cursor cType)Set the cursor type.voidsetElementVisible(java.lang.String id, java.lang.Boolean visible)Show/Hide an element.voidsetElShadow(java.lang.String id, java.lang.Double radius)Set a basic shadow on an element.voidsetElVisualProps(java.lang.String id, VisualProps props)Set props on Visual Element.voidshowBlockingMessage(java.lang.String message)Show a blocking message to the user.voidshowConsole()Show the Python console.voidshowDocPicker()Shows a new-doc file picker, then loads selected doc.voidshowNonBlockingMessage(java.lang.String message)Show a non-blocking message to the user.voidshowPlayable(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.voidshowSavePicker()Shows a document save window, then saves the doc.voidtoggleBubble(java.lang.Boolean bubble)Toggle if events are consumed at the source.voidtoggleEditable(java.lang.Boolean editable)Allows editing elements.voidtogglePlayerPlaying(java.lang.String id, java.lang.Boolean play)Make a player play/pause.voidupdatePropsList(javafx.scene.Node node)Update the list of properties.voidupdateShape(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.voidupdateShapeColour(java.lang.String id, javafx.scene.paint.Color col)Change a shape's colour.voidupdateShapeStroke(java.lang.String id, StrokeProps props)Change Shape stroke.voidupdateShapeText(java.lang.String id, java.util.ArrayList<StyledTextSeg> text)Update the text on a shape.
-
-
-
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 sizecolour- Page colourid- 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.
-
-