Documentation
¶
Index ¶
- type CrlWorkspaceManager
- func (mgr *CrlWorkspaceManager) ClearWorkspace(workspacePath string, trans *core.Transaction) error
- func (mgr *CrlWorkspaceManager) CloseWorkspace(trans *core.Transaction) error
- func (mgr *CrlWorkspaceManager) GetUofD() *core.UniverseOfDiscourse
- func (mgr *CrlWorkspaceManager) Initialize()
- func (mgr *CrlWorkspaceManager) LoadSettings(trans *core.Transaction) error
- func (mgr *CrlWorkspaceManager) LoadUserPreferences(workspaceArg string) error
- func (mgr *CrlWorkspaceManager) LoadWorkspace(trans *core.Transaction) error
- func (mgr *CrlWorkspaceManager) SaveWorkspace(trans *core.Transaction) error
- type DiagramManager
- func (dMgr *DiagramManager) AddConceptView(diagramID string, conceptID string, x float64, y float64, ...) (core.Concept, error)
- func (dMgr *DiagramManager) AddDiagram(ownerID string, trans *core.Transaction) (core.Concept, error)
- func (dMgr *DiagramManager) DisplayDiagram(diagramID string, trans *core.Transaction) error
- func (dMgr *DiagramManager) NewDiagram(trans *core.Transaction) (core.Concept, error)
- type Editor
- func (editor *Editor) AddEditorGUI(editorGUI EditorGUI) error
- func (editor *Editor) ClearWorkspace(trans *core.Transaction) error
- func (editor *Editor) CloseDiagramView(diagramID string, trans *core.Transaction) error
- func (editor *Editor) CloseWorkspace(trans *core.Transaction) error
- func (editor *Editor) DeleteElement(elID string, trans *core.Transaction) error
- func (editor *Editor) DiagramDisplayRemoved(id string)
- func (editor *Editor) DiagramDisplayed(id string)
- func (editor *Editor) DiagramSelected(id string)
- func (editor *Editor) EndTransaction()
- func (editor *Editor) FileLoaded(el core.Concept, trans *core.Transaction)
- func (editor *Editor) GetCurrentSelection() core.Concept
- func (editor *Editor) GetCurrentSelectionID(trans *core.Transaction) string
- func (editor *Editor) GetDefaultDiagramLabel() string
- func (editor *Editor) GetDefaultDomainLabel() string
- func (editor *Editor) GetDefaultElementLabel() string
- func (editor *Editor) GetDefaultLiteralLabel() string
- func (editor *Editor) GetDefaultReferenceLabel() string
- func (editor *Editor) GetDefaultRefinementLabel() string
- func (editor *Editor) GetDiagramManager() *DiagramManager
- func (editor *Editor) GetDropDiagramReferenceAsLink(trans *core.Transaction) bool
- func (editor *Editor) GetDropDiagramRefinementAsLink(trans *core.Transaction) bool
- func (editor *Editor) GetExitRequested() bool
- func (editor *Editor) GetSettings() *Settings
- func (editor *Editor) GetTransaction() (*core.Transaction, bool)
- func (editor *Editor) GetUofD() *core.UniverseOfDiscourse
- func (editor *Editor) GetUserPreferences() *UserPreferences
- func (editor *Editor) GetWorkspacePath() string
- func (editor *Editor) Initialize(workspacePath string, promptWorkspaceSelection bool) error
- func (editor *Editor) IsDiagramDisplayed(diagramID string, trans *core.Transaction) bool
- func (editor *Editor) LoadWorkspace(trans *core.Transaction) error
- func (editor *Editor) OpenWorkspace(trans *core.Transaction) error
- func (editor *Editor) Redo(trans *core.Transaction) error
- func (editor *Editor) RefreshGUI(trans *core.Transaction) error
- func (editor *Editor) RemoveDiagramFromDisplayedList(diagramID string, trans *core.Transaction)
- func (editor *Editor) SaveSettings() error
- func (editor *Editor) SaveUserPreferences() error
- func (editor *Editor) SaveWorkspace(trans *core.Transaction) error
- func (editor *Editor) SelectElement(el core.Concept, trans *core.Transaction) error
- func (editor *Editor) SelectElementUsingIDString(id string, trans *core.Transaction) error
- func (editor *Editor) SelectWorkspace() (string, error)
- func (editor *Editor) SetDropDiagramReferenceAsLink(value bool, trans *core.Transaction)
- func (editor *Editor) SetDropDiagramRefinementAsLink(value bool, trans *core.Transaction)
- func (editor *Editor) SetExitRequested()
- func (editor *Editor) SetSelectionDefinition(definition string, trans *core.Transaction)
- func (editor *Editor) SetSelectionLabel(name string, trans *core.Transaction)
- func (editor *Editor) SetSelectionURI(uri string, trans *core.Transaction)
- func (editor *Editor) SetWorkspacePath(path string) error
- func (editor *Editor) Undo(trans *core.Transaction) error
- func (editor *Editor) UpdateCurrentDiagram(diagramID string, trans *core.Transaction)
- func (editor *Editor) UpdateOpenDiagrams(diagramIDs []string, trans *core.Transaction)
- type EditorGUI
- type Settings
- type UserPreferences
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 ¶
func (mgr *CrlWorkspaceManager) GetUofD() *core.UniverseOfDiscourse
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 (*Editor) AddEditorGUI ¶
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 ¶
DiagramDisplayRemoved ensures that the indicated diagram is not on the list of currently displayed diagrams
func (*Editor) DiagramDisplayed ¶
DiagramDisplayed ensures that the indicated diagram is on the list of currently displayed diagrams
func (*Editor) DiagramSelected ¶
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 ¶
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 ¶
GetDefaultDiagramLabel increments the default label count and returns a label containing the new count
func (*Editor) GetDefaultDomainLabel ¶
GetDefaultDomainLabel increments the default label count and returns a label containing the new count
func (*Editor) GetDefaultElementLabel ¶
GetDefaultElementLabel increments the default label count and returns a label containing the new count
func (*Editor) GetDefaultLiteralLabel ¶
GetDefaultLiteralLabel increments the default label count and returns a label containing the new count
func (*Editor) GetDefaultReferenceLabel ¶
GetDefaultReferenceLabel increments the default label count and returns a label containing the new count
func (*Editor) GetDefaultRefinementLabel ¶
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) GetDropDiagramReferenceAsLink ¶
func (editor *Editor) GetDropDiagramReferenceAsLink(trans *core.Transaction) bool
GetDropDiagramReferenceAsLink returns true if dropped references are shown as links
func (*Editor) GetDropDiagramRefinementAsLink ¶
func (editor *Editor) GetDropDiagramRefinementAsLink(trans *core.Transaction) bool
GetDropDiagramRefinementAsLink returns true if dropped refinements are shown as links
func (*Editor) GetExitRequested ¶
GetExitRequested returns true if exit has been requested
func (*Editor) GetSettings ¶
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 ¶
GetWorkspacePath return the path to the current workspace
func (*Editor) Initialize ¶
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 ¶
SaveSettings saves the settings to the workspace
func (*Editor) SaveUserPreferences ¶
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 ¶
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 ¶
SelectWorkspace opens a dialog for the user to select a workspace
func (*Editor) SetDropDiagramReferenceAsLink ¶
func (editor *Editor) SetDropDiagramReferenceAsLink(value bool, trans *core.Transaction)
SetDropDiagramReferenceAsLink returns true if dropped references are shown as links
func (*Editor) SetDropDiagramRefinementAsLink ¶
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 ¶
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