}
});
controlsColumn.addButton("Set Border 1", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setBorder(new FillImageBorder(Color.GREEN, new Insets(20), new Insets(5)));
}
});
controlsColumn.addButton("Set Border 2 (L/R only)", new ActionListener() {
public void actionPerformed(ActionEvent e) {
FillImageBorder fib = new FillImageBorder(Color.GREEN, new Insets(20), new Insets(5));
fib.setFillImage(FillImageBorder.LEFT, Styles.BG_SHADOW_DARK_BLUE);
fib.setFillImage(FillImageBorder.RIGHT, Styles.BG_SHADOW_LIGHT_BLUE);
windowPane.setBorder(fib);
}
});
controlsColumn.addButton("Clear Border", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setBorder(null);
}
});
controlsColumn.addButton("Set Foreground", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setForeground(StyleUtil.randomColor());
}
});
controlsColumn.addButton("Clear Foreground", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setForeground(null);
}
});
controlsColumn.addButton("Set Background", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setBackground(StyleUtil.randomColor());
}
});
controlsColumn.addButton("Clear Background", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setBackground(null);
}
});
controlsColumn.addButton("Set Font", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setFont(StyleUtil.randomFont());
}
});
controlsColumn.addButton("Clear Font", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setFont(null);
}
});
controlsColumn.addButton("Set Background Image", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setBackgroundImage(Styles.BG_SHADOW_LIGHT_BLUE);
}
});
controlsColumn.addButton("Clear Background Image", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setBackgroundImage(null);
}
});
controlsColumn.addButton("Set Content Insets to 0", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setInsets(new Insets(0));
}
});
controlsColumn.addButton("Set Content Insets to 5", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setInsets(new Insets(5));
}
});
controlsColumn.addButton("Set Content Insets to 10/20/40/80", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setInsets(new Insets(10, 20, 40, 80));
}
});
controlsColumn.addButton("Clear Content Insets", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setInsets(null);
}
});
controlsColumn.addButton("Set Position Random", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setPositionX(new Extent((int) (Math.random() * 600)));
windowPane.setPositionY(new Extent((int) (Math.random() * 500)));
}
});
controlsColumn.addButton("Set Size Random", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setWidth(new Extent(100 + (int) (Math.random() * 400)));
windowPane.setHeight(new Extent(100 + (int) (Math.random() * 300)));
}
});
controlsColumn.addButton("Set Position&Size Random", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setPositionX(new Extent((int) (Math.random() * 600)));
windowPane.setPositionY(new Extent((int) (Math.random() * 500)));
windowPane.setWidth(new Extent(100 + (int) (Math.random() * 400)));
windowPane.setHeight(new Extent(100 + (int) (Math.random() * 300)));
}
});
// Title-Related Properties
controlsColumn = new ButtonColumn();
controlsColumn.add(new Label("Properties"));
groupContainerColumn.add(controlsColumn);
controlsColumn.addButton("Set Title", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setTitle("Window Title");
}
});
controlsColumn.addButton("Set Title Long", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setTitle("This is a fairly long window title that goes on for a little to long to see if " +
"wrapping is handled properly and such.");
}
});
controlsColumn.addButton("Clear Title", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setTitle(null);
}
});
controlsColumn.addButton("Set Title Height", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setTitleHeight(new Extent(((int) (Math.random() * 24)) + 24));
}
});
controlsColumn.addButton("Clear Title Height", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setTitleHeight(null);
}
});
controlsColumn.addButton("Set Title Insets to 0", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setTitleInsets(new Insets(0));
}
});
controlsColumn.addButton("Set Title Insets to 5", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setTitleInsets(new Insets(5));
}
});
controlsColumn.addButton("Set Title Insets to 10/20/40/80", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setTitleInsets(new Insets(10, 20, 40, 80));
}
});
controlsColumn.addButton("Clear Title Insets", new ActionListener() {
public void actionPerformed(ActionEvent e) {
windowPane.setTitleInsets(null);