From 4d2c4420025abfbd45813f6dbf98aca0586a8a43 Mon Sep 17 00:00:00 2001 From: BenKenobie31415 Date: Sun, 11 Feb 2024 21:54:03 +0100 Subject: [PATCH 1/6] added javadocs --- .../actions/AbstractPositionableViewModelElementAction.java | 1 + src/main/java/org/gecko/actions/Action.java | 1 + src/main/java/org/gecko/actions/ActionFactory.java | 1 + src/main/java/org/gecko/actions/ActionGroup.java | 1 + src/main/java/org/gecko/actions/ActionManager.java | 1 + .../actions/ChangeColorRegionViewModelElementAction.java | 1 + .../org/gecko/actions/ChangeContractEdgeViewModelAction.java | 1 + .../gecko/actions/ChangeInvariantViewModelElementAction.java | 1 + .../java/org/gecko/actions/ChangeKindEdgeViewModelAction.java | 2 ++ .../actions/ChangePostconditionViewModelElementAction.java | 1 + .../actions/ChangePreconditionViewModelElementAction.java | 1 + .../gecko/actions/ChangeTypePortViewModelElementAction.java | 1 + .../gecko/actions/ChangeVisibilityPortViewModelAction.java | 1 + .../gecko/actions/CreateContractViewModelElementAction.java | 1 + .../org/gecko/actions/CreateEdgeViewModelElementAction.java | 1 + .../org/gecko/actions/CreatePortViewModelElementAction.java | 1 + .../org/gecko/actions/CreateRegionViewModelElementAction.java | 1 + .../org/gecko/actions/CreateStateViewModelElementAction.java | 1 + .../actions/CreateSystemConnectionViewModelElementAction.java | 1 + .../org/gecko/actions/CreateSystemViewModelElementAction.java | 1 + src/main/java/org/gecko/actions/CreateVariableAction.java | 1 + .../java/org/gecko/actions/DeleteActionsCreatorVisitor.java | 2 ++ .../org/gecko/actions/DeleteEdgeViewModelElementAction.java | 1 + .../org/gecko/actions/DeletePortViewModelElementAction.java | 1 + .../actions/DeletePositionableViewModelElementAction.java | 1 + .../org/gecko/actions/DeleteRegionViewModelElementAction.java | 1 + .../org/gecko/actions/DeleteStateViewModelElementAction.java | 1 + .../actions/DeleteSystemConnectionViewModelElementAction.java | 1 + .../org/gecko/actions/DeleteSystemViewModelElementAction.java | 1 + .../actions/FocusPositionableViewModelElementAction.java | 1 + .../org/gecko/actions/ModifyEdgeViewModelPriorityAction.java | 1 + .../org/gecko/actions/MoveBlockViewModelElementAction.java | 1 + .../org/gecko/actions/MoveEdgeViewModelElementAction.java | 1 + .../actions/MoveSystemConnectionViewModelElementAction.java | 1 + .../java/org/gecko/actions/RenameViewModelElementAction.java | 1 + .../gecko/actions/RestoreContractViewModelElementAction.java | 1 + .../org/gecko/actions/RestoreEdgeViewModelElementAction.java | 1 + .../org/gecko/actions/RestorePortViewModelElementAction.java | 1 + .../actions/RestorePositionableViewModelElementAction.java | 1 + src/main/java/org/gecko/application/Gecko.java | 4 ++++ src/main/java/org/gecko/application/GeckoIOManager.java | 1 + src/main/java/org/gecko/application/GeckoManager.java | 1 + src/main/java/org/gecko/application/Main.java | 2 ++ src/main/java/org/gecko/exceptions/GeckoException.java | 1 + .../gecko/exceptions/MissingViewModelElementException.java | 1 + src/main/java/org/gecko/exceptions/ModelException.java | 1 + src/main/java/org/gecko/tools/AreaTool.java | 1 + src/main/java/org/gecko/tools/CursorTool.java | 1 + src/main/java/org/gecko/tools/EdgeCreatorTool.java | 1 + src/main/java/org/gecko/tools/MarqueeTool.java | 1 + src/main/java/org/gecko/tools/PanTool.java | 1 + src/main/java/org/gecko/tools/RegionCreatorTool.java | 1 + src/main/java/org/gecko/tools/StateCreatorTool.java | 1 + .../java/org/gecko/tools/SystemConnectionCreatorTool.java | 1 + src/main/java/org/gecko/tools/SystemCreatorTool.java | 1 + src/main/java/org/gecko/tools/Tool.java | 1 + src/main/java/org/gecko/tools/ToolType.java | 1 + src/main/java/org/gecko/tools/VariableBlockCreatorTool.java | 1 + src/main/java/org/gecko/tools/ZoomTool.java | 1 + 59 files changed, 65 insertions(+) diff --git a/src/main/java/org/gecko/actions/AbstractPositionableViewModelElementAction.java b/src/main/java/org/gecko/actions/AbstractPositionableViewModelElementAction.java index c5222c50..b4acacc6 100644 --- a/src/main/java/org/gecko/actions/AbstractPositionableViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/AbstractPositionableViewModelElementAction.java @@ -2,6 +2,7 @@ import org.gecko.viewmodel.PositionableViewModelElement; +/** An abstract representation of an {@link Action} that has a target-{@link PositionableViewModelElement}. */ public abstract class AbstractPositionableViewModelElementAction extends Action { abstract PositionableViewModelElement getTarget(); } diff --git a/src/main/java/org/gecko/actions/Action.java b/src/main/java/org/gecko/actions/Action.java index 17b0f889..ae35bde2 100644 --- a/src/main/java/org/gecko/actions/Action.java +++ b/src/main/java/org/gecko/actions/Action.java @@ -2,6 +2,7 @@ import org.gecko.exceptions.GeckoException; +/** An abstract representation of an operation that can be executed in the Gecko Graphic Editor. An {@link Action} can be run or undone. The provided methods must be implemented by concrete actions. */ public abstract class Action { /** * Runs the action. diff --git a/src/main/java/org/gecko/actions/ActionFactory.java b/src/main/java/org/gecko/actions/ActionFactory.java index c08abd36..46235449 100644 --- a/src/main/java/org/gecko/actions/ActionFactory.java +++ b/src/main/java/org/gecko/actions/ActionFactory.java @@ -19,6 +19,7 @@ import org.gecko.viewmodel.SystemConnectionViewModel; import org.gecko.viewmodel.SystemViewModel; +/** Represents a factory for actions. Provides a method for the creation of each subtype of {@link Action}. */ public class ActionFactory { private final GeckoViewModel geckoViewModel; diff --git a/src/main/java/org/gecko/actions/ActionGroup.java b/src/main/java/org/gecko/actions/ActionGroup.java index 8ed4dab5..9b92b191 100644 --- a/src/main/java/org/gecko/actions/ActionGroup.java +++ b/src/main/java/org/gecko/actions/ActionGroup.java @@ -5,6 +5,7 @@ import lombok.EqualsAndHashCode; import org.gecko.exceptions.GeckoException; +/** A concrete representation of an {@link Action}, which encapsulates a list of other concrete actions, which are iteratively run or undone. */ @Data @EqualsAndHashCode(callSuper = true) public class ActionGroup extends Action { diff --git a/src/main/java/org/gecko/actions/ActionManager.java b/src/main/java/org/gecko/actions/ActionManager.java index 0e34663b..84023a6e 100644 --- a/src/main/java/org/gecko/actions/ActionManager.java +++ b/src/main/java/org/gecko/actions/ActionManager.java @@ -6,6 +6,7 @@ import org.gecko.exceptions.GeckoException; import org.gecko.viewmodel.GeckoViewModel; +/** Represents a manager for the actions of the active {@link org.gecko.application.Gecko}. Holds an {@link ActionFactory}, a stack of currently undoable {@link Action}s and a stack of currently redoable {@link Action}s, thus providing methods for running, undoing and redoing actions. */ public class ActionManager { @Getter private final ActionFactory actionFactory; diff --git a/src/main/java/org/gecko/actions/ChangeColorRegionViewModelElementAction.java b/src/main/java/org/gecko/actions/ChangeColorRegionViewModelElementAction.java index 2fa2b631..d5aad144 100644 --- a/src/main/java/org/gecko/actions/ChangeColorRegionViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/ChangeColorRegionViewModelElementAction.java @@ -4,6 +4,7 @@ import org.gecko.exceptions.GeckoException; import org.gecko.viewmodel.RegionViewModel; +/** A concrete representation of an {@link Action} that changes the color of a {@link RegionViewModel}. Additionally holds the old and new {@link Color}s of the region for undo/redo purposes. */ public class ChangeColorRegionViewModelElementAction extends Action { private final RegionViewModel regionViewModel; diff --git a/src/main/java/org/gecko/actions/ChangeContractEdgeViewModelAction.java b/src/main/java/org/gecko/actions/ChangeContractEdgeViewModelAction.java index 25a489f7..f71ea764 100644 --- a/src/main/java/org/gecko/actions/ChangeContractEdgeViewModelAction.java +++ b/src/main/java/org/gecko/actions/ChangeContractEdgeViewModelAction.java @@ -4,6 +4,7 @@ import org.gecko.viewmodel.ContractViewModel; import org.gecko.viewmodel.EdgeViewModel; +/** A concrete representation of an {@link Action} that changes the contract of an {@link EdgeViewModel}, which it holds a reference to. Additionally holds the old and new {@link ContractViewModel}s of the edge for undo/redo purposes. */ public class ChangeContractEdgeViewModelAction extends Action { private final EdgeViewModel edgeViewModel; diff --git a/src/main/java/org/gecko/actions/ChangeInvariantViewModelElementAction.java b/src/main/java/org/gecko/actions/ChangeInvariantViewModelElementAction.java index 7564c030..3ff60c98 100644 --- a/src/main/java/org/gecko/actions/ChangeInvariantViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/ChangeInvariantViewModelElementAction.java @@ -3,6 +3,7 @@ import org.gecko.exceptions.GeckoException; import org.gecko.viewmodel.RegionViewModel; +/** A concrete representation of an {@link Action} that changes the invariant of a {@link RegionViewModel}, which it holds a reference to. Additionally holds the old and new {@link String invariants}s of the region for undo/redo purposes*/ public class ChangeInvariantViewModelElementAction extends Action { private final RegionViewModel regionViewModel; diff --git a/src/main/java/org/gecko/actions/ChangeKindEdgeViewModelAction.java b/src/main/java/org/gecko/actions/ChangeKindEdgeViewModelAction.java index be753188..95b904c8 100644 --- a/src/main/java/org/gecko/actions/ChangeKindEdgeViewModelAction.java +++ b/src/main/java/org/gecko/actions/ChangeKindEdgeViewModelAction.java @@ -4,6 +4,8 @@ import org.gecko.model.Kind; import org.gecko.viewmodel.EdgeViewModel; + +/** Represents a type of {@link Action} that changes the {@link Kind} of an {@link EdgeViewModel}, which it holds a references to. Additionally, holds the old and new {@link Kind}s of the edge for undo/redo purposes. */ public class ChangeKindEdgeViewModelAction extends Action { private final Kind kind; diff --git a/src/main/java/org/gecko/actions/ChangePostconditionViewModelElementAction.java b/src/main/java/org/gecko/actions/ChangePostconditionViewModelElementAction.java index 24665843..2f8f8779 100644 --- a/src/main/java/org/gecko/actions/ChangePostconditionViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/ChangePostconditionViewModelElementAction.java @@ -3,6 +3,7 @@ import org.gecko.exceptions.GeckoException; import org.gecko.viewmodel.ContractViewModel; +/** A concrete representation of an {@link Action} that changes the postcondition of a {@link ContractViewModel}, which it holds a reference to. Additionally holds the old and new {@link String postcondition}s of the contract for undo/redo purposes. */ public class ChangePostconditionViewModelElementAction extends Action { private final ContractViewModel contractViewModel; diff --git a/src/main/java/org/gecko/actions/ChangePreconditionViewModelElementAction.java b/src/main/java/org/gecko/actions/ChangePreconditionViewModelElementAction.java index 4afc5735..c70152ba 100644 --- a/src/main/java/org/gecko/actions/ChangePreconditionViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/ChangePreconditionViewModelElementAction.java @@ -3,6 +3,7 @@ import org.gecko.exceptions.GeckoException; import org.gecko.viewmodel.ContractViewModel; +/** A concrete representation of an {@link Action} that changes the precondition of a {@link ContractViewModel}, which it holds a reference to. Additionally holds the old and new {@link String precondition}s of the contract for undo/redo purposes. */ public class ChangePreconditionViewModelElementAction extends Action { private final ContractViewModel contractViewModel; diff --git a/src/main/java/org/gecko/actions/ChangeTypePortViewModelElementAction.java b/src/main/java/org/gecko/actions/ChangeTypePortViewModelElementAction.java index b3fd5ca5..eff3ca7e 100644 --- a/src/main/java/org/gecko/actions/ChangeTypePortViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/ChangeTypePortViewModelElementAction.java @@ -3,6 +3,7 @@ import org.gecko.exceptions.GeckoException; import org.gecko.viewmodel.PortViewModel; +/** A concrete representation of an {@link Action} that changes the type of a {@link PortViewModel}, which it holds a reference to. Additionally holds the old and new {@link String type}s of the contract for undo/redo purposes. */ public class ChangeTypePortViewModelElementAction extends Action { private final PortViewModel portViewModel; diff --git a/src/main/java/org/gecko/actions/ChangeVisibilityPortViewModelAction.java b/src/main/java/org/gecko/actions/ChangeVisibilityPortViewModelAction.java index f73a5df4..30d1e532 100644 --- a/src/main/java/org/gecko/actions/ChangeVisibilityPortViewModelAction.java +++ b/src/main/java/org/gecko/actions/ChangeVisibilityPortViewModelAction.java @@ -11,6 +11,7 @@ import org.gecko.viewmodel.PortViewModel; import org.gecko.viewmodel.SystemConnectionViewModel; +/** A concrete representation of an {@link Action} that changes the visibility of a {@link PortViewModel}, which it holds a reference to. Additionally holds the old and new {@link Visibility Visibilities} of the contract for undo/redo purposes. */ public class ChangeVisibilityPortViewModelAction extends Action { private final GeckoViewModel geckoViewModel; diff --git a/src/main/java/org/gecko/actions/CreateContractViewModelElementAction.java b/src/main/java/org/gecko/actions/CreateContractViewModelElementAction.java index b581131f..6c65ce17 100644 --- a/src/main/java/org/gecko/actions/CreateContractViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/CreateContractViewModelElementAction.java @@ -5,6 +5,7 @@ import org.gecko.viewmodel.StateViewModel; import org.gecko.viewmodel.ViewModelFactory; +/** A concrete representation of an {@link Action} that creates a {@link ContractViewModel} in a given {@link StateViewModel} through the {@link ViewModelFactory} of the {@link org.gecko.viewmodel.GeckoViewModel}. */ public class CreateContractViewModelElementAction extends Action { private final ViewModelFactory viewModelFactory; diff --git a/src/main/java/org/gecko/actions/CreateEdgeViewModelElementAction.java b/src/main/java/org/gecko/actions/CreateEdgeViewModelElementAction.java index 4d6ddaf2..24743a13 100644 --- a/src/main/java/org/gecko/actions/CreateEdgeViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/CreateEdgeViewModelElementAction.java @@ -6,6 +6,7 @@ import org.gecko.viewmodel.StateViewModel; import org.gecko.viewmodel.SystemViewModel; +/** A concrete representation of an {@link Action} that creates an {@link EdgeViewModel} in the current-{@link SystemViewModel} with given source- and destination-{@link StateViewModel}s through the {@link org.gecko.viewmodel.ViewModelFactory} of the {@link GeckoViewModel}. */ public class CreateEdgeViewModelElementAction extends Action { private final GeckoViewModel geckoViewModel; diff --git a/src/main/java/org/gecko/actions/CreatePortViewModelElementAction.java b/src/main/java/org/gecko/actions/CreatePortViewModelElementAction.java index 5180d41f..cefb074d 100644 --- a/src/main/java/org/gecko/actions/CreatePortViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/CreatePortViewModelElementAction.java @@ -6,6 +6,7 @@ import org.gecko.viewmodel.PortViewModel; import org.gecko.viewmodel.SystemViewModel; +/** A concrete representation of an {@link Action} that creates a {@link PortViewModel} in a given {@link SystemViewModel} through the {@link org.gecko.viewmodel.ViewModelFactory} of the {@link GeckoViewModel}. */ public class CreatePortViewModelElementAction extends Action { private final GeckoViewModel geckoViewModel; diff --git a/src/main/java/org/gecko/actions/CreateRegionViewModelElementAction.java b/src/main/java/org/gecko/actions/CreateRegionViewModelElementAction.java index d088373f..f27d78a0 100644 --- a/src/main/java/org/gecko/actions/CreateRegionViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/CreateRegionViewModelElementAction.java @@ -7,6 +7,7 @@ import org.gecko.viewmodel.RegionViewModel; import org.gecko.viewmodel.SystemViewModel; +/** A concrete representation of an {@link Action} that creates a {@link RegionViewModel} in the current-{@link SystemViewModel} through the {@link org.gecko.viewmodel.ViewModelFactory} of the {@link GeckoViewModel}. Additionally holds the current {@link org.gecko.viewmodel.EditorViewModel} for setting the correct size and position for the created region. */ public class CreateRegionViewModelElementAction extends Action { private final GeckoViewModel geckoViewModel; diff --git a/src/main/java/org/gecko/actions/CreateStateViewModelElementAction.java b/src/main/java/org/gecko/actions/CreateStateViewModelElementAction.java index 0174bc25..3ee4a9be 100644 --- a/src/main/java/org/gecko/actions/CreateStateViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/CreateStateViewModelElementAction.java @@ -7,6 +7,7 @@ import org.gecko.viewmodel.StateViewModel; import org.gecko.viewmodel.SystemViewModel; +/** A concrete representation of an {@link Action} that creates a {@link StateViewModel} in the current-{@link SystemViewModel} through the {@link org.gecko.viewmodel.ViewModelFactory} of the {@link GeckoViewModel}. Additionally, holds the {@link Point2D position} and the current {@link EditorViewModel} for setting the correct position for the created state. */ public class CreateStateViewModelElementAction extends Action { private final GeckoViewModel geckoViewModel; diff --git a/src/main/java/org/gecko/actions/CreateSystemConnectionViewModelElementAction.java b/src/main/java/org/gecko/actions/CreateSystemConnectionViewModelElementAction.java index 5fe15a00..110691d7 100644 --- a/src/main/java/org/gecko/actions/CreateSystemConnectionViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/CreateSystemConnectionViewModelElementAction.java @@ -6,6 +6,7 @@ import org.gecko.viewmodel.SystemConnectionViewModel; import org.gecko.viewmodel.SystemViewModel; +/** A concrete representation of an {@link Action} that creates an {@link SystemConnectionViewModel} in the current-{@link SystemViewModel} with given source- and destination-{@link PortViewModel}s through the {@link org.gecko.viewmodel.ViewModelFactory} of the {@link GeckoViewModel}. */ public class CreateSystemConnectionViewModelElementAction extends Action { private final GeckoViewModel geckoViewModel; diff --git a/src/main/java/org/gecko/actions/CreateSystemViewModelElementAction.java b/src/main/java/org/gecko/actions/CreateSystemViewModelElementAction.java index 1405482c..351deaed 100644 --- a/src/main/java/org/gecko/actions/CreateSystemViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/CreateSystemViewModelElementAction.java @@ -6,6 +6,7 @@ import org.gecko.viewmodel.GeckoViewModel; import org.gecko.viewmodel.SystemViewModel; +/** A concrete representation of an {@link Action} that creates a {@link SystemViewModel} in the current-{@link SystemViewModel} through the {@link org.gecko.viewmodel.ViewModelFactory} of the {@link GeckoViewModel}. Additionally, holds the {@link Point2D position} and the current {@link EditorViewModel} for setting the correct position for the created system. */ public class CreateSystemViewModelElementAction extends Action { private final GeckoViewModel geckoViewModel; diff --git a/src/main/java/org/gecko/actions/CreateVariableAction.java b/src/main/java/org/gecko/actions/CreateVariableAction.java index cec3e8e7..73fe75a8 100644 --- a/src/main/java/org/gecko/actions/CreateVariableAction.java +++ b/src/main/java/org/gecko/actions/CreateVariableAction.java @@ -6,6 +6,7 @@ import org.gecko.viewmodel.GeckoViewModel; import org.gecko.viewmodel.PortViewModel; +/** A concrete representation of an {@link Action} that creates a {@link PortViewModel} in the current-{@link org.gecko.viewmodel.SystemViewModel} through the {@link org.gecko.viewmodel.ViewModelFactory} of the {@link GeckoViewModel}. Additionally, holds the {@link Point2D position} and the current {@link EditorViewModel} for setting the correct position for the created port. */ public class CreateVariableAction extends Action { private final GeckoViewModel geckoViewModel; diff --git a/src/main/java/org/gecko/actions/DeleteActionsCreatorVisitor.java b/src/main/java/org/gecko/actions/DeleteActionsCreatorVisitor.java index aeaa2d11..f87fd422 100644 --- a/src/main/java/org/gecko/actions/DeleteActionsCreatorVisitor.java +++ b/src/main/java/org/gecko/actions/DeleteActionsCreatorVisitor.java @@ -15,6 +15,8 @@ import org.gecko.viewmodel.SystemConnectionViewModel; import org.gecko.viewmodel.SystemViewModel; + +/** Follows the visitor pattern, implementing the {@link PositionableViewModelElementVisitor} interface. Determines all necessary delete-{@link Action}s for deleting all "lower level"-dependencies of a given parent-@link SystemViewModel}. */ public class DeleteActionsCreatorVisitor implements PositionableViewModelElementVisitor { private final GeckoViewModel geckoViewModel; diff --git a/src/main/java/org/gecko/actions/DeleteEdgeViewModelElementAction.java b/src/main/java/org/gecko/actions/DeleteEdgeViewModelElementAction.java index d9aab3ec..257c533e 100644 --- a/src/main/java/org/gecko/actions/DeleteEdgeViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/DeleteEdgeViewModelElementAction.java @@ -6,6 +6,7 @@ import org.gecko.viewmodel.GeckoViewModel; import org.gecko.viewmodel.PositionableViewModelElement; +/** A concrete representation of an {@link Action} that removes the target of an {@link EdgeViewModel} from the given {@link Automaton} and the afferent {@link EdgeViewModel} from the list of outgoing- and ingoing-{@link EdgeViewModel}s of its source- and destination-{@link org.gecko.viewmodel.StateViewModel}s. */ public class DeleteEdgeViewModelElementAction extends AbstractPositionableViewModelElementAction { private final GeckoViewModel geckoViewModel; private final EdgeViewModel edgeViewModel; diff --git a/src/main/java/org/gecko/actions/DeletePortViewModelElementAction.java b/src/main/java/org/gecko/actions/DeletePortViewModelElementAction.java index 9463fddc..6e105d6a 100644 --- a/src/main/java/org/gecko/actions/DeletePortViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/DeletePortViewModelElementAction.java @@ -6,6 +6,7 @@ import org.gecko.viewmodel.PositionableViewModelElement; import org.gecko.viewmodel.SystemViewModel; +/** A concrete representation of an {@link Action} that removes a {@link PortViewModel} from the given parent-{@link SystemViewModel}. */ public class DeletePortViewModelElementAction extends AbstractPositionableViewModelElementAction { private final GeckoViewModel geckoViewModel; private final PortViewModel portViewModel; diff --git a/src/main/java/org/gecko/actions/DeletePositionableViewModelElementAction.java b/src/main/java/org/gecko/actions/DeletePositionableViewModelElementAction.java index 0e664796..ca4d5a66 100644 --- a/src/main/java/org/gecko/actions/DeletePositionableViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/DeletePositionableViewModelElementAction.java @@ -8,6 +8,7 @@ import org.gecko.viewmodel.GeckoViewModel; import org.gecko.viewmodel.PositionableViewModelElement; +/** A concrete representation of an {@link Action} that deletes a set of {@link PositionableViewModelElement}s and their dependencies from the {@link GeckoViewModel}. */ public class DeletePositionableViewModelElementAction extends Action { private final GeckoViewModel geckoViewModel; diff --git a/src/main/java/org/gecko/actions/DeleteRegionViewModelElementAction.java b/src/main/java/org/gecko/actions/DeleteRegionViewModelElementAction.java index e308b0db..6bdcc5ab 100644 --- a/src/main/java/org/gecko/actions/DeleteRegionViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/DeleteRegionViewModelElementAction.java @@ -6,6 +6,7 @@ import org.gecko.viewmodel.PositionableViewModelElement; import org.gecko.viewmodel.RegionViewModel; +/** A concrete representation of an {@link Action} that removes a {@link RegionViewModel} from the {@link GeckoViewModel} and its target-{@link org.gecko.model.Region} from the given {@link Automaton}. */ public class DeleteRegionViewModelElementAction extends AbstractPositionableViewModelElementAction { private final GeckoViewModel geckoViewModel; private final RegionViewModel regionViewModel; diff --git a/src/main/java/org/gecko/actions/DeleteStateViewModelElementAction.java b/src/main/java/org/gecko/actions/DeleteStateViewModelElementAction.java index db01a5cb..879af6ca 100644 --- a/src/main/java/org/gecko/actions/DeleteStateViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/DeleteStateViewModelElementAction.java @@ -12,6 +12,7 @@ import org.gecko.viewmodel.StateViewModel; import org.gecko.viewmodel.SystemViewModel; +/** A concrete representation of an {@link Action} that removes a {@link StateViewModel} from the {@link GeckoViewModel} and its target-{@link State} from the given {@link Automaton}. */ public class DeleteStateViewModelElementAction extends AbstractPositionableViewModelElementAction { private final GeckoViewModel geckoViewModel; private final EditorViewModel editorViewModel; diff --git a/src/main/java/org/gecko/actions/DeleteSystemConnectionViewModelElementAction.java b/src/main/java/org/gecko/actions/DeleteSystemConnectionViewModelElementAction.java index 735fcf30..b228f26b 100644 --- a/src/main/java/org/gecko/actions/DeleteSystemConnectionViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/DeleteSystemConnectionViewModelElementAction.java @@ -6,6 +6,7 @@ import org.gecko.viewmodel.PositionableViewModelElement; import org.gecko.viewmodel.SystemConnectionViewModel; +/** A concrete representation of an {@link Action} that removes a {@link SystemConnectionViewModel} from a given {@link org.gecko.viewmodel.SystemViewModel}. */ public class DeleteSystemConnectionViewModelElementAction extends AbstractPositionableViewModelElementAction { private final GeckoViewModel geckoViewModel; private final SystemConnectionViewModel systemConnectionViewModel; diff --git a/src/main/java/org/gecko/actions/DeleteSystemViewModelElementAction.java b/src/main/java/org/gecko/actions/DeleteSystemViewModelElementAction.java index e8345362..587749b8 100644 --- a/src/main/java/org/gecko/actions/DeleteSystemViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/DeleteSystemViewModelElementAction.java @@ -6,6 +6,7 @@ import org.gecko.viewmodel.PositionableViewModelElement; import org.gecko.viewmodel.SystemViewModel; +/** A concrete representation of an {@link Action} that removes a {@link SystemViewModel} from a given {@link SystemViewModel}. */ public class DeleteSystemViewModelElementAction extends AbstractPositionableViewModelElementAction { private final GeckoViewModel geckoViewModel; private final SystemViewModel systemViewModel; diff --git a/src/main/java/org/gecko/actions/FocusPositionableViewModelElementAction.java b/src/main/java/org/gecko/actions/FocusPositionableViewModelElementAction.java index 2f3e067e..c6ad5d79 100644 --- a/src/main/java/org/gecko/actions/FocusPositionableViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/FocusPositionableViewModelElementAction.java @@ -4,6 +4,7 @@ import org.gecko.viewmodel.EditorViewModel; import org.gecko.viewmodel.PositionableViewModelElement; +/** A concrete representation of an {@link Action} that selects and focuses on a {link PositionableViewModelElement}. */ public class FocusPositionableViewModelElementAction extends Action { private final EditorViewModel editorViewModel; diff --git a/src/main/java/org/gecko/actions/ModifyEdgeViewModelPriorityAction.java b/src/main/java/org/gecko/actions/ModifyEdgeViewModelPriorityAction.java index 6f41fec4..8e32248f 100644 --- a/src/main/java/org/gecko/actions/ModifyEdgeViewModelPriorityAction.java +++ b/src/main/java/org/gecko/actions/ModifyEdgeViewModelPriorityAction.java @@ -3,6 +3,7 @@ import org.gecko.exceptions.GeckoException; import org.gecko.viewmodel.EdgeViewModel; +/** A concrete representation of an {@link Action} that changes the priority of an {@link EdgeViewModel}. Holds the old and new priorities of the edge. */ public class ModifyEdgeViewModelPriorityAction extends Action { private final EdgeViewModel edgeViewModel; diff --git a/src/main/java/org/gecko/actions/MoveBlockViewModelElementAction.java b/src/main/java/org/gecko/actions/MoveBlockViewModelElementAction.java index 4bf13cd1..4b385df9 100644 --- a/src/main/java/org/gecko/actions/MoveBlockViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/MoveBlockViewModelElementAction.java @@ -7,6 +7,7 @@ import org.gecko.viewmodel.EditorViewModel; import org.gecko.viewmodel.PositionableViewModelElement; +/** A concrete representation of an {@link Action} that moves a set of {link PositionableViewModelElement}s with a given {@link Point2D delta value}. */ public class MoveBlockViewModelElementAction extends Action { private final EditorViewModel editorViewModel; diff --git a/src/main/java/org/gecko/actions/MoveEdgeViewModelElementAction.java b/src/main/java/org/gecko/actions/MoveEdgeViewModelElementAction.java index 60f5dec0..0b3edb8e 100644 --- a/src/main/java/org/gecko/actions/MoveEdgeViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/MoveEdgeViewModelElementAction.java @@ -9,6 +9,7 @@ import org.gecko.viewmodel.GeckoViewModel; import org.gecko.viewmodel.StateViewModel; +/** A concrete representation of an {@link Action} that moves an {link EdgeViewModelElement} with a given {@link Point2D delta value}. */ public class MoveEdgeViewModelElementAction extends Action { private final GeckoViewModel geckoViewModel; diff --git a/src/main/java/org/gecko/actions/MoveSystemConnectionViewModelElementAction.java b/src/main/java/org/gecko/actions/MoveSystemConnectionViewModelElementAction.java index 9e4ae75a..c46c61f4 100644 --- a/src/main/java/org/gecko/actions/MoveSystemConnectionViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/MoveSystemConnectionViewModelElementAction.java @@ -14,6 +14,7 @@ import org.gecko.viewmodel.SystemConnectionViewModel; import org.gecko.viewmodel.SystemViewModel; +/** A concrete representation of an {@link Action} that moves a {@link SystemConnectionViewModel} with a given {@link Point2D delta value}. */ public class MoveSystemConnectionViewModelElementAction extends Action { private final GeckoViewModel geckoViewModel; diff --git a/src/main/java/org/gecko/actions/RenameViewModelElementAction.java b/src/main/java/org/gecko/actions/RenameViewModelElementAction.java index c11dac17..ff8c5a42 100644 --- a/src/main/java/org/gecko/actions/RenameViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/RenameViewModelElementAction.java @@ -5,6 +5,7 @@ import org.gecko.viewmodel.AbstractViewModelElement; import org.gecko.viewmodel.Renamable; +/** A concrete representation of an {@link Action} that changes the name of a {@link Renamable}. Additionally, holds the old and new {@link String name}s of the element. */ public class RenameViewModelElementAction extends Action { private final GeckoModel geckoModel; private final Renamable renamable; diff --git a/src/main/java/org/gecko/actions/RestoreContractViewModelElementAction.java b/src/main/java/org/gecko/actions/RestoreContractViewModelElementAction.java index 2d455a55..165e3165 100644 --- a/src/main/java/org/gecko/actions/RestoreContractViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/RestoreContractViewModelElementAction.java @@ -6,6 +6,7 @@ import org.gecko.viewmodel.EdgeViewModel; import org.gecko.viewmodel.StateViewModel; +/** A concrete representation of an {@link Action} that restores a deleted {@link ContractViewModel} in a given parent-{@link StateViewModel}. */ public class RestoreContractViewModelElementAction extends Action { private final StateViewModel parent; diff --git a/src/main/java/org/gecko/actions/RestoreEdgeViewModelElementAction.java b/src/main/java/org/gecko/actions/RestoreEdgeViewModelElementAction.java index 0bf66115..099022e1 100644 --- a/src/main/java/org/gecko/actions/RestoreEdgeViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/RestoreEdgeViewModelElementAction.java @@ -5,6 +5,7 @@ import org.gecko.viewmodel.EdgeViewModel; import org.gecko.viewmodel.GeckoViewModel; +/** A concrete representation of an {@link Action} that restores a deleted {@link EdgeViewModel} in a given {@link Automaton}. */ public class RestoreEdgeViewModelElementAction extends Action { private final GeckoViewModel geckoViewModel; private final EdgeViewModel edgeViewModel; diff --git a/src/main/java/org/gecko/actions/RestorePortViewModelElementAction.java b/src/main/java/org/gecko/actions/RestorePortViewModelElementAction.java index a5814665..95773b48 100644 --- a/src/main/java/org/gecko/actions/RestorePortViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/RestorePortViewModelElementAction.java @@ -5,6 +5,7 @@ import org.gecko.viewmodel.PortViewModel; import org.gecko.viewmodel.SystemViewModel; +/** A concrete representation of an {@link Action} that restores a deleted {@link PortViewModel} in a given {@link SystemViewModel}. */ public class RestorePortViewModelElementAction extends Action { private final GeckoViewModel geckoViewModel; private final PortViewModel portViewModel; diff --git a/src/main/java/org/gecko/actions/RestorePositionableViewModelElementAction.java b/src/main/java/org/gecko/actions/RestorePositionableViewModelElementAction.java index 34458dcc..0cd6da45 100644 --- a/src/main/java/org/gecko/actions/RestorePositionableViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/RestorePositionableViewModelElementAction.java @@ -7,6 +7,7 @@ import org.gecko.viewmodel.GeckoViewModel; import org.gecko.viewmodel.PositionableViewModelElement; +/** A concrete representation of an {@link Action} that restores a set of deleted {@link PositionableViewModelElement}s in the current {@link org.gecko.viewmodel.EditorViewModel}. */ public class RestorePositionableViewModelElementAction extends Action { private final GeckoViewModel geckoViewModel; diff --git a/src/main/java/org/gecko/application/Gecko.java b/src/main/java/org/gecko/application/Gecko.java index b58f7d91..f4ec7db0 100644 --- a/src/main/java/org/gecko/application/Gecko.java +++ b/src/main/java/org/gecko/application/Gecko.java @@ -6,6 +6,10 @@ import org.gecko.view.GeckoView; import org.gecko.viewmodel.GeckoViewModel; +/** + * Represents a Gecko, integrating the three architectural pattern levels of the graphic editor: a {@link GeckoModel}, a + * {@link GeckoView} and a {@link GeckoViewModel}. + */ @Getter public class Gecko { private final GeckoModel model; diff --git a/src/main/java/org/gecko/application/GeckoIOManager.java b/src/main/java/org/gecko/application/GeckoIOManager.java index 9e9bc274..93e224e7 100644 --- a/src/main/java/org/gecko/application/GeckoIOManager.java +++ b/src/main/java/org/gecko/application/GeckoIOManager.java @@ -19,6 +19,7 @@ import org.gecko.io.ProjectFileSerializer; import org.gecko.viewmodel.GeckoViewModel; +/** Represents a manager for the I/O functionalities of the Gecko Graphic Editor, following the singleton pattern. Provides methods for creating, loading and saving project files or importing and exporting a project to another file format. Uses the IO package for serialization and parsing. */ @Getter @Setter public class GeckoIOManager { diff --git a/src/main/java/org/gecko/application/GeckoManager.java b/src/main/java/org/gecko/application/GeckoManager.java index 6adc632b..929a1039 100644 --- a/src/main/java/org/gecko/application/GeckoManager.java +++ b/src/main/java/org/gecko/application/GeckoManager.java @@ -5,6 +5,7 @@ import lombok.Getter; import org.gecko.exceptions.ModelException; +/** Represents a manager for the active {@link Gecko}. Additionally, holds a reference to the {@link Stage} of the application.*/ public class GeckoManager { @Getter private Gecko gecko; diff --git a/src/main/java/org/gecko/application/Main.java b/src/main/java/org/gecko/application/Main.java index c27775fc..0d9088df 100644 --- a/src/main/java/org/gecko/application/Main.java +++ b/src/main/java/org/gecko/application/Main.java @@ -2,6 +2,8 @@ import javafx.application.Application; + +/** The main class of the Gecko Graphic Editor for Contract Automata, serving as the entry point of the {@link Application}. Provides the start method to configure and display the primary {@link javafx.stage.Stage} of the application. */ public class Main { private Main() { } diff --git a/src/main/java/org/gecko/exceptions/GeckoException.java b/src/main/java/org/gecko/exceptions/GeckoException.java index 67db8cfc..68119063 100644 --- a/src/main/java/org/gecko/exceptions/GeckoException.java +++ b/src/main/java/org/gecko/exceptions/GeckoException.java @@ -1,5 +1,6 @@ package org.gecko.exceptions; +/** A custom {@link Exception} for the Gecko Graphic Editor for Contract Automata. */ public class GeckoException extends Exception { public GeckoException(String message) { super(message); diff --git a/src/main/java/org/gecko/exceptions/MissingViewModelElementException.java b/src/main/java/org/gecko/exceptions/MissingViewModelElementException.java index bfc4aaf7..524667dd 100644 --- a/src/main/java/org/gecko/exceptions/MissingViewModelElementException.java +++ b/src/main/java/org/gecko/exceptions/MissingViewModelElementException.java @@ -1,5 +1,6 @@ package org.gecko.exceptions; +/** A custom {@link Exception} for the Gecko Graphic Editor for Contract Automata. */ public class MissingViewModelElementException extends GeckoException { public MissingViewModelElementException(String message) { super(message); diff --git a/src/main/java/org/gecko/exceptions/ModelException.java b/src/main/java/org/gecko/exceptions/ModelException.java index 157c9624..f86620fe 100644 --- a/src/main/java/org/gecko/exceptions/ModelException.java +++ b/src/main/java/org/gecko/exceptions/ModelException.java @@ -1,5 +1,6 @@ package org.gecko.exceptions; +/** A custom {@link Exception} for the Gecko Graphic Editor for Contract Automata. */ public class ModelException extends GeckoException { public ModelException(String message) { super(message); diff --git a/src/main/java/org/gecko/tools/AreaTool.java b/src/main/java/org/gecko/tools/AreaTool.java index fd835209..22015f9e 100644 --- a/src/main/java/org/gecko/tools/AreaTool.java +++ b/src/main/java/org/gecko/tools/AreaTool.java @@ -12,6 +12,7 @@ import javafx.scene.shape.Rectangle; import org.gecko.actions.ActionManager; +/** A concrete representation of an area-{@link Tool}, utilized for marking a rectangle-formed area in the view. Holds the {@Point2D starting position} and the afferent {@link Rectangle}. */ public abstract class AreaTool extends Tool { private Point2D startPosition; diff --git a/src/main/java/org/gecko/tools/CursorTool.java b/src/main/java/org/gecko/tools/CursorTool.java index 6ba538be..122e7096 100644 --- a/src/main/java/org/gecko/tools/CursorTool.java +++ b/src/main/java/org/gecko/tools/CursorTool.java @@ -28,6 +28,7 @@ import org.gecko.viewmodel.SelectionManager; import org.gecko.viewmodel.SystemConnectionViewModel; +/** A concrete representation of an area-{@link Tool}, utilized for marking a rectangle-formed area in the view. Holds the {@Point2D starting position} and the afferent {@link javafx.scene.shape.Rectangle}. */ public class CursorTool extends Tool { private boolean isDragging = false; diff --git a/src/main/java/org/gecko/tools/EdgeCreatorTool.java b/src/main/java/org/gecko/tools/EdgeCreatorTool.java index 59ae7b2b..b2f9a107 100644 --- a/src/main/java/org/gecko/tools/EdgeCreatorTool.java +++ b/src/main/java/org/gecko/tools/EdgeCreatorTool.java @@ -10,6 +10,7 @@ import org.gecko.view.views.viewelement.StateViewElement; import org.gecko.viewmodel.StateViewModel; +/** A concrete representation of an edge-creating-{@link Tool}, utilized for connecting a source- and a destination-{@link StateViewModel} through an {@link org.gecko.viewmodel.EdgeViewModel}. Holds the source-{@link StateViewModel}. */ public class EdgeCreatorTool extends Tool { private StateViewModel source; diff --git a/src/main/java/org/gecko/tools/MarqueeTool.java b/src/main/java/org/gecko/tools/MarqueeTool.java index f1113f50..ff021eb0 100644 --- a/src/main/java/org/gecko/tools/MarqueeTool.java +++ b/src/main/java/org/gecko/tools/MarqueeTool.java @@ -9,6 +9,7 @@ import org.gecko.viewmodel.EditorViewModel; import org.gecko.viewmodel.PositionableViewModelElement; +/** A concrete representation of a marquee-{@link AreaTool}, utilized for marking a rectangle-formed area in the view and thus selecting the covered {@link org.gecko.view.views.viewelement.ViewElement}s. Holds the current {@link EditorViewModel}.. */ public class MarqueeTool extends AreaTool { private final EditorViewModel editorViewModel; diff --git a/src/main/java/org/gecko/tools/PanTool.java b/src/main/java/org/gecko/tools/PanTool.java index 0e7caf8a..1d881248 100644 --- a/src/main/java/org/gecko/tools/PanTool.java +++ b/src/main/java/org/gecko/tools/PanTool.java @@ -6,6 +6,7 @@ import javafx.scene.layout.VBox; import org.gecko.actions.ActionManager; +/** A concrete representation of a pan-{@link Tool}, utilized for moving the view. */ public class PanTool extends Tool { public PanTool(ActionManager actionManager) { diff --git a/src/main/java/org/gecko/tools/RegionCreatorTool.java b/src/main/java/org/gecko/tools/RegionCreatorTool.java index e5d14980..28ce57e4 100644 --- a/src/main/java/org/gecko/tools/RegionCreatorTool.java +++ b/src/main/java/org/gecko/tools/RegionCreatorTool.java @@ -8,6 +8,7 @@ import org.gecko.actions.ActionManager; import org.gecko.viewmodel.PositionableViewModelElement; +/** A concrete representation of a region-creating-{@link AreaTool}, utilized for creating a rectangle-formed-{@link org.gecko.viewmodel.RegionViewModel}. Holds the {@link Color} of the drawn region. */ public class RegionCreatorTool extends AreaTool { private Color color; diff --git a/src/main/java/org/gecko/tools/StateCreatorTool.java b/src/main/java/org/gecko/tools/StateCreatorTool.java index c662b32a..b505c385 100644 --- a/src/main/java/org/gecko/tools/StateCreatorTool.java +++ b/src/main/java/org/gecko/tools/StateCreatorTool.java @@ -8,6 +8,7 @@ import org.gecko.actions.Action; import org.gecko.actions.ActionManager; +/** A concrete representation of a state-creating-{@link Tool}, utilized for creating a {@link org.gecko.viewmodel.StateViewModel}. */ public class StateCreatorTool extends Tool { public StateCreatorTool(ActionManager actionManager) { diff --git a/src/main/java/org/gecko/tools/SystemConnectionCreatorTool.java b/src/main/java/org/gecko/tools/SystemConnectionCreatorTool.java index 4bf523e4..c7e4ebd1 100644 --- a/src/main/java/org/gecko/tools/SystemConnectionCreatorTool.java +++ b/src/main/java/org/gecko/tools/SystemConnectionCreatorTool.java @@ -12,6 +12,7 @@ import org.gecko.view.views.viewelement.VariableBlockViewElement; import org.gecko.viewmodel.PortViewModel; +/** A concrete representation of a system-connection-creating-{@link Tool}, utilized for connecting a source- and a destination-{@link PortViewModel} through a {@link org.gecko.viewmodel.SystemConnectionViewModel}. Holds the source-{@link PortViewModel}. */ public class SystemConnectionCreatorTool extends Tool { private PortViewModel firstPortViewModel; diff --git a/src/main/java/org/gecko/tools/SystemCreatorTool.java b/src/main/java/org/gecko/tools/SystemCreatorTool.java index aa83414c..f8ae431f 100644 --- a/src/main/java/org/gecko/tools/SystemCreatorTool.java +++ b/src/main/java/org/gecko/tools/SystemCreatorTool.java @@ -8,6 +8,7 @@ import org.gecko.actions.Action; import org.gecko.actions.ActionManager; +/** A concrete representation of a system-creating-{@link Tool}, utilized for creating a {@link org.gecko.viewmodel.SystemViewModel}. */ public class SystemCreatorTool extends Tool { public SystemCreatorTool(ActionManager actionManager) { super(actionManager, ToolType.SYSTEM_CREATOR); diff --git a/src/main/java/org/gecko/tools/Tool.java b/src/main/java/org/gecko/tools/Tool.java index d848fe70..a1b3e010 100644 --- a/src/main/java/org/gecko/tools/Tool.java +++ b/src/main/java/org/gecko/tools/Tool.java @@ -23,6 +23,7 @@ import org.gecko.view.views.viewelement.decorator.ElementScalerViewElementDecorator; import org.gecko.view.views.viewelement.decorator.SelectableViewElementDecorator; +/** An abstract representation of a tool used in the Gecko Graphic Editor, characterized by a {@toolType}. Follows the visitor pattern, implementing the {@link ViewElementVisitor} interface. Defines the {@link MouseEvent} {@link EventHandler}s for each {@link org.gecko.view.views.viewelement.ViewElement}. */ public abstract class Tool implements ViewElementVisitor { protected final ActionManager actionManager; diff --git a/src/main/java/org/gecko/tools/ToolType.java b/src/main/java/org/gecko/tools/ToolType.java index e9839eae..eaae39c7 100644 --- a/src/main/java/org/gecko/tools/ToolType.java +++ b/src/main/java/org/gecko/tools/ToolType.java @@ -4,6 +4,7 @@ import lombok.Getter; import org.gecko.view.views.shortcuts.Shortcuts; +/** Enumerates the types of tools used in the Gecko Graphic Editor. Each {@link ToolType} is described by a label, an icon and a {@link KeyCodeCombination}. */ @Getter public enum ToolType { CURSOR("Cursor Tool", "cursor-icon", Shortcuts.CURSOR_TOOL.get()), diff --git a/src/main/java/org/gecko/tools/VariableBlockCreatorTool.java b/src/main/java/org/gecko/tools/VariableBlockCreatorTool.java index 141e5705..ac74e924 100644 --- a/src/main/java/org/gecko/tools/VariableBlockCreatorTool.java +++ b/src/main/java/org/gecko/tools/VariableBlockCreatorTool.java @@ -9,6 +9,7 @@ import org.gecko.actions.Action; import org.gecko.actions.ActionManager; +/** A concrete representation of a variable-block-creating-{@link Tool}, utilized for creating a {@link org.gecko.viewmodel.PortViewModel}. */ public class VariableBlockCreatorTool extends Tool { public VariableBlockCreatorTool(ActionManager actionManager) { diff --git a/src/main/java/org/gecko/tools/ZoomTool.java b/src/main/java/org/gecko/tools/ZoomTool.java index 3df8925e..f9e125f0 100644 --- a/src/main/java/org/gecko/tools/ZoomTool.java +++ b/src/main/java/org/gecko/tools/ZoomTool.java @@ -7,6 +7,7 @@ import javafx.scene.layout.VBox; import org.gecko.actions.ActionManager; +/** A concrete representation of a zoom-{@link Tool}, utilized for zooming in and out in the view. */ public class ZoomTool extends Tool { private static final double ZOOM_SCALE = 1.1; From c05b52fc98e824bc8270a28abaf99c76f194699c Mon Sep 17 00:00:00 2001 From: DecwLK Date: Mon, 12 Feb 2024 00:39:03 +0100 Subject: [PATCH 2/6] view switch fixes --- .../org/gecko/actions/ViewSwitchAction.java | 3 +++ .../org/gecko/view/menubar/MenuBarBuilder.java | 17 ++++------------- .../view/views/shortcuts/ShortcutHandler.java | 10 ---------- .../SystemEditorViewShortcutHandler.java | 11 +---------- .../org/gecko/viewmodel/EditorViewModel.java | 16 ++-------------- .../org/gecko/viewmodel/GeckoViewModel.java | 10 ++++------ 6 files changed, 14 insertions(+), 53 deletions(-) diff --git a/src/main/java/org/gecko/actions/ViewSwitchAction.java b/src/main/java/org/gecko/actions/ViewSwitchAction.java index 9ad0b952..cd762198 100644 --- a/src/main/java/org/gecko/actions/ViewSwitchAction.java +++ b/src/main/java/org/gecko/actions/ViewSwitchAction.java @@ -20,6 +20,9 @@ public class ViewSwitchAction extends Action { @Override boolean run() throws GeckoException { + if (systemViewModel == null) { + return false; + } geckoViewModel.switchEditor(systemViewModel, isAutomaton); return true; } diff --git a/src/main/java/org/gecko/view/menubar/MenuBarBuilder.java b/src/main/java/org/gecko/view/menubar/MenuBarBuilder.java index da90400c..90908262 100644 --- a/src/main/java/org/gecko/view/menubar/MenuBarBuilder.java +++ b/src/main/java/org/gecko/view/menubar/MenuBarBuilder.java @@ -3,8 +3,6 @@ import java.io.File; import java.util.List; import java.util.Set; -import javafx.scene.control.Alert; -import javafx.scene.control.ButtonType; import javafx.scene.control.Menu; import javafx.scene.control.MenuBar; import javafx.scene.control.MenuItem; @@ -20,6 +18,7 @@ import org.gecko.view.GeckoView; import org.gecko.view.views.shortcuts.Shortcuts; import org.gecko.viewmodel.PositionableViewModelElement; +import org.gecko.viewmodel.SystemViewModel; public class MenuBarBuilder { private final MenuBar menuBar; @@ -157,17 +156,9 @@ private Menu setupViewMenu() { MenuItem goToParentSystemMenuItem = new MenuItem("Go To Parent System"); goToParentSystemMenuItem.setOnAction(e -> { - if (view.getCurrentView().getViewModel().getCurrentSystem().getName().equals("root")) { - Alert alert = - new Alert(Alert.AlertType.INFORMATION, "The root system does not have a parent.", ButtonType.OK); - alert.showAndWait(); - } else { - if (view.getCurrentView().getViewModel().isAutomatonEditor()) { - changeViewMenuItem.fire(); - } - actionManager.run(actionManager.getActionFactory() - .createViewSwitchAction(view.getCurrentView().getViewModel().getParentSystem(), false)); - } + boolean isAutomatonEditor = view.getCurrentView().getViewModel().isAutomatonEditor(); + SystemViewModel parentSystem = view.getCurrentView().getViewModel().getParentSystem(); + actionManager.run(actionManager.getActionFactory().createViewSwitchAction(parentSystem, isAutomatonEditor)); }); goToParentSystemMenuItem.setAccelerator(Shortcuts.OPEN_PARENT_SYSTEM_EDITOR.get()); diff --git a/src/main/java/org/gecko/view/views/shortcuts/ShortcutHandler.java b/src/main/java/org/gecko/view/views/shortcuts/ShortcutHandler.java index 27cd3fbf..ce08f63a 100644 --- a/src/main/java/org/gecko/view/views/shortcuts/ShortcutHandler.java +++ b/src/main/java/org/gecko/view/views/shortcuts/ShortcutHandler.java @@ -11,7 +11,6 @@ import org.gecko.actions.ActionManager; import org.gecko.tools.ToolType; import org.gecko.view.views.EditorView; -import org.gecko.viewmodel.EditorViewModel; public abstract class ShortcutHandler implements EventHandler { private static final double ZOOM_FACTOR = 1.1; @@ -30,7 +29,6 @@ protected ShortcutHandler(ActionManager actionManager, EditorView editorView) { addSelectionShortcuts(); addDeleteShortcuts(); addUndoRedoShortcuts(); - addSwitchEditorShortcuts(); } @Override @@ -99,12 +97,4 @@ private void addUndoRedoShortcuts() { shortcuts.put(Shortcuts.REDO.get(), actionManager::redo); } - - private void addSwitchEditorShortcuts() { - shortcuts.put(Shortcuts.SWITCH_EDITOR.get(), () -> { - EditorViewModel editorViewModel = editorView.getViewModel(); - actionManager.run(actionFactory.createViewSwitchAction(editorViewModel.getCurrentSystem(), - !editorViewModel.isAutomatonEditor())); - }); - } } diff --git a/src/main/java/org/gecko/view/views/shortcuts/SystemEditorViewShortcutHandler.java b/src/main/java/org/gecko/view/views/shortcuts/SystemEditorViewShortcutHandler.java index df95a25f..4d24ae84 100644 --- a/src/main/java/org/gecko/view/views/shortcuts/SystemEditorViewShortcutHandler.java +++ b/src/main/java/org/gecko/view/views/shortcuts/SystemEditorViewShortcutHandler.java @@ -25,17 +25,8 @@ private void addNavigateSystemShortcuts() { try { SystemViewModel systemViewModel = (SystemViewModel) focusedElement; actionManager.run(actionFactory.createViewSwitchAction(systemViewModel, false)); - } catch (ClassCastException e) { - return; - } - }); - - shortcuts.put(Shortcuts.OPEN_PARENT_SYSTEM_EDITOR.get(), () -> { - SystemViewModel parentSystem = editorView.getViewModel().getParentSystem(); - if (parentSystem == null) { - return; + } catch (ClassCastException ignored) { } - actionManager.run(actionFactory.createViewSwitchAction(parentSystem, false)); }); } diff --git a/src/main/java/org/gecko/viewmodel/EditorViewModel.java b/src/main/java/org/gecko/viewmodel/EditorViewModel.java index cb7b1b6c..84014ff0 100644 --- a/src/main/java/org/gecko/viewmodel/EditorViewModel.java +++ b/src/main/java/org/gecko/viewmodel/EditorViewModel.java @@ -239,10 +239,6 @@ private void setFocusedElement(PositionableViewModelElement focusedElement) { focusedElementProperty.setValue(focusedElement); } - public void addPositionableViewModelElement(PositionableViewModelElement element) { - addPositionableViewModelElements(Set.of(element)); - } - /** * Adds the given elements to the current {@link EditorViewModel}. They will then be displayed in the view. * @@ -251,22 +247,14 @@ public void addPositionableViewModelElement(PositionableViewModelElement elem public void addPositionableViewModelElements(Set> elements) { elements.removeAll(containedPositionableViewModelElementsProperty); containedPositionableViewModelElementsProperty.addAll(elements); - //don't select elements if no elements are added to the current view - /*if (!elements.isEmpty()) { - actionManager.run(actionManager.getActionFactory().createSelectAction(elements, true)); - }*/ } /** - * Removes the given element from the current {@link EditorViewModel}. It will then no longer be displayed in the + * Removes the given elements from the current {@link EditorViewModel}. They will then no longer be displayed in the * view. * - * @param element the element to remove + * @param elements the elements to remove */ - public void removePositionableViewModelElement(PositionableViewModelElement element) { - containedPositionableViewModelElementsProperty.remove(element); - } - public void removePositionableViewModelElements(Set> elements) { elements.forEach(containedPositionableViewModelElementsProperty::remove); } diff --git a/src/main/java/org/gecko/viewmodel/GeckoViewModel.java b/src/main/java/org/gecko/viewmodel/GeckoViewModel.java index a98f4bd6..eb640f2b 100644 --- a/src/main/java/org/gecko/viewmodel/GeckoViewModel.java +++ b/src/main/java/org/gecko/viewmodel/GeckoViewModel.java @@ -68,13 +68,11 @@ public void switchEditor(SystemViewModel nextSystemViewModel, boolean isAutomato } private void setupNewEditorViewModel(SystemViewModel nextSystemViewModel, boolean isAutomatonEditor) { - SystemViewModel currentSystemViewModel = null; - if (getCurrentEditor() != null) { - currentSystemViewModel = getCurrentEditor().getCurrentSystem(); + SystemViewModel parent = null; + if (nextSystemViewModel.getTarget().getParent() != null) { + parent = (SystemViewModel) getViewModelElement(nextSystemViewModel.getTarget().getParent()); } - - EditorViewModel editorViewModel = viewModelFactory.createEditorViewModel(nextSystemViewModel, - nextSystemViewModel.equals(currentSystemViewModel) ? null : currentSystemViewModel, isAutomatonEditor); + EditorViewModel editorViewModel = viewModelFactory.createEditorViewModel(nextSystemViewModel, parent, isAutomatonEditor); openedEditorsProperty.add(editorViewModel); setCurrentEditor(editorViewModel); } From fc9a932e13a146b52797f1995df84767d19f2021 Mon Sep 17 00:00:00 2001 From: BenKenobie31415 Date: Mon, 12 Feb 2024 00:41:40 +0100 Subject: [PATCH 3/6] added rest of javadocs --- .../org/gecko/actions/RestoreRegionViewModelElementAction.java | 1 + .../org/gecko/actions/RestoreStateViewModelElementAction.java | 1 + .../actions/RestoreSystemConnectionViewModelElementAction.java | 1 + .../org/gecko/actions/RestoreSystemViewModelElementAction.java | 1 + .../java/org/gecko/actions/ScaleBlockViewModelElementAction.java | 1 + src/main/java/org/gecko/actions/SelectAction.java | 1 + src/main/java/org/gecko/actions/SelectToolAction.java | 1 + src/main/java/org/gecko/actions/SelectionHistoryBackAction.java | 1 + .../java/org/gecko/actions/SelectionHistoryForwardAction.java | 1 + .../org/gecko/actions/SetStartStateViewModelElementAction.java | 1 + src/main/java/org/gecko/actions/ViewSwitchAction.java | 1 + src/main/java/org/gecko/actions/ZoomAction.java | 1 + src/main/java/org/gecko/actions/ZoomCenterAction.java | 1 + src/main/java/org/gecko/view/ResourceHandler.java | 1 + .../view/contextmenu/EdgeViewElementContextMenuBuilder.java | 1 + .../view/contextmenu/RegionViewElementContextMenuBuilder.java | 1 + .../view/contextmenu/StateViewElementContextMenuBuilder.java | 1 + .../SystemConnectionViewElementContextMenuBuilder.java | 1 + .../view/contextmenu/SystemViewElementContextMenuBuilder.java | 1 + .../contextmenu/VariableBlockViewElementContextMenuBuilder.java | 1 + .../java/org/gecko/view/contextmenu/ViewContextMenuBuilder.java | 1 + src/main/java/org/gecko/view/inspector/Inspector.java | 1 + src/main/java/org/gecko/view/inspector/InspectorFactory.java | 1 + .../java/org/gecko/view/inspector/InspectorFactoryVisitor.java | 1 + .../gecko/view/inspector/builder/AbstractInspectorBuilder.java | 1 + .../org/gecko/view/inspector/builder/EdgeInspectorBuilder.java | 1 + .../org/gecko/view/inspector/builder/RegionInspectorBuilder.java | 1 + .../org/gecko/view/inspector/builder/StateInspectorBuilder.java | 1 + .../org/gecko/view/inspector/builder/SystemInspectorBuilder.java | 1 + .../view/inspector/builder/VariableBlockInspectorBuilder.java | 1 + .../org/gecko/view/inspector/element/InspectorColorPicker.java | 1 + .../java/org/gecko/view/inspector/element/InspectorElement.java | 1 + .../org/gecko/view/inspector/element/InspectorSeparator.java | 1 + .../view/inspector/element/button/AbstractInspectorButton.java | 1 + .../inspector/element/button/InspectorAddContractButton.java | 1 + .../inspector/element/button/InspectorAddVariableButton.java | 1 + .../element/button/InspectorCollapseContractButton.java | 1 + .../view/inspector/element/button/InspectorDeleteButton.java | 1 + .../view/inspector/element/button/InspectorFocusButton.java | 1 + .../view/inspector/element/button/InspectorOpenSystemButton.java | 1 + .../inspector/element/button/InspectorRemoveContractButton.java | 1 + .../inspector/element/button/InspectorRemoveVariableButton.java | 1 + .../element/button/InspectorSelectionBackwardButton.java | 1 + .../element/button/InspectorSelectionForwardButton.java | 1 + .../inspector/element/button/InspectorSetStartStateButton.java | 1 + .../gecko/view/inspector/element/combobox/InspectorComboBox.java | 1 + .../view/inspector/element/combobox/InspectorKindComboBox.java | 1 + .../inspector/element/combobox/InspectorVisibilityComboBox.java | 1 + .../view/inspector/element/container/InspectorContractItem.java | 1 + .../view/inspector/element/container/InspectorContractLabel.java | 1 + .../inspector/element/container/InspectorEdgeStateLabel.java | 1 + .../view/inspector/element/container/InspectorKindPicker.java | 1 + .../view/inspector/element/container/InspectorPriorityLabel.java | 1 + .../inspector/element/container/InspectorRegionColorItem.java | 1 + .../view/inspector/element/container/InspectorTypeLabel.java | 1 + .../view/inspector/element/container/InspectorVariableField.java | 1 + .../view/inspector/element/container/InspectorVariableLabel.java | 1 + .../inspector/element/container/InspectorVisibilityPicker.java | 1 + .../inspector/element/container/LabeledInspectorElement.java | 1 + .../org/gecko/view/inspector/element/label/InspectorLabel.java | 1 + .../gecko/view/inspector/element/list/AbstractInspectorList.java | 1 + .../gecko/view/inspector/element/list/InspectorContractList.java | 1 + .../gecko/view/inspector/element/list/InspectorRegionList.java | 1 + .../gecko/view/inspector/element/list/InspectorVariableList.java | 1 + .../inspector/element/textfield/InspectorInvariantField.java | 1 + .../inspector/element/textfield/InspectorPostconditionField.java | 1 + .../inspector/element/textfield/InspectorPreconditionField.java | 1 + .../view/inspector/element/textfield/InspectorPriorityField.java | 1 + .../view/inspector/element/textfield/InspectorRenameField.java | 1 + .../view/inspector/element/textfield/InspectorTextField.java | 1 + .../view/inspector/element/textfield/InspectorTypeField.java | 1 + src/main/java/org/gecko/view/menubar/MenuBarBuilder.java | 1 + src/main/java/org/gecko/view/toolbar/ToolBarBuilder.java | 1 + src/main/java/org/gecko/view/views/EditorView.java | 1 + src/main/java/org/gecko/view/views/FloatingUIBuilder.java | 1 + .../java/org/gecko/view/views/ViewElementCreatorVisitor.java | 1 + src/main/java/org/gecko/view/views/ViewElementSearchVisitor.java | 1 + src/main/java/org/gecko/view/views/ViewFactory.java | 1 + .../view/views/shortcuts/AutomatonEditorViewShortcutHandler.java | 1 + .../java/org/gecko/view/views/shortcuts/ShortcutHandler.java | 1 + src/main/java/org/gecko/view/views/shortcuts/Shortcuts.java | 1 + .../view/views/shortcuts/SystemEditorViewShortcutHandler.java | 1 + .../java/org/gecko/view/views/viewelement/BlockViewElement.java | 1 + .../org/gecko/view/views/viewelement/ConnectionViewElement.java | 1 + .../java/org/gecko/view/views/viewelement/EdgeViewElement.java | 1 + .../java/org/gecko/view/views/viewelement/PortViewElement.java | 1 + .../java/org/gecko/view/views/viewelement/RegionViewElement.java | 1 + .../java/org/gecko/view/views/viewelement/StateViewElement.java | 1 + .../view/views/viewelement/SystemConnectionViewElement.java | 1 + .../java/org/gecko/view/views/viewelement/SystemViewElement.java | 1 + .../gecko/view/views/viewelement/VariableBlockViewElement.java | 1 + src/main/java/org/gecko/view/views/viewelement/ViewElement.java | 1 + .../org/gecko/view/views/viewelement/ViewElementVisitor.java | 1 + .../decorator/BlockElementScalerViewElementDecorator.java | 1 + .../decorator/ConnectionElementScalerViewElementDecorator.java | 1 + .../view/views/viewelement/decorator/ElementScalerBlock.java | 1 + .../viewelement/decorator/SelectableViewElementDecorator.java | 1 + .../view/views/viewelement/decorator/ViewElementDecorator.java | 1 + src/main/java/org/gecko/viewmodel/ConnectionViewModel.java | 1 + src/main/java/org/gecko/viewmodel/EditorViewModel.java | 1 + src/main/java/org/gecko/viewmodel/SelectionManager.java | 1 + 101 files changed, 101 insertions(+) diff --git a/src/main/java/org/gecko/actions/RestoreRegionViewModelElementAction.java b/src/main/java/org/gecko/actions/RestoreRegionViewModelElementAction.java index b24e6359..cf7fccea 100644 --- a/src/main/java/org/gecko/actions/RestoreRegionViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/RestoreRegionViewModelElementAction.java @@ -4,6 +4,7 @@ import org.gecko.viewmodel.GeckoViewModel; import org.gecko.viewmodel.RegionViewModel; +/** A concrete representation of an {@link Action} that restores a deleted {@link RegionViewModel} in a given {@link Automaton}. */ public class RestoreRegionViewModelElementAction extends Action { private final GeckoViewModel geckoViewModel; private final RegionViewModel regionViewModel; diff --git a/src/main/java/org/gecko/actions/RestoreStateViewModelElementAction.java b/src/main/java/org/gecko/actions/RestoreStateViewModelElementAction.java index ee1de776..36b3689c 100644 --- a/src/main/java/org/gecko/actions/RestoreStateViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/RestoreStateViewModelElementAction.java @@ -6,6 +6,7 @@ import org.gecko.viewmodel.StateViewModel; import org.gecko.viewmodel.SystemViewModel; +/** A concrete representation of an {@link Action} that restores a deleted {@link StateViewModel} in a given {@link Automaton}. */ public class RestoreStateViewModelElementAction extends Action { private final GeckoViewModel geckoViewModel; private final StateViewModel stateViewModel; diff --git a/src/main/java/org/gecko/actions/RestoreSystemConnectionViewModelElementAction.java b/src/main/java/org/gecko/actions/RestoreSystemConnectionViewModelElementAction.java index efd5d338..2ac0818c 100644 --- a/src/main/java/org/gecko/actions/RestoreSystemConnectionViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/RestoreSystemConnectionViewModelElementAction.java @@ -5,6 +5,7 @@ import org.gecko.viewmodel.GeckoViewModel; import org.gecko.viewmodel.SystemConnectionViewModel; +/** A concrete representation of an {@link Action} that restores a deleted {@link SystemConnectionViewModel} in a given {@link org.gecko.viewmodel.SystemViewModel}. */ public class RestoreSystemConnectionViewModelElementAction extends Action { private final GeckoViewModel geckoViewModel; private final SystemConnectionViewModel systemConnectionViewModel; diff --git a/src/main/java/org/gecko/actions/RestoreSystemViewModelElementAction.java b/src/main/java/org/gecko/actions/RestoreSystemViewModelElementAction.java index 34d1d839..61abd4e5 100644 --- a/src/main/java/org/gecko/actions/RestoreSystemViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/RestoreSystemViewModelElementAction.java @@ -5,6 +5,7 @@ import org.gecko.viewmodel.GeckoViewModel; import org.gecko.viewmodel.SystemViewModel; +/** A concrete representation of an {@link Action} that restores a deleted {@link SystemViewModel} in a given {@link SystemViewModel}. */ public class RestoreSystemViewModelElementAction extends Action { private final GeckoViewModel geckoViewModel; private final SystemViewModel systemViewModel; diff --git a/src/main/java/org/gecko/actions/ScaleBlockViewModelElementAction.java b/src/main/java/org/gecko/actions/ScaleBlockViewModelElementAction.java index 2aa11c50..3cd2b17b 100644 --- a/src/main/java/org/gecko/actions/ScaleBlockViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/ScaleBlockViewModelElementAction.java @@ -6,6 +6,7 @@ import org.gecko.viewmodel.BlockViewModelElement; import org.gecko.viewmodel.EditorViewModel; +/** A concrete representation of an {@link Action} that scales a {@link BlockViewModelElement} by a {@link Point2D delta value} using an {@link ElementScalerBlock}. */ public class ScaleBlockViewModelElementAction extends Action { private final EditorViewModel editorViewModel; diff --git a/src/main/java/org/gecko/actions/SelectAction.java b/src/main/java/org/gecko/actions/SelectAction.java index 222ad5ca..e5cc45fa 100644 --- a/src/main/java/org/gecko/actions/SelectAction.java +++ b/src/main/java/org/gecko/actions/SelectAction.java @@ -7,6 +7,7 @@ import org.gecko.viewmodel.PositionableViewModelElement; import org.gecko.viewmodel.SelectionManager; +/** A concrete representation of an {@link Action} that selects a set of {link PositionableViewModelElement}s. */ public class SelectAction extends Action { private final SelectionManager selectionManager; private final Set> elementsToSelect; diff --git a/src/main/java/org/gecko/actions/SelectToolAction.java b/src/main/java/org/gecko/actions/SelectToolAction.java index 48a2fad2..1628a61a 100644 --- a/src/main/java/org/gecko/actions/SelectToolAction.java +++ b/src/main/java/org/gecko/actions/SelectToolAction.java @@ -4,6 +4,7 @@ import org.gecko.tools.ToolType; import org.gecko.viewmodel.EditorViewModel; +/** A concrete representation of an {@link Action} that changes the active {@link org.gecko.tools.Tool} in the current {@link EditorViewModel}. */ public class SelectToolAction extends Action { private final EditorViewModel editorViewModel; private final ToolType tool; diff --git a/src/main/java/org/gecko/actions/SelectionHistoryBackAction.java b/src/main/java/org/gecko/actions/SelectionHistoryBackAction.java index ecd8dd1f..4cfc0c44 100644 --- a/src/main/java/org/gecko/actions/SelectionHistoryBackAction.java +++ b/src/main/java/org/gecko/actions/SelectionHistoryBackAction.java @@ -3,6 +3,7 @@ import org.gecko.exceptions.GeckoException; import org.gecko.viewmodel.SelectionManager; +/** A concrete representation of an {@link Action} that navigates back in the {@link SelectionManager}. */ public class SelectionHistoryBackAction extends Action { private final SelectionManager selectionManager; diff --git a/src/main/java/org/gecko/actions/SelectionHistoryForwardAction.java b/src/main/java/org/gecko/actions/SelectionHistoryForwardAction.java index b94b1fdf..2094cea5 100644 --- a/src/main/java/org/gecko/actions/SelectionHistoryForwardAction.java +++ b/src/main/java/org/gecko/actions/SelectionHistoryForwardAction.java @@ -3,6 +3,7 @@ import org.gecko.exceptions.GeckoException; import org.gecko.viewmodel.SelectionManager; +/** A concrete representation of an {@link Action} that navigates forward in the {@link SelectionManager}. */ public class SelectionHistoryForwardAction extends Action { private final SelectionManager selectionManager; diff --git a/src/main/java/org/gecko/actions/SetStartStateViewModelElementAction.java b/src/main/java/org/gecko/actions/SetStartStateViewModelElementAction.java index 0664e406..a6649422 100644 --- a/src/main/java/org/gecko/actions/SetStartStateViewModelElementAction.java +++ b/src/main/java/org/gecko/actions/SetStartStateViewModelElementAction.java @@ -5,6 +5,7 @@ import org.gecko.viewmodel.StateViewModel; import org.gecko.viewmodel.SystemViewModel; +/** A concrete representation of an {@link Action} that sets a {@link StateViewModel} as start state in the current {@link SystemViewModel}. Additionally, holds the previous start-{@link StateViewModel}. */ public class SetStartStateViewModelElementAction extends Action { private final GeckoViewModel geckoViewModel; private final StateViewModel stateViewModel; diff --git a/src/main/java/org/gecko/actions/ViewSwitchAction.java b/src/main/java/org/gecko/actions/ViewSwitchAction.java index 9ad0b952..0fd18b4c 100644 --- a/src/main/java/org/gecko/actions/ViewSwitchAction.java +++ b/src/main/java/org/gecko/actions/ViewSwitchAction.java @@ -5,6 +5,7 @@ import org.gecko.viewmodel.GeckoViewModel; import org.gecko.viewmodel.SystemViewModel; +/** A concrete representation of an {@link Action} that switches between {@link EditorViewModel}s depending on whether or not the current {@link EditorViewModel} is an automaton view. */ public class ViewSwitchAction extends Action { private final SystemViewModel systemViewModel; private final boolean isAutomaton; diff --git a/src/main/java/org/gecko/actions/ZoomAction.java b/src/main/java/org/gecko/actions/ZoomAction.java index 6bc0de4f..f4e5ef85 100644 --- a/src/main/java/org/gecko/actions/ZoomAction.java +++ b/src/main/java/org/gecko/actions/ZoomAction.java @@ -4,6 +4,7 @@ import org.gecko.exceptions.GeckoException; import org.gecko.viewmodel.EditorViewModel; +/** A concrete representation of an {@link Action} that zooms in or out in the given {@link EditorViewModel} from a given {link Point2D pivot} by a given zoom factor. */ public class ZoomAction extends Action { private final EditorViewModel editorViewModel; diff --git a/src/main/java/org/gecko/actions/ZoomCenterAction.java b/src/main/java/org/gecko/actions/ZoomCenterAction.java index 23e3dce7..8d871116 100644 --- a/src/main/java/org/gecko/actions/ZoomCenterAction.java +++ b/src/main/java/org/gecko/actions/ZoomCenterAction.java @@ -3,6 +3,7 @@ import org.gecko.exceptions.GeckoException; import org.gecko.viewmodel.EditorViewModel; +/** A concrete representation of an {@link Action} that zooms in or out from the center of a given {@link EditorViewModel} by a given zoom factor. */ public class ZoomCenterAction extends Action { private final EditorViewModel editorViewModel; diff --git a/src/main/java/org/gecko/view/ResourceHandler.java b/src/main/java/org/gecko/view/ResourceHandler.java index 0f8d091b..41d1c609 100644 --- a/src/main/java/org/gecko/view/ResourceHandler.java +++ b/src/main/java/org/gecko/view/ResourceHandler.java @@ -6,6 +6,7 @@ import lombok.Getter; import lombok.Setter; +/** Provides methods for getting {@link String}s that are dependent on a given key and the Language currently used in the view. */ public class ResourceHandler { @Getter @Setter diff --git a/src/main/java/org/gecko/view/contextmenu/EdgeViewElementContextMenuBuilder.java b/src/main/java/org/gecko/view/contextmenu/EdgeViewElementContextMenuBuilder.java index 65c130b0..a1d9d544 100644 --- a/src/main/java/org/gecko/view/contextmenu/EdgeViewElementContextMenuBuilder.java +++ b/src/main/java/org/gecko/view/contextmenu/EdgeViewElementContextMenuBuilder.java @@ -8,6 +8,7 @@ import org.gecko.model.Kind; import org.gecko.viewmodel.EdgeViewModel; +/** Represents a type of {@link ViewContextMenuBuilder} for a {@link ContextMenu} specific to an {@link org.gecko.view.views.viewelement.EdgeViewElement EdgeViewElement}. Contains {@link MenuItem}s that run operations like changing the edge's kind or deleting the edge. */ public class EdgeViewElementContextMenuBuilder extends ViewContextMenuBuilder { private final EdgeViewModel edgeViewModel; diff --git a/src/main/java/org/gecko/view/contextmenu/RegionViewElementContextMenuBuilder.java b/src/main/java/org/gecko/view/contextmenu/RegionViewElementContextMenuBuilder.java index f125f142..c2dfbda5 100644 --- a/src/main/java/org/gecko/view/contextmenu/RegionViewElementContextMenuBuilder.java +++ b/src/main/java/org/gecko/view/contextmenu/RegionViewElementContextMenuBuilder.java @@ -6,6 +6,7 @@ import org.gecko.actions.ActionManager; import org.gecko.viewmodel.RegionViewModel; +/** Represents a type of {@link ViewContextMenuBuilder} for a {@link ContextMenu} specific to a {@link org.gecko.view.views.viewelement.RegionViewElement RegionViewElement}. Contains {@link MenuItem}s that run operations like deleting the edge. */ public class RegionViewElementContextMenuBuilder extends ViewContextMenuBuilder { private final RegionViewModel regionViewModel; diff --git a/src/main/java/org/gecko/view/contextmenu/StateViewElementContextMenuBuilder.java b/src/main/java/org/gecko/view/contextmenu/StateViewElementContextMenuBuilder.java index 04272fb1..51c36d88 100644 --- a/src/main/java/org/gecko/view/contextmenu/StateViewElementContextMenuBuilder.java +++ b/src/main/java/org/gecko/view/contextmenu/StateViewElementContextMenuBuilder.java @@ -6,6 +6,7 @@ import org.gecko.actions.ActionManager; import org.gecko.viewmodel.StateViewModel; +/** Represents a type of {@link ViewContextMenuBuilder} for a {@link ContextMenu} specific to a {@link org.gecko.view.views.viewelement.StateViewElement StateViewElement}. Contains {@link MenuItem}s that run operations like setting the state as start-state or deleting the state. */ public class StateViewElementContextMenuBuilder extends ViewContextMenuBuilder { private final StateViewModel stateViewModel; diff --git a/src/main/java/org/gecko/view/contextmenu/SystemConnectionViewElementContextMenuBuilder.java b/src/main/java/org/gecko/view/contextmenu/SystemConnectionViewElementContextMenuBuilder.java index dc76c3ac..400ba3fc 100644 --- a/src/main/java/org/gecko/view/contextmenu/SystemConnectionViewElementContextMenuBuilder.java +++ b/src/main/java/org/gecko/view/contextmenu/SystemConnectionViewElementContextMenuBuilder.java @@ -6,6 +6,7 @@ import org.gecko.actions.ActionManager; import org.gecko.viewmodel.SystemConnectionViewModel; +/** Represents a type of {@link ViewContextMenuBuilder} for a {@link ContextMenu} specific to a {@link org.gecko.view.views.viewelement.SystemConnectionViewElement SystemConnectionViewElement}. Contains {@link MenuItem}s that run operations like deleting the connection. */ public class SystemConnectionViewElementContextMenuBuilder extends ViewContextMenuBuilder { private final SystemConnectionViewModel systemConnectionViewModel; diff --git a/src/main/java/org/gecko/view/contextmenu/SystemViewElementContextMenuBuilder.java b/src/main/java/org/gecko/view/contextmenu/SystemViewElementContextMenuBuilder.java index 5753a8be..38675430 100644 --- a/src/main/java/org/gecko/view/contextmenu/SystemViewElementContextMenuBuilder.java +++ b/src/main/java/org/gecko/view/contextmenu/SystemViewElementContextMenuBuilder.java @@ -7,6 +7,7 @@ import org.gecko.view.views.shortcuts.Shortcuts; import org.gecko.viewmodel.SystemViewModel; +/** Represents a type of {@link ViewContextMenuBuilder} for a {@link ContextMenu} specific to a {@link org.gecko.view.views.viewelement.SystemViewElement SystemViewElement}. Contains {@link MenuItem}s that run operations like opening or deleting the system. */ public class SystemViewElementContextMenuBuilder extends ViewContextMenuBuilder { private final SystemViewModel systemViewModel; diff --git a/src/main/java/org/gecko/view/contextmenu/VariableBlockViewElementContextMenuBuilder.java b/src/main/java/org/gecko/view/contextmenu/VariableBlockViewElementContextMenuBuilder.java index ec171350..fdc491bb 100644 --- a/src/main/java/org/gecko/view/contextmenu/VariableBlockViewElementContextMenuBuilder.java +++ b/src/main/java/org/gecko/view/contextmenu/VariableBlockViewElementContextMenuBuilder.java @@ -6,6 +6,7 @@ import org.gecko.actions.ActionManager; import org.gecko.viewmodel.PortViewModel; +/** Represents a type of {@link ViewContextMenuBuilder} for a {@link ContextMenu} specific to a {@link org.gecko.view.views.viewelement.PortViewElement PortViewElement}. Contains {@link MenuItem}s that run operations like deleting the port. */ public class VariableBlockViewElementContextMenuBuilder extends ViewContextMenuBuilder { private final PortViewModel portViewModel; diff --git a/src/main/java/org/gecko/view/contextmenu/ViewContextMenuBuilder.java b/src/main/java/org/gecko/view/contextmenu/ViewContextMenuBuilder.java index ac9ae583..05316549 100644 --- a/src/main/java/org/gecko/view/contextmenu/ViewContextMenuBuilder.java +++ b/src/main/java/org/gecko/view/contextmenu/ViewContextMenuBuilder.java @@ -9,6 +9,7 @@ import org.gecko.view.views.shortcuts.Shortcuts; import org.gecko.viewmodel.EditorViewModel; +/** Represents a builder for a general purpose {@link ContextMenu} in the view, containing {@link MenuItem}s that run the cut, copy, paste, select all and deselect all operations. Holds therefore a reference to the {@link ActionManager} and to the built {@link ContextMenu}. */ public class ViewContextMenuBuilder { protected final ActionManager actionManager; @Setter diff --git a/src/main/java/org/gecko/view/inspector/Inspector.java b/src/main/java/org/gecko/view/inspector/Inspector.java index 8d07d294..a6d4cea0 100644 --- a/src/main/java/org/gecko/view/inspector/Inspector.java +++ b/src/main/java/org/gecko/view/inspector/Inspector.java @@ -13,6 +13,7 @@ import org.gecko.view.inspector.element.button.InspectorSelectionBackwardButton; import org.gecko.view.inspector.element.button.InspectorSelectionForwardButton; +/** Represents a {@link ScrollPane} that encapsulates {@link InspectorElement}s, which allow the properties of Gecko elements to be modified from the view. */ public class Inspector extends ScrollPane { private static final int INSPECTOR_ELEMENT_SPACING = 10; diff --git a/src/main/java/org/gecko/view/inspector/InspectorFactory.java b/src/main/java/org/gecko/view/inspector/InspectorFactory.java index 1735d51d..ca1215ad 100644 --- a/src/main/java/org/gecko/view/inspector/InspectorFactory.java +++ b/src/main/java/org/gecko/view/inspector/InspectorFactory.java @@ -18,6 +18,7 @@ import org.gecko.viewmodel.StateViewModel; import org.gecko.viewmodel.SystemViewModel; +/** Represents a factory for inspectors. Provides a method for the creation of an {@link Inspector} built by each of the {@link AbstractInspectorBuilder}s. */ public class InspectorFactory { private final EditorViewModel editorViewModel; diff --git a/src/main/java/org/gecko/view/inspector/InspectorFactoryVisitor.java b/src/main/java/org/gecko/view/inspector/InspectorFactoryVisitor.java index 0c1db67b..7e7cbe1f 100644 --- a/src/main/java/org/gecko/view/inspector/InspectorFactoryVisitor.java +++ b/src/main/java/org/gecko/view/inspector/InspectorFactoryVisitor.java @@ -9,6 +9,7 @@ import org.gecko.viewmodel.SystemConnectionViewModel; import org.gecko.viewmodel.SystemViewModel; +/** Follows the visitor pattern, implementing the {@link PositionableViewModelElementVisitor} interface. Holds a reference to the {@link InspectorFactory} and to the built {@link Inspector}. It uses the factory when visiting each type of {@link org.gecko.viewmodel.PositionableViewModelElement PositionableViewModelElement} in order to create inspectors for concrete {@link org.gecko.viewmodel.PositionableViewModelElement PositionableViewModelElement}s. */ public class InspectorFactoryVisitor implements PositionableViewModelElementVisitor { private final InspectorFactory inspectorFactory; diff --git a/src/main/java/org/gecko/view/inspector/builder/AbstractInspectorBuilder.java b/src/main/java/org/gecko/view/inspector/builder/AbstractInspectorBuilder.java index bbe13de4..a38bfee2 100644 --- a/src/main/java/org/gecko/view/inspector/builder/AbstractInspectorBuilder.java +++ b/src/main/java/org/gecko/view/inspector/builder/AbstractInspectorBuilder.java @@ -12,6 +12,7 @@ import org.gecko.viewmodel.PositionableViewModelElement; import org.gecko.viewmodel.Renamable; +/** An abstract representation of a generic builder for an {@link Inspector} that corresponds to a {@link PositionableViewModelElement}. Holds a reference to the {@link ActionManager}, which allows for operations to be run from the inspector, and a list of {@link InspectorElement}s, which are added to a built {@link Inspector}. */ public abstract class AbstractInspectorBuilder> { @Getter private final T viewModel; diff --git a/src/main/java/org/gecko/view/inspector/builder/EdgeInspectorBuilder.java b/src/main/java/org/gecko/view/inspector/builder/EdgeInspectorBuilder.java index 80e98030..86e2630c 100644 --- a/src/main/java/org/gecko/view/inspector/builder/EdgeInspectorBuilder.java +++ b/src/main/java/org/gecko/view/inspector/builder/EdgeInspectorBuilder.java @@ -10,6 +10,7 @@ import org.gecko.view.inspector.element.label.InspectorLabel; import org.gecko.viewmodel.EdgeViewModel; +/** Represents a type of {@link AbstractInspectorBuilder} of an {@link Inspector} for an {@link EdgeViewModel}. Adds to the list of {@link InspectorElement}s, which are added to a built {@link org.gecko.view.inspector.Inspector Inspector}, the following: an {@link InspectorKindPicker}, two {@link InspectorEdgeStateLabel}s for the source- and target-states, an {@link InspectorPriorityLabel} and an {@link InspectorContractComboBox}. */ public class EdgeInspectorBuilder extends AbstractInspectorBuilder { public EdgeInspectorBuilder(ActionManager actionManager, EdgeViewModel viewModel) { diff --git a/src/main/java/org/gecko/view/inspector/builder/RegionInspectorBuilder.java b/src/main/java/org/gecko/view/inspector/builder/RegionInspectorBuilder.java index f2815abf..e6811409 100644 --- a/src/main/java/org/gecko/view/inspector/builder/RegionInspectorBuilder.java +++ b/src/main/java/org/gecko/view/inspector/builder/RegionInspectorBuilder.java @@ -8,6 +8,7 @@ import org.gecko.view.inspector.element.label.InspectorLabel; import org.gecko.viewmodel.RegionViewModel; +/** Represents a type of {@link AbstractInspectorBuilder} of an {@link Inspector} for a {@link RegionViewModel}. Adds to the list of {@link org.gecko.view.inspector.element.InspectorElement InspectorElement}s, which are added to a built {@link org.gecko.view.inspector.Inspector Inspector}, the following: an {@link InspectorRegionColorItem} and an {@link InspectorContractItem}. */ public class RegionInspectorBuilder extends AbstractInspectorBuilder { public RegionInspectorBuilder(ActionManager actionManager, RegionViewModel viewModel) { diff --git a/src/main/java/org/gecko/view/inspector/builder/StateInspectorBuilder.java b/src/main/java/org/gecko/view/inspector/builder/StateInspectorBuilder.java index 96b5d76f..d550449b 100644 --- a/src/main/java/org/gecko/view/inspector/builder/StateInspectorBuilder.java +++ b/src/main/java/org/gecko/view/inspector/builder/StateInspectorBuilder.java @@ -12,6 +12,7 @@ import org.gecko.viewmodel.RegionViewModel; import org.gecko.viewmodel.StateViewModel; +/** Represents a type of {@link AbstractInspectorBuilder} of an {@link Inspector} for a {@link StateViewModel}. Adds to the list of {@link InspectorElement}s, which are added to a built {@link org.gecko.view.inspector.Inspector Inspector}, the following: an {@link InspectorLabel} for each {@link RegionViewModel} of the {@link StateViewModel}, an {@link InspectorSetStartStateButton} and an {@link InspectorContractList}. */ public class StateInspectorBuilder extends AbstractInspectorBuilder { public StateInspectorBuilder( diff --git a/src/main/java/org/gecko/view/inspector/builder/SystemInspectorBuilder.java b/src/main/java/org/gecko/view/inspector/builder/SystemInspectorBuilder.java index 4d1ef5bd..f7382db6 100644 --- a/src/main/java/org/gecko/view/inspector/builder/SystemInspectorBuilder.java +++ b/src/main/java/org/gecko/view/inspector/builder/SystemInspectorBuilder.java @@ -10,6 +10,7 @@ import org.gecko.view.inspector.element.textfield.InspectorCodeSystemField; import org.gecko.viewmodel.SystemViewModel; +/** Represents a type of {@link AbstractInspectorBuilder} of an {@link org.gecko.view.inspector.Inspector Inspector} for a {@link SystemViewModel}. Adds to the list of {@link org.gecko.view.inspector.element.InspectorElement InspectorElement}s, which are added to a built {@link org.gecko.view.inspector.Inspector Inspector}, the following: an {@link InspectorOpenSystemButton} and two {@link InspectorVariableList}s for input- and output-{@link org.gecko.viewmodel.PortViewModel PortViewModel}s of the {@link SystemViewModel}. */ public class SystemInspectorBuilder extends AbstractInspectorBuilder { public SystemInspectorBuilder(ActionManager actionManager, SystemViewModel viewModel) { diff --git a/src/main/java/org/gecko/view/inspector/builder/VariableBlockInspectorBuilder.java b/src/main/java/org/gecko/view/inspector/builder/VariableBlockInspectorBuilder.java index a160021c..d84d5bf5 100644 --- a/src/main/java/org/gecko/view/inspector/builder/VariableBlockInspectorBuilder.java +++ b/src/main/java/org/gecko/view/inspector/builder/VariableBlockInspectorBuilder.java @@ -6,6 +6,7 @@ import org.gecko.view.inspector.element.container.InspectorVisibilityPicker; import org.gecko.viewmodel.PortViewModel; +/** Represents a type of {@link AbstractInspectorBuilder} of an {@link org.gecko.view.inspector.Inspector Inspector} for a {@link PortViewModel}. Adds to the list of {@link org.gecko.view.inspector.element.InspectorElement InspectorElement}s, which are added to a built {@link org.gecko.view.inspector.Inspector Inspector}, the following: an {@link InspectorVisibilityPicker} and an {@link InspectorTypeLabel}. */ public class VariableBlockInspectorBuilder extends AbstractInspectorBuilder { public VariableBlockInspectorBuilder(ActionManager actionManager, PortViewModel viewModel) { diff --git a/src/main/java/org/gecko/view/inspector/element/InspectorColorPicker.java b/src/main/java/org/gecko/view/inspector/element/InspectorColorPicker.java index 429b4813..07d6da0d 100644 --- a/src/main/java/org/gecko/view/inspector/element/InspectorColorPicker.java +++ b/src/main/java/org/gecko/view/inspector/element/InspectorColorPicker.java @@ -4,6 +4,7 @@ import org.gecko.actions.ActionManager; import org.gecko.viewmodel.RegionViewModel; +/** Represents a type of {@link ColorPicker}, implementing the {@link InspectorElement} interface. Used for changing the color of a displayed {@link RegionViewModel}. */ public class InspectorColorPicker extends ColorPicker implements InspectorElement { public InspectorColorPicker(ActionManager actionManager, RegionViewModel regionViewModel) { setValue(regionViewModel.getColor()); diff --git a/src/main/java/org/gecko/view/inspector/element/InspectorElement.java b/src/main/java/org/gecko/view/inspector/element/InspectorElement.java index 59ad4073..78d181da 100644 --- a/src/main/java/org/gecko/view/inspector/element/InspectorElement.java +++ b/src/main/java/org/gecko/view/inspector/element/InspectorElement.java @@ -2,6 +2,7 @@ import javafx.scene.Node; +/** Represents a generic interface that encapsulates a subtype of {@link Node} displayed in an {@link org.gecko.view.inspector.Inspector Inspector}. The provided method must be implemented by concrete inspector elements. */ public interface InspectorElement { T getControl(); } diff --git a/src/main/java/org/gecko/view/inspector/element/InspectorSeparator.java b/src/main/java/org/gecko/view/inspector/element/InspectorSeparator.java index 18be4579..6a4060bc 100644 --- a/src/main/java/org/gecko/view/inspector/element/InspectorSeparator.java +++ b/src/main/java/org/gecko/view/inspector/element/InspectorSeparator.java @@ -2,6 +2,7 @@ import javafx.scene.control.Separator; +/** Represents a type of {@link Separator}, implementing the {@link InspectorElement} interface. Serves as delimiter between other inspector elements. */ public class InspectorSeparator extends Separator implements InspectorElement { @Override diff --git a/src/main/java/org/gecko/view/inspector/element/button/AbstractInspectorButton.java b/src/main/java/org/gecko/view/inspector/element/button/AbstractInspectorButton.java index a156d7c2..1692a6c2 100644 --- a/src/main/java/org/gecko/view/inspector/element/button/AbstractInspectorButton.java +++ b/src/main/java/org/gecko/view/inspector/element/button/AbstractInspectorButton.java @@ -3,6 +3,7 @@ import javafx.scene.control.Button; import org.gecko.view.inspector.element.InspectorElement; +/** An abstract representation of a type of {@link Button}, implementing the {@link InspectorElement} interface. */ public abstract class AbstractInspectorButton extends Button implements InspectorElement