Enterprise Architect class fill color - class

I have a very stupid question! I have created class diagram and right now I am trying to change class background fill color. I have not found any info in the help how to do that. Any suggestions?

Not a stupid question at all. There are a couple of different ways of doing this, depending on the scope you want.
To change the colour of one class in a single diagram, right-click it in the diagram. This opens up the context menu, but also opens a mini-toolbar. In this toolbar, the third icon from the left is the class fill colour. This toolbar can also be opened by selecting the class, and then clicking the middle of the three icons EA displays to the right of the class (the paintbrush).
Using this toolbar you can change the class colour locally. It does not affect how the class is displayed in other current or future diagrams, it is specific to the diagram you're in.
If you want to change the appearance of a class in all diagrams, right-click it and select Appearance -- Default Appearance. If you change the colour here, it will affect all future diagrams and all current diagrams except the ones where you've specified a local colour for the class as above.
Finally, you can change the EA-wide colour scheme in Tools -- Options -- Standard Colors. This affects all elements in all diagrams, unless you've specified something else for an element using either of the above methods.
In addition to these, if you create a profile you can specify a different appearance for a particular stereotype using shape scripts. But that's a different question.

Related

Visio protect object from selection

A big problem for me creating diagrams in visio (and powerpoint and similar programs) is that if you have a background object, it blocks you from selecting multiple objects by lassoing. Instead you end up moving the background around, this is annoying.
In many applications there's an option to "lock" or "protect" a specific object so it becomes un-selectable while still visible on the drawing. In Visio there is no simple way of doing this as far as I'm aware.
There's a rather convoluted way of doing this, it feels to me like Visio designers wanted to make this difficult on purpose. The methods I'm aware of I list here, feel free to let me know of a better way(s)
You can protect objects from selection by going to (hidden by default) Developer tab and pick "shape design"-> protection -> selection. However this does not actually protect them from selection, which makes sense . To actually protect the said object from selection, you have to open drawing explorer, which is also hidden by default and the visibility tickbox is in hidden by default Developer tab under show/hide section.
Drawing explorer, however won't highlight whatever object you have selected in the drawing, another unexplicable design decision. If you want to see the name of the object you've selected with live update, you have to enable the diagram navigation pane. That's found in View tab on Show section under "task panes" icon. This pane does highlight whatever you've selected and you can rename the object to give it a meaningful name, but not change the shape in any other way.
To finally protect that shape from selection, right click on the top level document on the drawing explorer and pick "Protect document" and tick "shapes" and hey presto, now your background rectangle is visible but not selectable. Very straightforward indeed
There are also layers which offer similar functionality but they naturally come with their own gotchas.
You can see layers on the Drawing explorer under foreground pages, page name, "Layers" tree. To move an object on a specific layer, you cannot do it by right clicking on the object, because of course you can't. There's an assign to layer button in Home->Editing->Layers->"Assign to Layer", which will let you select the layer(s) for the selected object. You can also do this by right clicking on an object from the Drawing explorer, but you have to know the object name, because there's no reverse selection .. The object name you can get from the Diagram navigation. By default "protected" and "lock" layers do nothing.
To change what the layers do, you again go to the Home -> Editing -> Layers and select "Layer properties". This is also available from Drawing explorer by right clicking on the "layers" tree under a specific page. Here you can control if the layer is visible and/or protected. However, if you lock a layer, you also cannot move objects to/from it, as that'd be too easy. So you have to untick "lock" if you want to move stuff in and out of a protection layer.
So there are two awkward ways of doing that that I'm aware of.
If the shape really is a background object then maybe you should be looking at putting the shape on a background page. You can then make it the background page for your active page. That'll fix all your shape selection problems.

How to hide stereotypes labels from my profile

I have created a new profile for activity diagram in EA(Enterprise Architect).
The stereotype I created is named dummy. The profile is created with some activity diagram elements, but I use elements from my newly created profile, on top of each element, something like is seen with element name «dummy» followed by the element name.
I would like to know if there is a way to hide the stereotype label. I have learned about shape script but couldn't figure it out well.
I am using EA version 13.
The only way (I know) is to turn off stereotype display for the whole diagram:
I first thought that DrawNativeShape in the shape script would work, but it also draws the stereotype. And it's near to impossible to show all compartments manually except for the stereotype. Just showing the class name (and individual drawings/texts) is simple. But showing attributes/operations and respecting the feature/diagram settings is near to impossible.

JavaFX 2 custom popup pane

