Package org.jdesktop.application

Examples of org.jdesktop.application.ResourceMap


        super(app);
        getFrame().setResizable(false);
        initComponents();

        // status bar initialization - message timeout, idle icon and busy animation, etc
        ResourceMap resourceMap = getResourceMap();
        int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
        messageTimer = new Timer(messageTimeout, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                statusMessageLabel.setText("");
            }
        });
        messageTimer.setRepeats(false);
        int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
        for (int i = 0; i < busyIcons.length; i++) {
            busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
        }
        busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
                statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
            }
        });
        idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
        statusAnimationLabel.setIcon(idleIcon);
        progressBar.setVisible(false);

        // connecting action tasks to status bar via TaskMonitor
        TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
View Full Code Here


        initComponents();
       

        // status bar initialization - message timeout, idle icon and busy animation, etc
        ResourceMap resourceMap = getResourceMap();
        int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
        messageTimer = new Timer(messageTimeout, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                statusMessageLabel.setText("");
            }
        });
        messageTimer.setRepeats(false);
        int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
        for (int i = 0; i < busyIcons.length; i++) {
            busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
        }
        busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
                statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
            }
        });
        idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
        statusAnimationLabel.setIcon(idleIcon);
        progressBar.setVisible(false);
       
        chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        // connecting action tasks to status bar via TaskMonitor
View Full Code Here

        fileChooser = new JFileChooser();

        jSlider1.setValue(300);
        jSlider2.setValue(500);
        // status bar initialization - message timeout, idle icon and busy animation, etc
        ResourceMap resourceMap = getResourceMap();
        int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
        messageTimer = new Timer(messageTimeout, new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                statusMessageLabel.setText("");
            }
            });
        messageTimer.setRepeats(false);
        int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
        for (int i = 0; i < busyIcons.length; i++) {
            busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
        }
        busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
                statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
            }
            });
        idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
        statusAnimationLabel.setIcon(idleIcon);
        progressBar.setVisible(false);

        // connecting action tasks to status bar via TaskMonitor
        TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
View Full Code Here

        }
    }
   
    private JMenuBar createMenuBar() {
        BindingGroup menuBinding = new BindingGroup();
        ResourceMap resourceMap = application.getContext().getResourceMap(Mediator.class);
        ApplicationActionMap actionMap = getActionMap();
        JMenuBar bar = new JMenuBar();

        // Menu File
        JMenu menuFile = new JMenu(resourceMap.getString("menu.file"));
        menuFileDevices = new JMenu(resourceMap.getString("menu.file.devices.text"));
        menuFileDevices.setIcon(resourceMap.getIcon("menu.file.devices.icon"));
        menuFile.add(menuFileDevices);
        menuBinding.addBinding( bindRead(this, PROP_DEVICES, menuFileDevices, "enabled"));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get(ACTION_SAVE_SCREENSHOT)));
        menuFile.add(new JCheckBoxMenuItem(actionMap.get(ACTION_RECORDING)));
        menuFile.add(new JMenuItem(actionMap.get(ACTION_OPEN_DESTINATION_FOLDER)));
        menuFile.addSeparator();
        menuFile.add(new JMenuItem(actionMap.get("quit")));

        // Menu Edit
        JMenu menuEdit = new JMenu(resourceMap.getString("menu.edit"));
        menuEdit.add(new JMenuItem(actionMap.get(ACTION_COPY_TO_CLIPBOARD)));
        menuEdit.addSeparator();
        menuEdit.add(new JMenuItem(actionMap.get(ACTION_OPTIONS)));

        // Menu View
        JMenu menuView = new JMenu(resourceMap.getString("menu.view"));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_LANDSCAPE)));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_LANDSCAPE_CW)));
        menuView.addSeparator();
        menuView.add(new JMenuItem(actionMap.get(ACTION_ZOOM_IN)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_ZOOM_OUT)));
        menuView.addSeparator();
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_ORIGINAL)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_SMALL)));
        menuView.add(new JMenuItem(actionMap.get(ACTION_SIZE_LARGE)));
        menuView.add(new JCheckBoxMenuItem(actionMap.get(ACTION_SIZE_FIT)));
        menuView.addSeparator();
        menuView.add(new JMenuItem(actionMap.get(ACTION_FULL_SCREEN)));

        // Menu Help
        JMenu menuHelp = new JMenu(resourceMap.getString("menu.help"));
        menuHelp.add(new JMenuItem(actionMap.get(ACTION_CHECK_UPDATES)));
        menuHelp.add(new JMenuItem(actionMap.get(ACTION_ABOUT)));

        bar.add(menuFile);
        bar.add(menuEdit);
