Package fr.soleil.salsa.client.tool

Examples of fr.soleil.salsa.client.tool.Perspective


        catch (SalsaPerspectiveException e1) {
            e1.printStackTrace();
        }

        try {
            Perspective newCurrentPerspective = perspectivesManager
                    .getPerspectiveByName(perspectiveName);
            setWindowLayout(newCurrentPerspective.getWindowLayout());
            this.perspectivesManager.setCurrentPerspective(newCurrentPerspective);
            if (uiPreferences != null) {
                uiPreferences.setLastPerspectiveName(newCurrentPerspective.getName());
            }
        }
        catch (SalsaPerspectiveException e) {
            e.printStackTrace();
        }
View Full Code Here


     */
    public void loadDefaultPerspective() {
        InputStream defaultStream = null;
        try {
            defaultStream = getClass().getResourceAsStream("/fr/soleil/salsa/view/Default.dat");
            Perspective perspective = perspectivesManager.loadPerspectiveFile(defaultStream);
            setWindowLayout(perspective.getWindowLayout());
            perspectivesManager.setCurrentPerspective(perspective);
        } catch (SalsaPerspectiveException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

     */
    public void loadLastPerspective() throws SalsaPerspectiveException {
        // use getUiPreferences() to recover from system if necessary
        if (perspectivesManager != null) {
            String lastPerspectiveName = UIPreferences.getInstance().getLastPerspectiveName();
            Perspective newCurrentPerspective = null;
            if (lastPerspectiveName != null && !lastPerspectiveName.trim().isEmpty()) {
                newCurrentPerspective = perspectivesManager.getPerspectiveByName(lastPerspectiveName);
            }

            loadPerspective(newCurrentPerspective);
View Full Code Here

    public void loadLastPerspective(String perspectiveName) throws SalsaPerspectiveException {
        // use getUiPreferences() to recover from system if necessary
        if (perspectiveName == null || perspectiveName.trim().isEmpty()) {
            loadLastPerspective();
        } else {
            Perspective newCurrentPerspective = perspectivesManager.getPerspectiveByName(perspectiveName.trim());
            loadPerspective(newCurrentPerspective);
        }
    }
View Full Code Here

                        return;
                    }
                }
            }

            Perspective newPerspective = null;
            try {
                newPerspective = new Perspective(newPerspectiveName, getWindowLayout());
            } catch (SalsaPerspectiveException e) {
                e.printStackTrace();
            }
            perspectivesManager.addPerspective(newPerspective);
            perspectivesManager.updateJMenu(newPerspectiveName);

            for (int i = 0; i < this.perspectivesManager.getMenuBarViewTool().getMenuPerspective().getItemCount() - 3; i++) {
                if (this.perspectivesManager.getMenuBarViewTool().getMenuPerspective().getItem(i).isSelected()) {
                    this.perspectivesManager.getMenuBarViewTool().getMenuPerspective().getItem(i).setSelected(false);
                }
            }
            this.perspectivesManager.getMenuBarViewTool().getMenuPerspective()
                    .getItem(this.perspectivesManager.getMenuBarViewTool().getMenuPerspective().getItemCount() - 4)
                    .setSelected(true);

            perspectivesManager.setCurrentPerspective(newPerspective);
            UIPreferences.getInstance().setLastPerspectiveName(newPerspective.getName());
        }
    }
View Full Code Here

        } catch (SalsaPerspectiveException e1) {
            e1.printStackTrace();
        }

        try {
            Perspective newCurrentPerspective = perspectivesManager
                    .getPerspectiveByName(((javax.swing.JRadioButtonMenuItem) source).getText());
            setWindowLayout(newCurrentPerspective.getWindowLayout());
            this.perspectivesManager.setCurrentPerspective(newCurrentPerspective);
            UIPreferences.getInstance().setLastPerspectiveName(newCurrentPerspective.getName());
        } catch (SalsaPerspectiveException e) {
            e.printStackTrace();
        }
    }
View Full Code Here

            } catch (SalsaPerspectiveException e1) {
                e1.printStackTrace();
            }

            try {
                Perspective newCurrentPerspective = perspectivesManager.getPerspectiveByName(perspectiveName);
                setWindowLayout(newCurrentPerspective.getWindowLayout());
                this.perspectivesManager.setCurrentPerspective(newCurrentPerspective);
                UIPreferences.getInstance().setLastPerspectiveName(newCurrentPerspective.getName());

            } catch (SalsaPerspectiveException e) {
                e.printStackTrace();
            }
        }
View Full Code Here

     */
    public void loadDefaultPerspective() {
        InputStream defaultStream = null;
        try {
            defaultStream = getClass().getResourceAsStream("/fr/soleil/salsa/view/Default.dat");
            Perspective perspective = perspectivesManager.loadPerspectiveFile(defaultStream);
            setWindowLayout(perspective.getWindowLayout());
            perspectivesManager.setCurrentPerspective(perspective);
        }
        catch (SalsaPerspectiveException e) {
            e.printStackTrace();
        }
View Full Code Here

     */
    public void loadLastPerspective() throws SalsaPerspectiveException {
        // use getUiPreferences() to recover from system if necessary
        if (getUiPreferences() != null) {
            String lastPerspectiveName = uiPreferences.getLastPerspectiveName();
            Perspective newCurrentPerspective;
            if (!"".equals(lastPerspectiveName)) {
                newCurrentPerspective = perspectivesManager.getPerspectiveByName(uiPreferences
                        .getLastPerspectiveName());
                if (newCurrentPerspective == null) {
                    newCurrentPerspective = perspectivesManager.getPerspectiveByName("Default");
                    setWindowLayout(newCurrentPerspective.getWindowLayout());
                    perspectivesManager.setCurrentPerspective(newCurrentPerspective);
                    return;
                }
                perspectivesManager.setCurrentPerspective(newCurrentPerspective);
                setWindowLayout(newCurrentPerspective.getWindowLayout());
                updateDocking(newCurrentPerspective.getName());

            }
            else {
                newCurrentPerspective = perspectivesManager.getPerspectiveByName("Default");
                setWindowLayout(newCurrentPerspective.getWindowLayout());
                perspectivesManager.setCurrentPerspective(newCurrentPerspective);
            }
        }
    }
View Full Code Here

                        return;
                    }
                }
            }

            Perspective newPerspective = null;
            try {
                newPerspective = new Perspective(newPerspectiveName, getWindowLayout());
            }
            catch (SalsaPerspectiveException e) {
                e.printStackTrace();
            }
            perspectivesManager.addPerspective(newPerspective);
            perspectivesManager.updateJMenu(newPerspectiveName);

            for (int i = 0; i < this.perspectivesManager.getMenuBarViewTool().getMenuPerspective()
                    .getItemCount() - 3; i++) {
                if (this.perspectivesManager.getMenuBarViewTool().getMenuPerspective().getItem(i)
                        .isSelected()) {
                    this.perspectivesManager.getMenuBarViewTool().getMenuPerspective().getItem(i)
                            .setSelected(false);
                }
            }
            this.perspectivesManager
                    .getMenuBarViewTool()
                    .getMenuPerspective()
                    .getItem(
                            this.perspectivesManager.getMenuBarViewTool().getMenuPerspective()
                                    .getItemCount() - 4).setSelected(true);

            perspectivesManager.setCurrentPerspective(newPerspective);
            if (uiPreferences != null) {
                uiPreferences.setLastPerspectiveName(newPerspective.getName());
            }
        }
    }
View Full Code Here

TOP

Related Classes of fr.soleil.salsa.client.tool.Perspective

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.