use of org.apache.pivot.wtk.effects.FadeDecorator in project pivot by apache.
the class DecoratorDemo method startup.
@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
BXMLSerializer bxmlSerializer = new BXMLSerializer();
reflectionWindow = (Window) bxmlSerializer.readObject(DecoratorDemo.class, "reflection_window.bxml");
translucentFrame = (Frame) bxmlSerializer.readObject(DecoratorDemo.class, "translucent_frame.bxml");
final FadeDecorator fadeDecorator = new FadeDecorator();
translucentFrame.getDecorators().insert(fadeDecorator, 0);
translucentFrame.getComponentMouseListeners().add(new ComponentMouseListener() {
@Override
public void mouseOver(Component component) {
fadeDecorator.setOpacity(0.9f);
component.repaint();
}
@Override
public void mouseOut(Component component) {
fadeDecorator.setOpacity(0.5f);
component.repaint();
}
});
reflectionWindow.open(display);
translucentFrame.open(reflectionWindow);
}
Aggregations