Transition opacityTransition = new Transition() { { setCycleDuration(Duration.seconds(1)); } protected void interpolate(double frac) { opacity.set(frac); } };
public boolean hasOneEpsilonTransitionOnly(NFAState state) { return state.getNumberOfTransitions() == 1 && state.transition(0).isEpsilon(); }
int _getMaxLookaheadDepth(DFAState d, int depth) { // not cyclic; don't worry about termination // fail if pred edge. int max = depth; for (int i=0; i<d.getNumberOfTransitions(); i++) { Transition t = d.transition(i); // if ( t.isSemanticPredicate() ) return Integer.MAX_VALUE; if ( !t.isSemanticPredicate() ) { // if pure pred not gated, it must target stop state; don't count DFAState edgeTarget = (DFAState)t.target; int m = _getMaxLookaheadDepth(edgeTarget, depth+1); max = Math.max(max, m); } } return max; }
Transition transition = new Transition() { transition.setCycleCount(Animation.INDEFINITE); transition.setAutoReverse(true); transition.play();
System.out.println("End State is = "+endState); Transition t1 = new Transition(); t1.setName("to_firstNode"); t1.setFrom(startState); t1.setTo(firstNode); System.out.println("Transition t1 = "+t1.toString()); Transition t2 = new Transition(); t2.setName("to_firstState"); t2.setFrom(firstNode); t2.setTo(firstState); System.out.println("Transition t2 = "+t2.toString()); Transition t3 = new Transition(); t3.setName("to_secondNode"); t3.setFrom(firstState); t3.setTo(secondNode); System.out.println("Transition t3 = "+t3.toString()); Transition t4 = new Transition(); t4.setName("to_end"); t4.setFrom(secondNode); t4.setTo(endState); System.out.println("Transition t4 = "+t4.toString());
StringBuilder buf = new StringBuilder(); buf.append(stateStr); if ( edge.isAction() ) { buf.append("-{}->"); else if ( edge.isEpsilon() ) { buf.append("->"); else if ( edge.isSemanticPredicate() ) { buf.append("-{").append(edge.label.getSemanticContext()).append("}?->");
StringBuilder buf = new StringBuilder(); buf.append(stateStr); if ( edge.isAction() ) { buf.append("-{}->"); else if ( edge.isEpsilon() ) { buf.append("->"); else if ( edge.isSemanticPredicate() ) { buf.append("-{").append(edge.label.getSemanticContext()).append("}?->");
Transition transition = new Transition() { transition.setCycleCount(Animation.INDEFINITE); transition.setAutoReverse(true); transition.play();
StringBuffer buf = new StringBuffer(); buf.append(stateStr); if ( edge.isAction() ) { buf.append("-{}->"); else if ( edge.isEpsilon() ) { buf.append("->"); else if ( edge.isSemanticPredicate() ) { buf.append("-{"+edge.label.getSemanticContext()+"}?->");
Animation animation = new Transition() { { setCycleDuration(Duration.millis(1000)); } @Override protected void interpolate(double frac) { // your rotation code here } }
int _getMaxLookaheadDepth(DFAState d, int depth) { // not cyclic; don't worry about termination // fail if pred edge. int max = depth; for (int i=0; i<d.getNumberOfTransitions(); i++) { Transition t = d.transition(i); // if ( t.isSemanticPredicate() ) return Integer.MAX_VALUE; if ( !t.isSemanticPredicate() ) { // if pure pred not gated, it must target stop state; don't count DFAState edgeTarget = (DFAState)t.target; int m = _getMaxLookaheadDepth(edgeTarget, depth+1); max = Math.max(max, m); } } return max; }
public boolean hasOneOrMoreEpsilonTransitionOnly(NFAState state) { for(int t=0; t<state.getNumberOfTransitions(); t++) { Transition transition = state.transition(t); if(!transition.isEpsilon()) return false; } return state.getNumberOfTransitions()>0; }
StringBuffer buf = new StringBuffer(); buf.append(stateStr); if ( edge.isAction() ) { buf.append("-{}->"); else if ( edge.isEpsilon() ) { buf.append("->"); else if ( edge.isSemanticPredicate() ) { buf.append("-{"+edge.label.getSemanticContext()+"}?->");
public Controller(){ > final Animation anim = new Transition() { > { > setCycleDuration(Duration.millis(3000)); > } > @Override > protected void interpolate(double frac) { > rectangle_height = rectangle1.getHeight(); > mult_factor = frac * 5.8; > rectangle1.setHeight(rectangle_height * mult_factor); > } > }; > anim.play(); // <- start the actual animation } }
int _getMaxLookaheadDepth(DFAState d, int depth) { // not cyclic; don't worry about termination // fail if pred edge. int max = depth; for (int i=0; i<d.getNumberOfTransitions(); i++) { Transition t = d.transition(i); // if ( t.isSemanticPredicate() ) return Integer.MAX_VALUE; if ( !t.isSemanticPredicate() ) { // if pure pred not gated, it must target stop state; don't count DFAState edgeTarget = (DFAState)t.target; int m = _getMaxLookaheadDepth(edgeTarget, depth+1); max = Math.max(max, m); } } return max; }
public boolean hasMoreThanOneEpsilonTransitionOnly(NFAState state) { for(int t=0; t<state.getNumberOfTransitions(); t++) { Transition transition = state.transition(t); if(!transition.isEpsilon()) return false; } return state.getNumberOfTransitions()>1; }