Skip to content

Commit

Permalink
added radioboxes, refs #5
Browse files Browse the repository at this point in the history
  • Loading branch information
SnowballThrower committed Feb 15, 2016
1 parent a94902b commit daf6a7b
Show file tree
Hide file tree
Showing 13 changed files with 153 additions and 3 deletions.
Binary file added DMXSoftware/Data/Pictures/Cameo Par.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMXSoftware/Data/Pictures/Outdoor.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMXSoftware/Data/Pictures/Renkforce RDM.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DMXSoftware/Data/Pictures/Stairville Bar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions DMXSoftware/Readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pictures-Ordner nach target/classes
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package SnowballThrower.dmxsoftware.Database;

import SnowballThrower.dmxsoftware.Processing.Manage;
import java.util.ArrayList;
import java.util.List;

/**
*
* @author Sven
*/
public class Channels {

DMXChannel[] channels;
Manage manager;

public Channels(Manage manager) {
channels = new DMXChannel[600];
}

public Channels(Manage manager, List<Device> devices) {
channels = new DMXChannel[600];
for (Device device : devices) {
for (DMXChannel channel : device.getChannels()) {
if (channel != null) {
channel.addManager(manager);
channels[channel.adress] = channel;
}
}
}
}

public DMXChannel[] getAll() {
return channels;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package SnowballThrower.dmxsoftware.Database;

/**
*
* @author Sven
*/
public class ControlChannel extends Channel{

public ControlChannel(TypeChannel ch) {
super(ch);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package SnowballThrower.dmxsoftware.Database;

import SnowballThrower.dmxsoftware.Processing.Manage;
import java.util.List;

/**
*
* @author Sven
*/
public class DMXChannel extends Channel {

Device device;
List<ControlChannel> controls;
int adress;
private Manage manager;

public DMXChannel(TypeChannel ch) {
super(ch);
this.number = ch.getNumber();
}

public DMXChannel(TypeChannel ch, Device dev) {
super(ch);
this.number = ch.getNumber();
this.device = dev;
this.adress = device.getStartCh() + number - 1;
}

@Override
public void setValue(int value) {
super.setValue(value);
if (device != null) {
device.act();

}
manager.handle(adress, value);
}

public int getAdress() {
return adress;
}

public Device getDevice() {
return device;
}

void addManager(Manage manager) {
this.manager = manager;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,8 @@ public void startMidi() {
System.out.println("Error in startMidi");
}
}

public void barExtend(){

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.RadioButton;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.ToggleGroup;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.InputEvent;
Expand Down Expand Up @@ -187,14 +190,18 @@ ScrollPane bars() {
ScrollPane pane = new ScrollPane();
Group bars = new Group();
Group red = getBars(Function.Red);
red.setLayoutY((sizeY + distY) * 0);
red.setLayoutY((sizeY + distY) * 1);
bars.getChildren().add(red);
Group green = getBars(Function.Green);
green.setLayoutY((sizeY + distY) * 1);
green.setLayoutY((sizeY + distY) * 2);
bars.getChildren().add(green);
Group blue = getBars(Function.Blue);
blue.setLayoutY((sizeY + distY) * 2);
blue.setLayoutY((sizeY + distY) * 3);
bars.getChildren().add(blue);
Group checkBoxes = getCheckBoxes();
checkBoxes.setLayoutY(sizeY - 60);
bars.getChildren().add(checkBoxes);
bars.getChildren().add(new Rectangle(0, sizeY / 2, 0, 0));
pane.setContent(bars);
return pane;
}
Expand Down Expand Up @@ -298,4 +305,28 @@ private Group getBars(Function function) {

return faders;
}

private Group getCheckBoxes() {
Group boxes = new Group();
for (int i = 0; i < 5; i++) {
ToggleGroup group = new ToggleGroup();
RadioButton clone = new RadioButton("Kopie");
clone.setLayoutY(0);
clone.setToggleGroup(group);
RadioButton mirror = new RadioButton("Spiegel");
mirror.setLayoutY(30);
mirror.setToggleGroup(group);
RadioButton extend = new RadioButton("Erweitern");
extend.setLayoutY(60);
extend.setToggleGroup(group);
extend.setSelected(true);
if (i >= 3) {
mirror.setSelected(true);
}
Group triple = new Group(clone, mirror, extend);
triple.setLayoutX(sizeX * Math.pow(2, i));
boxes.getChildren().add(triple);
}
return boxes;
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit daf6a7b

Please sign in to comment.