View Full Code Here

            p.put(PREF_DEFAULT_FILE_FOLDER, f);
        }

        demon.resetLastImage();
        JToggleButton bt = (JToggleButton) toolBarMap.get(ACTION_RECORDING);
        ResourceMap resourceMap = application.getContext().getResourceMap(Mediator.class);
        if (isRecording()) {
            bt.setText(resourceMap.getString("recording.Action.selectedText"));
        } else {
            bt.setText(resourceMap.getString("recording.Action.text"));
        }
    }
View Full Code Here

        application.getContext().getActionManager().getActionMap(Mediator.class, this).get(actionName).actionPerformed(
                new ActionEvent(this, ActionEvent.ACTION_PERFORMED, null));
    }

    private String requestDefaultFolder() {
        ResourceMap resourceMap = application.getContext().getResourceMap(OptionsDialog.class);
        return  FolderRequestDialog.requestFolderFor(p.get(PREF_DEFAULT_FILE_FOLDER, ""),
                resourceMap.getString("save.request.title"), resourceMap.getString("save.request.desc"));
    }
View Full Code Here

    private FolderRequestDialog(final String oldPath, final String title, final String description) {
        super(Application.getInstance(AShot.class).getMainFrame(), title, true);
        final AShot app = Application.getInstance(AShot.class);

        final ResourceMap resourceMap = app.getContext().getResourceMap(FolderRequestDialog.class);
        resourceMap.injectFields(this);

        this.title = title;

        setModal(true);
View Full Code Here

        setResizable(false);
       
        this.mediator = mediator;

        initComponents();
        ResourceMap resourceMap = mediator.getApplication().getContext().getResourceMap(OptionsDialog.class);
        resourceMap.injectComponents(this);
        setTitle(resourceMap.getString("title"));

        loadPreferences();
        getRootPane().setDefaultButton(okButton);
        this.pack();
    }
View Full Code Here

        this.pack();
    }

    private void initComponents() {
        ApplicationActionMap actionMap = mediator.getApplication().getContext().getActionMap(this);
        ResourceMap resourceMap = mediator.getApplication().getContext().getResourceMap(OptionsDialog.class);
        getRootPane().setLayout(new BorderLayout());

        JPanel buttonsPanel = createButtonsPanel(actionMap, resourceMap);
        JPanel generalPanel = createGeneralPanel(actionMap, resourceMap);

        JTabbedPane pane = new JTabbedPane();
        pane.addTab(resourceMap.getString("tab.general"), generalPanel);

        getRootPane().add(pane, BorderLayout.CENTER);
        getRootPane().add(buttonsPanel, BorderLayout.PAGE_END);
    }
View Full Code Here

    }

    public static final String ACTION_SET_SDK_PATH = "setSdkPath";
    @Action(name=ACTION_SET_SDK_PATH)
    public void setSdkPath() {
        ResourceMap resourceMap = mediator.getApplication().getContext().getResourceMap(OptionsDialog.class);
        String folder = FolderRequestDialog.requestFolderFor(sdkPathShowTextField.getText(),
                resourceMap.getString("sdk.request.title"), resourceMap.getString("sdk.request.desc"));
        if (StringUtils.isNotBlank(folder)) {
            sdkPathShowTextField.setText(folder);
        }
    }
View Full Code Here

TOP

Related Classes of org.jdesktop.application.ResourceMap

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.