Skip to content

Commit

Permalink
Resolve the requests regarding comments and variable name adjustments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyclone1337 committed Sep 27, 2024
1 parent 1e596b3 commit fbeabf2
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Assets/SEE/Controls/Actions/AbstractPlayerAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public abstract class AbstractPlayerAction : IReversibleAction
protected IReversibleAction.Progress CurrentState = IReversibleAction.Progress.NoEffect;

/// <summary>
/// Whether the action was executed via context menu.
/// Whether the action is executed through the context menu.
/// </summary>
public bool ExecuteViaContextMenu { get; set; } = false;

Expand Down
8 changes: 7 additions & 1 deletion Assets/SEE/Controls/Actions/AcceptDivergenceAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ private static Edge CreateConvergentEdge(Memento memento)
/// <summary>
/// Used to execute the <see cref="AcceptDivergenceAction"/> from the context menu.
/// Creates a new edge in the architecture to allow the given <paramref name="divergence"/>
/// and ensures that the <see cref="Update"/> method performs the external execution.
/// and ensures that the <see cref="Update"/> method performs the execution via context menu.
/// </summary>
/// <param name="divergence">the edge representing the divergence</param>
/// <returns>the new edge</returns>
Expand All @@ -294,6 +294,12 @@ public Edge ContextMenuExecution(Edge divergence)
return createdEdge;
}

/// <summary>
/// Used to execute the <see cref="AcceptDivergenceAction"/> from the context menu in multiselection mode.
/// Creates new edges in the architecture to allow the given <paramref name="divergences"/> and ensures
/// that the <see cref="Update"/> method perfoms the execution via context menu.
/// </summary>
/// <param name="divergences">The edges representing the divergences.</param>
public void ContextMenuExection(IList<Edge> divergences)
{
ExecuteViaContextMenu = true;
Expand Down
2 changes: 1 addition & 1 deletion Assets/SEE/Controls/Actions/AddEdgeAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public override bool Update()

/// <summary>
/// Used to execute the <see cref="AddEdgeAction"/> from the context menu.
/// It ensures that the <see cref="Update"/> method performs the external execution.
/// It ensures that the <see cref="Update"/> method performs the execution via context menu.
/// </summary>
/// <param name="source">Is the source node of the edge.</param>
public void ContextMenuExecution(GameObject source)
Expand Down
4 changes: 2 additions & 2 deletions Assets/SEE/Controls/Actions/DeleteAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private bool MultiDelete()
/// <summary>
/// Used to execute the <see cref="DeleteAction"> from the context menu.
/// It sets the object to be deleted and ensures that the <see cref="Update"/> method
/// performs the external execution.
/// performs the execution via context menu.
/// </summary>
/// <param name="toDelete">The object to be deleted.</param>
public void ContextMenuExecution(GameObject toDelete)
Expand All @@ -206,7 +206,7 @@ public void ContextMenuExecution(GameObject toDelete)
/// <summary>
/// Used to execute the <see cref="DeleteAction"/> from the multiselection context menu.
/// It sets the objects to be deleted and ensures that the <see cref="Update"/> method
/// performs the external execution.
/// performs the execution via context menu.
/// </summary>
/// <param name="toDelete">The objects to be deleted.</param>
public void ContextMenuExecution(IEnumerable<GameObject> toDelete)
Expand Down
2 changes: 1 addition & 1 deletion Assets/SEE/Game/SceneManipulation/GameNodeEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private static GameObject GetText(GameObject go)
}

/// <summary>
/// Checks if the text object needs to be added.
/// Checks if the decorations of the node needs to be added <see cref="GraphRenderer.AddDecorations(GameObject)"/>.
/// </summary>
/// <param name="node">The node to be checked.</param>
private static void ShouldAddTextObject(Node node)
Expand Down
7 changes: 4 additions & 3 deletions Assets/SEE/UI/PopupMenu/PopupMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,16 @@ public void AddEntry(PopupMenuEntry entry)
default:
throw new System.ArgumentException($"Unknown entry type: {entry.GetType()}");
}

// TODO (#668): Respect priority
}

/// <summary>
/// Adds a new <paramref name="action"/> to the menu.
/// </summary>
/// <param name="action">The action to be added.</param>
/// <param name="actionItem">Whether the standard item for the action entry should be used.</param>
/// <param name="actionItem">The item to be added to the PopupMenu.
/// If the default item is to be added, null should be used.
/// Another item can be, for example, the SubMenuButton.
/// </param>
private void AddAction(PopupMenuAction action, GameObject actionItem = null)
{
actionItem ??= PrefabInstantiator.InstantiatePrefab("Prefabs/UI/PopupMenuButton", actionList, false);
Expand Down
5 changes: 5 additions & 0 deletions Assets/SEE/UI/Window/PropertyWindow/PropertyWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,11 @@ private TextMeshProUGUI Attribute(GameObject propertyRow)
return GameFinder.FindChild(propertyRow, "AttributeLine").MustGetComponent<TextMeshProUGUI>();
}

