GEF sketchy figure - eclipse-gef

I am trying to create a eclipse based editor for class diagram for a school project. One of the main requirement is that the diagram need to have a "sketchy effect" (something like the one shown in this website yuml)
I am new to Eclipse graphical editor frameworks, and I want to get some opinion about how I can implement it (pros/cons of using plain GEF vs GMF). My preference will be to use GEF as it may require a lot of customization in the future and I find that GMF has a high learning curve and not much documentation.
If I implement it using GEF, will it better done by using SVG graphics and should the figure or edit parts be splitted (to three parts : box for Class name, box for Properties, and box for Methods)?

Think it's best to use SVG for the sketchy shape. GEF doesn't have support for SVG images, GMF does. You can try to borrow SVG handling from GMF - it's not too complicated.
Properties and methods should be text labels figures and children of properties and method compartment figures that are nested inside the class shape. See this: https://eclipse.org/articles/Article-GEF-Draw2d/GEF-Draw2d.html

Related

Highlight buildings in a map

I have a requirement where I need to highlight the buildings around my current location on a map. I am using Xamarin and was wondering if anyone can point me to a correct library or control that can fulfill my requirement.
I am currently using Mapsui for Xamarin but I don't think it has the feature I am looking for.
If you have access to the geometries of the buildings there are many ways you could implement highlighting.
One way that comes to mind. Create a layer on top of your background layer with the same geometries as data source. Use a ThemeStyle to show only the selected geometry. The ThemeStyle class is created with a callback method which determines the style. In that method you should return no style unless the feature id is the same as selected feature id.
You can take a look at the ThemeStyle sample for a more general use of themes (no highlighting).
Also you could look at Mapsui.Sample.Wpf.Editing. Here is a screenshot of that sample:

How to make a shape in a vb6 application that resembles an Excel shape

I am trying to make a shape like a "call-out" box to use in a VB6 application. I can use the "Shape" tool to make a rounded-corner rectangle, but I would like to add the "V" shape at the bottom and have it all incorporated in the shape. A good example is the call-out shape used in Excel.
I have also used an image tool with a BMP in it, but still have the square corners of the image tool. I can't figure a way to do this and hope some out there knows how...???
Karl Peterson has code and explanation on creating an irregularly shaped object. It uses API calls, not just native VB controls.
See http://vb.mvps.org/samples/PolyBtn/.

Is There Aspect Ratio Cropping in CQ5, Not Just Free Crop?

The image component allows Free Ratio cropping out of the box. I'm a bit baffled at why there is no Aspect Ratio option (keeping height and width constrained to each other), which would work much better for us. Is this an existing feature that can be enabled, or a custom task in Java?
I am using CQ 5.4.
This is OOTB since 5.4 (atleast), though not well documented.. Set up your smart image widget like so:
<image-16x10
jcr:primaryType="cq:Widget"
allowFileReference="{Boolean}true"
cropParameter="./image-16x10/imageCrop"
fileReferenceParameter="fileReference"
name="./image-16x10/file"
requestSuffix=".img.png"
rotateParameter=""
title="16x10"
xtype="html5smartimage">
<cropConfig
jcr:primaryType="nt:unstructured">
<aspectRatios
jcr:primaryType="nt:unstructured">
<aspectRatio-16x10
jcr:primaryType="nt:unstructured"
text="16x10"
value="16,10"/>
</aspectRatios>
</cropConfig>
</image-16x10>
The cropConfig node structure is what youre interested in. text="16x:10" is what will appear in the Crop dropdown, value="16,10" is the actual fixed Crop size for the tool. You can add as many predefined crops you want per html5smartimage widget.
The image-16x10 and aspectRatio-16x10 names aren't required, but not a useful convention to help in maintainability of the config.If you allow multiple aspectRatios then the image-16x10 naming probably doesnt make as much sense tho its not a bad idea to provide semantic naming to your aspectRatio definition node.
If you'd like to generate images with different aspectRatios, try this...
http://experience-aem.blogspot.com/2013/09/cq-image-custom-aspect-ratios-crop.html
The crop parameters are saved in different properties and not "cropParameter" of the html5smartimage widget
That would be a custom JavaScript widget: the one you're using (smart image) does not have an aspect ratio functionality (or just I never seen one), even in 5.6.
You could extend the existing widget, and provide this functionality in your own, using Javascript though -- it's not trivial, but not rocket science either -- see source code for smart image to see how it extends smart panel, and then registers itself into the framework.

Actionscript 3 - generating user created UI components

I'm creating a library of UI elements, and I want the graphics to be custom. At first, I was going to draw everything with code, and take properties such as "background-base-color", "background-gradient-color", etc. I was concerned that the user would need to modify too many properties and might get confused. I eventually talked myself into using external graphics, such as button_top_left_over.png and etc. Now I'm back and forth. I want people to easily be able to change the skin, so my options are, have them create external graphic libraries, or have them update properties in a front end that would write to XML, such as background-base-color, background-base-highlight,etc. Anyone have experience with this, and can offer advise?
You may "guess" gradients by a given single color, and it should fit in the most of the cases. Here is an algorithm: ColorUtil.as
Customizing components is a common problem. The user shouldn't need to step that deep into the implementation but we sill want a maximum of flexibility. For that, I have created a CSS framework: Jakute Styling Engine. Using Jakute you may set up your component using states.
Instead of declaring tons of properties for each state:
Button top_left_over: red.png
Button top_left_down: blue.png
Button top_left_disabled_over: grey.png
With Jakute you may specify stateful rules:
Button:over top_left: red.png
Button:down top_left: blue.png
Button:disabled:over top_left: blue.png
In this case the user only needs to know the list of button states and the single property "top_left". The styles can be loaded from an external style sheet or directly set to the component.
Finally, here is an example that shows you how to create a stateful styleable component: States Example. Even if you are not plan to incorporate Jakute, you might get an idea of how others create such components. :-)

Create custom shape or connector in PowerPoint using code/script/definition

The shapes in in PowerPoint 2007 seem to be built in - is there a way to create 'user'/'custom' shapes?
I wanted to create a custom connector, but knowing if you can create a custom shape, could be handy in the future.
There are several ways to do this, but not sure if they would meet your needs. If you need to have a custom shape added to the "insert shapes" drop-down and then place and size with your mouse cursor, then I know of no way to do this.
However, if you would like to define a custom shape and then programmatically add this to a location in your presentation, this is doable for sure. In VBA and VSTO, this is can be done via the Object Model; you can add a FreeForm shape, polylines, curves, etc. and in some cases group these to form a single shape. I've done as much with a series of 9-pointed stars that I needed on a regular basis.
To create a custom shape/connector in Drawing ML also appears possible. It is not something I've tried yet, but it certainly looks as if it can be done. There are a number of calculations you would need for this that are well documented in the Ecma specs. By "well documented", I don't mean "easy" though - all of the formulas can be complex. In the case of the connector, it looks as if you would need to programmatically change the shapes your connector is connecting to though to your custom connector (shapes identify their connector, if they have one).

Resources