Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
82b934f
setup project
Muhammed-als Sep 13, 2023
00aa5a5
made changes to sample pom file
Muhammed-als Sep 13, 2023
303143c
Main method is changed
Muhammed-als Sep 20, 2023
73770b8
Merge pull request #1 from Muhammed-als/setup
Muhammed-als Sep 20, 2023
8b19292
Added FeatureEntryPoint to actionPerformed in Deleteaction
LaugeSolvang Sep 27, 2023
073718a
Merge pull request #4 from Muhammed-als/delete
Muhammed-als Sep 27, 2023
175aad6
entrypoint added to my feature
Muhammed-als Sep 27, 2023
4c49794
Merge pull request #5 from Muhammed-als/feature/3/Rectangle_tool
LaugeSolvang Sep 27, 2023
bfabd7f
fix feature entry point
Muhammed-als Oct 4, 2023
a3b9dff
Inserted Featuretracer for undo refactoring and modified pom.xml for …
KlaesSoerensen Oct 4, 2023
e2474c0
Merge branch 'develop' into RedoUndoKlaes
Muhammed-als Oct 4, 2023
84f341b
Merge pull request #9 from Muhammed-als/RedoUndoKlaes
KlaesSoerensen Oct 4, 2023
d67b980
Merge pull request #8 from Muhammed-als/feature/3/Rectangle_tool
Muhammed-als Oct 4, 2023
85afab3
feature trace added
JesperIHansen Oct 4, 2023
cd18678
Formatting
JesperIHansen Oct 4, 2023
390abb9
FeatureTrace Generering
JesperIHansen Oct 4, 2023
a32f39e
Merge branch 'develop' into ImageInsertFeature2
JesperIHansen Oct 4, 2023
1af82e0
Removed unused imports
JesperIHansen Oct 4, 2023
28515bb
setup github action
Muhammed-als Oct 4, 2023
92eea94
fix utils
Muhammed-als Oct 4, 2023
5158b50
fix utils
Muhammed-als Oct 4, 2023
f50e843
Made changes to maven action file
Muhammed-als Oct 4, 2023
37883f4
added settings file
Muhammed-als Oct 4, 2023
7f9e7de
Made changes to maven action file
Muhammed-als Oct 4, 2023
c1401b1
Made changes to maven action file
Muhammed-als Oct 4, 2023
5d6556c
Made changes to maven action file
Muhammed-als Oct 4, 2023
a31cbc8
Made changes to maven action file
Muhammed-als Oct 4, 2023
e748afc
try to build maven ci
Muhammed-als Oct 11, 2023
5c73799
try to build maven ci
Muhammed-als Oct 11, 2023
bb642d9
try to build maven ci
Muhammed-als Oct 11, 2023
635d42f
try to build maven ci
Muhammed-als Oct 11, 2023
57307c7
try to build maven ci
Muhammed-als Oct 11, 2023
b27bd3c
try to build maven ci
Muhammed-als Oct 11, 2023
b0d3003
try to build maven ci
Muhammed-als Oct 11, 2023
badd2e3
try to build maven ci
Muhammed-als Oct 11, 2023
e8afb65
try to build maven ci
Muhammed-als Oct 11, 2023
8dcb3dc
try to build maven ci
Muhammed-als Oct 11, 2023
3114096
try to build maven ci
Muhammed-als Oct 11, 2023
b298de3
test
Muhammed-als Oct 11, 2023
ca00288
try to build maven ci
Muhammed-als Oct 11, 2023
4718829
try to build maven ci
Muhammed-als Oct 11, 2023
19e865f
Merge pull request #13 from Muhammed-als/maven_ci
Muhammed-als Oct 11, 2023
e32820e
Changed the feature
Muhammed-als Dec 14, 2023
80f6e4c
Changed feature from delete to align
LaugeSolvang Dec 18, 2023
f95c069
Deleted import featureentrypoint from DeleteAction
LaugeSolvang Dec 18, 2023
8905fa7
Remove the code smell of static members
Muhammed-als Dec 19, 2023
331f8bd
Added an enum
Muhammed-als Dec 19, 2023
a84429c
Added abstract class and subclasses for switch statement
Muhammed-als Dec 19, 2023
82c75ae
Removed unused libraries
Muhammed-als Dec 19, 2023
c5d3232
Added test class
Muhammed-als Dec 21, 2023
7622c53
Bdd is added
Muhammed-als Dec 22, 2023
2899922
Done of the BDD
Muhammed-als Dec 22, 2023
7bff949
Merge pull request #14 from Muhammed-als/ChangeFeature
Muhammed-als Dec 23, 2023
292a281
dont skip tests
Muhammed-als Dec 24, 2023
342ac77
Remove unused imports
Muhammed-als Dec 24, 2023
b0b1a08
Remove unused imports
Muhammed-als Dec 24, 2023
b1b2c55
Ignore tests
Muhammed-als Dec 24, 2023
bc19063
Merge pull request #15 from Muhammed-als/feature/3/edit_rectangle
Muhammed-als Dec 24, 2023
7370654
Merge pull request #16 from Muhammed-als/develop
Muhammed-als Dec 24, 2023
161bb94
Refactor to remove duplicate code in classes.
LaugeSolvang Dec 17, 2023
fb778af
Refactored to use enums instead of classes.
LaugeSolvang Dec 17, 2023
5ba3e40
Shfted from individual align methods to one align method
LaugeSolvang Dec 17, 2023
ea6e4b3
Minor refactoring, access modifier and shifted a variables place.
LaugeSolvang Dec 17, 2023
fa9ae3e
Added testing and featuretracer
LaugeSolvang Dec 18, 2023
caab0ea
DAdded BDD test
LaugeSolvang Dec 26, 2023
05436ca
Changed name for BDD directory
LaugeSolvang Dec 26, 2023
e3b071c
Removed duplicate dependencies.
LaugeSolvang Dec 26, 2023
b3c62ad
Remove duplicate.
LaugeSolvang Dec 26, 2023
cc79ca8
Merge pull request #17 from Muhammed-als/align
LaugeSolvang Dec 26, 2023
4b2861f
Baseline denpendencies for feature tarcer
KlaesSoerensen Dec 29, 2023
78372a1
Super class extracted.
KlaesSoerensen Dec 30, 2023
3387203
Enums added for action ids
KlaesSoerensen Dec 30, 2023
1273223
Small refactorings
KlaesSoerensen Dec 30, 2023
04f8be7
Update UndoRedoAction.java
KlaesSoerensen Dec 30, 2023
7f2b078
Update UndoRedoAction.java
KlaesSoerensen Jan 1, 2024
02e9a9c
Update PropertyChangeListener variable.
KlaesSoerensen Jan 1, 2024
168d229
Baseline for testing
KlaesSoerensen Jan 2, 2024
5dd406f
Tests added
KlaesSoerensen Jan 3, 2024
90872de
Removed feature entrypoints
KlaesSoerensen Jan 3, 2024
34ecbbd
Updated enums
KlaesSoerensen Jan 3, 2024
707fb5a
Removed unused imports
KlaesSoerensen Jan 3, 2024
5814952
Merge pull request #22 from Muhammed-als/RedoUndoKlaes
KlaesSoerensen Jan 3, 2024
cd72cc0
Everything
JesperIHansen Jan 3, 2024
8467a52
Merge branch 'develop' into ImageInsertFeature2
JesperIHansen Jan 4, 2024
f0662fc
Last Minute Changes
JesperIHansen Jan 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/m2_settings/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>