/// <summary>
/// Returns the value of a node attribute.
/// </summary>
/// <param name="propertyRow">a game object representing a pair of an attribute name and an attribute value.</param>
/// <returns>value of the node attribute or the name of the node attribute if it does not have a value (SubMenuButton). </returns>
private string AttributeValue(GameObject propertyRow)
{
return Value(propertyRow) != null ? Value(propertyRow).text : AttributeName(propertyRow);
Expand Down
2 changes: 1 addition & 1 deletion Assets/SEE/UI/Window/TreeWindow/DesktopTreeWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ void RegisterClickHandler()
}, Icons.Hide)
};
IEnumerable<PopupMenuEntry> actions = ContextMenuAction
.GetOptionsForTreeView(contextMenu.contextMenu,
.GetOptionsForTreeView(contextMenu.ContextMenu,
e.position,
representedGraphElement,
representedGameObject,
Expand Down
24 changes: 12 additions & 12 deletions Assets/SEE/UI/Window/TreeWindow/TreeWindowContextMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class TreeWindowContextMenu
/// <summary>
/// The context menu that this class manages.
/// </summary>
public readonly PopupMenu.PopupMenu contextMenu;
public readonly PopupMenu.PopupMenu ContextMenu;

/// <summary>
/// The graph search associated with the tree window.
Expand Down Expand Up @@ -69,7 +69,7 @@ public TreeWindowContextMenu(PopupMenu.PopupMenu contextMenu, GraphSearch search
Action rebuild, ButtonManagerBasic filterButton, ButtonManagerBasic sortButton,
ButtonManagerBasic groupButton)
{
this.contextMenu = contextMenu;
this.ContextMenu = contextMenu;
this.searcher = searcher;
this.grouper = grouper;
this.rebuild = rebuild;
Expand All @@ -88,7 +88,7 @@ public TreeWindowContextMenu(PopupMenu.PopupMenu contextMenu, GraphSearch search
/// <summary>
/// Forwards to <see cref="PopupMenu.ShowWith(IEnumerable{PopupMenuEntry},Vector2)"/>.
/// </summary>
public void ShowWith(IEnumerable<PopupMenuEntry> entries, Vector2 position) => contextMenu.ShowWith(entries, position);
public void ShowWith(IEnumerable<PopupMenuEntry> entries, Vector2 position) => ContextMenu.ShowWith(entries, position);

#region Filter menu

Expand All @@ -98,7 +98,7 @@ public TreeWindowContextMenu(PopupMenu.PopupMenu contextMenu, GraphSearch search
private void ShowFilterMenu()
{
UpdateFilterMenuEntries();
contextMenu.ShowWith(position: filterButton.transform.position);
ContextMenu.ShowWith(position: filterButton.transform.position);
}

/// <summary>
Expand Down Expand Up @@ -158,8 +158,8 @@ private void UpdateFilterMenuEntries()
entries.AddRange(edgeToggles.Select(FilterActionFor));
}

contextMenu.ClearEntries();
contextMenu.AddEntries(entries);
ContextMenu.ClearEntries();
ContextMenu.AddEntries(entries);
}

/// <summary>
Expand Down Expand Up @@ -221,7 +221,7 @@ private void ResetFilter()
private void ShowSortMenu()
{
UpdateSortMenuEntries();
contextMenu.ShowWith(position: sortButton.transform.position);
ContextMenu.ShowWith(position: sortButton.transform.position);
}

/// <summary>
Expand Down Expand Up @@ -250,8 +250,8 @@ private void UpdateSortMenuEntries()
entries.AddRange(searcher.Graph.AllNumericAttributes().Select(NumericAttributeSortAction));
entries.AddRange(searcher.Graph.AllStringAttributes().Select(StringAttributeSortAction));

contextMenu.ClearEntries();
contextMenu.AddEntries(entries);
ContextMenu.ClearEntries();
ContextMenu.AddEntries(entries);
return;

PopupMenuAction NumericAttributeSortAction(string attributeKey)
Expand Down Expand Up @@ -338,7 +338,7 @@ private void ResetSort()
private void ShowGroupMenu()
{
UpdateGroupMenuEntries();
contextMenu.ShowWith(position: groupButton.transform.position);
ContextMenu.ShowWith(position: groupButton.transform.position);
}

/// <summary>
Expand All @@ -365,8 +365,8 @@ private void UpdateGroupMenuEntries()
GroupActionFor("Type",
new TreeWindowGroupAssigment<string>(searcher.Graph.AllElementTypes().ToDictionary(x => x, TypeToGroup), element => element.Type)),
};
contextMenu.ClearEntries();
contextMenu.AddEntries(entries);
ContextMenu.ClearEntries();
ContextMenu.AddEntries(entries);
return;

// Returns the group action for the given <paramref name="name"/> and <paramref name="assignment"/>.
Expand Down

0 comments on commit fbeabf2

Please sign in to comment.