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
Apress
committed
Oct 14, 2016
0 parents
commit 78e035c
Showing
783 changed files
with
50,871 additions
and
0 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,69 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- You may freely edit this file. See commented blocks below for --> | ||
<!-- some examples of how to customize the build. --> | ||
<!-- (If you delete it and reopen the project it will be recreated.) --> | ||
<project name="AudioConfig" default="default" basedir="."> | ||
<description>Builds, tests, and runs the project AudioConfig.</description> | ||
<import file="nbproject/build-impl.xml"/> | ||
<!-- | ||
There exist several targets which are by default empty and which can be | ||
used for execution of your tasks. These targets are usually executed | ||
before and after some main targets. They are: | ||
-pre-init: called before initialization of project properties | ||
-post-init: called after initialization of project properties | ||
-pre-compile: called before javac compilation | ||
-post-compile: called after javac compilation | ||
-pre-compile-single: called before javac compilation of single file | ||
-post-compile-single: called after javac compilation of single file | ||
-pre-compile-test: called before javac compilation of JUnit tests | ||
-post-compile-test: called after javac compilation of JUnit tests | ||
-pre-compile-test-single: called before javac compilation of single JUnit test | ||
-post-compile-test-single: called after javac compilation of single JUunit test | ||
-pre-jar: called before JAR building | ||
-post-jar: called after JAR building | ||
-post-clean: called after cleaning build products | ||
(Targets beginning with '-' are not intended to be called on their own.) | ||
Example of inserting an obfuscator after compilation could look like this: | ||
<target name="-post-compile"> | ||
<obfuscate> | ||
<fileset dir="${build.classes.dir}"/> | ||
</obfuscate> | ||
</target> | ||
For list of available properties check the imported | ||
nbproject/build-impl.xml file. | ||
Another way to customize the build is by overriding existing main targets. | ||
The targets of interest are: | ||
-init-macrodef-javac: defines macro for javac compilation | ||
-init-macrodef-junit: defines macro for junit execution | ||
-init-macrodef-debug: defines macro for class debugging | ||
-init-macrodef-java: defines macro for class execution | ||
-do-jar-with-manifest: JAR building (if you are using a manifest) | ||
-do-jar-without-manifest: JAR building (if you are not using a manifest) | ||
run: execution of project | ||
-javadoc-build: Javadoc generation | ||
test-report: JUnit report generation | ||
An example of overriding the target for project execution could look like this: | ||
<target name="run" depends="AudioConfig-impl.jar"> | ||
<exec dir="bin" executable="launcher.exe"> | ||
<arg file="${dist.jar}"/> | ||
</exec> | ||
</target> | ||
Notice that the overridden target depends on the jar target and not only on | ||
the compile target as the regular run target does. Again, for a list of available | ||
properties which you can use, check the target you are overriding in the | ||
nbproject/build-impl.xml file. | ||
--> | ||
</project> |
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,3 @@ | ||
Manifest-Version: 1.0 | ||
X-COMMENT: Main-Class will be added automatically by build | ||
|
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
build.xml.data.CRC32=38c8818d | ||
build.xml.script.CRC32=34e5f0c2 | ||
build.xml.stylesheet.CRC32=bdec6f99 | ||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. | ||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. | ||
nbproject/build-impl.xml.data.CRC32=38c8818d | ||
nbproject/build-impl.xml.script.CRC32=7bdf6f41 | ||
nbproject/build-impl.xml.stylesheet.CRC32=e7782709 |
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,54 @@ | ||
applet.draggable=true | ||
applet.height=345 | ||
applet.width=320 | ||
application.title=AudioConfig | ||
application.vendor=Steve | ||
build.classes.excludes=**/*.java,**/*.form,**/*.fx | ||
build.classpath=\ | ||
${javac.classpath}:\ | ||
${src.dir}:\ | ||
${build.classes.dir}: | ||
# This directory is removed when the project is cleaned: | ||
build.dir=build | ||
build.generated.dir=${build.dir}/generated | ||
# Only compile against the classpath explicitly listed here: | ||
build.sysclasspath=ignore | ||
debug.classpath=\ | ||
${run.classpath} | ||
# This directory is removed when the project is cleaned: | ||
dist.dir=dist | ||
dist.jar=${dist.dir}/AudioConfig.jar | ||
dist.javadoc.dir=${dist.dir}/javadoc | ||
excludes= | ||
execution.target=standard | ||
includes=** | ||
jar.compress=true | ||
javac.classpath= | ||
# Space-separated list of extra javac options | ||
javac.compilerargs= | ||
javac.deprecation=false | ||
javac.source=1.5 | ||
javac.target=1.5 | ||
javadoc.additionalparam= | ||
javadoc.author=true | ||
javadoc.encoding= | ||
javadoc.private=true | ||
javadoc.version=true | ||
javafx.profile=desktop | ||
jnlp.codebase.type=local | ||
jnlp.codebase.url=file:/C:/Veriana/ProJavaFX/ProJavaFXBook/CodeExamplesMarina/Chapter01/AudioConfig/dist/ | ||
jnlp.offline-allowed=true | ||
jnlp.packEnabled=true | ||
jnlp.signed=false | ||
main.class=projavafx.audioconfig.ui.AudioConfigMain | ||
pack200.jar.compress=true | ||
platform.active=default_fx_platform | ||
run.classpath=\ | ||
${javac.classpath}:\ | ||
${build.classes.dir} | ||
# Space-separated list of JVM arguments used when running the project | ||
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value | ||
# or test-sys-prop.name=value to set system properties for unit tests): | ||
run.jvmargs= | ||
source.encoding=UTF-8 | ||
src.dir=src |
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,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://www.netbeans.org/ns/project/1"> | ||
<type>org.netbeans.modules.javafx.project</type> | ||
<configuration> | ||
<data xmlns="http://www.netbeans.org/ns/javafx-project/3"> | ||
<name>AudioConfig</name> | ||
<minimum-ant-version>1.6.5</minimum-ant-version> | ||
<source-roots> | ||
<root id="src.dir"/> | ||
</source-roots> | ||
<test-roots/> | ||
</data> | ||
</configuration> | ||
</project> |
96 changes: 96 additions & 0 deletions
96
Chapter01/AudioConfig/src/projavafx/audioconfig/model/AudioConfigModel.fx
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,96 @@ | ||
/* | ||
* Copyright (c) 2009, Pro JavaFX Authors | ||
* All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions are met: | ||
* 1. Redistributions of source code must retain the above copyright notice, | ||
* this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright notice, | ||
* this list of conditions and the following disclaimer in the documentation | ||
* and/or other materials provided with the distribution. | ||
* 3. Neither the name of JFXtras nor the names of its contributors may be used | ||
* to endorse or promote products derived from this software without | ||
* specific prior written permission. | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
* POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* AudioConfigModel.fx - The model class behind a JavaFX Script example | ||
* program that demonstrates "the way of JavaFX" (binding to model classes, | ||
* triggers, sequences, and declaratively expressed, node-centric UIs). | ||
* | ||
* Developed 2009 by James L. Weaver jim.weaver [at] javafxpert.com | ||
* as a JavaFX Script SDK 1.2 example for the Pro JavaFX book. | ||
*/ | ||
package projavafx.audioconfig.model; | ||
|
||
/** | ||
* The model class that the AudioConfigMain.fx script uses | ||
*/ | ||
public class AudioConfigModel { | ||
/** | ||
* The minimum audio volume in decibels | ||
*/ | ||
public def minDecibels:Number = 0; | ||
|
||
/** | ||
* The maximum audio volume in decibels | ||
*/ | ||
public def maxDecibels:Number = 160; | ||
|
||
/** | ||
* The selected audio volume in decibels | ||
*/ | ||
public var selectedDecibels:Number; | ||
|
||
/** | ||
* Indicates whether audio is muted | ||
*/ | ||
public var muting:Boolean; // false is default for Boolean | ||
|
||
/** | ||
* List of some musical genres | ||
*/ | ||
public def genres = [ | ||
"Chamber", | ||
"Country", | ||
"Cowbell", | ||
"Metal", | ||
"Polka", | ||
"Rock" | ||
]; | ||
|
||
/** | ||
* Index of the selected genre | ||
*/ | ||
public var selectedGenreIndex:Integer on replace { | ||
if (genres[selectedGenreIndex] == "Chamber") { | ||
selectedDecibels = 80; | ||
} | ||
else if (genres[selectedGenreIndex] == "Country") { | ||
selectedDecibels = 100; | ||
} | ||
else if (genres[selectedGenreIndex] == "Cowbell") { | ||
selectedDecibels = 150; | ||
} | ||
else if (genres[selectedGenreIndex] == "Metal") { | ||
selectedDecibels = 140; | ||
} | ||
else if (genres[selectedGenreIndex] == "Polka") { | ||
selectedDecibels = 120; | ||
} | ||
else if (genres[selectedGenreIndex] == "Rock") { | ||
selectedDecibels = 130; | ||
} | ||
}; | ||
} |
Oops, something went wrong.