Class MainView

java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.layout.Pane
javafx.scene.layout.StackPane
io.github.jbastgen.stemma.app.ui.MainView
All Implemented Interfaces:
Host, javafx.css.Styleable, javafx.event.EventTarget

public final class MainView extends javafx.scene.layout.StackPane implements Host
Application shell: tab strip, library or repository view, status bar, dialogs and toasts. Repositories opened from disk are loaded through RepositoryService; the library also holds sample repositories (demo data of the design prototype).
  • Property Summary

    Properties inherited from class javafx.scene.layout.StackPane

    alignment

    Properties inherited from class javafx.scene.layout.Region

    background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width

    Properties inherited from class javafx.scene.Parent

    needsLayout

    Properties inherited from class javafx.scene.Node

    accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, focusVisible, focusWithin, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from class javafx.scene.layout.Region

    USE_COMPUTED_SIZE, USE_PREF_SIZE

    Fields inherited from class javafx.scene.Node

    BASELINE_OFFSET_SAME_AS_HEIGHT
  • Constructor Summary

    Constructors
    Constructor
    Description
    MainView(javafx.stage.Stage stage, RepositoryService service, BackendManager backends, SettingsStore settingsStore, AppSettings appSettings, LibraryStore libraryStore, CredentialService credentials, Path askpass, boolean demo)
    Creates the window content and loads the library: the repositories of the library file, or the demo repositories when demo is set.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    The dialog that creates a new repository.
    ai()
    The connection to AI services (switched off unless the settings say otherwise).
    void
    aiBusy(boolean on)
    An AI command starts (true) or ends (false): the window shows a spinner while at least one runs (feature 30).
    The global settings as last saved.
    The pictures of the authors (feature 59); none by default, so a host without them shows the initials.
    void
    bindTheme(javafx.scene.Scene scene)
    Gives the window its scene: the theme is applied to it, and what went wrong with a branding file is shown.
    void
    Closes the dialog shown with Host.showDialog(javafx.scene.layout.Region).
    The accounts and their secrets.
    The commit labels.
    The repositories of the library.
    void
    A real repository was reloaded: the library entry (branch, changes, ahead/behind) may have changed.
    static javafx.scene.image.ImageView
    logo(double size)
    The logo as an image of the given size.
    The logos of the projects (feature 61); none by default.
    void
    open(Path directory)
    Opens a repository from disk.
    void
    Keeps the size of the window for the next start (feature 62); an unknown size leaves what was kept.
    The Git service all real repositories are used through.
    The look settings; the changes of them go to the window.
    void
    showDialog(javafx.scene.layout.Region overlay)
    Shows a larger dialog (settings) over the window.
    void
    At the first start: remembers that the welcome was shown (so closing the dialog in any way is enough) and opens it.
    void
    Shows a form dialog over the window.
    void
    showNotice(String message)
    Shows a warning, e.g. when the configured backend could not be used at startup.
    void
    Called when the state of a repository changed in a way that affects the status bar.
    Describes commits with AI; remembers the answers.
    The active colour theme (needed by popups, which have their own scene).
    void
    toast(String text, Tone tone)
    Shows a short message that goes away by itself.
    void
    toast(String text, Tone tone, String action, Runnable onAction)
    A toast with one button, e.g.
    The user mapping (feature 26); an empty one when the feature is off.
    void
    The user mapping file was changed: load it again and redraw.
    static Path
    The file of the user mapping.
    void
    A look or layout setting changed (e.g. a panel was resized): save it.
    static String
    windowTitle(String repositoryName)
    The window title: the application and its version, and the name of the repository that is selected.
    static String
    windowTitle(String repositoryName, String company)
    The window title with the company name after the name (feature 16), when it is given.
    void
    Runs action (an operation that talks to a remote) once the stored credentials can be used: if they are locked, the user is asked for the master password first.

    Methods inherited from class javafx.scene.layout.StackPane

    alignmentProperty, clearConstraints, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getAlignment, getAlignment, getClassCssMetaData, getContentBias, getCssMetaData, getMargin, layoutChildren, requestLayout, setAlignment, setAlignment, setMargin

    Methods inherited from class javafx.scene.layout.Pane

    getChildren

    Methods inherited from class javafx.scene.layout.Region

    backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty

    Methods inherited from class javafx.scene.Parent

    getBaselineOffset, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestParentLayout, setNeedsLayout, updateBounds

    Methods inherited from class javafx.scene.Node

    accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isFocusVisible, isFocusWithin, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.github.jbastgen.stemma.app.ui.Host

    openFile, openInBrowser, openInTerminal, runTool, showInFileManager

    Methods inherited from interface javafx.css.Styleable

    getStyleableNode
  • Field Details

  • Constructor Details

  • Method Details

    • bindTheme

      public void bindTheme(javafx.scene.Scene scene)
      Gives the window its scene: the theme is applied to it, and what went wrong with a branding file is shown.
    • showNotice

      public void showNotice(String message)
      Shows a warning, e.g. when the configured backend could not be used at startup.
    • open

      public void open(Path directory)
      Opens a repository from disk. Safe to call from the UI thread; the work runs in the background.
    • settings

      public ViewSettings settings()
      Description copied from interface: Host
      The look settings; the changes of them go to the window.
      Specified by:
      settings in interface Host
    • appSettings

      public AppSettings appSettings()
      Description copied from interface: Host
      The global settings as last saved.
      Specified by:
      appSettings in interface Host
    • avatars

      public Avatars avatars()
      Description copied from interface: Host
      The pictures of the authors (feature 59); none by default, so a host without them shows the initials.
      Specified by:
      avatars in interface Host
    • logos

      public ProjectLogos logos()
      Description copied from interface: Host
      The logos of the projects (feature 61); none by default.
      Specified by:
      logos in interface Host
    • library

      public List<LibraryEntry> library()
      The repositories of the library.
    • toast

      public void toast(String text, Tone tone)
      Description copied from interface: Host
      Shows a short message that goes away by itself.
      Specified by:
      toast in interface Host
    • toast

      public void toast(String text, Tone tone, String action, Runnable onAction)
      Description copied from interface: Host
      A toast with one button, e.g. Undo; it stays a little longer. A host that cannot show buttons shows the text only.
      Specified by:
      toast in interface Host
    • showModal

      public void showModal(ModalSpec spec)
      Description copied from interface: Host
      Shows a form dialog over the window.
      Specified by:
      showModal in interface Host
    • showDialog

      public void showDialog(javafx.scene.layout.Region overlay)
      Description copied from interface: Host
      Shows a larger dialog (settings) over the window.
      Specified by:
      showDialog in interface Host
    • closeDialog

      public void closeDialog()
      Description copied from interface: Host
      Closes the dialog shown with Host.showDialog(javafx.scene.layout.Region).
      Specified by:
      closeDialog in interface Host
    • statusChanged

      public void statusChanged()
      Description copied from interface: Host
      Called when the state of a repository changed in a way that affects the status bar.
      Specified by:
      statusChanged in interface Host
    • service

      public RepositoryService service()
      Description copied from interface: Host
      The Git service all real repositories are used through.
      Specified by:
      service in interface Host
    • viewSettingsChanged

      public void viewSettingsChanged()
      Description copied from interface: Host
      A look or layout setting changed (e.g. a panel was resized): save it.
      Specified by:
      viewSettingsChanged in interface Host
    • libraryEntryChanged

      public void libraryEntryChanged(LibraryEntry updated)
      Description copied from interface: Host
      A real repository was reloaded: the library entry (branch, changes, ahead/behind) may have changed.
      Specified by:
      libraryEntryChanged in interface Host
    • theme

      public Theme theme()
      Description copied from interface: Host
      The active colour theme (needed by popups, which have their own scene).
      Specified by:
      theme in interface Host
    • actCreate

      public void actCreate()
      The dialog that creates a new repository.
    • rememberWindowSize

      public void rememberWindowSize(WindowSizing.Size size)
      Keeps the size of the window for the next start (feature 62); an unknown size leaves what was kept.
    • showFirstStart

      public void showFirstStart()
      At the first start: remembers that the welcome was shown (so closing the dialog in any way is enough) and opens it. Does nothing at later starts.
    • credentials

      public CredentialService credentials()
      Description copied from interface: Host
      The accounts and their secrets.
      Specified by:
      credentials in interface Host
    • labels

      public LabelService labels()
      Description copied from interface: Host
      The commit labels.
      Specified by:
      labels in interface Host
    • usersFile

      public static Path usersFile(AppSettings s)
      The file of the user mapping.
    • users

      public UserBook users()
      Description copied from interface: Host
      The user mapping (feature 26); an empty one when the feature is off.
      Specified by:
      users in interface Host
    • usersChanged

      public void usersChanged()
      Description copied from interface: Host
      The user mapping file was changed: load it again and redraw.
      Specified by:
      usersChanged in interface Host
    • ai

      public AiService ai()
      Description copied from interface: Host
      The connection to AI services (switched off unless the settings say otherwise).
      Specified by:
      ai in interface Host
    • summarizer

      public CommitSummarizer summarizer()
      Description copied from interface: Host
      Describes commits with AI; remembers the answers.
      Specified by:
      summarizer in interface Host
    • withCredentials

      public void withCredentials(Runnable action)
      Description copied from interface: Host
      Runs action (an operation that talks to a remote) once the stored credentials can be used: if they are locked, the user is asked for the master password first. If they decline, the action runs anyway: SSH agents and credential helpers may still work.
      Specified by:
      withCredentials in interface Host
    • aiBusy

      public void aiBusy(boolean on)
      Description copied from interface: Host
      An AI command starts (true) or ends (false): the window shows a spinner while at least one runs (feature 30). Calls come in pairs from the UI thread.
      Specified by:
      aiBusy in interface Host
    • windowTitle

      public static String windowTitle(String repositoryName)
      The window title: the application and its version, and the name of the repository that is selected.
    • windowTitle

      public static String windowTitle(String repositoryName, String company)
      The window title with the company name after the name (feature 16), when it is given.
    • logo

      public static javafx.scene.image.ImageView logo(double size)
      The logo as an image of the given size.