Examples of FillImage


Examples of nextapp.echo2.app.FillImage

            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.FillImage

        in.close();
    }

    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());
        assertEquals(new Extent(50), backgroundImage.getHorizontalOffset());
        assertEquals(new Extent(-30, Extent.PERCENT), backgroundImage.getVerticalOffset());
    }
View Full Code Here

Examples of nextapp.echo2.app.FillImage

        assertEquals(new Extent(-30, Extent.PERCENT), backgroundImage.getVerticalOffset());
    }
   
    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.FillImage

                .equals(new FillImageBorder(Color.RED, new Insets(10), new Insets(20))));
        assertFalse(new FillImageBorder(Color.RED, new Insets(10), new Insets(10))
                .equals(new FillImageBorder(Color.RED, new Insets(10), new Insets(20))));

        FillImageBorder fib1 = new FillImageBorder();
        fib1.setFillImage(FillImageBorder.TOP_LEFT, new FillImage(new ResourceImageReference("topleft.gif")));
        fib1.setFillImage(FillImageBorder.TOP, new FillImage(new ResourceImageReference("top.gif")));
        fib1.setFillImage(FillImageBorder.TOP_RIGHT, new FillImage(new ResourceImageReference("topright.gif")));
        fib1.setFillImage(FillImageBorder.LEFT, new FillImage(new ResourceImageReference("left.gif")));
        fib1.setFillImage(FillImageBorder.RIGHT, new FillImage(new ResourceImageReference("right.gif")));
        fib1.setFillImage(FillImageBorder.BOTTOM_LEFT, new FillImage(new ResourceImageReference("bottomleft.gif")));
        fib1.setFillImage(FillImageBorder.BOTTOM, new FillImage(new ResourceImageReference("bottom.gif")));
        fib1.setFillImage(FillImageBorder.BOTTOM_RIGHT, new FillImage(new ResourceImageReference("bottomright.gif")));
        FillImageBorder fib2 = new FillImageBorder();
        fib2.setFillImage(FillImageBorder.TOP_LEFT, new FillImage(new ResourceImageReference("topleft.gif")));
        fib2.setFillImage(FillImageBorder.TOP, new FillImage(new ResourceImageReference("top.gif")));
        fib2.setFillImage(FillImageBorder.TOP_RIGHT, new FillImage(new ResourceImageReference("topright.gif")));
        fib2.setFillImage(FillImageBorder.LEFT, new FillImage(new ResourceImageReference("left.gif")));
        fib2.setFillImage(FillImageBorder.RIGHT, new FillImage(new ResourceImageReference("right.gif")));
        fib2.setFillImage(FillImageBorder.BOTTOM_LEFT, new FillImage(new ResourceImageReference("bottomleft.gif")));
        fib2.setFillImage(FillImageBorder.BOTTOM, new FillImage(new ResourceImageReference("bottom.gif")));
        fib2.setFillImage(FillImageBorder.BOTTOM_RIGHT, new FillImage(new ResourceImageReference("bottomright2.gif")));
        assertFalse(fib1.equals(fib2));

        fib2.setFillImage(FillImageBorder.BOTTOM_RIGHT, new FillImage(new ResourceImageReference("bottomright.gif")));
        assertTrue(fib1.equals(fib2));
       
        fib1.setBorderInsets(new Insets(20));
        assertFalse(fib1.equals(fib2));
        fib2.setBorderInsets(new Insets(20));
View Full Code Here

Examples of nextapp.echo2.app.FillImage

        int borderPartCount = borderPartList.getLength();
        for (int i = 0; i < borderPartCount; ++i) {
            Element borderPartElement = (Element) borderPartList.item(i);
            String position = borderPartElement.getAttribute("position");

            FillImage fillImage = (FillImage) propertyLoader.getPropertyValue(FillImageBorder.class, FillImage.class,
                    borderPartElement);
           
            if ("top-left".equals(position)) {
                fillImageBorder.setFillImage(FillImageBorder.TOP_LEFT, fillImage);
            } else if ("top".equals(position)) {
View Full Code Here

Examples of nextapp.echo2.app.FillImage

        FillImageBorder fillImageBorder = (FillImageBorder) alphaStyle.getProperty(WindowPane.PROPERTY_BORDER);
        assertEquals(new Color(0xabcdef), fillImageBorder.getColor());
        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());
        assertEquals(new Extent(50), topLeftFillImage.getHorizontalOffset());
        assertEquals(new Extent(-30, Extent.PERCENT), topLeftFillImage.getVerticalOffset());
    }
View Full Code Here

Examples of nextapp.echo2.app.FillImage

                public void actionPerformed(ActionEvent e) {
                    if (testPane.getComponentCount() < paneNumber + 1) {
                        return;
                    }
                    SplitPaneLayoutData splitPaneLayoutData = getLayoutData(paneNumber);
                    FillImage backgroundImage = splitPaneLayoutData.getBackgroundImage();
                    if (backgroundImage == null) {
                        splitPaneLayoutData.setBackgroundImage(Styles.BG_SHADOW_LIGHT_BLUE);
                    } else {
                        splitPaneLayoutData.setBackgroundImage(null);
                    }
View Full Code Here

Examples of nextapp.echo2.app.FillImage

   
    /**
     * Test simple constructor.
     */
    public void testConstructorSimple() {
        FillImage backgroundImage = new FillImage(TestConstants.ICON);
        assertEquals(TestConstants.ICON, backgroundImage.getImage());
        assertEquals(null, backgroundImage.getHorizontalOffset());
        assertEquals(null, backgroundImage.getVerticalOffset());
        assertEquals(FillImage.REPEAT, backgroundImage.getRepeat());
    }
View Full Code Here

Examples of nextapp.echo2.app.FillImage

   
    /**
     * Test full-featured constructor.
     */
    public void testConstructorFullFeature() {
        FillImage backgroundImage = new FillImage(TestConstants.ICON, TestConstants.EXTENT_30_PX,
                TestConstants.EXTENT_50_PERCENT, FillImage.REPEAT_HORIZONTAL);
        assertEquals(TestConstants.ICON, backgroundImage.getImage());
        assertEquals(TestConstants.EXTENT_30_PX, backgroundImage.getHorizontalOffset());
        assertEquals(TestConstants.EXTENT_50_PERCENT, backgroundImage.getVerticalOffset());
        assertEquals(FillImage.REPEAT_HORIZONTAL, backgroundImage.getRepeat());
    }
View Full Code Here

Examples of nextapp.echo2.app.FillImage

        boolean renderEnabled = textComponent.isRenderEnabled();

        Border border;
        Color foreground, background;
        Font font;
        FillImage backgroundImage;
        if (!renderEnabled) {
            // Retrieve disabled style information.
            background = (Color) textComponent.getRenderProperty(TextComponent.PROPERTY_DISABLED_BACKGROUND);
            backgroundImage = (FillImage) textComponent.getRenderProperty(TextComponent.PROPERTY_DISABLED_BACKGROUND_IMAGE);
            border = (Border) textComponent.getRenderProperty(TextComponent.PROPERTY_DISABLED_BORDER);
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.