});
controlsColumn.addButton("TextPosition = Top", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setTextPosition(new Alignment(Alignment.DEFAULT, Alignment.TOP));
}
});
}
});
controlsColumn.addButton("TextPosition = Bottom", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setTextPosition(new Alignment(Alignment.DEFAULT, Alignment.BOTTOM));
}
});
}
});
controlsColumn.addButton("TextPosition = Left", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setTextPosition(new Alignment(Alignment.LEFT, Alignment.DEFAULT));
}
});
}
});
controlsColumn.addButton("TextPosition = Right", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setTextPosition(new Alignment(Alignment.RIGHT, Alignment.DEFAULT));
}
});
}
});
controlsColumn.addButton("TextPosition = Leading", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setTextPosition(new Alignment(Alignment.LEADING, Alignment.DEFAULT));
}
});
}
});
controlsColumn.addButton("TextPosition = Trailing", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setTextPosition(new Alignment(Alignment.TRAILING, Alignment.DEFAULT));
}
});
}
});
// Text Alignment
controlsColumn = new ButtonColumn();
controlGroupsColumn.add(controlsColumn);
controlsColumn.add(new Label("Text Alignment"));
controlsColumn.addButton("TextAlignment = Default", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setTextAlignment(null);
}
});
}
});
controlsColumn.addButton("TextAlignment = Top", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setTextAlignment(new Alignment(Alignment.DEFAULT, Alignment.TOP));
}
});
}
});
controlsColumn.addButton("TextAlignment = Center (V)", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setTextAlignment(new Alignment(Alignment.DEFAULT, Alignment.CENTER));
}
});
}
});
controlsColumn.addButton("TextAlignment = Bottom", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setTextAlignment(new Alignment(Alignment.DEFAULT, Alignment.BOTTOM));
}
});
}
});
controlsColumn.addButton("TextAlignment = Left", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setTextAlignment(new Alignment(Alignment.LEFT, Alignment.DEFAULT));
}
});
}
});
controlsColumn.addButton("TextAlignment = Center (H)", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setTextAlignment(new Alignment(Alignment.CENTER, Alignment.DEFAULT));
}
});
}
});
controlsColumn.addButton("TextAlignment = Right", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setTextAlignment(new Alignment(Alignment.RIGHT, Alignment.DEFAULT));
}
});
}
});
controlsColumn.addButton("TextAlignment = Leading", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setTextAlignment(new Alignment(Alignment.LEADING, Alignment.DEFAULT));
}
});
}
});
controlsColumn.addButton("TextAlignment = Trailing", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setTextAlignment(new Alignment(Alignment.TRAILING, Alignment.DEFAULT));
}
});
}
});
// Alignment
controlsColumn = new ButtonColumn();
controlGroupsColumn.add(controlsColumn);
controlsColumn.add(new Label("Alignment"));
controlsColumn.addButton("Alignment = Default", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setAlignment(null);
}
});
}
});
controlsColumn.addButton("Alignment = Left", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setAlignment(new Alignment(Alignment.LEFT, Alignment.DEFAULT));
}
});
}
});
controlsColumn.addButton("Alignment = Center (H)", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setAlignment(new Alignment(Alignment.CENTER, Alignment.DEFAULT));
}
});
}
});
controlsColumn.addButton("Alignment = Right", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setAlignment(new Alignment(Alignment.RIGHT, Alignment.DEFAULT));
}
});
}
});
controlsColumn.addButton("Alignment = Leading", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setAlignment(new Alignment(Alignment.LEADING, Alignment.DEFAULT));
}
});
}
});
controlsColumn.addButton("Alignment = Trailing", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setAlignment(new Alignment(Alignment.TRAILING, Alignment.DEFAULT));
}
});
}
});
// Icon/Text Margin
controlsColumn = new ButtonColumn();
controlGroupsColumn.add(controlsColumn);
controlsColumn.add(new Label("Icon/Text Margin"));
controlsColumn.addButton("IconTextMargin = default", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setIconTextMargin(null);
}
});
}
});
controlsColumn.addButton("IconTextMargin = 0px", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setIconTextMargin(new Extent(0));
}
});
}
});
controlsColumn.addButton("IconTextMargin = 1px", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setIconTextMargin(new Extent(1));
}
});
}
});
controlsColumn.addButton("IconTextMargin = 2px", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setIconTextMargin(new Extent(2));
}
});
}
});
controlsColumn.addButton("IconTextMargin = 10px", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setIconTextMargin(new Extent(10));
}
});
}
});
controlsColumn.addButton("IconTextMargin = 1in", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
button.setIconTextMargin(new Extent(1, Extent.IN));
}
});
}
});
// Create 'ToggleButton Controls Group'
controlsColumn = new ButtonColumn();
controlGroupsColumn.add(controlsColumn);
controlsColumn.add(new Label("General ToggleButton Controls"));
controlsColumn.addButton("Selected = False", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setSelected(false);
}
}
});
}
});
controlsColumn.addButton("Selected = True", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setSelected(true);
}
}
});
}
});
controlsColumn.addButton("Set Custom State Icons", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
ToggleButton toggleButton = (ToggleButton) button;
toggleButton.setStateIcon(Styles.RG_STATE_ICON);
toggleButton.setSelectedStateIcon(Styles.RG_SELECTED_STATE_ICON);
toggleButton.setPressedStateIcon(Styles.RG_PRESSED_STATE_ICON);
toggleButton.setPressedSelectedStateIcon(Styles.RG_PRESSED_SELECTED_STATE_ICON);
toggleButton.setRolloverStateIcon(Styles.RG_ROLLOVER_STATE_ICON);
toggleButton.setRolloverSelectedStateIcon(Styles.RG_ROLLOVER_SELECTED_STATE_ICON);
}
}
});
}
});
controlsColumn.addButton("Clear Custom State Icons", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
ToggleButton toggleButton = (ToggleButton) button;
toggleButton.setStateIcon(null);
toggleButton.setSelectedStateIcon(null);
toggleButton.setPressedStateIcon(null);
toggleButton.setPressedSelectedStateIcon(null);
toggleButton.setRolloverStateIcon(null);
toggleButton.setRolloverSelectedStateIcon(null);
}
}
});
}
});
// ToggleButton State Position
controlsColumn = new ButtonColumn();
controlGroupsColumn.add(controlsColumn);
controlsColumn.add(new Label("ToggleButton State Position"));
controlsColumn.addButton("StatePosition = Default", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setStatePosition(null);
}
}
});
}
});
controlsColumn.addButton("StatePosition = Top", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setStatePosition(new Alignment(Alignment.DEFAULT, Alignment.TOP));
}
}
});
}
});
controlsColumn.addButton("StatePosition = Bottom", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setStatePosition(new Alignment(Alignment.DEFAULT, Alignment.BOTTOM));
}
}
});
}
});
controlsColumn.addButton("StatePosition = Left", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setStatePosition(new Alignment(Alignment.LEFT, Alignment.DEFAULT));
}
}
});
}
});
controlsColumn.addButton("StatePosition = Right", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setStatePosition(new Alignment(Alignment.RIGHT, Alignment.DEFAULT));
}
}
});
}
});
controlsColumn.addButton("StatePosition = Leading", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setStatePosition(new Alignment(Alignment.LEADING, Alignment.DEFAULT));
}
}
});
}
});
controlsColumn.addButton("StatePosition = Trailing", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setStatePosition(new Alignment(Alignment.TRAILING, Alignment.DEFAULT));
}
}
});
}
});
// ToggleButton State Alignment
controlsColumn = new ButtonColumn();
controlGroupsColumn.add(controlsColumn);
controlsColumn.add(new Label("ToggleButton State Alignment"));
controlsColumn.addButton("StateAlignment = Default", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setStateAlignment(null);
}
}
});
}
});
controlsColumn.addButton("StateAlignment = Top", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setStateAlignment(new Alignment(Alignment.DEFAULT, Alignment.TOP));
}
}
});
}
});
controlsColumn.addButton("StateAlignment = Center (V)", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setStateAlignment(new Alignment(Alignment.DEFAULT, Alignment.CENTER));
}
}
});
}
});
controlsColumn.addButton("StateAlignment = Bottom", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setStateAlignment(new Alignment(Alignment.DEFAULT, Alignment.BOTTOM));
}
}
});
}
});
controlsColumn.addButton("StateAlignment = Left", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setStateAlignment(new Alignment(Alignment.LEFT, Alignment.DEFAULT));
}
}
});
}
});
controlsColumn.addButton("StateAlignment = Center (H)", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setStateAlignment(new Alignment(Alignment.CENTER, Alignment.DEFAULT));
}
}
});
}
});
controlsColumn.addButton("StateAlignment = Right", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setStateAlignment(new Alignment(Alignment.RIGHT, Alignment.DEFAULT));
}
}
});
}
});
controlsColumn.addButton("StateAlignment = Leading", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setStateAlignment(new Alignment(Alignment.LEADING, Alignment.DEFAULT));
}
}
});
}
});
controlsColumn.addButton("StateAlignment = Trailing", new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply(new Applicator() {
public void apply(AbstractButton button) {
if (button instanceof ToggleButton) {
((ToggleButton) button).setStateAlignment(new Alignment(Alignment.TRAILING, Alignment.DEFAULT));
}
}
});
}
});