use of com.jgoodies.forms.layout.FormLayout in project SIMRacingApps by SIMRacingApps.
the class JreForm method createPanel1.
public JPanel createPanel1() {
JPanel jpanel1 = new JPanel();
FormLayout formlayout1 = new FormLayout("RIGHT:MAX(65DLU;DEFAULT):NONE,FILL:3DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:3DLU:NONE,FILL:DEFAULT:NONE,FILL:3DLU:NONE,FILL:DEFAULT:NONE", "CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE");
CellConstraints cc = new CellConstraints();
jpanel1.setLayout(formlayout1);
_varCombo.setName("varCombo");
jpanel1.add(_varCombo, cc.xy(3, 1));
_propertyButton.setActionCommand("Add");
_propertyButton.setIcon(loadImage("images/edit_add16.png"));
_propertyButton.setName("propertyButton");
_propertyButton.setText(Messages.getString("property"));
_propertyButton.setToolTipText(Messages.getString("propertyTip"));
jpanel1.add(_propertyButton, cc.xy(5, 1));
_optionButton.setActionCommand("Add");
_optionButton.setIcon(loadImage("images/edit_add16.png"));
_optionButton.setName("optionButton");
_optionButton.setText(Messages.getString("option"));
_optionButton.setToolTipText(Messages.getString("optionTip"));
jpanel1.add(_optionButton, cc.xy(7, 1));
_envPropertyButton.setActionCommand("Add");
_envPropertyButton.setIcon(loadImage("images/edit_add16.png"));
_envPropertyButton.setName("envPropertyButton");
_envPropertyButton.setText(Messages.getString("property"));
_envPropertyButton.setToolTipText(Messages.getString("propertyTip"));
jpanel1.add(_envPropertyButton, cc.xy(5, 3));
JLabel jlabel1 = new JLabel();
jlabel1.setText(Messages.getString("varsAndRegistry"));
jpanel1.add(jlabel1, cc.xy(1, 1));
JLabel jlabel2 = new JLabel();
jlabel2.setIcon(loadImage("images/asterix.gif"));
jlabel2.setText(Messages.getString("envVar"));
jpanel1.add(jlabel2, cc.xy(1, 3));
_envOptionButton.setActionCommand("Add");
_envOptionButton.setIcon(loadImage("images/edit_add16.png"));
_envOptionButton.setName("envOptionButton");
_envOptionButton.setText(Messages.getString("option"));
_envOptionButton.setToolTipText(Messages.getString("optionTip"));
jpanel1.add(_envOptionButton, cc.xy(7, 3));
_envVarField.setName("envVarField");
jpanel1.add(_envVarField, cc.xy(3, 3));
addFillComponents(jpanel1, new int[] { 2, 4, 6 }, new int[] { 2 });
return jpanel1;
}
use of com.jgoodies.forms.layout.FormLayout in project SIMRacingApps by SIMRacingApps.
the class ConfigForm method createPanel.
public JPanel createPanel() {
JPanel jpanel1 = new JPanel();
FormLayout formlayout1 = new FormLayout("FILL:7DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:7DLU:NONE", "CENTER:3DLU:NONE,FILL:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:9DLU:NONE");
CellConstraints cc = new CellConstraints();
jpanel1.setLayout(formlayout1);
_logTextArea.setName("logTextArea");
JScrollPane jscrollpane1 = new JScrollPane();
jscrollpane1.setViewportView(_logTextArea);
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
jpanel1.add(jscrollpane1, cc.xy(2, 6));
_logSeparator.setName("logSeparator");
_logSeparator.setText(Messages.getString("log"));
jpanel1.add(_logSeparator, cc.xy(2, 4));
_tab.setName("tab");
jpanel1.add(_tab, cc.xywh(1, 2, 3, 1));
addFillComponents(jpanel1, new int[] { 1, 2, 3 }, new int[] { 1, 3, 4, 5, 6, 7 });
return jpanel1;
}
use of com.jgoodies.forms.layout.FormLayout in project intellij-community by JetBrains.
the class UngroupRowsColumnsAction method update.
@Override
public void update(final AnActionEvent e) {
super.update(e);
CaptionSelection selection = CaptionSelection.DATA_KEY.getData(e.getDataContext());
if (selection != null) {
e.getPresentation().setEnabled(selection.getContainer() != null && selection.getContainer().getLayout() instanceof FormLayout && GroupRowsColumnsAction.isGrouped(selection));
}
}
use of com.jgoodies.forms.layout.FormLayout in project intellij-community by JetBrains.
the class UngroupRowsColumnsAction method actionPerformed.
protected void actionPerformed(CaptionSelection selection) {
FormLayout layout = (FormLayout) selection.getContainer().getLayout();
int[][] oldGroups = selection.isRow() ? layout.getRowGroups() : layout.getColumnGroups();
List<int[]> newGroups = new ArrayList<>();
int[] selInts = selection.getSelection();
for (int[] group : oldGroups) {
if (!GroupRowsColumnsAction.intersect(group, selInts)) {
newGroups.add(group);
}
}
int[][] newGroupArray = newGroups.toArray(new int[newGroups.size()][]);
if (selection.isRow()) {
layout.setRowGroups(newGroupArray);
} else {
layout.setColumnGroups(newGroupArray);
}
}
use of com.jgoodies.forms.layout.FormLayout in project intellij-community by JetBrains.
the class GroupRowsColumnsAction method actionPerformed.
protected void actionPerformed(CaptionSelection selection) {
FormLayout layout = (FormLayout) selection.getContainer().getLayout();
int[][] oldGroups = selection.isRow() ? layout.getRowGroups() : layout.getColumnGroups();
int[][] newGroups = new int[oldGroups.length + 1][];
System.arraycopy(oldGroups, 0, newGroups, 0, oldGroups.length);
int[] cellsToGroup = getCellsToGroup(selection);
newGroups[oldGroups.length] = new int[cellsToGroup.length];
for (int i = 0; i < cellsToGroup.length; i++) {
newGroups[oldGroups.length][i] = cellsToGroup[i] + 1;
}
if (selection.isRow()) {
layout.setRowGroups(newGroups);
} else {
layout.setColumnGroups(newGroups);
}
}
Aggregations