@Override
public void install(Component component) {
super.install(component);
Window window = (Window)component;
// Attach the drop-shadow decorator
dropShadowDecorator = new DropShadowDecorator();
window.getDecorators().add(dropShadowDecorator);
window.add(titleBarFlowPane);
// Create the frame buttons
minimizeButton = new FrameButton(minimizeImage);
maximizeButton = new FrameButton(maximizeImage);
closeButton = new FrameButton(closeImage);
frameButtonFlowPane.add(minimizeButton);
frameButtonFlowPane.add(maximizeButton);
frameButtonFlowPane.add(closeButton);
ButtonPressListener buttonPressListener = new ButtonPressListener() {
public void buttonPressed(Button button) {
Window window = (Window)getComponent();
if (button == minimizeButton) {
window.setDisplayable(false);
} else if (button == maximizeButton) {
window.setMaximized(!window.isMaximized());
} else if (button == closeButton) {
window.close();
}
}
};
minimizeButton.getButtonPressListeners().add(buttonPressListener);
maximizeButton.getButtonPressListeners().add(buttonPressListener);
closeButton.getButtonPressListeners().add(buttonPressListener);
window.add(resizeHandle);
iconChanged(window, null);
titleChanged(window, null);
activeChanged(window);