QSysMLAction::QSysMLAction(const QMap<QString, QVariant> &properties, QGraphicsItem *parent) :
QAbstractDiagramShape(QSysMLPlugin::staticName(), QSysMLAction::staticItemClass(), properties, parent)
{
	initGeometry(400, 300);
	textItem()->setTextColorProperty("textColor");
	textItem()->setTextProperty("name");
	textItem()->setDefaultTextAlignment(Qt::AlignCenter);

    addProperty("actionType", QDiagramToolkit::String, true, properties.value("actionType"));
    addProperty("background", QDiagramToolkit::Brush, false, properties.value("background", QColor("wheat")));
    addProperty("textColor", QDiagramToolkit::Color, false, properties.value("textColor", QColor("black")));
    addProperty("textFont", QDiagramToolkit::Font, false, properties.value("textFont"));
    addProperty("lineStyle", QDiagramToolkit::Pen, false, properties.value("lineStyle"));
    addProperty("name", QDiagramToolkit::String, false, "action");

    addSizeGripHandle(new QDiagramShapeSizeGripHandle(QDiagramShapeSizeGripHandle::Left, this));
    addSizeGripHandle(new QDiagramShapeSizeGripHandle(QDiagramShapeSizeGripHandle::Right, this));

	addConnectionPoint(new QSysMLControlConnectionPointIn(this, "controlIn", 0, 1));
	addConnectionPoint(new QSysMLControlConnectionPointOut(this, "controlOut", 0, 1));

	addConnectionPoint(new QSysMLDataConnectionPointIn(this, "dataIn1", 0, 1));
	addConnectionPoint(new QSysMLDataConnectionPointOut(this, "dataOut1", 0, 1));

    restoreProperties(properties);
}
void CtrlrManagerWindowManager::restoreState (const ValueTree &savedState)
{
	restoreProperties (savedState, managerTree, nullptr);
	for (int i=0; i<savedState.getNumChildren(); i++)
	{
		managerTree.addChild (savedState.getChild(i).createCopy(), -1, nullptr);
	}
}
Esempio n. 3
0
void CtrlrManager::restoreState (const ValueTree &savedTree)
{
	if (savedTree.isValid())
	{
		ctrlrManagerRestoring = true;

		restoreProperties (savedTree, managerTree);

		if (owner->getOverrides().isValid())
		{
			for (int i=0; i<owner->getOverrides().getNumProperties(); i++)
			{
				setProperty (owner->getOverrides().getPropertyName(i), owner->getOverrides().getPropertyAsValue(owner->getOverrides().getPropertyName(i), 0));
			}
		}

		managerTree.removeAllChildren (0);
		managerTree.addChild (ctrlrMidiDeviceManager.getManagerTree(), -1, 0);
		managerTree.addChild (ctrlrWindowManager.getManagerTree(), -1, 0);

		if (savedTree.getChildWithName(Ids::midiDeviceManager).isValid())
		{
			ctrlrMidiDeviceManager.restoreState (savedTree.getChildWithName(Ids::midiDeviceManager));
		}

		if (savedTree.getChildWithName(Ids::uiWindowManager).isValid())
		{
			ctrlrWindowManager.restoreState (savedTree.getChildWithName(Ids::uiWindowManager));
		}

		if (getInstanceMode() != InstanceMulti && savedTree.hasType (Ids::panelState))
		{
			restoreInstanceState (savedTree);
			return;
		}

		for (int i=0; i<savedTree.getNumChildren(); i++)
		{
			if (savedTree.getChild(i).hasType (Ids::panel))
			{
				addPanel (savedTree.getChild(i));
			}
		}

		if (ctrlrEditor)
		{
			restoreEditorState();
		}

		ctrlrManagerRestoring = false;
	}
}
QSysMLBlock::QSysMLBlock(const QMap<QString, QVariant> &properties, QGraphicsItem *parent) :
QAbstractDiagramShape(QSysMLPlugin::staticName(), QSysMLBlock::staticItemClass(), properties, parent)
{
	initGeometry(400, 300);
    addProperty("blockType", QDiagramToolkit::String, true, properties.value("blockType"));
    addProperty("backgroundColor", QDiagramToolkit::Color, false, QColor("white"));
    addProperty("name", QDiagramToolkit::String, false, "action");
    addProperty("textFont", QDiagramToolkit::Font, false, properties.value("textFont"));

    addSizeGripHandle(new QDiagramShapeSizeGripHandle(QDiagramShapeSizeGripHandle::Left, this));
    addSizeGripHandle(new QDiagramShapeSizeGripHandle(QDiagramShapeSizeGripHandle::Right, this));

	addConnectionPoint(new QSysMLControlConnectionPointIn(this, "controlIn", 0, 1));
	addConnectionPoint(new QSysMLControlConnectionPointOut(this, "controlOut", 0, 1));

	addConnectionPoint(new QSysMLDataConnectionPointIn(this, "dataIn1", 0, 1));
	addConnectionPoint(new QSysMLDataConnectionPointOut(this, "dataOut1", 0, 1));

    restoreProperties(properties);
}
void CtrlrLuaMethodEditor::restoreState(const ValueTree &savedState)
{
	restoreProperties (savedState, componentTree, nullptr);

	ScopedPointer <XmlElement> treeState(XmlDocument::parse (savedState.getProperty(Ids::luaMethodEditor).toString().upToLastOccurrenceOf(";", false, true)));

	if (treeState)
	{
		methodTree->restoreOpennessState (*treeState, true);
	}

	StringArray openedMethods;
	openedMethods.addTokens (savedState.getProperty(Ids::luaMethodEditor).toString().fromLastOccurrenceOf(";", false, true), ":", String::empty);

	for (int i=0; i<openedMethods.size(); i++)
	{
		setEditedMethod (Uuid (openedMethods[i]));
	}

	updateTabs();
}
void CtrlrPanelCanvasLayer::restoreState (const ValueTree &savedState)
{
	restoreProperties (savedState, layerTree, 0);
}
// QMap<QString, QMultiMap<QString, QString> > 
QLogicCircuitShapeConnector::QLogicCircuitShapeConnector(const QVariantMap & properties) :
    QAbstractDiagramShapeConnector(QLogicCircuitPlugin::staticName(), "default", properties)
{
	addProperty("lineStyle", QDiagramToolkit::Pen, true, properties.value("lineStyle"));
	restoreProperties(properties);
}