Search in sources :

Example 1 with ContextMasterDialog

use of com.ramussoft.pb.idef.frames.ContextMasterDialog in project ramus by Vitaliy-Yakovchuk.

the class MovingArea method down.

/**
 * Мотод показує контекстну діаграму активного функціонального блоку, якщо
 * на поточній діаграмі всього один функціональний блок то показується його
 * контекстна діаграма.
 */
public void down() {
    Function function = null;
    if (activeFunction.getRealChildCount() == 1)
        function = ((Function) activeFunction).getRealChildAt(0);
    else if (activeObject instanceof MovingFunction) {
        function = ((MovingFunction) activeObject).getFunction();
    }
    if ((function != null) && (function.getType() < Function.TYPE_EXTERNAL_REFERENCE)) {
        if (function.getRealChildCount() == 0) {
            if (panel.isReadOnly())
                return;
            panel.getFramework().setOpenDynamikViewEvent(panel.getView().getOpenAction());
            ContextMasterDialog contextMasterDialog = panel.getContextMasterDialog();
            contextMasterDialog.setDecompositionType(activeFunction.getDecompositionType());
            final Template model = contextMasterDialog.showModal();
            panel.getFramework().setOpenDynamikViewEvent(null);
            int type = contextMasterDialog.getDecompositionType();
            if (model != null) {
                startUserTransaction();
                function.setDecompositionType(type);
                refactor.saveToFunction();
                model.createChilds(function, dataPlugin);
                setActiveFunction(function);
                refactor.fixNoNameBug();
                refactor.saveToFunction();
                if (isUserTransactionStarted())
                    commitUserTransaction();
            }
        } else
            setActiveFunction(function);
        panel.getJPanel3().repaint();
    }
    pressedPanel = null;
}
Also used : DFDSFunction(com.ramussoft.pb.dfds.visual.DFDSFunction) Function(com.ramussoft.pb.Function) DFDFunction(com.ramussoft.pb.dfd.visual.DFDFunction) NFunction(com.ramussoft.pb.data.negine.NFunction) ContextMasterDialog(com.ramussoft.pb.idef.frames.ContextMasterDialog) PerspectivePoint(com.ramussoft.pb.idef.elements.SectorRefactor.PerspectivePoint) FloatPoint(com.dsoft.pb.types.FloatPoint) Crosspoint(com.ramussoft.pb.Crosspoint) Point(com.ramussoft.pb.idef.elements.Point) UserTemplate(com.ramussoft.pb.dmaster.UserTemplate) Template(com.ramussoft.pb.dmaster.Template)

Aggregations

FloatPoint (com.dsoft.pb.types.FloatPoint)1 Crosspoint (com.ramussoft.pb.Crosspoint)1 Function (com.ramussoft.pb.Function)1 NFunction (com.ramussoft.pb.data.negine.NFunction)1 DFDFunction (com.ramussoft.pb.dfd.visual.DFDFunction)1 DFDSFunction (com.ramussoft.pb.dfds.visual.DFDSFunction)1 Template (com.ramussoft.pb.dmaster.Template)1 UserTemplate (com.ramussoft.pb.dmaster.UserTemplate)1 Point (com.ramussoft.pb.idef.elements.Point)1 PerspectivePoint (com.ramussoft.pb.idef.elements.SectorRefactor.PerspectivePoint)1 ContextMasterDialog (com.ramussoft.pb.idef.frames.ContextMasterDialog)1