Skip to content

Commit

Permalink
merge refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
DecwLK committed Jan 15, 2024
2 parents d8ed95c + 88c25a4 commit 821fe1d
Show file tree
Hide file tree
Showing 34 changed files with 110 additions and 83 deletions.
16 changes: 12 additions & 4 deletions src/main/java/org/gecko/actions/ActionFactory.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
package org.gecko.actions;

import javafx.geometry.Point2D;
import java.util.List;

import javafx.geometry.Point2D;
import org.gecko.tools.Tool;
import org.gecko.viewmodel.*;

import java.util.List;
import org.gecko.viewmodel.BlockViewModelElement;
import org.gecko.viewmodel.ContractViewModel;
import org.gecko.viewmodel.EdgeViewModel;
import org.gecko.viewmodel.GeckoViewModel;
import org.gecko.viewmodel.PortViewModel;
import org.gecko.viewmodel.PositionableViewModelElement;
import org.gecko.viewmodel.Renamable;
import org.gecko.viewmodel.StateViewModel;
import org.gecko.viewmodel.SystemConnectionViewModel;
import org.gecko.viewmodel.SystemViewModel;

public class ActionFactory {
private final GeckoViewModel geckoViewModel;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/gecko/actions/ActionGroup.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.gecko.actions;

import java.util.List;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

@Data
@EqualsAndHashCode(callSuper = true)
public class ActionGroup extends Action {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/gecko/actions/ActionManager.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.gecko.actions;

import lombok.Getter;

import java.util.Stack;

import lombok.Getter;

public class ActionManager {
@Getter
private final ActionFactory actionFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.gecko.actions;

import java.util.List;

import org.gecko.viewmodel.EditorViewModel;
import org.gecko.viewmodel.PositionableViewModelElement;

import java.util.List;

public class CopyPositionableViewModelElementAction extends Action {
CopyPositionableViewModelElementAction(EditorViewModel editorViewModel, List<PositionableViewModelElement<?>> positionableViewModelElement) {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.gecko.actions;

import java.util.List;

import org.gecko.viewmodel.EditorViewModel;
import org.gecko.viewmodel.PositionableViewModelElement;

import java.util.List;

public class CutPositionableViewModelElementAction extends Action {
CutPositionableViewModelElementAction(EditorViewModel editorViewModel, List<PositionableViewModelElement<?>> elements) {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.gecko.actions;

import java.util.List;

import org.gecko.viewmodel.GeckoViewModel;
import org.gecko.viewmodel.PositionableViewModelElement;

import java.util.List;

public class DeletePositionableViewModelElementAction extends Action {
DeletePositionableViewModelElementAction(GeckoViewModel geckoViewModel, PositionableViewModelElement<?> element) {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.gecko.actions;

import java.util.List;

import org.gecko.viewmodel.GeckoViewModel;
import org.gecko.viewmodel.PositionableViewModelElement;

import java.util.List;

public class PastePositionableViewModelElementAction extends Action {
PastePositionableViewModelElementAction(GeckoViewModel geckoViewModel) {
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.gecko.actions;

import java.util.List;

import org.gecko.viewmodel.GeckoViewModel;
import org.gecko.viewmodel.PositionableViewModelElement;

import java.util.List;

public class RestorePositionableViewModelElementAction extends Action {
RestorePositionableViewModelElementAction(GeckoViewModel geckoViewModel, List<PositionableViewModelElement<?>> elements) {
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/gecko/actions/SelectAction.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.gecko.actions;

import java.util.List;

import org.gecko.viewmodel.EditorViewModel;
import org.gecko.viewmodel.PositionableViewModelElement;

import java.util.List;

public class SelectAction extends Action {

SelectAction(EditorViewModel editorViewModel, PositionableViewModelElement<?> element, boolean newSelection) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/gecko/application/GeckoIOManager.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.gecko.application;

import java.io.File;

import lombok.Getter;
import lombok.Setter;

import java.io.File;

public class GeckoIOManager {
@Getter
@Setter
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/gecko/io/AutomatonFileParser.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.gecko.io;

import org.gecko.application.Gecko;

import java.io.File;

import org.gecko.application.Gecko;

public class AutomatonFileParser implements FileParser {
public Gecko parse(File file) {
// TODO
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/gecko/io/FileParser.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.gecko.io;

import org.gecko.application.Gecko;

import java.io.File;

import org.gecko.application.Gecko;

public interface FileParser {
Gecko parse(File file);
}
4 changes: 2 additions & 2 deletions src/main/java/org/gecko/io/ProjectFileParser.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.gecko.io;

import org.gecko.application.Gecko;

import java.io.File;

import org.gecko.application.Gecko;

public class ProjectFileParser implements FileParser {
public Gecko parse(File file) {
// TODO
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/gecko/model/Automaton.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.gecko.model;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

import lombok.Data;

@Data
public class Automaton {
private State startState;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/gecko/model/Region.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.gecko.model;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

import lombok.Data;

@Data
public class Region implements Renamable, Element {
private String name;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/gecko/model/State.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package org.gecko.model;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

import lombok.Data;

@Data
public class State implements Renamable, Element {
private String name;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/gecko/model/System.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package org.gecko.model;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

import lombok.Data;

@Data
public class System implements Renamable, Element {
private final List<System> children;
private final List<SystemConnection> connections;
private final List<Variable> variables;
private String name;
private System parent;
private String code;
private Automaton automaton;
private final List<System> children;
private final List<SystemConnection> connections;
private final List<Variable> variables;

public System(String name, String code, Automaton automaton) {
this.name = name;
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/org/gecko/view/inspector/Inspector.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
package org.gecko.view.inspector;

import java.util.List;

import javafx.scene.Node;
import javafx.scene.control.ScrollPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import org.gecko.actions.ActionManager;
import org.gecko.view.inspector.element.InspectorElement;

import javafx.scene.control.ScrollPane;
import org.gecko.view.inspector.element.button.InspectorCollapseButton;
import org.gecko.view.inspector.element.button.InspectorSelectionBackwardButton;
import org.gecko.view.inspector.element.button.InspectorSelectionForwardButton;
import org.gecko.view.views.EditorView;
import org.gecko.viewmodel.EditorViewModel;

import java.util.List;

public class Inspector extends ScrollPane {

private boolean isCollapsed = false;
Expand Down
16 changes: 14 additions & 2 deletions src/main/java/org/gecko/view/inspector/InspectorFactory.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
package org.gecko.view.inspector;


import org.gecko.actions.ActionManager;
import org.gecko.view.inspector.builder.*;
import org.gecko.view.inspector.builder.AbstractInspectorBuilder;
import org.gecko.view.inspector.builder.EdgeInspectorBuilder;
import org.gecko.view.inspector.builder.RegionInspectorBuilder;
import org.gecko.view.inspector.builder.StateInspectorBuilder;
import org.gecko.view.inspector.builder.SystemInspectorBuilder;
import org.gecko.view.inspector.builder.VariableBlockInspectorBuilder;
import org.gecko.view.views.EditorView;
import org.gecko.viewmodel.*;
import org.gecko.viewmodel.EdgeViewModel;
import org.gecko.viewmodel.EditorViewModel;
import org.gecko.viewmodel.PortViewModel;
import org.gecko.viewmodel.PositionableViewModelElement;
import org.gecko.viewmodel.RegionViewModel;
import org.gecko.viewmodel.StateViewModel;
import org.gecko.viewmodel.SystemViewModel;

public class InspectorFactory {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.gecko.view.inspector.builder;

import java.util.LinkedList;
import java.util.List;

import lombok.Getter;
import org.gecko.actions.ActionManager;
import org.gecko.view.inspector.Inspector;
Expand All @@ -12,9 +15,6 @@
import org.gecko.viewmodel.PositionableViewModelElement;
import org.gecko.viewmodel.Renamable;

import java.util.LinkedList;
import java.util.List;

public abstract class AbstractInspectorBuilder<T extends PositionableViewModelElement<?>> {
@Getter
private final T viewModel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.gecko.view.inspector.builder;

import java.util.List;

import org.gecko.actions.ActionManager;
import org.gecko.view.inspector.element.InspectorSeparator;
import org.gecko.view.inspector.element.button.InspectorAddContractButton;
Expand All @@ -10,8 +12,6 @@
import org.gecko.viewmodel.RegionViewModel;
import org.gecko.viewmodel.StateViewModel;

import java.util.List;

public class StateInspectorBuilder extends AbstractInspectorBuilder<StateViewModel> {
public StateInspectorBuilder(ActionManager actionManager, EditorViewModel editorViewModel, StateViewModel viewModel) {
super(actionManager, viewModel);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.gecko.view.inspector.element.button;

import org.gecko.view.inspector.element.textfield.InspectorContractField;

import java.util.List;

import org.gecko.view.inspector.element.textfield.InspectorContractField;

public class InspectorCollapseContractButton extends AbstractInspectorButton {
public InspectorCollapseContractButton(List<InspectorContractField> fields) {
setOnAction(event -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.gecko.view.inspector.element.container;

import java.util.ArrayList;
import java.util.List;

import javafx.beans.property.StringProperty;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
Expand All @@ -14,9 +17,6 @@
import org.gecko.viewmodel.Renamable;
import org.gecko.viewmodel.StateViewModel;

import java.util.ArrayList;
import java.util.List;

public class InspectorContractItem extends VBox implements InspectorElement<VBox> {
/**
* Constructor for the State contract item
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/gecko/view/toolbar/ToolBarBuilder.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.gecko.view.toolbar;

import java.util.List;

import javafx.scene.control.Button;
import javafx.scene.control.ButtonBase;
import javafx.scene.control.Separator;
Expand All @@ -8,8 +10,6 @@
import org.gecko.tools.Tool;
import org.gecko.viewmodel.EditorViewModel;

import java.util.List;

public class ToolBarBuilder {

private final ToolBar toolBar;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/gecko/view/views/EditorView.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.gecko.view.views;

import java.util.Collection;
import java.util.stream.Collectors;

import javafx.collections.ListChangeListener;
import javafx.scene.Node;
import javafx.scene.control.ToolBar;
Expand All @@ -13,9 +16,6 @@
import org.gecko.viewmodel.PositionableViewModelElement;
import org.gecko.viewmodel.PositionableViewModelElementVisitor;

import java.util.Collection;
import java.util.stream.Collectors;

public class EditorView {
private final EditorViewModel viewModel;
private final ToolBar toolBar;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/gecko/view/views/ViewFactory.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.gecko.view.views;

import org.gecko.actions.ActionManager;
import org.gecko.model.Automaton;
import org.gecko.view.toolbar.ToolBarBuilder;
import org.gecko.view.views.shortcuts.AutomatonEditorViewShortcutHandler;
import org.gecko.view.views.shortcuts.SystemEditorViewShortcutHandler;
Expand Down
Loading

0 comments on commit 821fe1d

Please sign in to comment.