file Property Pages

4 years 8 months ago #3418 by ua138
Is there any way of customizing the type of values of a property in a stereotype? For example I would like to have different types such as comboboxes or checkboxes. Is that possible?


[attachment:2]Untitled2.png[/attachment]


Is it also possible to display a customized properties graphically?



How could I do this?

Thank you very much in advance.
Attachments:

Please Log in or Create an account to join the conversation.

4 years 7 months ago #3442 by ebr
Hi,

In fact instead to customize the type of stereotype properties, you can define a Property Page in order to customize how to specify their value. That's the mechanism behind, for example, the JavaDesigner property page (cf. below).



To customize the graphical properties, you can use the symbol view.



But if you want to customize the graphical properties, for example, for all classes stereotyped "toto", the best way would be to define a new tool inside a new diagram. By using this tool, you will be able to create an given kind of element, e.g. a classes stereotyped "toto", with particular graphical properties.
This is how the SysML module is able to create classes stereotyped "Block" with particular graphical properties.



Hoping it helps,

EBR
Attachments:

Please Log in or Create an account to join the conversation.

4 years 7 months ago #3446 by ua138
I have used a PropertyPage as suggested, but when I activate the view from the Symbol tab. But what I get is what I share in the image. Would it be possible to have them in a more "beautiful" manner? I do not understand how can I modify the tools for enabling this image to show as I want. I would be very grateful if you could provide me some more information about this.




Thank you very much in advance.
Attachments:

Please Log in or Create an account to join the conversation.

4 years 7 months ago #3450 by ua138
I have been trying to implement an image for a stereotype. Like it is done for the block diagram but it does not work for me. It seems related with the styles. Is there any way of changing the shape, color etc. of an stereotype from the tool/command? Could you please provide some further explanation?


Thank you very much in advance

Please Log in or Create an account to join the conversation.

4 years 7 months ago #3456 by ebr
Hi ua,

Could you describe what does not work for you? Did you specify an image for your stereotype?
In fact, instead of create a Class, stereotype it as Contextual Entity, change its graphical properties from value A to B, you can develop, in Java, a dedicated "create contextual entity" tool/command which will do that each time.

Could give us a small but representative example of what you try todo.

Regards,
EBR

Please Log in or Create an account to join the conversation.

4 years 7 months ago #3462 by ua138
I have created a context stereotype as follows:
<Stereotype name="ContextualEntityStereotype" metaclass="Class" is-hidden="false" label="%ContextualEntityStereotype.label" uid="3e8ce7a4-43d1-46b2-963a-3ea01c20dc60">
                <Icon path="res/icons/context_16.png"/>
                <Image path="res/icons/context_look_64.png"/>
                <TagTypes>
                    <TagType name="CETagId" uid="8790413a-37c1-4222-a99d-1e45a92fa80d" label="Id" parameter-card="1" is-hidden="false" is-signed="false"/>
                    <TagType name="TagCost" uid="b3912a7f-cb03-425c-bd4f-eb995a3bb727" label="Estimated Cost" parameter-card="1" is-hidden="false" is-signed="false"/>
                    <TagType name="TagConstraints" uid="ce358a44-c103-4db6-a861-dc33beb96964" label="Constraints" parameter-card="1" is-hidden="false" is-signed="false"/>
                    <TagType name="TagResponsibility" uid="2ab91184-f1af-4179-a182-aa6f9ea7d346" label="Acquisition Responsibility" parameter-card="1" is-hidden="false" is-signed="false"/>
                    <TagType name="TagFrequency" uid="46952323-adcb-436d-9950-5b4b9df2f2a0" label="Acquisition Frequency" parameter-card="1" is-hidden="false" is-signed="false"/>
                    <TagType name="TagSource" uid="62721a3b-a245-4a1c-9379-78961fb258b7" label="Acquisition Source" parameter-card="1" is-hidden="false" is-signed="false"/>
                    <TagType name="TagSensorType" uid="285b00af-e57f-42b2-9525-3d7e93c21939" label="Acquisition Sensor Type" parameter-card="1" is-hidden="false" is-signed="false"/>
                    <TagType name="TagAcqProcess" uid="8cde6e7f-e40e-4808-a718-2838d0bc4ee9" label="Acquisition Process" parameter-card="1" is-hidden="false" is-signed="false"/>
                </TagTypes>
                <NoteTypes>
                    <NoteType name="ContextNote" label="Note" is-hidden="false" uid="990cb938-bf1d-49e4-af37-4389def2752d"/>
                </NoteTypes>
            </Stereotype>

Then I define the tool that creates a "contextual entity":
<Tool id="ContextDependencyTool" label="%ContextDependencyTool.label" tooltip="%ContextDependencyTool.tooltip" image="%ContextDependencyTool.image">
                <Scope-source metaclass="ModelTree"/>
                <Scope-source metaclass="UseCase"/>
                <Scope-source metaclass="Note"/>
                <Scope-source metaclass="Dictionary"/>
                <Scope-target stereotype="ContextualEntityStereotype"/>
                <Handler class="org.casesuite.rcase.diagrams.context.tools.relations.ContextDependencyTool">
                    <HParameter name="metaclass" value="Dependency"/>
                    <HParameter name="stereotype" value="ContextDependencyStereotype"/>
                </Handler>
            </Tool>


And I do the java class ContextDependencyTool.java:
public class ContextualEntityTool extends AbstractElementTool {

	@Override
	public List<IDiagramGraphic> createOwnElement(
			IDiagramHandle representation, IModelingSession session,
			MObject element, Rectangle rect) {
		String name = "Contextual Entity";
		Stereotype stereotype = session.getMetamodelExtensions().getStereotype(
				"ContextualEntityStereotype", Metamodel.getMClass("Class"));
		Class createdElement = session.getModel().createClass(name,
				(NameSpace) element, stereotype);
		Utils.setFreeName(createdElement, name);
		// Utils.createContextualEntityAttributes(session, createdElement);

		return representation.unmask(createdElement, rect.x, rect.y);
	}

}

I would like to obtain something as shown in the attached image, but i do not know what I am missing. Would it be possible to obtain some clue about how can I achive it? Or if it is possible?




Attachments:

Please Log in or Create an account to join the conversation.

Moderators: tmachmaab
Time to create page: 0.772 seconds
^ Back to Top