|
|
|
@ -95,6 +95,7 @@ public class NodePanel extends DraggablePanel implements Selectable, PropertyCha |
|
|
|
|
/** |
|
|
|
|
* Creates new form NodePanel |
|
|
|
|
*/ |
|
|
|
|
@SuppressWarnings("LeakingThisInConstructor") |
|
|
|
|
public NodePanel(ShaderNodeBlock node, ShaderNodeDefinition def) { |
|
|
|
|
super(); |
|
|
|
|
if (def.getType() == Shader.ShaderType.Vertex) { |
|
|
|
@ -116,6 +117,7 @@ public class NodePanel extends DraggablePanel implements Selectable, PropertyCha |
|
|
|
|
/** |
|
|
|
|
* Creates new form NodePanel |
|
|
|
|
*/ |
|
|
|
|
@SuppressWarnings("LeakingThisInConstructor") |
|
|
|
|
public NodePanel(ShaderNodeVariable singleOut, NodePanel.NodeType type) { |
|
|
|
|
super(); |
|
|
|
|
List<ShaderNodeVariable> outputs = new ArrayList<ShaderNodeVariable>(); |
|
|
|
@ -199,19 +201,20 @@ public class NodePanel extends DraggablePanel implements Selectable, PropertyCha |
|
|
|
|
} |
|
|
|
|
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, // Anti-alias!
|
|
|
|
|
RenderingHints.VALUE_ANTIALIAS_ON); |
|
|
|
|
Color[] colors = {new Color(0, 0, 0, 0.7f), new Color(0, 0, 0, 0.15f)}; |
|
|
|
|
// Color[] colors = {new Color(0, 0, 0, 0.7f), new Color(0, 0, 0, 0.15f)};
|
|
|
|
|
if (diagram.selectedItem == this) { |
|
|
|
|
colors = new Color[]{new Color(0.6f, 0.6f, 1.0f, 0.9f), new Color(0.6f, 0.6f, 1.0f, 0.5f)}; |
|
|
|
|
} |
|
|
|
|
Color[] colors = new Color[]{new Color(0.6f, 0.6f, 1.0f, 0.8f), new Color(0.6f, 0.6f, 1.0f, 0.5f)}; |
|
|
|
|
float[] factors = {0f, 1f}; |
|
|
|
|
g.setPaint(new RadialGradientPaint(getWidth() / 2, getHeight() / 2, getWidth() / 2, factors, colors)); |
|
|
|
|
g.fillRoundRect(8, 3, getWidth() - 10, getHeight() - 6, 15, 15); |
|
|
|
|
g.setColor(new Color(170, 170, 170)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
g.setColor(new Color(170, 170, 170, 120)); |
|
|
|
|
g.fillRoundRect(5, 1, getWidth() - 9, getHeight() - 6, 15, 15); |
|
|
|
|
g.setColor(boderColor); |
|
|
|
|
|
|
|
|
|
g.drawRoundRect(4, 0, getWidth() - 9, getHeight() - 6, 15, 15); |
|
|
|
|
g.setColor(new Color(170, 170, 170)); |
|
|
|
|
g.setColor(new Color(170, 170, 170, 120)); |
|
|
|
|
g.fillRect(4, 1, 10, 10); |
|
|
|
|
g.setColor(boderColor); |
|
|
|
|
g.drawLine(4, 0, 14, 0); |
|
|
|
@ -305,8 +308,6 @@ public class NodePanel extends DraggablePanel implements Selectable, PropertyCha |
|
|
|
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">
|
|
|
|
|
private void initComponents() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ImageIcon icon = Icons.vert; |
|
|
|
|
if (type == NodeType.Fragment) { |
|
|
|
|
icon = Icons.frag; |
|
|
|
@ -335,8 +336,6 @@ public class NodePanel extends DraggablePanel implements Selectable, PropertyCha |
|
|
|
|
GroupLayout contentLayout = new GroupLayout(content); |
|
|
|
|
content.setLayout(contentLayout); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int txtLength = 100; |
|
|
|
|
|
|
|
|
|
GroupLayout.ParallelGroup grpHoriz = contentLayout.createParallelGroup(GroupLayout.Alignment.LEADING); |
|
|
|
@ -371,7 +370,6 @@ public class NodePanel extends DraggablePanel implements Selectable, PropertyCha |
|
|
|
|
.addComponent(outputLabels.get(i))).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
grpVert.addGroup(GroupLayout.Alignment.TRAILING, grp); |
|
|
|
|
|
|
|
|
|
contentLayout.setVerticalGroup(grpVert); |
|
|
|
|