Search in sources :

Example 71 with BXMLSerializer

use of org.apache.pivot.beans.BXMLSerializer in project pivot by apache.

the class TablePaneTest method startup.

@Override
public void startup(final Display display, final Map<String, String> properties) throws Exception {
    BXMLSerializer bxmlSerializer = new BXMLSerializer();
    window = (Window) bxmlSerializer.readObject(TablePaneTest.class, "table_pane_test.bxml");
    window.open(display);
}
Also used : BXMLSerializer(org.apache.pivot.beans.BXMLSerializer)

Example 72 with BXMLSerializer

use of org.apache.pivot.beans.BXMLSerializer in project pivot by apache.

the class Pivot686 method startup.

@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
    System.out.println("startup: start");
    String forceFocusParameter = properties.get(FORCE_FOCUS_KEY);
    boolean forceFocus = false;
    forceFocus = Boolean.parseBoolean(forceFocusParameter);
    BXMLSerializer bxmlSerializer = new BXMLSerializer();
    window = (Window) bxmlSerializer.readObject(this.getClass(), "pivot_686.bxml");
    initializeFields(bxmlSerializer);
    window.open(display);
    if (forceFocus == true) {
        System.out.println("force focus on textInput now");
        // force focus on TextInput, Ok when run
        textInput.requestFocus();
    // as a Java Application, and even as
    // Applet
    }
    System.out.println("textInput has focus: " + textInput.isFocused());
    System.out.println("startup: end");
}
Also used : BXMLSerializer(org.apache.pivot.beans.BXMLSerializer)

Example 73 with BXMLSerializer

use of org.apache.pivot.beans.BXMLSerializer in project pivot by apache.

the class ColorSchemeBuilder method startup.

@Override
public void startup(Display display, Map<String, String> properties) throws Exception {
    BXMLSerializer bxmlSerializer = new BXMLSerializer();
    window = (ColorSchemeBuilderWindow) bxmlSerializer.readObject(ColorSchemeBuilderWindow.class, "color_scheme_builder_window.bxml");
    window.open(display);
}
Also used : BXMLSerializer(org.apache.pivot.beans.BXMLSerializer)

Example 74 with BXMLSerializer

use of org.apache.pivot.beans.BXMLSerializer in project pivot by apache.

the class ColorSchemeBuilderWindow method reloadContent.

private void reloadContent() {
    BXMLSerializer bxmlSerializer = new BXMLSerializer();
    try {
        Component sampleContent = (Component) bxmlSerializer.readObject(ColorSchemeBuilderWindow.class, "sample_content.bxml");
        sampleContentBorder.setContent(sampleContent);
    } catch (IOException exception) {
        throw new RuntimeException(exception);
    } catch (SerializationException exception) {
        throw new RuntimeException(exception);
    }
}
Also used : SerializationException(org.apache.pivot.serialization.SerializationException) IOException(java.io.IOException) Component(org.apache.pivot.wtk.Component) BXMLSerializer(org.apache.pivot.beans.BXMLSerializer)

Example 75 with BXMLSerializer

use of org.apache.pivot.beans.BXMLSerializer 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);
}
Also used : FadeDecorator(org.apache.pivot.wtk.effects.FadeDecorator) Component(org.apache.pivot.wtk.Component) ComponentMouseListener(org.apache.pivot.wtk.ComponentMouseListener) BXMLSerializer(org.apache.pivot.beans.BXMLSerializer)

Aggregations

BXMLSerializer (org.apache.pivot.beans.BXMLSerializer)86 Component (org.apache.pivot.wtk.Component)24 IOException (java.io.IOException)19 SerializationException (org.apache.pivot.serialization.SerializationException)14 Window (org.apache.pivot.wtk.Window)13 Button (org.apache.pivot.wtk.Button)11 PushButton (org.apache.pivot.wtk.PushButton)11 File (java.io.File)9 ButtonPressListener (org.apache.pivot.wtk.ButtonPressListener)9 Frame (org.apache.pivot.wtk.Frame)8 TextInput (org.apache.pivot.wtk.TextInput)8 ArrayList (org.apache.pivot.collections.ArrayList)7 List (org.apache.pivot.collections.List)7 Mouse (org.apache.pivot.wtk.Mouse)6 Sequence (org.apache.pivot.collections.Sequence)5 ComponentMouseButtonListener (org.apache.pivot.wtk.ComponentMouseButtonListener)5 ListButton (org.apache.pivot.wtk.ListButton)5 TextInputContentListener (org.apache.pivot.wtk.TextInputContentListener)5 URL (java.net.URL)4 MalformedURLException (java.net.MalformedURLException)3