The JavaFX 2 colour picker has a button that pops up a colour chooser pane like so:
I'd like to do something similar, in that I'd like a custom pane to pop up when the button is clicked on and disappear when something else is clicked (in my case, a few image thumbnails). What would be the best way of achieving this? Should I use a ContextMenu and add a pane to a MenuItem somehow, or is there something else I should look at?
It's kind of difficult to do well with the current JavaFX 2.2 API.
Here are some options.
Use a MenuButton with a graphic set in it's MenuItem
This is the approach taken in Button with popup showed below's executable sample code.
Use a PopupControl
Take a look at how the ColorPicker does this in it's code.
ColorPicker extends PopupControl. You could do this, but not all of the API required to build your own PopupControl is currently public. So, for JavaFX 2.2, you would have to rely on internal com.sun classes which are deprecated and will be replaced by public javafx.scene.control classes in JDK8.
Use a ContextMenu
So, I think your idea to "use a ContextMenu and add a pane to a MenuItem" is probably the best approach for now. You should be able to do this by using a CustomMenuItem or setting a graphic on a normal MenuItem. The ContextMenu has nice relative positioning logic. A ContextMenu can also be triggered by a MenuButton.
Use a Custom Dialog
To do this, display a transparent stage at a location relative to the node.
There is some sample code to get you started which I have temporarily linked here.
The sample code does relative positioning to the sides of the main window, but you could update it to perform positioning relative to the sides of a given node (like the ContextMenu's show method).
Use a Glass Pane
To do this, create a StackPane as your root of your main window. Place your main content pane as the first node in the StackPane and then create a Group as the second node in the stackpane, so that it will layer over the top of the main content. Normally, the top group contains nothing, but when you want to show your popup, place it in the top group and translate it to a location relative to the appropriate node in your main content.
You could look at how the anchor nodes in this demo are used to see how this might be adaptable to your context.
Is there a relevant update for this for JavaFX8?
There is not much difference of relevance for Java 8, in general the options are as outlined in this post based on Java 2.2 functionality. Java 8 does add Dialog and Alert functionality, but those are more targeted at use of dialogs with borders, titles and buttons rather than the kind of functionality desired in the question. Perhaps you might be able to start from the Dialog class and heavily customize it to get something close to what is needed, but you are probably better off starting from a blank stage or PopupControl instead.

How to use customized tool bar in tiny mce?

I'm using tiny mce in one of my projects and client do not want to use the Horizontal tool bar of tiny mce. He wants a centralized custom tool bar from where user can control all the properties like text color, type of text, size, back grounds and every thing that is needed to do while designing a web page using templates. I configured the mce instance with out its default tool bar and controlled the properties from the customized tool bar. And the properties are applied to the tiny mce instance as a whole. But now, the requirement has come up that, the text editing should be in MS office style.That means, if user has placed cursor at one place and changes color, nothing will be affected, but if he starts typing from the cursor position the text should have the color which was set recently. I tried to use the external tool bar option. But, my work area and customized tool bar are at different z index levels. So, positioning the tool bar fails. If I append the tool bar to my customized tool bar, it is not click-able. So, how to invoke tiny mce's core functionality using customized tool bar?
Or, Kindly suggest, should I change editor ? Then, which one should I go for ?
EDIT
As per the suggestion, I'm writing the function save the property styles and insert the span at caret position. But I'm facing some problems and could not do it after spending whole day. I could add span at caret position by using following code.
marker = ed.selection.getBookmark();
ed.selection.moveToBookmark(marker);
tinyMCE.execCommand('mceInsertContent',false,'<span id="mytitle"></span>');
But still, I failed to type inside the new span. Also, I could not figure out how to set styles to this span.
If your aim is to have your tinymce behave like MS Office you should write an own plugin which will take care of this.
I suggest if a user has placed the cursor at one place and changes color you save this color as a setting to your tinymce instance like: ed.color = 'choosencolor';
When the user start typing now you can insert a span on the first keystroke and set the color as css class or style property to this span.

Design-time properties in IB?

Coming from the .NET world into ObjC and iPhone development, I'm used to providing design-time support for my UI classes. For example, say that I have a custom button class with a color property. I want to be able to set this color in design time from IB. How can I accomplish this? Is it even possible? Worth the effort?
It isn't possible to create custom IB plugins for iOS. The best you can do is use a generic UIView with a custom class in your nib and set the properties programatically.
You would usually create an IBPlugin for that, which can contain a single custom element or an entire collection.
Interface Builder Plug-In Programming Guide (Official Guide)
Custom views in Interface Builder using IBPlugins (Inofficial Tutorial)
(This tutorial should get you going! It covers custom attribute settings in IB.)
Be warned though: Xcode 4 does not support custom built IBPlugins!
(And sadly this still holds true for Gold Master. Hopefully there'll be an official/native solution once the NDA is lifted. Until then make sure to backup your IB before installing any copy of Xcode 4.)
Whilst waiting for the 'User Defined Runtime Attributes' feature to become more widely supported, you can still use the 'tag' property of UIView. This is just an integer, but you can use that as a key into a dictionary to access additional properties. So for example define your design-time attributes in a JSON file, load that into a NSDictionary and walk over the view hierarchy at runtime, applying the attributes you've defined.
It's not ideal but better than nothing, or implementing loads of tiny custom classes just to use a custom font or whatever.
This is actually very easy to do. In InterfaceBuilder, select the button and open the Attribute Inspector (hotkey: [command]+1). Select the first tab on the top of the Attribute Inspector window, and look at the section titled "View". The entry labeled "Background" will have a colored rectangle next to it, which will likely be split diagonally, half black and half white. That's an indication that the button's background is currently transparent. Click that rectangle, and the color selection box will appear. Don't forget to change the value of the "alpha" slider in the color selection box, or the button will remain completely transparent.
Here's an image of the attribute inspector, configured like I described.
For arbitrary types (such as an NSColor property), Interface Builder plugins are your only option, as others have mentioned.
However, for certain limited types, there is an easier solution. If your custom property is a string, numeric primitive, or boolean, you can use the "Runtime Attributes" inspector in Interface Builder to define these properties at design time.
However, I see that you have the 'iphone' tag on your questoin. Runtime Attributes are not currently available on iOS.