LWUIT - Create new line in Flowlayout - java-me

from flying through the source code of the HTMLComponent, the method for creating a line break in a Form filled with labels the proper method is embedding the labels in a container and the newline actually creates a new container.
Is this the proper way to do it?
So:
Container
|Label Label
|Label Label
|Label
|Label
Container:
|Label
|Label

Flow layout can and should perform its own line breaks on entered text. The reason the HTML component does this manually is to provide it with even more fine grained control over layout.
Generally you need to see why HTMLComponent doesn't wrap lines for you, you need to look in the LWUITBrowser demo and the LWUITDemo both of which line wrap properly and see what you did differently.

Related

How do I completely remove the label or the label's spacing in angular-formly form?

Using angular-formly, I'm trying to build a form, where if the label is removed in fields json, there is no padding or spacing given to the that label in the rendered html.
Here is an example of the actual form and my 'desired' form:
JS Bin
The best solution would require a pull request to the template library's label wrapper template which would use an ng-if to hide the label if one is not provided.
If you don't want to deal with that, then you can choose from one of these options:
Set wrapper to null for the field. But you lose the other wrappers as well (like the one that adds has-error)
Create your own type that allows you to specify your own wrappers.
Both of these are demonstrated here:
https://jsbin.com/quceqi/edit?html,js,output

How do you make a template for screens in ScreenManager?

I was wondering how you make a template for screens in kivy using ScreenManager.
I want to be able to have a template that will create screens with a grid layout in which I can change the background image of the screen and add a label and button to it.
I tried using
[ScreenMenu#BoxLayout]:
Button:
text: ctx.title
Image:
source: ctx.image
And then using
screen1 = Builder.template('ScreenMenu', title='Hello', image='C:/Users/mmoma_000/Pictures/Wallpapers/aot.png')
But I can't access the screens it makes (if it even successfully makes a screen)
I assume I will need to do something about adding the widgets to screen manager but I'm not sure what that is.
Any help is appreciated, thanks.
Templates are deprecated, don't use them, use dynamic classes instead.
I don't know exactly what your problem is though. Are you using Builder in the kv file or in python?
Of course, you could also solve the problem by just using a normal class.

iPhone SDK building an Omnigraffle like app

I have been trying to find an example or some hints on how to create an app that I could drag, resize, rotate images onto a UIView and then save the individual pieces (including their size, rotation and placement) and the entire UIView into CoreData. Kind of like the omnigraffle app.
Any tutorials, examples or anything on any piece of the app would be greatly appreciated.
for dragging a view
http://www.cocoacontrols.com/platforms/ios/controls/tkdragview
for roting a view http://www.cocoacontrols.com/platforms/ios/controls/ktonefingerrotationgesturerecognizer
for resizing a view
http://www.cocoacontrols.com/platforms/ios/controls/spuserresizableview
What respects to core data, its actually pretty straightforward just, gather the classes in one view, see the properties you need to save, and the new one you will need for your app and thats it.
Like:
Object Canvas containing a many relationship to morphlingViews wich contain all the properties as center, color, width, height, angle, UIPath (if you plan to create custom shapes) layer position (so it gets drawn correctly) and if you plan to connect the views as omnigraffle add a many realtionship to self (in morphlingViews) so you can take the center of different morphlingViews and add a simple line between them. (and a string if you plan to add drawInRect method to allow users to write in the objects, then it will be a good idea to add the text properties as well).
You can also add Quartz Composer drawing styles properties to the object, as shadow, shadowColor, shadowOffset, or add patterColor to add resizable background.

how to set lwuit textarea scrolling false

I want to add large string content to a container dynamically.
There are 60 different contents(strings) to be displayed in this container.
To add the string to container, I am adding a TextArea(empty border with 100% transparency).
The problem is that TextArea offers scroll and I do not want it to scroll. Instead I want to grow(increase height) according to content. I am unable to achieve this.
Can you help me out with this?
Or can I use any other component for the purpose?
I am using LWUIT with J2ME.
You can derive text area and return false for isScrollableY() although it should generally work seamlessly even if you don't do that (since your parent layout is scrollable). Is it possible you changed the text area and don't revalidate the parent form on the EDT?
There are problems with text area layout when it is modified by a separate thread (race condition with the layout code).
First put the TextArea.setSingleLineTextArea(false) , and grow by content true.

Rendering order in JUNG graph visualisation

I'm using JUNG2 to draw some graphs.
This is the image I get:
http://img841.imageshack.us/img841/205/graphvizkk3312164f020b4.png
I'd like to:
1) change the rendering order (labels should be the last objects to be drawn);
2) add a semi-transparent background to the labels.
3) change background color of the whole image.
Any idea on how to do this?
The JUNG2 documentation is not very extensive on these issues.
Mulone
(1) To do this you'd have to hack the rendering code; I don't believe that we support this at the moment.
UPDATE: I took a closer look. Actually JUNG does support this without hacking the existing libraries; the easiest way is perhaps to subclass BasicRenderer and then override the render() method so that things happen in the order that you want. (I recommend that you render vertices after edges.) Once you do that, you create an instance of your custom Renderer, and call VisualizationViewer.setRenderer(customRenderer).
(2) The labels respect HTML code (i.e., surround your label with <html></html> and then put whatever tags you like in it).
(3) BasicVisualizationServer (and its subclasses, e.g. VisualizationViewer) inherit from JComponent, which defines setBackground(Color).

Resources