Skip to content

Commit

Permalink
Reformat Slider.java.
Browse files Browse the repository at this point in the history
  • Loading branch information
lopsided98 committed Mar 15, 2015
1 parent 2715a10 commit 1fe1252
Showing 1 changed file with 52 additions and 52 deletions.
104 changes: 52 additions & 52 deletions src/org/usfirst/frc/team2084/smartdashboard/extensions/Slider.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014 RobotsByTheC. All rights reserved.
* Copyright (c) 2015 RobotsByTheC. All rights reserved.
*
* Open Source Software - may be modified and shared by FRC teams. The code must
* be accompanied by the BSD license file in the root directory of the project.
Expand All @@ -25,65 +25,65 @@
@SuppressWarnings("serial")
public class Slider extends AbstractValueWidget {

public static final DataType[] TYPES = { DataType.NUMBER };
public static final DataType[] TYPES = { DataType.NUMBER };

public final DoubleProperty max = new DoubleProperty(this, "Maximum", 100);
public final DoubleProperty min = new DoubleProperty(this, "Minimum", 0);
public final DoubleProperty tickInterval = new DoubleProperty(this, "Tick Interval", 10);
public final BooleanProperty showTicks = new BooleanProperty(this, "Show Ticks", false);
public final BooleanProperty showLabel = new BooleanProperty(this, "Show Label", true);
public final MultiProperty orientation = new MultiProperty(this, "Orientation");
public final BooleanProperty editable = new BooleanProperty(this, "Editable", true);
public final DoubleProperty max = new DoubleProperty(this, "Maximum", 100);
public final DoubleProperty min = new DoubleProperty(this, "Minimum", 0);
public final DoubleProperty tickInterval = new DoubleProperty(this, "Tick Interval", 10);
public final BooleanProperty showTicks = new BooleanProperty(this, "Show Ticks", false);
public final BooleanProperty showLabel = new BooleanProperty(this, "Show Label", true);
public final MultiProperty orientation = new MultiProperty(this, "Orientation");
public final BooleanProperty editable = new BooleanProperty(this, "Editable", true);

private BindableSlider slider;
private JLabel label;
private BindableSlider slider;
private JLabel label;

public Slider() {
orientation.add("Horizontal", NumberSlider.HORIZONTAL);
orientation.add("Vertical", NumberSlider.VERTICAL);
orientation.setDefault("Horizontal");
}
public Slider() {
orientation.add("Horizontal", NumberSlider.HORIZONTAL);
orientation.add("Vertical", NumberSlider.VERTICAL);
orientation.setDefault("Horizontal");
}

@Override
public void init() {
slider = new BindableSlider(new BindableTableEntry(Robot.getTable(), getFieldName()));
@Override
public void init() {
slider = new BindableSlider(new BindableTableEntry(Robot.getTable(), getFieldName()));

setNumberBinding(slider);
setNumberBinding(slider);

update(max, max.getValue());
update(min, min.getValue());
update(tickInterval, tickInterval.getValue());
update(showTicks, showTicks.getValue());
update(orientation, orientation.getValue());
update(editable, editable.getValue());
update(max, max.getValue());
update(min, min.getValue());
update(tickInterval, tickInterval.getValue());
update(showTicks, showTicks.getValue());
update(orientation, orientation.getValue());
update(editable, editable.getValue());

setLayout(new BorderLayout());
add(label = new JLabel(getFieldName()), BorderLayout.PAGE_START);
update(showLabel, showLabel.getValue());
setLayout(new BorderLayout());
add(label = new JLabel(getFieldName()), BorderLayout.PAGE_START);
update(showLabel, showLabel.getValue());

add(slider, BorderLayout.CENTER);
add(slider, BorderLayout.CENTER);

revalidate();
repaint();
}
revalidate();
repaint();
}

@Override
public void propertyChanged(Property property) {
if (property == min) {
slider.setMin(min.getValue());
} else if (property == max) {
slider.setMax(max.getValue());
} else if (property == tickInterval) {
slider.setTickSpacing(tickInterval.getValue());
} else if (property == showTicks) {
slider.setPaintTicks(showTicks.getValue());
slider.setTickSpacing(tickInterval.getValue());
} else if (property == showLabel) {
label.setVisible(showLabel.getValue());
} else if (property == orientation) {
slider.setOrientation((int) orientation.getValue());
} else if (property == editable) {
slider.setEnabled(editable.getValue());
}
}
@Override
public void propertyChanged(Property property) {
if (property == min) {
slider.setMin(min.getValue());
} else if (property == max) {
slider.setMax(max.getValue());
} else if (property == tickInterval) {
slider.setTickSpacing(tickInterval.getValue());
} else if (property == showTicks) {
slider.setPaintTicks(showTicks.getValue());
slider.setTickSpacing(tickInterval.getValue());
} else if (property == showLabel) {
label.setVisible(showLabel.getValue());
} else if (property == orientation) {
slider.setOrientation((int) orientation.getValue());
} else if (property == editable) {
slider.setEnabled(editable.getValue());
}
}
}

0 comments on commit 1fe1252

Please sign in to comment.