-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
55 changed files
with
857 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.gecko.actions; | ||
|
||
import org.gecko.model.Visibility; | ||
import org.gecko.viewmodel.SystemViewModel; | ||
|
||
public class CreateVariableAction extends Action { | ||
|
||
public CreateVariableAction(ActionFactory actionFactory, SystemViewModel systemViewModel, Visibility visibility) {} | ||
|
||
@Override | ||
void run() {} | ||
|
||
@Override | ||
Action getUndoAction(ActionFactory actionFactory) { | ||
return null; | ||
} | ||
} |
6 changes: 5 additions & 1 deletion
6
src/main/java/org/gecko/actions/DeleteContractViewModelAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/org/gecko/actions/FocusPositionableViewModelElementAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.gecko.actions; | ||
|
||
import org.gecko.viewmodel.PositionableViewModelElement; | ||
import org.gecko.viewmodel.EditorViewModel; | ||
|
||
public class FocusPositionableViewModelElementAction extends Action { | ||
public FocusPositionableViewModelElementAction( | ||
ActionFactory actionFactory, | ||
EditorViewModel editorViewModel, | ||
PositionableViewModelElement<?> positionableViewModelElement) { | ||
} | ||
|
||
@Override | ||
void run() { | ||
|
||
} | ||
|
||
@Override | ||
Action getUndoAction(ActionFactory actionFactory) { | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,61 @@ | ||
package org.gecko.view.inspector; | ||
|
||
import javafx.scene.Node; | ||
import javafx.scene.layout.HBox; | ||
import javafx.scene.layout.VBox; | ||
import org.gecko.actions.ActionManager; | ||
import org.gecko.view.inspector.element.InspectorElement; | ||
import org.gecko.viewmodel.PositionableViewModelElement; | ||
|
||
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<T extends PositionableViewModelElement<?>> { | ||
public class Inspector extends ScrollPane { | ||
|
||
public Inspector( | ||
List<InspectorElement<?>> elements, | ||
ActionManager actionManager, | ||
EditorView editorView, | ||
EditorViewModel editorViewModel) { | ||
VBox vBox = new VBox(); | ||
|
||
// Inspector decorations | ||
HBox inspectorDecorations = new HBox(); | ||
|
||
// Selection forward/backward buttons | ||
HBox selectionButtons = new HBox(); | ||
selectionButtons | ||
.getChildren() | ||
.addAll( | ||
new InspectorSelectionBackwardButton( | ||
actionManager, editorViewModel.getSelectionManager()) | ||
.getControl(), | ||
new InspectorSelectionForwardButton( | ||
actionManager, editorViewModel.getSelectionManager()) | ||
.getControl()); | ||
inspectorDecorations | ||
.getChildren() | ||
.addAll( | ||
selectionButtons, | ||
// Collapse button | ||
new InspectorCollapseButton(editorView)); | ||
|
||
private T element; | ||
vBox.getChildren().add(inspectorDecorations); | ||
|
||
public Inspector(List<InspectorElement<?>> elements) { | ||
for (InspectorElement<?> element : elements) { | ||
vBox.getChildren().add(element.getControl()); | ||
} | ||
|
||
setContent(vBox); | ||
setFitToWidth(true); | ||
} | ||
|
||
public Node getView() { | ||
return null; | ||
return this; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/org/gecko/view/inspector/InspectorColorPicker.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.gecko.view.inspector; | ||
|
||
import javafx.beans.property.Property; | ||
import javafx.scene.control.ColorPicker; | ||
import javafx.scene.paint.Color; | ||
import org.gecko.view.inspector.element.InspectorElement; | ||
|
||
public class InspectorColorPicker extends ColorPicker implements InspectorElement<ColorPicker> { | ||
public InspectorColorPicker(Property<Color> targetColorProperty) { | ||
valueProperty().bindBidirectional(targetColorProperty); | ||
} | ||
|
||
@Override | ||
public ColorPicker getControl() { | ||
return this; | ||
} | ||
} |
59 changes: 35 additions & 24 deletions
59
src/main/java/org/gecko/view/inspector/InspectorFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,65 @@ | ||
package org.gecko.view.inspector; | ||
|
||
import lombok.Getter; | ||
import org.gecko.actions.ActionManager; | ||
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.view.views.viewelement.EdgeViewElement; | ||
import org.gecko.view.views.viewelement.RegionViewElement; | ||
import org.gecko.view.views.viewelement.StateViewElement; | ||
import org.gecko.view.views.viewelement.SystemConnectionViewElement; | ||
import org.gecko.view.views.viewelement.SystemViewElement; | ||
import org.gecko.view.views.viewelement.VariableBlockViewElement; | ||
import org.gecko.view.views.viewelement.ViewElement; | ||
import org.gecko.viewmodel.EdgeViewModel; | ||
import org.gecko.viewmodel.EditorViewModel; | ||
import org.gecko.viewmodel.PortViewModel; | ||
import org.gecko.viewmodel.PositionableViewModelElement; | ||
import org.gecko.viewmodel.PositionableViewModelElementVisitor; | ||
import org.gecko.viewmodel.RegionViewModel; | ||
import org.gecko.viewmodel.StateViewModel; | ||
import org.gecko.viewmodel.SystemConnectionViewModel; | ||
import org.gecko.viewmodel.SystemViewModel; | ||
|
||
public class InspectorFactory { | ||
|
||
private EditorView editorView; | ||
|
||
public InspectorFactory(EditorView editorView) { | ||
@Getter private final EditorView editorView; | ||
@Getter private final EditorViewModel editorViewModel; | ||
@Getter private final ActionManager actionManager; | ||
|
||
public InspectorFactory( | ||
ActionManager actionManager, EditorView editorView, EditorViewModel editorViewModel) { | ||
this.actionManager = actionManager; | ||
this.editorView = editorView; | ||
this.editorViewModel = editorViewModel; | ||
} | ||
|
||
public<T extends PositionableViewModelElement<?>> Inspector<T> createInspector(ViewElement<T> viewElement) { | ||
return null; | ||
public Inspector createInspector(PositionableViewModelElement<?> viewElement) { | ||
InspectorFactoryVisitor visitor = new InspectorFactoryVisitor(this); | ||
viewElement.accept(visitor); | ||
return visitor.getInspector(); | ||
} | ||
|
||
public Inspector<StateViewModel> createStateInspector(StateViewElement stateViewElement) { | ||
return null; | ||
public Inspector createStateInspector(StateViewModel stateViewModel) { | ||
return buildInspector(new StateInspectorBuilder(actionManager, editorViewModel, stateViewModel)); | ||
} | ||
|
||
public Inspector<EdgeViewModel> createEdgeInspector(EdgeViewElement edgeViewElement) { | ||
return null; | ||
public Inspector createEdgeInspector(EdgeViewModel edgeViewModel) { | ||
return buildInspector( | ||
new EdgeInspectorBuilder(actionManager, editorViewModel, edgeViewModel)); | ||
} | ||
|
||
public Inspector<SystemConnectionViewModel> createSystemConnectionInspector(SystemConnectionViewElement systemConnectionViewElement) { | ||
return null; | ||
public Inspector createRegionInspector(RegionViewModel regionViewModel) { | ||
return buildInspector(new RegionInspectorBuilder(actionManager, regionViewModel)); | ||
} | ||
|
||
public Inspector<RegionViewModel> createRegionInspector(RegionViewElement regionViewElement) { | ||
return null; | ||
public Inspector createSystemInspector(SystemViewModel systemViewModel) { | ||
return buildInspector(new SystemInspectorBuilder(actionManager, editorViewModel, systemViewModel)); | ||
} | ||
|
||
public Inspector<SystemViewModel> createSystemInspector(SystemViewElement systemViewElement) { | ||
return null; | ||
public Inspector createVariableBlockInspector(PortViewModel portviewModel) { | ||
return buildInspector(new VariableBlockInspectorBuilder(actionManager, portviewModel)); | ||
} | ||
|
||
public Inspector<PortViewModel> createVariableBlockInspector(VariableBlockViewElement variableBlockViewElement) { | ||
return null; | ||
private Inspector buildInspector(AbstractInspectorBuilder<?> builder) { | ||
return builder.build(editorView, editorViewModel); | ||
} | ||
} |
Oops, something went wrong.