Package org.apache.pivot.wtk.media

Examples of org.apache.pivot.wtk.media.Image


     *
     * @param image
     * The image to set, or <tt>null</tt> for no image.
     */
    public void setImage(Image image) {
        Image previousImage = this.image;

        if (previousImage != image) {
            this.image = image;
            imageViewListeners.imageChanged(this, previousImage);
        }
View Full Code Here


    public final void setImage(final URL imageURL) {
        if (imageURL == null) {
            throw new IllegalArgumentException("imageURL is null.");
        }

        Image imageLocal = (Image)ApplicationContext.getResourceCache().get(imageURL);

        if (imageLocal == null) {
            // Convert to URI because using a URL as a key causes performance problems
            final java.net.URI imageURI;
            try {
                imageURI = imageURL.toURI();
            } catch (URISyntaxException exception) {
                throw new RuntimeException(exception);
            }

            if (asynchronous) {
                if (loadMap.containsKey(imageURI)) {
                    // Add this to the list of image views that are interested in
                    // the image at this URL
                    loadMap.get(imageURI).add(this);
                } else {
                    Image.load(imageURL, new TaskAdapter<Image>(new TaskListener<Image>() {
                        @Override
                        public void taskExecuted(Task<Image> task) {
                            Image imageLoadedLocal = task.getResult();

                            // Update the contents of all image views that requested this
                            // image
                            for (ImageView imageView : loadMap.get(imageURI)) {
                                imageView.setImage(imageLoadedLocal);
View Full Code Here

    public void setIcon(URL iconURL) {
        if (iconURL == null) {
            throw new IllegalArgumentException("iconURL is null.");
        }

        Image icon = Image.loadFromCache(iconURL);

        getIcons().remove(0, getIcons().getLength());
        getIcons().add(icon);
    }
View Full Code Here

         * Obtains the icon to display for a given file.
         *
         * @param file
         */
        public static Image getIcon(File file) {
            Image icon;
            if (file.isDirectory()) {
                icon = file.equals(HOME_DIRECTORY) ? HOME_FOLDER_IMAGE : FOLDER_IMAGE;
            } else {
                icon = FILE_IMAGE;
            }
View Full Code Here

            boolean selected, boolean highlighted, boolean disabled) {
            if (row != null) {
                File file = (File)row;

                String text = null;
                Image icon = null;

                if (columnName.equals(NAME_KEY)) {
                    text = file.getName();
                    icon = getIcon(file);
                    getStyles().put("horizontalAlignment", HorizontalAlignment.LEFT);
View Full Code Here

        super.install(component);

        Expander expander = (Expander)component;
        expander.add(titleBarTablePane);

        Image buttonData = expander.isExpanded() ? collapseImage : expandImage;
        shadeButton = new ShadeButton(buttonData);
        buttonBoxPane.add(shadeButton);

        shadeButton.getButtonPressListeners().add(this);
View Full Code Here

        validate();
    }

    @Override
    public void render(Object data, Button button, boolean highlighted) {
        Image icon = null;
        String text = null;

        if (data instanceof ButtonData) {
            ButtonData buttonData = (ButtonData)data;
            icon = buttonData.getIcon();
View Full Code Here

        validate();
    }

    @Override
    public void render(Object data, Button button, boolean highlighted) {
        Image icon = null;
        String text = null;

        if (data instanceof ButtonData) {
            ButtonData buttonData = (ButtonData)data;
            icon = buttonData.getIcon();
View Full Code Here

    @Override
    public void render(Object node, Path path, int rowIndex, TreeView treeView, boolean expanded,
        boolean selected, TreeView.NodeCheckState checkState,
        boolean highlighted, boolean disabled) {
        if (node != null) {
            Image icon = null;
            String text = null;

            if (node instanceof TreeNode) {
                TreeNode treeNode = (TreeNode)node;
View Full Code Here

        validate();
    }

    @Override
    public void render(Object data, Button button, boolean highlighted) {
        Image icon = null;
        String text = null;
        Keyboard.KeyStroke keyboardShortcut = null;

        if (data instanceof ButtonData) {
            ButtonData buttonData = (ButtonData)data;
View Full Code Here

TOP

Related Classes of org.apache.pivot.wtk.media.Image

Copyright © 2018 www.massapicom. 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.