crleditor

package
v0.0.0-...-eb15970 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CrlWorkspaceManager

type CrlWorkspaceManager struct {
	// contains filtered or unexported fields
}

CrlWorkspaceManager manages Crl Workspaces

func NewCrlWorkspaceManager

func NewCrlWorkspaceManager(editor *Editor) *CrlWorkspaceManager

NewCrlWorkspaceManager returns a configured CrlWorkspaceManager

func (*CrlWorkspaceManager) ClearWorkspace

func (mgr *CrlWorkspaceManager) ClearWorkspace(workspacePath string, trans *core.Transaction) error

ClearWorkspace deletes all of the files in the workspace that correspond to uOfD root elements and removes the corresponding entry in workspaceFiles

func (*CrlWorkspaceManager) CloseWorkspace

func (mgr *CrlWorkspaceManager) CloseWorkspace(trans *core.Transaction) error

CloseWorkspace saves and closes all workspace files

func (*CrlWorkspaceManager) GetUofD

GetUofD returns the current UniverseOfDiscourse

func (*CrlWorkspaceManager) Initialize

func (mgr *CrlWorkspaceManager) Initialize()

Initialize initializes or re-initializes the workspace editor

func (*CrlWorkspaceManager) LoadSettings

func (mgr *CrlWorkspaceManager) LoadSettings(trans *core.Transaction) error

LoadSettings loads the settings saved in the workspace

func (*CrlWorkspaceManager) LoadUserPreferences

func (mgr *CrlWorkspaceManager) LoadUserPreferences(workspaceArg string) error

LoadUserPreferences loads the user preferences saved in the user's home directory

func (*CrlWorkspaceManager) LoadWorkspace

func (mgr *CrlWorkspaceManager) LoadWorkspace(trans *core.Transaction) error

LoadWorkspace loads the workspace currently designated by the userPreferences.WorkspacePath. If the path is empty, it is a no-op.

func (*CrlWorkspaceManager) SaveWorkspace

func (mgr *CrlWorkspaceManager) SaveWorkspace(trans *core.Transaction) error

SaveWorkspace saves all top-level concepts whose versions are different than the last retrieved version.

type DiagramManager

type DiagramManager struct {
	// contains filtered or unexported fields
}

DiagramManager manages the diagram display portion of the GUI

func NewDiagramManager

func NewDiagramManager(editor *Editor) *DiagramManager

NewDiagramManager creates an instance of the DiagramManager

func (*DiagramManager) AddConceptView

func (dMgr *DiagramManager) AddConceptView(diagramID string, conceptID string, x float64, y float64, trans *core.Transaction) (core.Concept, error)

AddConceptView adds a view of the concept to the indicated diagram

func (*DiagramManager) AddDiagram

func (dMgr *DiagramManager) AddDiagram(ownerID string, trans *core.Transaction) (core.Concept, error)

AddDiagram adds a diagram tab, if needed, and displays the tab

func (*DiagramManager) DisplayDiagram

func (dMgr *DiagramManager) DisplayDiagram(diagramID string, trans *core.Transaction) error

DisplayDiagram tells the client to display the indicated diagram.

func (*DiagramManager) NewDiagram

func (dMgr *DiagramManager) NewDiagram(trans *core.Transaction) (core.Concept, error)

NewDiagram creates a new crldiagram

type Editor

type Editor struct {
	// contains filtered or unexported fields
}

Editor manages one or more CrlEditors

var CrlEditorSingleton *Editor

CrlEditorSingleton is the unique single instance of the Editor in an editng session

func NewEditor

func NewEditor(userFolderArg string) *Editor

NewEditor returns an initialized Editor

func (*Editor) AddEditorGUI

func (editor *Editor) AddEditorGUI(editorGUI EditorGUI) error

AddEditorGUI adds an editor to the list of editorGUIs being managed by the editor and initializes the GUI

func (*Editor) ClearWorkspace

func (editor *Editor) ClearWorkspace(trans *core.Transaction) error

ClearWorkspace clears all files in the current workspace that correspond to uOfD root elements and then reinitializes all editorGUIs.

func (*Editor) CloseDiagramView

func (editor *Editor) CloseDiagramView(diagramID string, trans *core.Transaction) error

CloseDiagramView removes the diagram from the list of displayed diagrams and informs all GUIs

func (*Editor) CloseWorkspace

func (editor *Editor) CloseWorkspace(trans *core.Transaction) error

CloseWorkspace closes the current workspace, saving the root elements

func (*Editor) DeleteElement

func (editor *Editor) DeleteElement(elID string, trans *core.Transaction) error

DeleteElement removes the element from the UniverseOfDiscourse

func (*Editor) DiagramDisplayRemoved

func (editor *Editor) DiagramDisplayRemoved(id string)

