-
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 pull request #17 from sweat-tek/viewpalette
Add error fix for view palette
- Loading branch information
Showing
38 changed files
with
178 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
|
||
/JHotDraw/target/ | ||
|
||
# Netbeans | ||
nbactions.xml | ||
nb-configuration.xml | ||
|
Binary file added
BIN
+1.25 KB
JHotDraw/FeatureTraces/traces 2021.12.06.00.02.55/application startup.ftf
Binary file not shown.
Binary file added
BIN
+1.31 KB
JHotDraw/FeatureTraces/traces 2021.12.06.00.02.55/automatic selection.ftf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+80.3 KB
JHotDraw/FeatureTraces/traces 2021.12.06.00.02.55/manage drawings.ftf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+1.25 KB
JHotDraw/FeatureTraces/traces 2021.12.06.00.30.55/application startup.ftf
Binary file not shown.
Binary file added
BIN
+1.31 KB
JHotDraw/FeatureTraces/traces 2021.12.06.00.30.55/automatic selection.ftf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+71.4 KB
JHotDraw/FeatureTraces/traces 2021.12.06.00.30.55/manage drawings.ftf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,55 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<actions> | ||
<action> | ||
<actionName>run</actionName> | ||
<packagings> | ||
<packaging>jar</packaging> | ||
</packagings> | ||
<goals> | ||
<goal>process-classes</goal> | ||
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal> | ||
</goals> | ||
<properties> | ||
<exec.vmArgs>-javaagent:/Users/Samuel/.m2/repository/org/aspectj/aspectjweaver/1.8.6/aspectjweaver-1.8.6.jar</exec.vmArgs> | ||
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args> | ||
<exec.appArgs></exec.appArgs> | ||
<exec.mainClass>org.jhotdraw.samples.svg.Main</exec.mainClass> | ||
<exec.executable>java</exec.executable> | ||
</properties> | ||
</action> | ||
<action> | ||
<actionName>debug</actionName> | ||
<packagings> | ||
<packaging>jar</packaging> | ||
</packagings> | ||
<goals> | ||
<goal>process-classes</goal> | ||
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal> | ||
</goals> | ||
<properties> | ||
<exec.vmArgs>-javaagent:/Users/Samuel/.m2/repository/org/aspectj/aspectjweaver/1.8.6/aspectjweaver-1.8.6.jar -agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</exec.vmArgs> | ||
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args> | ||
<exec.appArgs></exec.appArgs> | ||
<exec.mainClass>org.jhotdraw.samples.svg.Main</exec.mainClass> | ||
<exec.executable>java</exec.executable> | ||
<jpda.listen>true</jpda.listen> | ||
</properties> | ||
</action> | ||
<action> | ||
<actionName>profile</actionName> | ||
<packagings> | ||
<packaging>jar</packaging> | ||
</packagings> | ||
<goals> | ||
<goal>process-classes</goal> | ||
<goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal> | ||
</goals> | ||
<properties> | ||
<exec.vmArgs>-javaagent:/Users/Samuel/.m2/repository/org/aspectj/aspectjweaver/1.8.6/aspectjweaver-1.8.6.jar</exec.vmArgs> | ||
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args> | ||
<exec.mainClass>org.jhotdraw.samples.svg.Main</exec.mainClass> | ||
<exec.executable>java</exec.executable> | ||
<exec.appArgs></exec.appArgs> | ||
</properties> | ||
</action> | ||
</actions> |
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
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
110 changes: 110 additions & 0 deletions
110
...raw/src/test/java/org/jhotdraw/samples/svg/gui/viewtoolbar/junitTest/viewtoolbarTest.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,110 @@ | ||
/* | ||
* 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.samples.svg.gui.viewtoolbar.junitTest; | ||
|
||
import java.awt.Component; | ||
import java.awt.Graphics2D; | ||
import java.awt.GridBagConstraints; | ||
import java.awt.GridBagLayout; | ||
import java.awt.Insets; | ||
import java.awt.image.BufferedImage; | ||
import java.beans.PropertyChangeListener; | ||
import javax.swing.*; | ||
import javax.swing.JPanel; | ||
import org.jhotdraw.draw.DefaultDrawingView; | ||
import org.jhotdraw.samples.svg.gui.AbstractToolBar; | ||
import org.jhotdraw.samples.svg.gui.ViewToolBar; | ||
import org.junit.After; | ||
import org.junit.AfterClass; | ||
import org.junit.Assert; | ||
import org.junit.Before; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* | ||
* @author Samuel | ||
*/ | ||
|
||
public class viewtoolbarTest { | ||
JPanel resultParent; | ||
JPanel expResParent; | ||
JFrame rootPane; | ||
BufferedImage image; | ||
Graphics2D graphics2d; | ||
AbstractToolBar abstractToolBar; | ||
|
||
public viewtoolbarTest() { | ||
} | ||
|
||
@BeforeClass | ||
public static void setUpClass() { | ||
} | ||
|
||
@AfterClass | ||
public static void tearDownClass() { | ||
} | ||
|
||
@Before | ||
public void setUp() { | ||
this.abstractToolBar = new AbstractToolBar(); | ||
this.rootPane = new JFrame(); | ||
this.resultParent = new JPanel(new GridBagLayout()); | ||
this.expResParent = new JPanel(new GridBagLayout()); | ||
this.image = new BufferedImage(100,100, BufferedImage.TYPE_INT_ARGB); | ||
this.graphics2d= image.createGraphics(); | ||
|
||
} | ||
|
||
@After | ||
public void tearDown() { | ||
} | ||
|
||
@Test | ||
public void testInit() { | ||
System.out.println("Init"); | ||
ViewToolBar instance = new ViewToolBar(); | ||
instance.init(); | ||
} | ||
|
||
|
||
@Test | ||
public void testJPanel() { | ||
System.out.println("Test JPanel components"); | ||
|
||
int resultInt = resultParent.getComponentCount(); | ||
int expResult = expResParent.getComponentCount();; | ||
int result = resultInt; | ||
|
||
System.out.println("Expected: " + resultInt); | ||
assertEquals(expResult, result); | ||
} | ||
|
||
@Test | ||
public void testViewPalette() { | ||
System.out.println("Test View Palette states as components"); | ||
|
||
rootPane.add(resultParent); | ||
rootPane.add(expResParent); | ||
|
||
JComponent result = abstractToolBar.getDisclosedComponent(1); | ||
resultParent.add(result); | ||
result.paint(graphics2d); | ||
int resultInt = resultParent.getComponentCount(); | ||
System.out.println("result:" + resultInt); | ||
|
||
JComponent expResult = new JPanel(); | ||
expResParent.add(expResult); | ||
expResult.paint(graphics2d); | ||
int expResultInt = expResParent.getComponentCount(); | ||
|
||
System.out.println("expresult:" + expResultInt); | ||
assertEquals("expects parent to have one component", 1, resultInt); | ||
assertEquals(expResultInt, resultInt); | ||
} | ||
|
||
} |