Examples of ImageReference


Examples of nextapp.echo2.app.ImageReference

        this.setStyleName("Default");
        this.setMaximizable(false);
        this.setMinimizable(false);
        this.setResizable(false);
        this.setModal(true);
        ImageReference icon = getMessageIcon(messageType);
        Label iconLabel = new Label("");
        int iconHeight = 0;
        if (icon != null) {
            iconLabel.setIcon(icon);
            iconHeight = icon.getHeight().getValue();
        }


        // Split newlines into multiple labels
        if (message instanceof String) {
View Full Code Here

Examples of nextapp.echo2.app.ImageReference

        if (!(imagePropertyValue instanceof ImageReference)) {
            throw new InvalidPropertyException("Invalid FillImage property (type \"" + imageType
                    + "\" is not an ImageReference.", null);
        }

        ImageReference imageReference = (ImageReference) imagePropertyValue;
        FillImage fillImage = new FillImage(imageReference, offsetX, offsetY, repeat);
       
        return fillImage;
    }
View Full Code Here

Examples of nextapp.echo2.app.ImageReference

    public void testCustom() {
        Style bravoStyle = styleSheet.getStyle(TextComponent.class, "bravo");
        FillImage backgroundImage = (FillImage) bravoStyle.getProperty(TextComponent.PROPERTY_BACKGROUND_IMAGE);
        assertNotNull(backgroundImage);
        ImageReference imageReference = backgroundImage.getImage();
        assertNotNull(imageReference);
        assertTrue(imageReference instanceof ResourceImageReference);
        assertEquals("nextapp/echo2/test/componentxml/BackgroundImage.png",
                ((ResourceImageReference) imageReference).getResource());
        assertEquals(FillImage.REPEAT_HORIZONTAL, backgroundImage.getRepeat());
View Full Code Here

Examples of nextapp.echo2.app.ImageReference

   
    public void testSimple() {
        Style alphaStyle = styleSheet.getStyle(TextComponent.class, "alpha");
        FillImage backgroundImage = (FillImage) alphaStyle.getProperty(TextComponent.PROPERTY_BACKGROUND_IMAGE);
        assertNotNull(backgroundImage);
        ImageReference imageReference = backgroundImage.getImage();
        assertNotNull(imageReference);
        assertTrue(imageReference instanceof ResourceImageReference);
        assertEquals("nextapp/echo2/test/componentxml/BackgroundImage.png",
                ((ResourceImageReference) imageReference).getResource());
    }
View Full Code Here

Examples of nextapp.echo2.app.ImageReference

        assertEquals(2, layoutData.getColumnSpan());
        assertEquals(1, layoutData.getRowSpan());
        assertEquals(new Color(0xabcdef), layoutData.getBackground());
        assertEquals(new Insets(20, 30), layoutData.getInsets());
        assertNotNull(layoutData.getBackgroundImage());
        ImageReference imageReference = layoutData.getBackgroundImage().getImage();
        assertNotNull(imageReference);
        assertTrue(imageReference instanceof ResourceImageReference);
        assertEquals("nextapp/echo2/test/componentxml/BackgroundImage.png",
                ((ResourceImageReference) imageReference).getResource());
    }
View Full Code Here

Examples of nextapp.echo2.app.ImageReference

        Style alphaStyle = styleSheet.getStyle(Column.class, "alpha");
        SplitPaneLayoutData layoutData = (SplitPaneLayoutData) alphaStyle.getProperty(Component.PROPERTY_LAYOUT_DATA);
        assertEquals(new Color(0xabcdef), layoutData.getBackground());
        assertEquals(new Insets(20, 30), layoutData.getInsets());
        assertNotNull(layoutData.getBackgroundImage());
        ImageReference imageReference = layoutData.getBackgroundImage().getImage();
        assertNotNull(imageReference);
        assertTrue(imageReference instanceof ResourceImageReference);
        assertEquals("nextapp/echo2/test/componentxml/BackgroundImage.png",
                ((ResourceImageReference) imageReference).getResource());
    }
View Full Code Here

Examples of nextapp.echo2.app.ImageReference

        assertEquals(new Insets(12), fillImageBorder.getContentInsets());
        assertEquals(new Insets(6, 4), fillImageBorder.getBorderInsets());
       
        FillImage topLeftFillImage = fillImageBorder.getFillImage(FillImageBorder.TOP_LEFT);
        assertNotNull(topLeftFillImage);
        ImageReference imageReference = topLeftFillImage.getImage();
        assertNotNull(imageReference);
        assertTrue(imageReference instanceof ResourceImageReference);
        assertEquals("nextapp/echo2/test/componentxml/BackgroundImage.png",
                ((ResourceImageReference) imageReference).getResource());
        assertEquals(FillImage.REPEAT_HORIZONTAL, topLeftFillImage.getRepeat());
View Full Code Here