DiagramDisplayRemoved ensures that the indicated diagram is not on the list of currently displayed diagrams

func (*Editor) DiagramDisplayed

func (editor *Editor) DiagramDisplayed(id string)

DiagramDisplayed ensures that the indicated diagram is on the list of currently displayed diagrams

func (*Editor) DiagramSelected

func (editor *Editor) DiagramSelected(id string)

DiagramSelected ensures that the setting is updated to indicate the currently displayed diagram

func (*Editor) EndTransaction

func (editor *Editor) EndTransaction()

EndTransaction releases the transaction locks and clears the in-progress transaction

func (*Editor) FileLoaded

func (editor *Editor) FileLoaded(el core.Concept, trans *core.Transaction)

FileLoaded is used to inform the CrlEditor that a file has been loaded

func (*Editor) GetCurrentSelection

func (editor *Editor) GetCurrentSelection() core.Concept

GetCurrentSelection returns the Element that is the current selection in the editor

func (*Editor) GetCurrentSelectionID

func (editor *Editor) GetCurrentSelectionID(trans *core.Transaction) string

GetCurrentSelectionID returns the ConceptID of the currently selected Element

func (*Editor) GetDefaultDiagramLabel

func (editor *Editor) GetDefaultDiagramLabel() string

GetDefaultDiagramLabel increments the default label count and returns a label containing the new count

func (*Editor) GetDefaultDomainLabel

func (editor *Editor) GetDefaultDomainLabel() string

GetDefaultDomainLabel increments the default label count and returns a label containing the new count

func (*Editor) GetDefaultElementLabel

func (editor *Editor) GetDefaultElementLabel() string

GetDefaultElementLabel increments the default label count and returns a label containing the new count

func (*Editor) GetDefaultLiteralLabel

func (editor *Editor) GetDefaultLiteralLabel() string

GetDefaultLiteralLabel increments the default label count and returns a label containing the new count

func (*Editor) GetDefaultReferenceLabel

func (editor *Editor) GetDefaultReferenceLabel() string

GetDefaultReferenceLabel increments the default label count and returns a label containing the new count

func (*Editor) GetDefaultRefinementLabel

func (editor *Editor) GetDefaultRefinementLabel() string

GetDefaultRefinementLabel increments the default label count and returns a label containing the new count

func (*Editor) GetDiagramManager

func (editor *Editor) GetDiagramManager() *DiagramManager

GetDiagramManager returns the diagram manager

func (editor *Editor) GetDropDiagramReferenceAsLink(trans *core.Transaction) bool

GetDropDiagramReferenceAsLink returns true if dropped references are shown as links

func (editor *Editor) GetDropDiagramRefinementAsLink(trans *core.Transaction) bool

GetDropDiagramRefinementAsLink returns true if dropped refinements are shown as links

func (*Editor) GetExitRequested

func (editor *Editor) GetExitRequested() bool

GetExitRequested returns true if exit has been requested

func (*Editor) GetSettings

func (editor *Editor) GetSettings() *Settings

GetSettings returns the editor settings

func (*Editor) GetTransaction

func (editor *Editor) GetTransaction() (*core.Transaction, bool)

GetTransaction returns the in-progress transaction, if there is one, and otherwise creates a new transaction

func (*Editor) GetUofD

func (editor *Editor) GetUofD() *core.UniverseOfDiscourse

GetUofD returns the current UniverseOfDiscourse

func (*Editor) GetUserPreferences

func (editor *Editor) GetUserPreferences() *UserPreferences

GetUserPreferences returns the current user's preferences

func (*Editor) GetWorkspacePath

func (editor *Editor) GetWorkspacePath() string

GetWorkspacePath return the path to the current workspace

func (*Editor) Initialize

func (editor *Editor) Initialize(workspacePath string, promptWorkspaceSelection bool) error

Initialize initializes the uOfD, workspace manager, and all registered editorGUIs

func (*Editor) IsDiagramDisplayed

func (editor *Editor) IsDiagramDisplayed(diagramID string, trans *core.Transaction) bool

IsDiagramDisplayed returns true if the diagram is in the list of displayed diagrams

func (*Editor) LoadWorkspace

func (editor *Editor) LoadWorkspace(trans *core.Transaction) error

LoadWorkspace tells the editor to load the workspace

func (*Editor) OpenWorkspace

func (editor *Editor) OpenWorkspace(trans *core.Transaction) error

OpenWorkspace sets the path to the folder to be used as a workspace. It is the implementation of a request from the client.

func (*Editor) Redo

func (editor *Editor) Redo(trans *core.Transaction) error

Redo performs an undo on the editor.editor.GetUofD() and refreshes the interface

func (*Editor) RefreshGUI