<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<name>GitHub External Packages</name>
<id>github</id>
<url>https://maven.pkg.github.com/sweat-tek/MavenRepository</url>
</repository>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
</repositories>
</profile>
</profiles>

<servers>
<server>
<id>github</id>
<username>${env.GITHUB_USERNAME}</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
</servers>

</settings>
37 changes: 37 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven

on:
push:
branches: [ "Master" ]
pull_request:
branches:
- Master
- develop

jobs:
Build-Test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn --batch-mode --update-snapshots -Dmaven.test.skip=true -s .github/m2_settings/settings.xml verify

env:
GITHUB_USERNAME: ${{ secrets.USER_NAME }}
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
6 changes: 6 additions & 0 deletions jhotdraw-actions/jhotdraw-actions.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="SonarLintModuleSettings">
<option name="uniqueId" value="52ae969a-33a8-44ee-a190-47c3abfc84d6" />
</component>
</module>
5 changes: 5 additions & 0 deletions jhotdraw-actions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
<groupId>${project.groupId}</groupId>
<artifactId>jhotdraw-utils</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>dk.sdu.cbse</groupId>
<artifactId>featuretracerlite</artifactId>
<version>1.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.jhotdraw.action.edit;

enum ActionIDs {;
static final String UNDOID = "edit.undo";
static final String REDOID = "edit.redo";
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.beans.PropertyChangeListener;
import javax.swing.JComponent;
import javax.swing.text.*;

import org.jhotdraw.api.gui.EditableComponent;
import org.jhotdraw.beans.WeakPropertyChangeListener;
import org.jhotdraw.util.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
* accompanying license terms.
*/
package org.jhotdraw.action.edit;

import java.awt.event.*;
import java.beans.*;
import javax.swing.*;
import org.jhotdraw.action.AbstractViewAction;
import org.jhotdraw.api.app.Application;
import org.jhotdraw.api.app.View;
import org.jhotdraw.util.*;
Expand All @@ -28,89 +23,18 @@
* with this ID and put it in your {@code ApplicationModel} in method
* {@link org.jhotdraw.app.ApplicationModel#initApplication}.
*
*
* @author Werner Randelshofer
* @version $Id$
*/
public class RedoAction extends AbstractViewAction {

private static final long serialVersionUID = 1L;
public static final String ID = "edit.redo";
private ResourceBundleUtil labels = ResourceBundleUtil.getBundle("org.jhotdraw.action.Labels");
private PropertyChangeListener redoActionPropertyListener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
String name = evt.getPropertyName();
if ((name == null && AbstractAction.NAME == null) || (name != null && name.equals(AbstractAction.NAME))) {
putValue(AbstractAction.NAME, evt.getNewValue());
} else if ("enabled".equals(name)) {
updateEnabledState();
}
}
};
public class RedoAction extends UndoRedoAction {
public static final String ID = getID(ActionIDs.REDOID);

/**
* Creates a new instance.
*/
public RedoAction(Application app, View view) {
super(app, view);
super(app, view, ID);
ResourceBundleUtil labels = ResourceBundleUtil.getBundle("org.jhotdraw.action.Labels");
labels.configureAction(this, ID);
}

protected void updateEnabledState() {
boolean isEnabled = false;
Action realRedoAction = getRealRedoAction();
if (realRedoAction != null && realRedoAction != this) {
isEnabled = realRedoAction.isEnabled();
}
setEnabled(isEnabled);
}

@Override
protected void updateView(View oldValue, View newValue) {
super.updateView(oldValue, newValue);
if (newValue != null
&& newValue.getActionMap().get(ID) != null
&& newValue.getActionMap().get(ID) != this) {
putValue(AbstractAction.NAME, newValue.getActionMap().get(ID).
getValue(AbstractAction.NAME));
updateEnabledState();
}
}

/**
* Installs listeners on the view object.
*/
@Override
protected void installViewListeners(View p) {
super.installViewListeners(p);
Action redoActionInView = p.getActionMap().get(ID);
if (redoActionInView != null && redoActionInView != this) {
redoActionInView.addPropertyChangeListener(redoActionPropertyListener);
}
}

/**
* Installs listeners on the view object.
*/
@Override
protected void uninstallViewListeners(View p) {
super.uninstallViewListeners(p);
Action redoActionInView = p.getActionMap().get(ID);
if (redoActionInView != null && redoActionInView != this) {
redoActionInView.removePropertyChangeListener(redoActionPropertyListener);
}
}

@Override
public void actionPerformed(ActionEvent e) {
Action realAction = getRealRedoAction();
if (realAction != null && realAction != this) {
realAction.actionPerformed(e);
}
}

private Action getRealRedoAction() {
return (getActiveView() == null) ? null : getActiveView().getActionMap().get(ID);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
* accompanying license terms.
*/
package org.jhotdraw.action.edit;

import java.awt.event.*;
import java.beans.*;
import javax.swing.*;
import org.jhotdraw.action.AbstractViewAction;
import org.jhotdraw.api.app.Application;
import org.jhotdraw.api.app.View;
import org.jhotdraw.util.*;
Expand All @@ -31,85 +26,15 @@
* @author Werner Randelshofer
* @version $Id$
*/
public class UndoAction extends AbstractViewAction {

private static final long serialVersionUID = 1L;
public static final String ID = "edit.undo";
private ResourceBundleUtil labels = ResourceBundleUtil.getBundle("org.jhotdraw.action.Labels");
private PropertyChangeListener redoActionPropertyListener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
String name = evt.getPropertyName();
if ((name == null && AbstractAction.NAME == null) || (name != null && name.equals(AbstractAction.NAME))) {
putValue(AbstractAction.NAME, evt.getNewValue());
} else if ("enabled".equals(name)) {
updateEnabledState();
}
}
};
public class UndoAction extends UndoRedoAction {
public static final String ID = getID(ActionIDs.UNDOID);

/**
* Creates a new instance.
*/
public UndoAction(Application app, View view) {
super(app, view);
super(app, view, ID);
ResourceBundleUtil labels = ResourceBundleUtil.getBundle("org.jhotdraw.action.Labels");
labels.configureAction(this, ID);
}

protected void updateEnabledState() {
boolean isEnabled = false;
Action realAction = getRealUndoAction();
if (realAction != null && realAction != this) {
isEnabled = realAction.isEnabled();
}
setEnabled(isEnabled);
}

@Override
protected void updateView(View oldValue, View newValue) {
super.updateView(oldValue, newValue);
if (newValue != null
&& newValue.getActionMap().get(ID) != null
&& newValue.getActionMap().get(ID) != this) {
putValue(AbstractAction.NAME, newValue.getActionMap().get(ID).
getValue(AbstractAction.NAME));
updateEnabledState();
}
}

/**
* Installs listeners on the view object.
*/
@Override
protected void installViewListeners(View p) {
super.installViewListeners(p);
Action undoActionInView = p.getActionMap().get(ID);
if (undoActionInView != null && undoActionInView != this) {
undoActionInView.addPropertyChangeListener(redoActionPropertyListener);
}
}

/**
* Installs listeners on the view object.
*/
@Override
protected void uninstallViewListeners(View p) {
super.uninstallViewListeners(p);
Action undoActionInView = p.getActionMap().get(ID);
if (undoActionInView != null && undoActionInView != this) {
undoActionInView.removePropertyChangeListener(redoActionPropertyListener);
}
}

@Override
public void actionPerformed(ActionEvent e) {
Action realUndoAction = getRealUndoAction();
if (realUndoAction != null && realUndoAction != this) {
realUndoAction.actionPerformed(e);
}
}

private Action getRealUndoAction() {
return (getActiveView() == null) ? null : getActiveView().getActionMap().get(ID);
}
}
Loading