Bola/ 0000755 0001750 0001750 00000000000 11361772322 010705 5 ustar alejo alejo Bola/nbproject/ 0000755 0001750 0001750 00000000000 11360337677 012704 5 ustar alejo alejo Bola/src/ 0000755 0001750 0001750 00000000000 11360337677 011505 5 ustar alejo alejo Bola/nbproject/private/ 0000755 0001750 0001750 00000000000 11360406733 014344 5 ustar alejo alejo Bola/src/bola/ 0000755 0001750 0001750 00000000000 11361763333 012413 5 ustar alejo alejo Bola/src/org/ 0000755 0001750 0001750 00000000000 11360337677 012274 5 ustar alejo alejo Bola/src/org/netbeans/ 0000755 0001750 0001750 00000000000 11360337677 014073 5 ustar alejo alejo Bola/src/org/netbeans/javafx/ 0000755 0001750 0001750 00000000000 11360337677 015352 5 ustar alejo alejo Bola/src/org/netbeans/javafx/design/ 0000755 0001750 0001750 00000000000 11360337677 016623 5 ustar alejo alejo Bola/build.xml 0000644 0001750 0001750 00000006320 11360337677 012540 0 ustar alejo alejo
Builds, tests, and runs the project Bola.
Bola/nbproject/project.xml 0000644 0001750 0001750 00000000721 11360337677 015074 0 ustar alejo alejo
org.netbeans.modules.javafx.project
Bola
1.6.5
Bola/nbproject/project.properties 0000644 0001750 0001750 00000002670 11360337677 016475 0 ustar alejo alejo applet.draggable=true
applet.height=200
applet.width=200
application.title=Bola
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}/Bola.jar
dist.javadoc.dir=${dist.dir}/javadoc
excludes=
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=false
javafx.profile=desktop
jnlp.codebase.type=local
jnlp.offline-allowed=true
jnlp.packEnabled=false
jnlp.signed=false
main.class=bola.Main_run
manifest.file=manifest.mf
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
Bola/nbproject/build-impl.xml 0000644 0001750 0001750 00000036504 11360337677 015474 0 ustar alejo alejo
Must set build.dir
Must set dist.dir
Must set dist.javadoc.dir
Bola/nbproject/genfiles.properties 0000644 0001750 0001750 00000000713 11360337677 016617 0 ustar alejo alejo build.xml.data.CRC32=a16151c3
build.xml.script.CRC32=ae2b4bf8
build.xml.stylesheet.CRC32=bdec6f99@1.9.1
# 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=a16151c3
nbproject/build-impl.xml.script.CRC32=b60b248a
nbproject/build-impl.xml.stylesheet.CRC32=08b52d4e@1.9.1
Bola/nbproject/private/private.xml 0000644 0001750 0001750 00000000317 11360406733 016541 0 ustar alejo alejo
Bola/nbproject/private/private.properties 0000644 0001750 0001750 00000000100 11360337677 020135 0 ustar alejo alejo user.properties.file=/home/alejo/.netbeans/6.8/build.properties
Bola/src/bola/op.fx 0000644 0001750 0001750 00000005256 11361767320 013400 0 ustar alejo alejo /*
* Main.fx
*
* Created on 11/04/2010, 07:25:35 AM
*/
package bola;
/**
* @author alejo
*/
public class Main {
public-read var button: javafx.scene.control.Button;//GEN-BEGIN:main
public-read var circle: javafx.scene.shape.Circle;
public-read var scene: javafx.scene.Scene;
public-read var currentState: org.netbeans.javafx.design.DesignState;
//
init {
button = javafx.scene.control.Button {
layoutX: 30.0
layoutY: 23.0
text: "mover"
action: buttonAction
};
circle = javafx.scene.shape.Circle {
layoutX: 60.0
layoutY: 112.0
radius: 25.0
};
scene = javafx.scene.Scene {
width: 480.0
height: 320.0
content: javafx.scene.layout.Panel {
content: getDesignRootNodes ()
}
};
currentState = org.netbeans.javafx.design.DesignState {
names: [ "uno", "dos", ]
stateChangeType: org.netbeans.javafx.design.DesignStateChangeType.PAUSE_AND_PLAY_FROM_START
actual: 0
createTimeline: function (actual) {
if (actual == 0) {
javafx.animation.Timeline {
keyFrames: [
javafx.animation.KeyFrame {
time: 500ms
values: [
circle.translateX => 0.0 tween javafx.animation.Interpolator.LINEAR,
]
}
]
}
} else if (actual == 1) {
javafx.animation.Timeline {
keyFrames: [
javafx.animation.KeyFrame {
time: 500ms
values: [
circle.translateX => 300.0 tween javafx.animation.Interpolator.LINEAR,
]
}
]
}
} else {
null
}
}
}
}//
//
public function getDesignRootNodes () : javafx.scene.Node[] {
[ button, circle, ]
}
public function getDesignScene (): javafx.scene.Scene {
scene
}// //GEN-END:main
function buttonAction(): Void {
currentState.nextWrapped();
}
}
Bola/src/bola/op.fxc 0000644 0001750 0001750 00000007464 11361767317 013554 0 ustar alejo alejo
Bola/src/bola/Main_run.fx 0000644 0001750 0001750 00000000162 11360337677 014530 0 ustar alejo alejo package bola;
var design = Main {}
javafx.stage.Stage {
title: "Main"
scene: design.getDesignScene ()
}
Bola/src/org/netbeans/javafx/design/DesignState.fx 0000644 0001750 0001750 00000015745 11360337677 021410 0 ustar alejo alejo /*
* Copyright (c) 2009, Sun Microsystems, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * 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.
* * Neither the name of Sun Microsystems, Inc. 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.
*/
package org.netbeans.javafx.design;
import javafx.animation.Timeline;
import org.netbeans.javafx.design.DesignStateChangeType;
/**
* Represents a container of a single state variable in a design.
* State variable can hold at maximum one particular state at a time.
* The actual state is held in actual
field.
*
* It is required to set timelines
field.
* Then you can switch between states using actual
field directly or any helper method e.g. previous
or next
.
* Optionally you can set names
field to navigate to states using their names.
*/
public class DesignState {
/**
* Contains a sequence of names.
* Each name is assigned to a particular state represented by an index starting from zero.
* For getting an index from a specified name, you can use findIndex
method.
*/
public-init var names: String[];
/**
* Contains a sequence of timelines.
* Each timeline is assigned to a particular state represented by an index starting from zero.
* A timeline sets various properties of components in a design to specific value.
* At the end of the timeline, the design should look as designed for a specific state.
*/
public-init var timelines: Timeline[];
/**
* This function should create a timeline for a specified actual state.
* Default implementation returns a timeline stored timelines
sequence at actual
position.
*/
public-init var createTimeline: function (actual: Integer): Timeline = function (actual) {
timelines[actual]
};
/**
* Defines how the timelines should be stop/started when the actual state is changed.
* Default value is PAUSE_AND_PLAY_FROM_START
.
* If null value is set, IllegalArgumentException
is thrown.
*/
public-init var stateChangeType = DesignStateChangeType.PAUSE_AND_PLAY_FROM_START on replace oldValue {
if (stateChangeType == null) {
stateChangeType = oldValue;
throw new java.lang.IllegalArgumentException ();
}
}
/**
* This is a notification method called when the actual state is changed.
* @param oldState the previous state
* @param newState the new actual state
*/
public var onActualStateChanged: function (oldState: Integer,newState: Integer): Void;
var actualTimeline: Timeline;
/**
* Holds the actual state index. The defined indices are [0 .. < sizeof names].
* Any other index is taken as undefined.
* Default actual state index is -1
.
* When a new actual state index is set, then based on onActualStateChanged
* a new timeline is started and onActualStateChanged
method is called.
*/
public var actual = -1 on replace old {
if (stateChangeType == DesignStateChangeType.PAUSE_AND_PLAY_FROM_START) {
actualTimeline.stop ();
actualTimeline = createTimeline (actual);
actualTimeline.playFromStart ();
} else if (stateChangeType == DesignStateChangeType.FINISH_AND_PLAY_FROM_START) {
actualTimeline.time = actualTimeline.totalDuration;
actualTimeline = createTimeline (actual);
actualTimeline.playFromStart ();
} else if (stateChangeType == DesignStateChangeType.CONTINUE_AND_PLAY) {
actualTimeline.play ();
} else if (stateChangeType == DesignStateChangeType.DO_NOTHING) {
}
onActualStateChanged (old, actual);
}
/**
* Returns a state index by a state name which can be found in names
field.
* @param name the state name to search for
* @return the state index or -1
if not found.
*/
public function findIndex (name: String): Integer {
javafx.util.Sequences.indexOf(names, name);
}
/**
* If possible, sets the actual state index to previous state index
* i.e. decrements the actual state index by 1.
* The function cares about the lower limit and disables decrement
* when the new actual state index would be undefined index.
*/
public function previous () {
if (actual > 0) {
actual = actual - 1;
}
}
/**
* If possible, sets the actual state index to next state index
* i.e. increments the actual state index by 1.
* The function cares about the upper limit and disables increment
* when the new actual state index would be undefined index.
*/
public function next () {
if (actual < sizeof names - 1) {
actual = actual + 1;
}
}
/**
* If possible, sets the actual state index to previous state index in a loop
* i.e. decrements the actual state index by 1 in a loop of defined indices.
* If the new actual state index would be undefined index, the last defined index is set instead.
*/
public function previousWrapped () {
actual = if (actual > 0) then actual - 1 else sizeof names - 1
}
/**
* If possible, sets the actual state index to next state index in a loop
* i.e. increments the actual state index by 1 in a loop of defined indices.
* If the new actual state index would be undefined index, the first defined index is set instead.
*/
public function nextWrapped () {
actual = if (actual < sizeof names - 1) then actual + 1 else 0
}
}
Bola/src/org/netbeans/javafx/design/md5sums.md5 0000644 0001750 0001750 00000000154 11360337677 020627 0 ustar alejo alejo e801f251c270b174517444747fe496e2 DesignState.fx
636b0ee8d0e0dd51663094d9c2206575 DesignStateChangeType.java
Bola/src/org/netbeans/javafx/design/DesignStateChangeType.java 0000644 0001750 0001750 00000005352 11360337677 023655 0 ustar alejo alejo /*
* Copyright (c) 2009, Sun Microsystems, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * 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.
* * Neither the name of Sun Microsystems, Inc. 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.
*/
package org.netbeans.javafx.design;
/**
* Represents a type of behaviour for timelines of previous and new state when an actual state is changed in state a DesignState.
*/
public enum DesignStateChangeType {
/**
* Use this constant for setting DesignState.stateChangeType
field.
* This type stops previous timeline and plays the new timeline from its start.
*/
PAUSE_AND_PLAY_FROM_START,
/**
* Use this constant for setting DesignState.stateChangeType
field.
* This type finishes previous timeline by setting the time to the totalDuration and plays the new timeline from its start.
*/
FINISH_AND_PLAY_FROM_START,
/**
* Use this constant for setting DesignState.stateChangeType
field.
* This type leaves the previous timeline running and starts playing the new one.
* This behaviour may lead to some unconsistent state e.g. when a new timeline finishes before the old one.
*/
CONTINUE_AND_PLAY,
/**
* Use this constant for setting DesignState.stateChangeType
field.
* This type does not do anything with the timelines.
*/
DO_NOTHING
}