Minor GUI cleanup

This commit is contained in:
Eiren Rain committed 2021-09-23 22:55:45 +03:00
1 parent a3a004536d
commit 82ba193bb4
3 files changed
+84 -81

No files matched your search

+49 -49
View File
@@ -63,7 +63,7 @@ public class SkeletonConfig extends EJBagNoStretch {
HumanSkeletonWithLegs hswl = (HumanSkeletonWithLegs) newSkeleton;
setSelected(hswl.getSkeletonConfigBoolean("Extended pelvis model"));
}
}}, s(c(0, row, 1), 3, 1));
}}, s(c(0, row, 2), 3, 1));
row++;
//*/
/*
@@ -88,11 +88,11 @@ public class SkeletonConfig extends EJBagNoStretch {
HumanSkeletonWithLegs hswl = (HumanSkeletonWithLegs) newSkeleton;
setSelected(hswl.getSkeletonConfigBoolean("Extended knee model"));
}
}}, s(c(0, row, 1), 3, 1));
}}, s(c(0, row, 2), 3, 1));
row++;
//*/
add(new TimedResetButton("Reset All", "All"), s(c(1, row, 1), 3, 1));
add(new TimedResetButton("Reset All", "All"), s(c(1, row, 2), 3, 1));
add(new JButton("Auto") {{
addMouseListener(new MouseInputAdapter() {
@Override
@@ -101,70 +101,70 @@ public class SkeletonConfig extends EJBagNoStretch {
autoBone.toFront();
}
});
}}, s(c(4, row, 1), 3, 1));
}}, s(c(4, row, 2), 3, 1));
row++;
add(new JLabel("Chest"), c(0, row, 1));
add(new AdjButton("+", "Chest", 0.01f), c(1, row, 1));
add(new SkeletonLabel("Chest"), c(2, row, 1));
add(new AdjButton("-", "Chest", -0.01f), c(3, row, 1));
add(new ResetButton("Reset", "Chest"), c(4, row, 1));
add(new JLabel("Chest"), c(0, row, 2));
add(new AdjButton("+", "Chest", 0.01f), c(1, row, 2));
add(new SkeletonLabel("Chest"), c(2, row, 2));
add(new AdjButton("-", "Chest", -0.01f), c(3, row, 2));
add(new ResetButton("Reset", "Chest"), c(4, row, 2));
row++;
add(new JLabel("Waist"), c(0, row, 1));
add(new AdjButton("+", "Waist", 0.01f), c(1, row, 1));
add(new SkeletonLabel("Waist"), c(2, row, 1));
add(new AdjButton("-", "Waist", -0.01f), c(3, row, 1));
add(new TimedResetButton("Reset", "Waist"), c(4, row, 1));
add(new JLabel("Waist"), c(0, row, 2));
add(new AdjButton("+", "Waist", 0.01f), c(1, row, 2));
add(new SkeletonLabel("Waist"), c(2, row, 2));
add(new AdjButton("-", "Waist", -0.01f), c(3, row, 2));
add(new TimedResetButton("Reset", "Waist"), c(4, row, 2));
row++;
add(new JLabel("Hips width"), c(0, row, 1));
add(new AdjButton("+", "Hips width", 0.01f), c(1, row, 1));
add(new SkeletonLabel("Hips width"), c(2, row, 1));
add(new AdjButton("-", "Hips width", -0.01f), c(3, row, 1));
add(new ResetButton("Reset", "Hips width"), c(4, row, 1));
add(new JLabel("Hips width"), c(0, row, 2));
add(new AdjButton("+", "Hips width", 0.01f), c(1, row, 2));
add(new SkeletonLabel("Hips width"), c(2, row, 2));
add(new AdjButton("-", "Hips width", -0.01f), c(3, row, 2));
add(new ResetButton("Reset", "Hips width"), c(4, row, 2));
row++;
add(new JLabel("Legs length"), c(0, row, 1));
add(new AdjButton("+", "Legs length", 0.01f), c(1, row, 1));
add(new SkeletonLabel("Legs length"), c(2, row, 1));
add(new AdjButton("-", "Legs length", -0.01f), c(3, row, 1));
add(new TimedResetButton("Reset", "Legs length"), c(4, row, 1));
add(new JLabel("Legs length"), c(0, row, 2));
add(new AdjButton("+", "Legs length", 0.01f), c(1, row, 2));
add(new SkeletonLabel("Legs length"), c(2, row, 2));
add(new AdjButton("-", "Legs length", -0.01f), c(3, row, 2));
add(new TimedResetButton("Reset", "Legs length"), c(4, row, 2));
row++;
add(new JLabel("Knee height"), c(0, row, 1));
add(new AdjButton("+", "Knee height", 0.01f), c(1, row, 1));
add(new SkeletonLabel("Knee height"), c(2, row, 1));
add(new AdjButton("-", "Knee height", -0.01f), c(3, row, 1));
add(new TimedResetButton("Reset", "Knee height"), c(4, row, 1));
add(new JLabel("Knee height"), c(0, row, 2));
add(new AdjButton("+", "Knee height", 0.01f), c(1, row, 2));
add(new SkeletonLabel("Knee height"), c(2, row, 2));
add(new AdjButton("-", "Knee height", -0.01f), c(3, row, 2));
add(new TimedResetButton("Reset", "Knee height"), c(4, row, 2));
row++;
add(new JLabel("Foot length"), c(0, row, 1));
add(new AdjButton("+", "Foot length", 0.01f), c(1, row, 1));
add(new SkeletonLabel("Foot length"), c(2, row, 1));
add(new AdjButton("-", "Foot length", -0.01f), c(3, row, 1));
add(new ResetButton("Reset", "Foot length"), c(4, row, 1));
add(new JLabel("Foot length"), c(0, row, 2));
add(new AdjButton("+", "Foot length", 0.01f), c(1, row, 2));
add(new SkeletonLabel("Foot length"), c(2, row, 2));
add(new AdjButton("-", "Foot length", -0.01f), c(3, row, 2));
add(new ResetButton("Reset", "Foot length"), c(4, row, 2));
row++;
add(new JLabel("Head offset"), c(0, row, 1));
add(new AdjButton("+", "Head", 0.01f), c(1, row, 1));
add(new SkeletonLabel("Head"), c(2, row, 1));
add(new AdjButton("-", "Head", -0.01f), c(3, row, 1));
add(new ResetButton("Reset", "Head"), c(4, row, 1));
add(new JLabel("Head offset"), c(0, row, 2));
add(new AdjButton("+", "Head", 0.01f), c(1, row, 2));
add(new SkeletonLabel("Head"), c(2, row, 2));
add(new AdjButton("-", "Head", -0.01f), c(3, row, 2));
add(new ResetButton("Reset", "Head"), c(4, row, 2));
row++;
add(new JLabel("Neck length"), c(0, row, 1));
add(new AdjButton("+", "Neck", 0.01f), c(1, row, 1));
add(new SkeletonLabel("Neck"), c(2, row, 1));
add(new AdjButton("-", "Neck", -0.01f), c(3, row, 1));
add(new ResetButton("Reset", "Neck"), c(4, row, 1));
add(new JLabel("Neck length"), c(0, row, 2));
add(new AdjButton("+", "Neck", 0.01f), c(1, row, 2));
add(new SkeletonLabel("Neck"), c(2, row, 2));
add(new AdjButton("-", "Neck", -0.01f), c(3, row, 2));
add(new ResetButton("Reset", "Neck"), c(4, row, 2));
row++;
add(new JLabel("Virtual waist"), c(0, row, 1));
add(new AdjButton("+", "Virtual waist", 0.01f), c(1, row, 1));
add(new SkeletonLabel("Virtual waist"), c(2, row, 1));
add(new AdjButton("-", "Virtual waist", -0.01f), c(3, row, 1));
add(new ResetButton("Reset", "Virtual waist"), c(4, row, 1));
add(new JLabel("Virtual waist"), c(0, row, 2));
add(new AdjButton("+", "Virtual waist", 0.01f), c(1, row, 2));
add(new SkeletonLabel("Virtual waist"), c(2, row, 2));
add(new AdjButton("-", "Virtual waist", -0.01f), c(3, row, 2));
add(new ResetButton("Reset", "Virtual waist"), c(4, row, 2));
row++;
gui.refresh();
@@ -26,14 +26,12 @@ public class SkeletonList extends EJBagNoStretch {
Vector3f v = new Vector3f();
float[] angles = new float[3];
private final VRServer server;
private final VRServerGUI gui;
private final List<NodeStatus> nodes = new FastList<>();
private long lastUpdate = 0;
public SkeletonList(VRServer server, VRServerGUI gui) {
super(false, true);
this.server = server;
this.gui = gui;
setAlignmentY(TOP_ALIGNMENT);
+35 -30
View File
@@ -147,6 +147,7 @@ public class TrackersList extends EJBoxNoStretch {
@AWTThread
public TrackerPanel(Tracker t) {
super(false, true);
this.t = t;
}
@@ -160,14 +161,14 @@ public class TrackersList extends EJBoxNoStretch {
realTracker = ((ReferenceAdjustedTracker<? extends Tracker>) t).getTracker();
removeAll();
JLabel nameLabel;
add(nameLabel = new JLabel(t.getName()), s(c(0, row, 0, GridBagConstraints.FIRST_LINE_START), 4, 1));
add(nameLabel = new JLabel(t.getName()), s(c(0, row, 2, GridBagConstraints.FIRST_LINE_START), 4, 1));
nameLabel.setFont(nameLabel.getFont().deriveFont(Font.BOLD));
row++;
if(t.userEditable()) {
TrackerConfig cfg = server.getTrackerConfig(t);
JComboBox<String> desSelect;
add(desSelect = new JComboBox<>(), s(c(0, row, 0, GridBagConstraints.FIRST_LINE_START), 2, 1));
add(desSelect = new JComboBox<>(), s(c(0, row, 2, GridBagConstraints.FIRST_LINE_START), 2, 1));
for(TrackerBodyPosition p : TrackerBodyPosition.values) {
desSelect.addItem(p.name());
}
@@ -188,7 +189,7 @@ public class TrackersList extends EJBoxNoStretch {
IMUTracker imu = (IMUTracker) realTracker;
TrackerMountingRotation tr = imu.getMountingRotation();
JComboBox<String> mountSelect;
add(mountSelect = new JComboBox<>(), s(c(2, row, 0, GridBagConstraints.FIRST_LINE_START), 2, 1));
add(mountSelect = new JComboBox<>(), s(c(2, row, 2, GridBagConstraints.FIRST_LINE_START), 2, 1));
for(TrackerMountingRotation p : TrackerMountingRotation.values) {
mountSelect.addItem(p.name());
}
@@ -209,50 +210,54 @@ public class TrackersList extends EJBoxNoStretch {
row++;
}
if(t.hasRotation())
add(new JLabel("Rotation"), c(0, row, 0, GridBagConstraints.FIRST_LINE_START));
add(new JLabel("Rotation"), c(0, row, 2, GridBagConstraints.FIRST_LINE_START));
if(t.hasPosition())
add(new JLabel("Position"), c(1, row, 0, GridBagConstraints.FIRST_LINE_START));
add(new JLabel("Ping"), c(2, row, 0, GridBagConstraints.FIRST_LINE_START));
add(new JLabel("TPS"), c(3, row, 0, GridBagConstraints.FIRST_LINE_START));
add(new JLabel("Position"), c(1, row, 2, GridBagConstraints.FIRST_LINE_START));
add(new JLabel("TPS"), c(3, row, 2, GridBagConstraints.FIRST_LINE_START));
row++;
if(t.hasRotation())
add(rotation = new JLabel("0 0 0"), c(0, row, 0, GridBagConstraints.FIRST_LINE_START));
add(rotation = new JLabel("0 0 0"), c(0, row, 2, GridBagConstraints.FIRST_LINE_START));
if(t.hasPosition())
add(position = new JLabel("0 0 0"), c(1, row, 0, GridBagConstraints.FIRST_LINE_START));
add(ping = new JLabel(""), c(2, row, 0, GridBagConstraints.FIRST_LINE_START));
add(position = new JLabel("0 0 0"), c(1, row, 2, GridBagConstraints.FIRST_LINE_START));
if(realTracker instanceof IMUTracker) {
add(new JLabel("Ping"), c(2, row, 2, GridBagConstraints.FIRST_LINE_START));
add(ping = new JLabel(""), c(2, row, 2, GridBagConstraints.FIRST_LINE_START));
}
if(realTracker instanceof TrackerWithTPS) {
add(tps = new JLabel("0"), c(3, row, 0, GridBagConstraints.FIRST_LINE_START));
add(tps = new JLabel("0"), c(3, row, 2, GridBagConstraints.FIRST_LINE_START));
} else {
add(new JLabel(""), c(3, row, 0, GridBagConstraints.FIRST_LINE_START));
add(new JLabel(""), c(3, row, 2, GridBagConstraints.FIRST_LINE_START));
}
row++;
add(new JLabel("Status:"), c(0, row, 0, GridBagConstraints.FIRST_LINE_START));
add(status = new JLabel(t.getStatus().toString().toLowerCase()), c(1, row, 0, GridBagConstraints.FIRST_LINE_START));
add(new JLabel("Battery:"), c(2, row, 0, GridBagConstraints.FIRST_LINE_START));
add(bat = new JLabel("0"), c(3, row, 0, GridBagConstraints.FIRST_LINE_START));
add(new JLabel("Status:"), c(0, row, 2, GridBagConstraints.FIRST_LINE_START));
add(status = new JLabel(t.getStatus().toString().toLowerCase()), c(1, row, 2, GridBagConstraints.FIRST_LINE_START));
if(realTracker instanceof TrackerWithBattery) {
add(new JLabel("Battery:"), c(2, row, 2, GridBagConstraints.FIRST_LINE_START));
add(bat = new JLabel("0"), c(3, row, 2, GridBagConstraints.FIRST_LINE_START));
}
row++;
add(new JLabel("Raw:"), c(0, row, 0, GridBagConstraints.FIRST_LINE_START));
add(raw = new JLabel("0 0 0"), s(c(1, row, 0, GridBagConstraints.FIRST_LINE_START), 3, 1));
add(new JLabel("Raw:"), c(0, row, 2, GridBagConstraints.FIRST_LINE_START));
add(raw = new JLabel("0 0 0"), s(c(1, row, 2, GridBagConstraints.FIRST_LINE_START), 3, 1));
row++;
if(realTracker instanceof IMUTracker) {
add(new JLabel("Raw mag:"), c(0, row, 0, GridBagConstraints.FIRST_LINE_START));
add(rawMag = new JLabel("0 0 0"), s(c(1, row, 0, GridBagConstraints.FIRST_LINE_START), 3, 1));
add(new JLabel("Raw mag:"), c(0, row, 2, GridBagConstraints.FIRST_LINE_START));
add(rawMag = new JLabel("0 0 0"), s(c(1, row, 2, GridBagConstraints.FIRST_LINE_START), 3, 1));
row++;
add(new JLabel("Cal:"), c(0, row, 0, GridBagConstraints.FIRST_LINE_START));
add(calibration = new JLabel("0"), c(1, row, 0, GridBagConstraints.FIRST_LINE_START));
add(new JLabel("Mag acc:"), c(2, row, 0, GridBagConstraints.FIRST_LINE_START));
add(magAccuracy = new JLabel("0°"), c(3, row, 0, GridBagConstraints.FIRST_LINE_START));
add(new JLabel("Cal:"), c(0, row, 2, GridBagConstraints.FIRST_LINE_START));
add(calibration = new JLabel("0"), c(1, row, 2, GridBagConstraints.FIRST_LINE_START));
add(new JLabel("Mag acc:"), c(2, row, 2, GridBagConstraints.FIRST_LINE_START));
add(magAccuracy = new JLabel("0°"), c(3, row, 2, GridBagConstraints.FIRST_LINE_START));
row++;
add(new JLabel("Correction:"), c(0, row, 0, GridBagConstraints.FIRST_LINE_START));
add(correction = new JLabel("0 0 0"), s(c(1, row, 0, GridBagConstraints.FIRST_LINE_START), 3, 1));
add(new JLabel("Correction:"), c(0, row, 2, GridBagConstraints.FIRST_LINE_START));
add(correction = new JLabel("0 0 0"), s(c(1, row, 2, GridBagConstraints.FIRST_LINE_START), 3, 1));
row++;
}
if(t instanceof ReferenceAdjustedTracker) {
add(new JLabel("Adj:"), c(0, row, 0, GridBagConstraints.FIRST_LINE_START));
add(adj = new JLabel("0 0 0 0"), c(1, row, 0, GridBagConstraints.FIRST_LINE_START));
add(new JLabel("AdjY:"), c(2, row, 0, GridBagConstraints.FIRST_LINE_START));
add(adjYaw = new JLabel("0 0 0 0"), c(3, row, 0, GridBagConstraints.FIRST_LINE_START));
add(new JLabel("Adj:"), c(0, row, 2, GridBagConstraints.FIRST_LINE_START));
add(adj = new JLabel("0 0 0 0"), c(1, row, 2, GridBagConstraints.FIRST_LINE_START));
add(new JLabel("AdjY:"), c(2, row, 2, GridBagConstraints.FIRST_LINE_START));
add(adjYaw = new JLabel("0 0 0 0"), c(3, row, 2, GridBagConstraints.FIRST_LINE_START));
}
setBorder(BorderFactory.createLineBorder(new Color(0x663399), 2, false));