Revision 339 2.0/trunk/org.gvsig.gvsig3d.app/org.gvsig.gvsig3d.app.extension/src/main/java/org/gvsig/gvsig3d/app/gui/styling/SimpleSymbolTab.java
SimpleSymbolTab.java | ||
---|---|---|
28 | 28 |
import org.gvsig.gvsig3d.symbology3d.marker.ISimpleMarker3DSymbol; |
29 | 29 |
import javax.swing.event.ChangeListener; |
30 | 30 |
import javax.swing.event.ChangeEvent; |
31 |
import javax.swing.border.LineBorder; |
|
31 | 32 |
|
32 | 33 |
|
33 | 34 |
public class SimpleSymbolTab extends JPanel implements ISymbolSelectorTab { |
... | ... | |
58 | 59 |
.getSymbol(); |
59 | 60 |
|
60 | 61 |
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP); |
61 |
tabbedPane.setPreferredSize(new Dimension(480,220));
|
|
62 |
tabbedPane.setPreferredSize(new Dimension(180,300));
|
|
62 | 63 |
add(tabbedPane, BorderLayout.CENTER); |
63 | 64 |
|
64 | 65 |
JPanel panel = new JPanel(); |
65 | 66 |
tabbedPane.addTab("Propeties", null, panel, null); |
66 | 67 |
GridBagLayout gbl_panel = new GridBagLayout(); |
67 |
gbl_panel.columnWidths = new int[] { 352, 84 }; |
|
68 |
gbl_panel.rowHeights = new int[] { 100 }; |
|
69 |
gbl_panel.columnWeights = new double[] { 0.0, 0.0 }; |
|
70 |
gbl_panel.rowWeights = new double[] { 0.0 }; |
|
68 |
gbl_panel.columnWidths = new int[] { 175 }; |
|
69 |
gbl_panel.rowHeights = new int[] { 180, 70 }; |
|
70 |
gbl_panel.columnWeights = new double[] { 0.0 }; |
|
71 |
gbl_panel.rowWeights = new double[] { 0.0, 0.0 }; |
|
72 |
//panel.setPreferredSize(new Dimension(120,130)); |
|
71 | 73 |
panel.setLayout(gbl_panel); |
72 | 74 |
|
73 |
JPanel PropertiesPanel = new JPanel(); |
|
74 |
PropertiesPanel.setBorder(new TitledBorder(null, "Titulo", TitledBorder.LEADING, TitledBorder.TOP, null, null)); |
|
75 |
symbolPreviewPanel = new JPanel(); |
|
76 |
symbolPreviewPanel.setBorder(new TitledBorder(null, "Preview", TitledBorder.LEADING, TitledBorder.TOP, null, null)); |
|
77 |
GridBagConstraints gbc_previewPanel = new GridBagConstraints(); |
|
78 |
gbc_previewPanel.fill = GridBagConstraints.BOTH; |
|
79 |
gbc_previewPanel.insets = new Insets(0, 0, 5, 5); |
|
80 |
gbc_previewPanel.gridx = 0; |
|
81 |
gbc_previewPanel.gridy = 0; |
|
82 |
panel.add(symbolPreviewPanel, gbc_previewPanel); |
|
83 |
symbolPreviewPanel.setLayout(new BorderLayout(0, 0)); |
|
84 |
//symbolPreviewPanel.setPreferredSize(new Dimension(80,80)); |
|
85 |
|
|
86 |
JPanel _simplePanel = new JPanel(); |
|
87 |
symbolPreviewPanel.add(_simplePanel, BorderLayout.CENTER); |
|
88 |
_simplePanel.setLayout(new BorderLayout(0, 0)); |
|
89 |
|
|
90 |
SymbolPreviewer sp = new SymbolPreviewer(); |
|
91 |
FlowLayout flowLayout = (FlowLayout) sp.getLayout(); |
|
92 |
_simplePanel.add(sp, BorderLayout.CENTER); |
|
93 |
sp.setSymbol(_symbol); |
|
94 |
|
|
95 |
JPanel propertiesPanel = new JPanel(); |
|
96 |
propertiesPanel.setBorder(new TitledBorder(new LineBorder(new Color(184, 207, 229)), "Properties", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(51, 51, 51))); |
|
75 | 97 |
GridBagConstraints gbc_PropertiesPanel = new GridBagConstraints(); |
76 |
gbc_PropertiesPanel.fill = GridBagConstraints.HORIZONTAL;
|
|
77 |
gbc_PropertiesPanel.ipady = 10;
|
|
78 |
gbc_PropertiesPanel.ipadx = 10;
|
|
79 |
gbc_PropertiesPanel.insets = new Insets(0, 0, 0, 5);
|
|
80 |
gbc_PropertiesPanel.anchor = GridBagConstraints.NORTHWEST;
|
|
98 |
gbc_PropertiesPanel.fill = GridBagConstraints.BOTH;
|
|
99 |
gbc_PropertiesPanel.anchor = GridBagConstraints.NORTH;
|
|
100 |
gbc_PropertiesPanel.ipady = 0;
|
|
101 |
gbc_PropertiesPanel.ipadx = 0;
|
|
102 |
gbc_PropertiesPanel.insets = new Insets(0, 0, 0, 0);
|
|
81 | 103 |
gbc_PropertiesPanel.gridx = 0; |
82 |
gbc_PropertiesPanel.gridy = 0;
|
|
83 |
panel.add(PropertiesPanel, gbc_PropertiesPanel);
|
|
84 |
PropertiesPanel.setLayout(new GridLayout(0, 3, 10, 10));
|
|
104 |
gbc_PropertiesPanel.gridy = 1;
|
|
105 |
panel.add(propertiesPanel, gbc_PropertiesPanel);
|
|
106 |
propertiesPanel.setLayout(new GridLayout(2, 3, 3, 3));
|
|
85 | 107 |
|
86 | 108 |
JLabel lblColor = new JLabel("Color:"); |
87 |
PropertiesPanel.add(lblColor);
|
|
109 |
propertiesPanel.add(lblColor);
|
|
88 | 110 |
|
89 | 111 |
_colorPanel = new JPanel(); |
112 |
FlowLayout flowLayout_1 = (FlowLayout) _colorPanel.getLayout(); |
|
90 | 113 |
_colorPanel.setBackground(_symbol.getColor()); |
91 |
PropertiesPanel.add(_colorPanel);
|
|
114 |
propertiesPanel.add(_colorPanel);
|
|
92 | 115 |
|
93 | 116 |
JButton colorButton = new JButton("Select"); |
94 | 117 |
colorButton.addActionListener(new ActionListener() { |
... | ... | |
105 | 128 |
|
106 | 129 |
} |
107 | 130 |
}); |
108 |
PropertiesPanel.add(colorButton);
|
|
131 |
propertiesPanel.add(colorButton);
|
|
109 | 132 |
|
133 |
propertiesPanel.setPreferredSize(new Dimension(80,80)); |
|
134 |
|
|
110 | 135 |
JLabel lblSize = new JLabel("Size:"); |
111 |
PropertiesPanel.add(lblSize);
|
|
136 |
propertiesPanel.add(lblSize);
|
|
112 | 137 |
|
113 | 138 |
sizeSpinner = new JSpinner(); |
114 | 139 |
sizeSpinner.setModel(new SpinnerNumberModel(_symbol |
... | ... | |
123 | 148 |
|
124 | 149 |
} |
125 | 150 |
}); |
126 |
PropertiesPanel.add(sizeSpinner);
|
|
151 |
propertiesPanel.add(sizeSpinner);
|
|
127 | 152 |
|
128 |
symbolPreviewPanel = new JPanel(); |
|
129 |
symbolPreviewPanel.setBorder(new TitledBorder(null, "Preview", TitledBorder.LEADING, TitledBorder.TOP, null, null)); |
|
130 |
GridBagConstraints gbc_previewPanel = new GridBagConstraints(); |
|
131 |
gbc_previewPanel.fill = GridBagConstraints.BOTH; |
|
132 |
gbc_previewPanel.gridx = 1; |
|
133 |
gbc_previewPanel.gridy = 0; |
|
134 |
panel.add(symbolPreviewPanel, gbc_previewPanel); |
|
135 |
symbolPreviewPanel.setLayout(new BorderLayout(0, 0)); |
|
136 |
symbolPreviewPanel.setPreferredSize(new Dimension(80,80)); |
|
137 |
|
|
138 |
JPanel _simplePanel = new JPanel(); |
|
139 |
symbolPreviewPanel.add(_simplePanel, BorderLayout.CENTER); |
|
140 |
_simplePanel.setLayout(new BorderLayout(0, 0)); |
|
141 |
|
|
142 |
SymbolPreviewer sp = new SymbolPreviewer(); |
|
143 |
_simplePanel.add(sp, BorderLayout.CENTER); |
|
144 |
sp.setSymbol(_symbol); |
|
145 |
|
|
146 | 153 |
|
147 | 154 |
} |
148 | 155 |
|
Also available in: Unified diff