From 25e796955e82812e8c1b4ff27fa158033101e164 Mon Sep 17 00:00:00 2001 From: Robert Virkus Date: Tue, 27 Aug 2013 12:27:04 +0200 Subject: [PATCH] improved documentation --- .../src/de/enough/polish/ui/ItemSource.java | 3 + .../resources/base/style/polish.css | 21 ++++ .../polish/app/view/SimpleMessageForm.java | 2 +- .../site/source/docs/gui-item-container.html | 97 ++++++++++++++++++ .../docs/gui-visualguide-viewtypes.html | 5 +- .../site/source/docs/gui-visualguide.html | 8 ++ .../site/source/images/gui-item-container.png | Bin 0 -> 7416 bytes .../enough/webprocessor/WebProcessorTask.java | 5 + 8 files changed, 138 insertions(+), 3 deletions(-) create mode 100644 enough-polish-website/site/source/docs/gui-item-container.html create mode 100644 enough-polish-website/site/source/images/gui-item-container.png diff --git a/enough-polish-j2me/source/src/de/enough/polish/ui/ItemSource.java b/enough-polish-j2me/source/src/de/enough/polish/ui/ItemSource.java index 955704c..5c35951 100644 --- a/enough-polish-j2me/source/src/de/enough/polish/ui/ItemSource.java +++ b/enough-polish-j2me/source/src/de/enough/polish/ui/ItemSource.java @@ -6,6 +6,9 @@ * * @author Robert Virkus, j2mepolish@enough.de * @see UniformItemSource + * @see UniformContainer + * @see SourcedContainer + * @see SourcedLazyContainer */ public interface ItemSource { diff --git a/enough-polish-sample-messaging/resources/base/style/polish.css b/enough-polish-sample-messaging/resources/base/style/polish.css index 71625d6..ac64682 100644 --- a/enough-polish-sample-messaging/resources/base/style/polish.css +++ b/enough-polish-sample-messaging/resources/base/style/polish.css @@ -178,10 +178,21 @@ info { layout: vertical-center; } +.messageFromMe:hover +{ + background-color: #fcc; +} + .messageFromUser extends messageFromMe { background-color: red; } +.messageFromUser:hover +{ + background-color: #fcc; +} + + .simpleMessage { text-effect: smiley-extended; label-style: nameLabel; @@ -198,12 +209,22 @@ info { background-color: silver; } +.simpleMessageFromMe:hover +{ + background-color: #cfc; +} + .simpleMessageFromYou extends simpleMessage { layout: right; background-color: #faa; } +.simpleMessageFromYou:hover +{ + background-color: #cfc; +} + /********************* CONTACT FORM ******************************************************************************************************/ .contactList { diff --git a/enough-polish-sample-messaging/source/src/de/enough/polish/app/view/SimpleMessageForm.java b/enough-polish-sample-messaging/source/src/de/enough/polish/app/view/SimpleMessageForm.java index 377092f..50c4e84 100644 --- a/enough-polish-sample-messaging/source/src/de/enough/polish/app/view/SimpleMessageForm.java +++ b/enough-polish-sample-messaging/source/src/de/enough/polish/app/view/SimpleMessageForm.java @@ -47,7 +47,6 @@ public class SimpleMessageForm extends FramedForm { TextField inputField; - private ArrayList messageList = new ArrayList(); private MessageItemSource itemSource; /** @@ -118,6 +117,7 @@ public Item createItem(int index) { //#style simpleMessageFromYou item = new StringItem(message.getSender() + ":", text); }; + //item.setDefaultCommand( new Command("Resend", Command.ITEM, 2)); return item; } diff --git a/enough-polish-website/site/source/docs/gui-item-container.html b/enough-polish-website/site/source/docs/gui-item-container.html new file mode 100644 index 0000000..b5e0ad9 --- /dev/null +++ b/enough-polish-website/site/source/docs/gui-item-container.html @@ -0,0 +1,97 @@ +<%define inDocumentationSection %> +<%define inDocumentationSection.gui %> +<%set title = J2ME Polish: Item %> +<%set basedir = ../ %> +<%include start_syntax.txt %> + +

Container

+ + <%index %> + +

+ Container can hold many items + + Container contain different items. They are the basis for all J2ME Polish screens like + Form, FramedForm + or List. +
+ You can create arbitrary complex items by nesting containers into each other. +
+ You can also use columns and rows for containers or use any of the view-types + available for Containers. +

+ +

ItemSource

+

+ The following containers require an item source. An de.enough.polish.ui.ItemSource + is responsible for translating underlying data into UI items. When an ItemSource is used, an + de.enough.polish.ui.ItemConsumer will register + with the source, so that the ItemSource can inform the ItemConsumer when the underlying data has been updated. +

+ +

Using a Different Container

+

+ If you want to use a different container you can either use one of the provided convenience forms + such as UniformForm + or SourcedForm + or you register the container as a root container using Screen.setRootContainer(Container): +

+
+public class MyFramedForm extends FramedForm
+{
+	public MyFramedForm()
+	{
+		super("title");
+		ItemSource mySource = new MyItemSource();
+		SourcedLazyContainer container = new SourcedLazyContainer(mySource, 5, 15);
+		setRootContainer(container);
+	}
+}
+
+ +

SourcedContainer

+

+ A de.enough.polish.ui.SourcedContainer + is a normal container that uses an ItemSource. +

+ +

SourcedLazyContainer

+

+ The de.enough.polish.ui.SourcedLazyContainer + only loads items when they are required. In contrast to the UniformContainer those Items can vary in height, + a typical example include messages or news entries. +
+ In combination with data storage like de.enough.polish.io.ChunkedStorageCollection, + de.enough.polish.io.ChunkedStorageRmsSystem + and the like you can create endless scrolling screens. +

+ +

UniformContainer

+

+ The de.enough.polish.ui.UniformContainer + along with the convenience de.enough.polish.ui.UniformForm + allow you to show vast numbers of entries without using too much memory. +
+ For best memory efficiency the UniformContainer reuses items - for doing that you need to supply a + de.enough.polish.ui.UniformItemSource + instead of an ItemSource. The UniformItemSource additionally defines a void populateItem(int itemIndex, Item item ) + method for reusing items. +
+ A UniformContainer only supports items that have the same height. +

+ +

Sample App

+

+ Please compare the 'messaging' sample application for using ItemSource, UniformContainer and SourcedLazyContainer. +

+ +

JavaDoc

+ + +<%include end.txt %> diff --git a/enough-polish-website/site/source/docs/gui-visualguide-viewtypes.html b/enough-polish-website/site/source/docs/gui-visualguide-viewtypes.html index 63e35e0..adaa9ca 100644 --- a/enough-polish-website/site/source/docs/gui-visualguide-viewtypes.html +++ b/enough-polish-website/site/source/docs/gui-visualguide-viewtypes.html @@ -136,8 +136,9 @@

size-increase view-type

View Types for Container based UI Components

- You can apply the following view-types for all Container based UI components - basically these are all - components that can contain a number of items. Examples include ChoiceGroup, + You can apply the following view-types for all Container + based UI components - basically these are all components that can contain a number of items. + Examples include ChoiceGroup, List, Form, HtmlBrowser and commands menu.

diff --git a/enough-polish-website/site/source/docs/gui-visualguide.html b/enough-polish-website/site/source/docs/gui-visualguide.html index c52fc56..2d0a68f 100644 --- a/enough-polish-website/site/source/docs/gui-visualguide.html +++ b/enough-polish-website/site/source/docs/gui-visualguide.html @@ -276,6 +276,12 @@

ClockItem

The ClockItem displays the time. +

Container

+ + + +
Container can hold many itemsDifferent container implementations allow you to show an insane amount of data in one screen.
+

CustomItem

@@ -419,5 +425,7 @@

TreeItem

Create Your Own CustomItem Interact with hierarchical data with the TreeItem.
+ + <%include end.txt %> diff --git a/enough-polish-website/site/source/images/gui-item-container.png b/enough-polish-website/site/source/images/gui-item-container.png new file mode 100644 index 0000000000000000000000000000000000000000..bd5f906dcd206873773d2badaaceb9f5a977a9ff GIT binary patch literal 7416 zcmaJ`2UJtrwhf>tD54;O^dd+Hks<^LNE2z&dv5}vL+DMUOHl-*H>CxnNhcs)kY1Ed z0J-!QTBNtXbMO1_m-qf3jGTnzoPEw-d#$)|LNlqqaHc@2XFX;q^#29 z9GmDp2d&mi(%H7|VnmZ1Z0wOtQQVnYi$xE09b)slm?Lj8Up#~AWxC0csGFZ${Mm2_ z{iBaAe3z0Sdt5ZrVhg(wm~|+Qokj=z8kArNI@{&D{))zJkgxTOd7ffgvsqnTo!O*~ z=ZE6;D|gBnBfYOmw{v;8h)?_M%rtq~etS*yhUyVMDJf}MT3S&_NnTD)Fhk%`oB7Nr zQkP)orxIVobkK_zx5?R*8KF=^thc>ACjsHjoZ{lBpFcH-iHYky)_yu}U{&i_<~`r8 zWcl4fnGF8?q;!0Mb|xYru^z|}Jvuq5dif&{J=@x5HYC2hveLOZSzTOOx;Uz9$|^3N z0lV0ZpANb_7h$DR2$+pUY_T~7AU7E?&W@ji*BbcHB@KgLK7Ql}zle*AKk;0@yD?T~x%Tsux36zWK#ftGZQqBsKS*Jv zft8zY)6#lAJhFsLG~qbce>r0Jw0typqA}4Y@00^@Ily-npAuT zB95yNkLTO3U)dnq zTLs^F(c#dq5e$J{rTW#Yzgl4z7Z+4F343~bC+l5VQh1Fm7Q5a;-X|wp2&dzDFTPcn zsC7)&hQ{^8f@KeW_l~U3rg}JWrp!HE*D}&W*OPo!Y3y5d=Ix` zP09=X4!4^3#|+mWd^T#(C>t(RV@OBPCT)x&Q)KSgyY8=RH#avAt$83eI4$7z_EpEq z(sy{Jz(a2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