Examples of nextapp.echo2.app.ImageReference

    public ImageReference getImage(Component component, String imageId) {
        if (IMAGE_ID_ICON.equals(imageId)) {
            if (component.isRenderEnabled()) {
                return (ImageReference) component.getRenderProperty(AbstractButton.PROPERTY_ICON);
            } else {
                ImageReference icon = (ImageReference) component.getRenderProperty(AbstractButton.PROPERTY_DISABLED_ICON);
                if (icon == null) {
                    icon = (ImageReference) component.getRenderProperty(AbstractButton.PROPERTY_ICON);
                }
                return icon;
            }
        } else if (IMAGE_ID_ROLLOVER_ICON.equals(imageId)) {
            return (ImageReference) component.getRenderProperty(AbstractButton.PROPERTY_ROLLOVER_ICON);
        } else if (IMAGE_ID_PRESSED_ICON.equals(imageId)) {
            return (ImageReference) component.getRenderProperty(AbstractButton.PROPERTY_PRESSED_ICON);
        } else if (IMAGE_ID_STATE_ICON.equals(imageId)) {
            return getStateIcon((ToggleButton) component);
        } else if (IMAGE_ID_SELECTED_STATE_ICON.equals(imageId)) {
            return getSelectedStateIcon((ToggleButton) component);
        } else if (IMAGE_ID_BACKGROUND.equals(imageId)) {
            FillImage backgroundImage;
            if (component.isRenderEnabled()) {
                backgroundImage = (FillImage) component.getRenderProperty(AbstractButton.PROPERTY_BACKGROUND_IMAGE);
            } else {
                backgroundImage = (FillImage) component.getRenderProperty(AbstractButton.PROPERTY_DISABLED_BACKGROUND_IMAGE);
                if (backgroundImage == null) {
                    backgroundImage = (FillImage) component.getRenderProperty(AbstractButton.PROPERTY_BACKGROUND_IMAGE);
                }
            }
            if (backgroundImage == null) {
                return null;
            } else {
                return backgroundImage.getImage();
            }
        } else if (IMAGE_ID_ROLLOVER_BACKGROUND.equals(imageId)) {
            FillImage backgroundImage
                    = (FillImage) component.getRenderProperty(AbstractButton.PROPERTY_ROLLOVER_BACKGROUND_IMAGE);
            if (backgroundImage == null) {
                return null;
            } else {
                return backgroundImage.getImage();
            }
        } else if (IMAGE_ID_PRESSED_BACKGROUND.equals(imageId)) {
            FillImage backgroundImage
                    = (FillImage) component.getRenderProperty(AbstractButton.PROPERTY_PRESSED_BACKGROUND_IMAGE);
            if (backgroundImage == null) {
                return null;
            } else {
                return backgroundImage.getImage();
            }
        } else if (IMAGE_ID_ROLLOVER_STATE_ICON.equals(imageId)) {
            ImageReference icon = (ImageReference) component.getRenderProperty(ToggleButton.PROPERTY_ROLLOVER_STATE_ICON);
            return icon == null ? getStateIcon((ToggleButton) component) : icon;
        } else if (IMAGE_ID_ROLLOVER_SELECTED_STATE_ICON.equals(imageId)) {
            ImageReference icon = (ImageReference) component.getRenderProperty(ToggleButton.PROPERTY_ROLLOVER_SELECTED_STATE_ICON);
            return icon == null ? getSelectedStateIcon((ToggleButton) component) : icon;
        } else if (IMAGE_ID_PRESSED_STATE_ICON.equals(imageId)) {
            ImageReference icon = (ImageReference) component.getRenderProperty(ToggleButton.PROPERTY_PRESSED_STATE_ICON);
            return icon == null ? getStateIcon((ToggleButton) component) : icon;
        } else if (IMAGE_ID_PRESSED_SELECTED_STATE_ICON.equals(imageId)) {
            ImageReference icon = (ImageReference) component.getRenderProperty(ToggleButton.PROPERTY_PRESSED_SELECTED_STATE_ICON);
            return icon == null ? getSelectedStateIcon((ToggleButton) component) : icon;
        } else {
            return null;
        }
    }
View Full Code Here

Examples of nextapp.echo2.app.ImageReference

     *
     * @param toggleButton the <code>ToggleButton</code>
     * @return the selected state icon
     */
    private ImageReference getSelectedStateIcon(ToggleButton toggleButton) {
        ImageReference selectedStateIcon
                = (ImageReference) toggleButton.getRenderProperty(ToggleButton.PROPERTY_SELECTED_STATE_ICON);
        if (selectedStateIcon == null) {
            if (toggleButton instanceof CheckBox) {
                selectedStateIcon = DEFAULT_SELECTED_CHECKBOX_ICON;
            } else if (toggleButton instanceof RadioButton) {
View Full Code Here

Examples of nextapp.echo2.app.ImageReference

     *
     * @param toggleButton the <code>ToggleButton</code>
     * @return the state icon
     */
    private ImageReference getStateIcon(ToggleButton toggleButton) {
        ImageReference stateIcon = (ImageReference) toggleButton.getRenderProperty(ToggleButton.PROPERTY_STATE_ICON);
        if (stateIcon == null) {
            if (toggleButton instanceof CheckBox) {
                stateIcon = DEFAULT_CHECKBOX_ICON;
            } else if (toggleButton instanceof RadioButton) {
                stateIcon = DEFAULT_RADIOBUTTON_ICON;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.