Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove public modifier from groovy methods #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/groovy/groovyx/javafx/animation/GTimeline.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import javafx.util.Duration
class FunctionWrapper {
public Closure closure;

public Object invoke() {
Object invoke() {
return closure.call();
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/groovy/groovyx/javafx/animation/TargetHolder.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ class TargetHolder {
public Object endValue;
public Interpolator interpolator = Interpolator.LINEAR;

public String toString() {
String toString() {
"bean = ${bean}, property = ${propertyName}, endValue = ${endValue}, interpolator = ${interpolator}"
}

public KeyValue getKeyValue() {
KeyValue getKeyValue() {
if(property == null) {
property = Util.getJavaBeanFXWritableProperty(bean, propertyName);
}
Expand Down
42 changes: 22 additions & 20 deletions src/main/groovy/groovyx/javafx/binding/BindingHolder.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ class BindingHolder {
ObservableValue binding;
// the bound value from any bindTo.
ObservableValue boundValue;
public BindingHolder(Object value) {

BindingHolder(Object value) {
this(null, value);
}
public BindingHolder(BindingHolder parent, Object value) {

BindingHolder(BindingHolder parent, Object value) {
this.parent = parent;
if(value instanceof ObservableValue) {
observable = value;
Expand All @@ -65,8 +65,8 @@ class BindingHolder {
}

}
public BindingHolder bind() {

BindingHolder bind() {
unbind();
if(bindTo) {
boundValue = bindTo.binding;
Expand All @@ -77,16 +77,16 @@ class BindingHolder {
}
this
}
public BindingHolder rebind() {

BindingHolder rebind() {
if(boundValue) {
unbind();
bind();
}
this
}
public BindingHolder unbind() {

BindingHolder unbind() {
if(boundValue) {
if(boundValue instanceof Property) {
binding.unbindBidirectional(boundValue);
Expand All @@ -97,20 +97,21 @@ class BindingHolder {
}
this
}
public ObservableValue getBinding() {

ObservableValue getBinding() {
if(binding == null) {
bind();
binding = converter == null ? observable :
new ConverterProperty(observable, converter);
}
binding
}
public boolean isResolved() {

boolean isResolved() {
return observable != null;
}
public ObservableValue resolve(Object instance) {

ObservableValue resolve(Object instance) {
observable = Util.getJavaFXProperty(instance, propertyName);
if(observable == null)
observable = Util.getJavaBeanFXProperty(instance, propertyName);
Expand All @@ -119,8 +120,8 @@ class BindingHolder {
}
return observable;
}
public BindingHolder using(Closure converter) {

BindingHolder using(Closure converter) {
BindingHolder bh = lastHolder();
bh.converter = converter
bh.binding = null;
Expand All @@ -129,14 +130,15 @@ class BindingHolder {
bh.parent.rebind();
this
}
public BindingHolder to(Object value) {

BindingHolder to(Object value) {
BindingHolder bh = lastHolder();
bh.bindTo = new BindingHolder(bh, value);
bh.bind();
this
}
public BindingHolder to(Object instance, String prop) {

BindingHolder to(Object instance, String prop) {
BindingHolder bh = lastHolder();
bh.bindTo = new BindingHolder(bh, [instance,prop]);
bh.bind();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ import javafx.scene.canvas.GraphicsContext;
@FXBindable
class AppendSVGPathOperation implements CanvasOperation {
String svgpath
public void initParams(Object val) {

void initParams(Object val) {
svgpath = val.toString();
}

public void execute(GraphicsContext gc) {
void execute(GraphicsContext gc) {
gc.appendSVGPath(svgpath);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ import javafx.scene.effect.Effect
@FXBindable
class ApplyEffectOperation implements CanvasOperation {
Effect effect
public void initParams(Object val) {

void initParams(Object val) {
effect = val;
}

public void execute(GraphicsContext gc) {
void execute(GraphicsContext gc) {
gc.applyEffect(effect);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/groovy/groovyx/javafx/canvas/ArcOperation.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class ArcOperation implements CanvasOperation {
double radiusY;
double startAngle;
double length;
public void initParams(Object val) {

void initParams(Object val) {
centerX = val[0];
centerY = val[1];
radiusX = val[2];
Expand All @@ -42,7 +42,7 @@ class ArcOperation implements CanvasOperation {
length = val[5];
}

public void execute(GraphicsContext gc) {
void execute(GraphicsContext gc) {
gc.arc(centerX, centerY, radiusX, radiusY, startAngle, length);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/groovy/groovyx/javafx/canvas/ArcToOperation.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ class ArcToOperation implements CanvasOperation {
double x2;
double y2;
double radius
public void initParams(Object val) {

void initParams(Object val) {
x1 = val[0]
y1 = val[1]
x2 = val[2]
y2 = val[3]
radius = val[4]
}

public void execute(GraphicsContext gc) {
void execute(GraphicsContext gc) {
gc.arcTo(x1, y1, x2, y2, radius);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ import javafx.scene.canvas.GraphicsContext;
@FXBindable
class BeginPathOperation implements CanvasOperation {

public void initParams(Object val) {
void initParams(Object val) {

}

public void execute(GraphicsContext gc) {
void execute(GraphicsContext gc) {
gc.beginPath();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ class BezierCurveToOperation implements CanvasOperation {
double yc2;
double x1;
double y1;
public void initParams(Object val) {

void initParams(Object val) {
xc1 = val[0]
yc1 = val[1]
xc2 = val[2]
yc2 = val[3]
x1 = val[4]
}

public void execute(GraphicsContext gc) {
void execute(GraphicsContext gc) {
gc.bezierCurveTo(xc1, yc1, xc2, yc2, x1, y1);
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/main/groovy/groovyx/javafx/canvas/CanvasOperation.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ import javafx.scene.canvas.GraphicsContext
*
* @author jimclarke
*/
public interface CanvasOperation {
interface CanvasOperation {

public void initParams(Object obj);
public void execute(GraphicsContext gc);
void initParams(Object obj);

void execute(GraphicsContext gc);
}

Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ class ClearRectOperation implements CanvasOperation {
double y;
double w;
double h;
public void initParams(Object val) {

void initParams(Object val) {
x = val[0]
y = val[1]
w = val[2]
h = val[3]
}

public void execute(GraphicsContext gc) {
void execute(GraphicsContext gc) {
gc.clearRect(x, y, w, h);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/groovy/groovyx/javafx/canvas/ClipOperation.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ import javafx.scene.canvas.GraphicsContext;
@FXBindable
class ClipOperation implements CanvasOperation {

public void initParams(Object val) {
void initParams(Object val) {

}

public void execute(GraphicsContext gc) {
void execute(GraphicsContext gc) {
gc.clip();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ import javafx.scene.canvas.GraphicsContext;
@FXBindable
class ClosePathOperation implements CanvasOperation {

public void initParams(Object val) {
void initParams(Object val) {

}

public void execute(GraphicsContext gc) {
void execute(GraphicsContext gc) {
gc.closePath();
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/groovy/groovyx/javafx/canvas/ClosureOperation.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ import javafx.scene.canvas.GraphicsContext;
@FXBindable
class ClosureOperation implements CanvasOperation {
Closure closure
public void initParams(Object val) {

void initParams(Object val) {
closure = val
}

public void execute(GraphicsContext gc) {
void execute(GraphicsContext gc) {
closure(gc)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ class DrawImageOperation implements CanvasOperation {
Image img;
double x;
double y;
public void initParams(Object val) {

void initParams(Object val) {
img = val[0]
x = val[1]
y = val[2]
}

public void execute(GraphicsContext gc) {
void execute(GraphicsContext gc) {
gc.drawImage(img, x, y);
}
}
Expand Down
28 changes: 15 additions & 13 deletions src/main/groovy/groovyx/javafx/canvas/DrawOperations.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,34 @@ import javafx.collections.FXCollections
class DrawOperations implements CanvasOperation {
private List<CanvasOperation> operations = [];
Canvas canvas
public void setOperations(List ops)

void setOperations(List ops)
{
this.operations = FXCollections.observableArrayList(ops)
}

public void add(CanvasOperation opertion) {
void add(CanvasOperation opertion) {
operations << operation;
}
public void clear() {

void clear() {
operations.clear()
}
public void remove(CanvasOperation operation) {

void remove(CanvasOperation operation) {
operations.remove(operation)
}
public void draw() {

void draw() {
execute(canvas.graphicsContext2D)
}
public void draw(Canvas canvas) {

void draw(Canvas canvas) {
this.canvas = canvas;
draw();
}
public void initParams(Object obj){

void initParams(Object obj){
if(obj instanceof Canvas) {
canvas = obj;
}else {
Expand All @@ -73,7 +74,8 @@ class DrawOperations implements CanvasOperation {
}
}
}
public void execute(GraphicsContext gc) {

void execute(GraphicsContext gc) {

operations?.each {
it.execute(gc);
Expand Down
Loading