Package org.openoffice.extensions.diagrams.diagram.organizationcharts

Examples of org.openoffice.extensions.diagrams.diagram.organizationcharts.OrganizationChart


            return true;
        }
        if(methodName.equals("root")){
            if(getController().getDiagram() != null) {
                if(getController().getGroupType() == Controller.ORGANIGROUP){
                    OrganizationChart orgChart = (OrganizationChart)getController().getDiagram();
                    TreeItem treeItem = orgChart.getDiagramTree().getRootItem();
                    if(treeItem != null)
                        getController().setSelectedShape(treeItem.getRectangleShape());
                }
            }
            return true;
        }

        if(methodName.equals("previous")){
            if(getController().isOnlySimpleItemIsSelected()){
                if(getController().getDiagram() != null) {
                    if(getController().getGroupType() == Controller.ORGANIGROUP){
                        OrganizationChart orgChart = (OrganizationChart)getController().getDiagram();
                        TreeItem treeItem = orgChart.getDiagramTree().getTreeItem(getController().getSelectedShape());
                        if(treeItem.isDad()){
                             TreeItem previousItem = treeItem.getDad().getPreviousSibling(treeItem);
                            if(previousItem != null)
                                getController().setSelectedShape(previousItem.getRectangleShape());
                        }
                    }
                }
            }
            return true;
        }

        if(methodName.equals("next")){
            if(getController().isOnlySimpleItemIsSelected()){
                if(getController().getDiagram() != null) {
                    if(getController().getGroupType() == Controller.ORGANIGROUP){
                        OrganizationChart orgChart = (OrganizationChart)getController().getDiagram();
                        TreeItem treeItem = orgChart.getDiagramTree().getTreeItem(getController().getSelectedShape());
                        if(treeItem.isFirstSibling())
                            getController().setSelectedShape(treeItem.getFirstSibling().getRectangleShape());
                    }
                }
            }
            return true;
        }

        if(methodName.equals("up")){
            if(getController().isOnlySimpleItemIsSelected()){
                if(getController().getDiagram() != null) {
                    if(getController().getGroupType() == Controller.ORGANIGROUP){
                        OrganizationChart orgChart = (OrganizationChart)getController().getDiagram();
                        TreeItem treeItem = orgChart.getDiagramTree().getTreeItem(getController().getSelectedShape());
                        if(treeItem.isDad())
                            getController().setSelectedShape(treeItem.getDad().getRectangleShape());
                    }
                }
            }
            return true;
        }

        if(methodName.equals("down")){
            if(getController().isOnlySimpleItemIsSelected()){
                if(getController().getDiagram() != null) {
                    if(getController().getGroupType() == Controller.ORGANIGROUP){
                        OrganizationChart orgChart = (OrganizationChart)getController().getDiagram();
                        TreeItem treeItem = orgChart.getDiagramTree().getTreeItem(getController().getSelectedShape());
                        if(treeItem.isFirstChild())
                            getController().setSelectedShape(treeItem.getFirstChild().getRectangleShape());
                    }
                }
            }
            return true;
        }

        if(methodName.equals("edit")){
            if(!getGui().isShownTextField())
                getGui().textFieldDownUp();
            if(getController().isOnlySimpleItemIsSelected())
                getGui().setFocusTextField();
            return true;
        }

        if(methodName.equals("showColorTable")){

            if(((EventObject)eventObject).Source.equals(getGui().m_xColorImageControl))
                getGui().m_xEventObjectControl = getGui().m_xColorImageControl;
            if(((EventObject)eventObject).Source.equals(getGui().m_xStartColorImageControl))
                getGui().m_xEventObjectControl = getGui().m_xStartColorImageControl;
            if(((EventObject)eventObject).Source.equals(getGui().m_xEndColorImageControl))
                getGui().m_xEventObjectControl = getGui().m_xEndColorImageControl;

            getGui().showColorTable();
            return true;
        }
        // ControlDialog1, ControlDialog2
        if(methodName.equals("addShape")){
            if(getController().getDiagram() != null) {
                if(getController().getGroupType() == Controller.ORGANIGROUP){
                    OrganizationChart orgChart = (OrganizationChart)getController().getDiagram();
                    if(orgChart.isErrorInTree()){
                        getGui().askUserForRepair(orgChart);
                    }else{
                        getController().getDiagram().addShape();
                        getController().getDiagram().refreshDiagram();
                    }
                }else{
                    getController().getDiagram().addShape();
                    getController().getDiagram().refreshDiagram();
                }
            }
            return true;
        }
        // ControlDialog1, ControlDialog2
        if(methodName.equals("removeShape")){
            if(getController().getDiagram() != null) {
                if(getController().getGroupType() == Controller.ORGANIGROUP){
                    OrganizationChart orgChart = (OrganizationChart)getController().getDiagram();
                    if(orgChart.isErrorInTree()){
                        getGui().askUserForRepair(orgChart);
                    }else{
                       getController().getDiagram().removeShape();
                       getController().getDiagram().refreshDiagram();
                    }
                }else{
                    getController().getDiagram().removeShape();
                    getController().getDiagram().refreshDiagram();
                }
            }
            return true;
        }
        // ControlDialog1, ControlDialog2
        if(methodName.equals("changedStyle")){
            if( getController().getDiagram() != null ){
                getController().getDiagram().setChangedMode((short)( (ItemEvent)eventObject ).Selected);
                getController().getDiagram().refreshShapeProperties();
                getController().getDiagram().refreshDiagram();
            }
            return true;
        }

        if(methodName.equals("convert")){
            getGui().showConvertDialog();
            m_iLastHorLevel = 2;
            return true;
        }

        if(methodName.equals("converButton1Pressed")){
            getGui().setConvertComboBox(false);
            return true;
        }

        if(methodName.equals("converButton2Pressed")){
            getGui().setConvertComboBox(true);
            return true;
        }

        if(methodName.equals("changedLastHorLevel")){
            m_iLastHorLevel = ((ItemEvent)eventObject).Selected;
            return true;
        }

        if(methodName.equals("convertAction")){
            getGui().m_xConvertTopWindow.removeTopWindowListener(this);
            short convType = getGui().getConversationType();

            getGui().m_xConvertDialog.endExecute();
            getGui().m_xConvertWindow = null;
            getGui().m_xConvertTopWindow = null;
            getGui().m_xConvertDialog = null;
            getGui().m_xControlDialogWindow.setEnable(true);
            getGui().m_xControlDialogWindow.setFocus();
            if(getController().getDiagram() != null) {
                if(getController().getGroupType() == Controller.ORGANIGROUP){
                    OrganizationChart orgChart = (OrganizationChart)getController().getDiagram();
                    if(orgChart.isErrorInTree()){
                        getGui().askUserForRepair(orgChart);
                    }else{
                        if(convType == Controller.ORGANIGRAM){
                            if(getController().getDiagramType() == Controller.ORGANIGRAM && m_iLastHorLevel == ODiagramTree.LASTHORLEVEL)
                                return true;
View Full Code Here

TOP

Related Classes of org.openoffice.extensions.diagrams.diagram.organizationcharts.OrganizationChart

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.