func (editor *Editor) RefreshGUI(trans *core.Transaction) error

RefreshGUI tells all GUIs to initialize their state

func (*Editor) RemoveDiagramFromDisplayedList

func (editor *Editor) RemoveDiagramFromDisplayedList(diagramID string, trans *core.Transaction)

RemoveDiagramFromDisplayedList removes the diagramID from the list of displayed diagrams

func (*Editor) SaveSettings

func (editor *Editor) SaveSettings() error

SaveSettings saves the settings to the workspace

func (*Editor) SaveUserPreferences

func (editor *Editor) SaveUserPreferences() error

SaveUserPreferences saves the current user preferences to the user's home directory

func (*Editor) SaveWorkspace

func (editor *Editor) SaveWorkspace(trans *core.Transaction) error

SaveWorkspace saves the workspace

func (*Editor) SelectElement

func (editor *Editor) SelectElement(el core.Concept, trans *core.Transaction) error

SelectElement selects the indicated Element in the tree, displays the Element in the Properties window, and selects it in the current diagram (if present).

func (*Editor) SelectElementUsingIDString

func (editor *Editor) SelectElementUsingIDString(id string, trans *core.Transaction) error

SelectElementUsingIDString selects the Element whose ConceptID matches the supplied string

func (*Editor) SelectWorkspace

func (editor *Editor) SelectWorkspace() (string, error)

SelectWorkspace opens a dialog for the user to select a workspace

func (editor *Editor) SetDropDiagramReferenceAsLink(value bool, trans *core.Transaction)

SetDropDiagramReferenceAsLink returns true if dropped references are shown as links

func (editor *Editor) SetDropDiagramRefinementAsLink(value bool, trans *core.Transaction)

SetDropDiagramRefinementAsLink returns true if dropped refinements are shown as links

func (*Editor) SetExitRequested

func (editor *Editor) SetExitRequested()

SetExitRequested informs the Editor that exit has been requested. Intended to be used by the GUI

func (*Editor) SetSelectionDefinition

func (editor *Editor) SetSelectionDefinition(definition string, trans *core.Transaction)

SetSelectionDefinition is a convenience method for setting the Definition of the currently selected Element

func (*Editor) SetSelectionLabel

func (editor *Editor) SetSelectionLabel(name string, trans *core.Transaction)

SetSelectionLabel is a convenience method for setting the Label of the currently selected Element

func (*Editor) SetSelectionURI

func (editor *Editor) SetSelectionURI(uri string, trans *core.Transaction)

SetSelectionURI is a convenience method for setting the URI of the curretly selected Element

func (*Editor) SetWorkspacePath

func (editor *Editor) SetWorkspacePath(path string) error

SetWorkspacePath sets the user's preference WorkspacePath value.

func (*Editor) Undo

func (editor *Editor) Undo(trans *core.Transaction) error

Undo performs an undo on the editor.GetUofD() and refreshes the interface

func (*Editor) UpdateCurrentDiagram

func (editor *Editor) UpdateCurrentDiagram(diagramID string, trans *core.Transaction)

UpdateCurrentDiagram updates the setting value for current diagram in a way that allows the change to be undone

func (*Editor) UpdateOpenDiagrams

func (editor *Editor) UpdateOpenDiagrams(diagramIDs []string, trans *core.Transaction)

UpdateOpenDiagrams updates the setting value for open diagrams in a way that allows the change to be undone

type EditorGUI

type EditorGUI interface {
	CloseDiagramView(diagramID string, trans *core.Transaction) error
	DisplayDiagram(diagram core.Concept, trans *core.Transaction) error
	ConceptDeleted(elID string, trans *core.Transaction) error
	ConceptSelected(el core.Concept, trans *core.Transaction) error
	FileLoaded(el core.Concept, trans *core.Transaction)
	GetNoSaveDomains(noSaveDomains map[string]core.Concept, trans *core.Transaction)
	Initialize(trans *core.Transaction) error
	RefreshGUI(trans *core.Transaction) error
}

EditorGUI is the interface for all CrlEditors, independent of implementation technology

type Settings

type Settings struct {
	DefaultDomainLabelCount     int
	DefaultElementLabelCount    int
	DefaultLiteralLabelCount    int
	DefaultReferenceLabelCount  int
	DefaultRefinementLabelCount int
	DefaultDiagramLabelCount    int
	Selection                   string
	OpenDiagrams                []string
	CurrentDiagram              string
}

Settings reflect the current status of the editing session

type UserPreferences

type UserPreferences struct {
	WorkspacePath               string
	DropDiagramReferenceAsLink  bool
	DropDiagramRefinementAsLink bool
	HorizontalLayoutSpacing     float64
	VerticalLayoutSpacing       float64
}

UserPreferences are the user preferences for the editor

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL