Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #126 Allow to get a ne w fresh instance of FXMLComponent
- Loading branch information
Showing
9 changed files
with
229 additions
and
1 deletion.
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
37 changes: 37 additions & 0 deletions
37
org.jrebirth.af/core/src/test/java/org/jrebirth/af/core/resource/fxml/EnumFxmls.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,37 @@ | ||
/** | ||
* Get more info at : www.jrebirth.org . | ||
* Copyright JRebirth.org © 2011-2013 | ||
* Contact : sebastien.bordes@jrebirth.org | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.jrebirth.af.core.resource.fxml; | ||
|
||
|
||
/** | ||
* The class <strong>EnumColors</strong>. | ||
* | ||
* @author Sébastien Bordes | ||
* | ||
*/ | ||
public enum EnumFxmls implements FXMLEnum { | ||
|
||
// @formatter:off | ||
|
||
/** . */ | ||
FIRST_FXML {{ fxml("fxml", "first"); }}, | ||
|
||
/** Color for inner shadow, white. */ | ||
SECOND_FXML{{ fxml("fxml", "second"); }}; | ||
|
||
} |
68 changes: 68 additions & 0 deletions
68
org.jrebirth.af/core/src/test/java/org/jrebirth/af/core/resource/fxml/FxmlTest.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,68 @@ | ||
package org.jrebirth.af.core.resource.fxml; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertNotEquals; | ||
|
||
import org.jrebirth.af.core.ui.fxml.FXMLComponent; | ||
import org.junit.After; | ||
import org.junit.AfterClass; | ||
import org.junit.Before; | ||
import org.junit.BeforeClass; | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
|
||
/** | ||
* The class <strong>ColorTest</strong>. | ||
* | ||
* @author Sébastien Bordes | ||
*/ | ||
@Ignore("Must launch the Toolkit before") | ||
public class FxmlTest { | ||
|
||
@BeforeClass | ||
public static void setUpBeforeClass() throws Exception { | ||
|
||
} | ||
|
||
@Before | ||
public void setUp() throws Exception { | ||
|
||
} | ||
|
||
@Test | ||
public void fxmlClone() { | ||
|
||
checkFXML(EnumFxmls.FIRST_FXML); | ||
checkFXML(EnumFxmls.SECOND_FXML); | ||
|
||
checkFXML(TestFxmls.FIRST_FXML); | ||
checkFXML(TestFxmls.SECOND_FXML); | ||
|
||
} | ||
|
||
private void checkFXML(final FXMLItem fxmlItem) { | ||
|
||
FXMLComponent fx1 = fxmlItem.get(); | ||
FXMLComponent fx2 = fxmlItem.get(); | ||
|
||
FXMLComponent fx3 = fxmlItem.getNew(); | ||
FXMLComponent fx4 = fxmlItem.getNew(); | ||
|
||
assertEquals(fx1, fx2); | ||
assertNotEquals(fx1, fx3); | ||
assertNotEquals(fx1, fx4); | ||
assertNotEquals(fx3, fx4); | ||
|
||
|
||
} | ||
|
||
|
||
@After | ||
public void tearDown() throws Exception { | ||
} | ||
|
||
@AfterClass | ||
public static void tearDownAfterClass() throws Exception { | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
org.jrebirth.af/core/src/test/java/org/jrebirth/af/core/resource/fxml/TestFxmls.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,39 @@ | ||
/** | ||
* Get more info at : www.jrebirth.org . | ||
* Copyright JRebirth.org © 2011-2013 | ||
* Contact : sebastien.bordes@jrebirth.org | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.jrebirth.af.core.resource.fxml; | ||
|
||
import static org.jrebirth.af.core.resource.Resources.create; | ||
|
||
/** | ||
* The class <strong>TestColors</strong>. | ||
* | ||
* @author Sébastien Bordes | ||
*/ | ||
public interface TestFxmls { | ||
|
||
/**************************************************************************************/ | ||
/** ___________________________________FXML Files.___________________________________ */ | ||
/**************************************************************************************/ | ||
|
||
/** The first fxml file. */ | ||
FXMLItem FIRST_FXML = create(new FXML("fxml", "first")); | ||
|
||
/** The second fxml file. */ | ||
FXMLItem SECOND_FXML = create(new FXML("fxml", "second")); | ||
|
||
} |
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,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.chart.*?> | ||
<?import javafx.scene.text.*?> | ||
<?import javafx.scene.control.*?> | ||
<?import java.lang.*?> | ||
<?import javafx.scene.layout.*?> | ||
|
||
|
||
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> | ||
<center> | ||
<ScrollPane prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER"> | ||
<content> | ||
<PieChart /> | ||
</content> | ||
</ScrollPane> | ||
</center> | ||
<right> | ||
<Accordion BorderPane.alignment="CENTER"> | ||
<panes> | ||
<TitledPane animated="false" text="untitled 1"> | ||
<content> | ||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" /> | ||
</content> | ||
</TitledPane> | ||
<TitledPane animated="false" text="untitled 2"> | ||
<content> | ||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" /> | ||
</content> | ||
</TitledPane> | ||
<TitledPane animated="false" text="untitled 3"> | ||
<content> | ||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" /> | ||
</content> | ||
</TitledPane> | ||
</panes> | ||
</Accordion> | ||
</right> | ||
</BorderPane> |
Empty file.
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,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.control.*?> | ||
<?import java.lang.*?> | ||
<?import javafx.scene.layout.*?> | ||
|
||
|
||
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="175.0" prefWidth="53.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"> | ||
<children> | ||
<Button mnemonicParsing="false" text="Button" /> | ||
<Button mnemonicParsing="false" text="Button" /> | ||
<Button mnemonicParsing="false" text="Button" /> | ||
<Button mnemonicParsing="false" text="Button" /> | ||
<Button mnemonicParsing="false" text="Button" /> | ||
<Button mnemonicParsing="false" text="Button" /> | ||
<Button mnemonicParsing="false" text="Button" /> | ||
</children> | ||
</VBox> |
Empty file.
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