-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathPortRow.java
More file actions
36 lines (27 loc) · 999 Bytes
/
PortRow.java
File metadata and controls
36 lines (27 loc) · 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package nodebox.client;
import nodebox.node.Parameter;
import nodebox.node.Port;
import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*;
public class PortRow extends JComponent {
private Port port;
private JLabel label;
private JComponent control;
private static final int TOP_PADDING = 2;
private static final int BOTTOM_PADDING = 2;
public PortRow(Port port, JComponent control) {
this.port = port;
setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS));
label = new ShadowLabel(port.getName());
label.setBorder(null);
label.setPreferredSize(new Dimension(ParameterView.LABEL_WIDTH, 16));
this.control = control;
control.setBorder(BorderFactory.createEmptyBorder(TOP_PADDING, 0, BOTTOM_PADDING, 0));
add(this.label);
add(Box.createHorizontalStrut(10));
add(this.control);
add(Box.createHorizontalGlue());
setBorder(Theme.PARAMETER_ROW_BORDER);
}
}