Fixed some layouting issues; Fixed type in device type name

Former-commit-id: d9bcb90ac57feac2e540bb9315f295bc678a854a
This commit is contained in:
johan 2013-11-09 11:06:46 +01:00
parent c77f45f221
commit 67f85de8c9
14 changed files with 106 additions and 18 deletions

View File

@ -1 +1 @@
03fb2204d7c3a13dd4a2c5c55336c259bf314026
7079c4843fecd32e0914e10a06cf4fe99d89ab9d

View File

@ -1,7 +1,9 @@
package org.hyperion.hypercon.gui;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.Transient;
import javax.swing.BorderFactory;
import javax.swing.GroupLayout;
@ -35,6 +37,14 @@ public class BootSequencePanel extends JPanel {
initialise();
}
@Override
@Transient
public Dimension getMaximumSize() {
Dimension maxSize = super.getMaximumSize();
Dimension prefSize = super.getPreferredSize();
return new Dimension(maxSize.width, prefSize.height);
}
private void initialise() {
setBorder(BorderFactory.createTitledBorder("Boot Sequence"));

View File

@ -1,6 +1,8 @@
package org.hyperion.hypercon.gui;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.beans.Transient;
import javax.swing.BorderFactory;
import javax.swing.Box;
@ -59,11 +61,20 @@ public class ColorPanel extends JPanel {
initialise();
}
@Override
@Transient
public Dimension getMaximumSize() {
Dimension maxSize = super.getMaximumSize();
Dimension prefSize = super.getPreferredSize();
return new Dimension(maxSize.width, prefSize.height);
}
private void initialise() {
setBorder(BorderFactory.createTitledBorder("Color transform"));
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
add(getRgbPanel());
add(Box.createVerticalStrut(10));
add(getHsvPanel());
}
@ -140,19 +151,18 @@ public class ColorPanel extends JPanel {
private JPanel getHsvPanel() {
if (mHsvTransformPanel == null) {
mHsvTransformPanel = new JPanel();
mHsvTransformPanel.setBorder(BorderFactory.createTitledBorder("HSV"));
GroupLayout layout = new GroupLayout(mHsvTransformPanel);
mHsvTransformPanel.setLayout(layout);
mSaturationAdjustLabel = new JLabel("Saturation");
mSaturationAdjustLabel = new JLabel("HSV Saturation gain");
mHsvTransformPanel.add(mSaturationAdjustLabel);
mSaturationAdjustSpinner = new JSpinner(new SpinnerNumberModel(mColorConfig.mSaturationGain, 0.0, 1024.0, 0.01));
mSaturationAdjustSpinner.addChangeListener(mChangeListener);
mHsvTransformPanel.add(mSaturationAdjustSpinner);
mValueAdjustLabel = new JLabel("Value");
mValueAdjustLabel = new JLabel("HSV Value gain");
mHsvTransformPanel.add(mValueAdjustLabel);
mValueAdjustSpinner = new JSpinner(new SpinnerNumberModel(mColorConfig.mValueGain, 0.0, 1024.0, 0.01));

View File

@ -1,7 +1,9 @@
package org.hyperion.hypercon.gui;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.Transient;
import javax.swing.BorderFactory;
import javax.swing.GroupLayout;
@ -37,6 +39,14 @@ public class ColorSmoothingPanel extends JPanel {
initialise();
}
@Override
@Transient
public Dimension getMaximumSize() {
Dimension maxSize = super.getMaximumSize();
Dimension prefSize = super.getPreferredSize();
return new Dimension(maxSize.width, prefSize.height);
}
private void initialise() {
setBorder(BorderFactory.createTitledBorder("Smoothing"));

View File

@ -130,7 +130,6 @@ public class ConfigPanel extends JPanel {
private JTabbedPane getSpecificationTabs() {
if (mSpecificationTabs == null) {
mSpecificationTabs = new JTabbedPane();
mSpecificationTabs.setPreferredSize(new Dimension(300,150));
mSpecificationTabs.addTab("Hardware", getHardwarePanel());
mSpecificationTabs.addTab("Process", getProcessPanel());
@ -163,33 +162,32 @@ public class ConfigPanel extends JPanel {
mHardwarePanel.add(new DevicePanel(ledString.mDeviceConfig));
mHardwarePanel.add(new LedFramePanel(ledString.mLedFrameConfig));
mHardwarePanel.add(new ImageProcessPanel(ledString.mProcessConfig));
mHardwarePanel.add(Box.createVerticalGlue());
}
return mHardwarePanel;
}
private JPanel getProcessPanel() {
if (mProcessPanel == null) {
mProcessPanel = new JPanel();
mProcessPanel.setLayout(new BoxLayout(mProcessPanel, BoxLayout.Y_AXIS));
mProcessPanel.add(new BootSequencePanel(ledString.mMiscConfig));
mProcessPanel.add(new FrameGrabberPanel(ledString.mMiscConfig));
mProcessPanel.add(new ColorSmoothingPanel(ledString.mColorConfig));
mProcessPanel.add(new ColorPanel(ledString.mColorConfig));
mProcessPanel.add(Box.createVerticalGlue());
}
return mProcessPanel;
}
private JPanel getExternalPanel() {
if (mExternalPanel == null) {
mExternalPanel = new JPanel();
mExternalPanel.setLayout(new BoxLayout(mExternalPanel, BoxLayout.Y_AXIS));
mExternalPanel.add(new XbmcPanel(ledString.mMiscConfig));
mExternalPanel.add(new InterfacePanel(ledString.mMiscConfig));
mExternalPanel.add(Box.createVerticalGlue());
}
return mExternalPanel;

View File

@ -1,7 +1,9 @@
package org.hyperion.hypercon.gui;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.Transient;
import javax.swing.BorderFactory;
import javax.swing.GroupLayout;
@ -44,6 +46,14 @@ public class DevicePanel extends JPanel {
initialise();
}
@Override
@Transient
public Dimension getMaximumSize() {
Dimension maxSize = super.getMaximumSize();
Dimension prefSize = super.getPreferredSize();
return new Dimension(maxSize.width, prefSize.height);
}
private void initialise() {
setBorder(BorderFactory.createTitledBorder("Device"));

View File

@ -1,7 +1,9 @@
package org.hyperion.hypercon.gui;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.Transient;
import javax.swing.BorderFactory;
import javax.swing.GroupLayout;
@ -35,6 +37,14 @@ public class FrameGrabberPanel extends JPanel {
initialise();
}
@Override
@Transient
public Dimension getMaximumSize() {
Dimension maxSize = super.getMaximumSize();
Dimension prefSize = super.getPreferredSize();
return new Dimension(maxSize.width, prefSize.height);
}
private void initialise() {
setBorder(BorderFactory.createTitledBorder("Frame Grabber"));

View File

@ -1,7 +1,9 @@
package org.hyperion.hypercon.gui;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.Transient;
import javax.swing.BorderFactory;
import javax.swing.GroupLayout;
@ -43,6 +45,14 @@ public class ImageProcessPanel extends JPanel {
initialise();
}
@Override
@Transient
public Dimension getMaximumSize() {
Dimension maxSize = super.getMaximumSize();
Dimension prefSize = super.getPreferredSize();
return new Dimension(maxSize.width, prefSize.height);
}
private void initialise() {
setBorder(BorderFactory.createTitledBorder("Image Process"));

View File

@ -1,7 +1,9 @@
package org.hyperion.hypercon.gui;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.Transient;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
@ -43,8 +45,16 @@ public class InterfacePanel extends JPanel {
initialise();
}
@Override
@Transient
public Dimension getMaximumSize() {
Dimension maxSize = super.getMaximumSize();
Dimension prefSize = super.getPreferredSize();
return new Dimension(maxSize.width, prefSize.height);
}
private void initialise() {
setBorder(BorderFactory.createTitledBorder("External interfaces"));
//setBorder(BorderFactory.createTitledBorder("External interfaces"));
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
add(getJsonPanel());
@ -57,7 +67,7 @@ public class InterfacePanel extends JPanel {
private JPanel getJsonPanel() {
if (mJsonPanel == null) {
mJsonPanel = new JPanel();
mJsonPanel.setBorder(BorderFactory.createTitledBorder("JSON"));
mJsonPanel.setBorder(BorderFactory.createTitledBorder("Json server"));
mJsonCheck = new JCheckBox("Enabled");
mJsonCheck.setSelected(mMiscConfig.mJsonInterfaceEnabled);
@ -96,7 +106,7 @@ public class InterfacePanel extends JPanel {
private JPanel getProtoPanel() {
if (mProtoPanel == null) {
mProtoPanel = new JPanel();
mProtoPanel.setBorder(BorderFactory.createTitledBorder("PROTO"));
mProtoPanel.setBorder(BorderFactory.createTitledBorder("Proto server"));
mProtoCheck = new JCheckBox("Enabled");
mProtoCheck.setSelected(mMiscConfig.mProtoInterfaceEnabled);
@ -136,7 +146,7 @@ public class InterfacePanel extends JPanel {
private JPanel getBoblightPanel() {
if (mBoblightPanel == null) {
mBoblightPanel = new JPanel();
mBoblightPanel.setBorder(BorderFactory.createTitledBorder("Boblight"));
mBoblightPanel.setBorder(BorderFactory.createTitledBorder("Boblight server"));
mBoblightCheck = new JCheckBox("Enabled");
mBoblightCheck.setSelected(mMiscConfig.mBoblightInterfaceEnabled);

View File

@ -1,7 +1,9 @@
package org.hyperion.hypercon.gui;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.Transient;
import javax.swing.BorderFactory;
import javax.swing.GroupLayout;
@ -47,6 +49,14 @@ public class LedFramePanel extends JPanel {
initialise();
}
@Override
@Transient
public Dimension getMaximumSize() {
Dimension maxSize = super.getMaximumSize();
Dimension prefSize = super.getPreferredSize();
return new Dimension(maxSize.width, prefSize.height);
}
private void initialise() {
setBorder(BorderFactory.createTitledBorder("Construction"));

View File

@ -1,7 +1,9 @@
package org.hyperion.hypercon.gui;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.Transient;
import javax.swing.BorderFactory;
import javax.swing.GroupLayout;
@ -48,6 +50,14 @@ public class XbmcPanel extends JPanel {
initialise();
}
@Override
@Transient
public Dimension getMaximumSize() {
Dimension maxSize = super.getMaximumSize();
Dimension prefSize = super.getPreferredSize();
return new Dimension(maxSize.width, prefSize.height);
}
private void initialise() {
setBorder(BorderFactory.createTitledBorder("XBMC Checker"));

View File

@ -26,11 +26,11 @@ public class DeviceConfig {
strBuf.append("\t/// Device configuration contains the following fields: \n");
strBuf.append("\t/// * 'name' : The user friendly name of the device (only used for display purposes)\n");
strBuf.append("\t/// * 'type' : The type of the device or leds (known types for now are 'ws2801', 'ldp6803', 'test' and 'none')\n");
strBuf.append("\t/// * 'type' : The type of the device or leds (known types for now are 'ws2801', 'lpd6803', 'sedu', 'test' and 'none')\n");
strBuf.append("\t/// * 'output' : The output specification depends on selected device\n");
strBuf.append("\t/// - 'ws2801' this is the device (eg '/dev/spidev0.0')\n");
strBuf.append("\t/// - 'ws2801' this is the device (eg '/dev/spidev0.0 or /dev/ttyS0')\n");
strBuf.append("\t/// - 'test' this is the file used to write test output (eg '/home/pi/hyperion.out')\n");
strBuf.append("\t/// * 'rate' : The baudrate of the output to the device (only applicable for 'ws2801')\n");
strBuf.append("\t/// * 'rate' : The baudrate of the output to the device\n");
strBuf.append("\t/// * 'colorOrder' : The order of the color bytes ('rgb', 'rbg', 'bgr', etc.).\n");
strBuf.append("\t\"device\" :\n");

View File

@ -7,7 +7,7 @@ public enum DeviceType {
/** WS2801 Led String device with one continuous shift-register (1 byte per color-channel) */
ws2801("WS2801"),
/** LDP6803 Led String device with one continuous shift-register (5 bits per color channel)*/
ldp6803("LDP6803"),
lpd6803("LPD6803"),
/** SEDU LED device */
sedu("SEDU"),
/** Test device for writing color values to file-output */

View File

@ -49,7 +49,7 @@ public class MiscConfig {
public int mProtoPort = 19445;
/** Flag indicating that the PROTO interface is enabled */
public boolean mBoblightInterfaceEnabled = true;
public boolean mBoblightInterfaceEnabled = false;
/** The TCP port at which the Protobuf server is listening for incoming connections */
public int mBoblightPort = 19333;