-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into viewpalette
- Loading branch information
Showing
31 changed files
with
1,078 additions
and
422 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,5 @@ jobs: | |
- name: Testing project | ||
working-directory: ./JHotDraw | ||
run: mvn test | ||
|
||
|
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 +1,32 @@ | ||
|
||
/JHotDraw/target/ | ||
|
||
# Netbeans | ||
nbactions.xml | ||
nb-configuration.xml | ||
build/ | ||
dist/ | ||
|
||
# IntelliJ | ||
.idea/ | ||
*.iml | ||
*.iws | ||
|
||
# Eclipse | ||
.classpath | ||
.project | ||
.settings/ | ||
bin/ | ||
|
||
# Mac | ||
.DS_Store | ||
|
||
# Maven | ||
target/ | ||
runner/ | ||
FeatureTraces/ | ||
nbactions.xml | ||
nb-configuration.xml | ||
/JHotDraw/nbproject/ | ||
|
||
JHotDraw/src/main/java/org/jhotdraw/app/DefaultSDIApplication.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
92 changes: 92 additions & 0 deletions
92
JHotDraw/src/main/java/org/jhotdraw/app/action/AbstractRedoUndoAction.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,92 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package org.jhotdraw.app.action; | ||
|
||
import dk.sdu.mmmi.featuretracer.lib.FeatureEntryPoint; | ||
import java.awt.*; | ||
import java.awt.event.*; | ||
import javax.swing.*; | ||
import javax.swing.text.*; | ||
import java.beans.*; | ||
import java.util.*; | ||
import org.jhotdraw.util.*; | ||
import org.jhotdraw.app.Application; | ||
import org.jhotdraw.app.JHotDrawFeatures; | ||
import org.jhotdraw.app.View; | ||
|
||
/** | ||
* | ||
* @author Mustafa | ||
*/ | ||
public abstract class AbstractRedoUndoAction extends AbstractViewAction { | ||
public static String ID; | ||
|
||
|
||
private PropertyChangeListener redoActionPropertyListener = new PropertyChangeListener() { | ||
public void propertyChange(PropertyChangeEvent evt) { | ||
String name = evt.getPropertyName(); | ||
if (name == AbstractAction.NAME) { | ||
putValue(AbstractAction.NAME, evt.getNewValue()); | ||
} else if (name == "enabled") { | ||
updateEnabledState(); | ||
} | ||
} | ||
}; | ||
|
||
/** Creates a new instance. */ | ||
public AbstractRedoUndoAction(Application app) { | ||
super(app); | ||
} | ||
|
||
protected void updateEnabledState() { | ||
boolean isEnabled = false; | ||
Action realAction = getRealAction(); | ||
if (realAction != null) { | ||
isEnabled = realAction.isEnabled(); | ||
} | ||
setEnabled(isEnabled); | ||
} | ||
|
||
@Override protected void updateView(View oldValue, View newValue) { | ||
super.updateView(oldValue, newValue); | ||
if (newValue != null && newValue.getAction(ID) != null) { | ||
putValue(AbstractAction.NAME, newValue.getAction(ID). | ||
getValue(AbstractAction.NAME)); | ||
updateEnabledState(); | ||
} | ||
} | ||
/** | ||
* Installs listeners on the view object. | ||
*/ | ||
@Override protected void installViewListeners(View p) { | ||
super.installViewListeners(p); | ||
if (p.getAction(ID) != null) { | ||
p.getAction(ID).addPropertyChangeListener(redoActionPropertyListener); | ||
} | ||
} | ||
/** | ||
* Installs listeners on the view object. | ||
*/ | ||
@Override protected void uninstallViewListeners(View p) { | ||
super.uninstallViewListeners(p); | ||
if (p.getAction(ID) != null) { | ||
p.getAction(ID).removePropertyChangeListener(redoActionPropertyListener); | ||
} | ||
} | ||
|
||
@FeatureEntryPoint(JHotDrawFeatures.UNDO_REDO) | ||
public void actionPerformed(ActionEvent e) { | ||
Action realAction = getRealAction(); | ||
if (realAction != null) { | ||
realAction.actionPerformed(e); | ||
} | ||
} | ||
|
||
public abstract Action getRealAction(); | ||
|
||
|
||
} | ||
|
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.