thinlet-development Mailing List for Thinlet
Brought to you by:
bajzat
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
(22) |
Apr
(7) |
May
(26) |
Jun
(42) |
Jul
(9) |
Aug
(3) |
Sep
|
Oct
(2) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
(6) |
Jun
(12) |
Jul
(2) |
Aug
(9) |
Sep
(1) |
Oct
(8) |
Nov
(1) |
Dec
|
2005 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
(13) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Thomas <skj...@us...> - 2009-01-07 22:02:05
|
Update of /cvsroot/thinlet/thinlet/src/jme/src/org/kxml2 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15209/src/jme/src/org/kxml2 Log Message: Directory /cvsroot/thinlet/thinlet/src/jme/src/org/kxml2 added to the repository |
From: Thomas <skj...@us...> - 2009-01-07 22:02:03
|
Update of /cvsroot/thinlet/thinlet/src/jme/src/org/thinlet/jme/event In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15209/src/jme/src/org/thinlet/jme/event Log Message: Directory /cvsroot/thinlet/thinlet/src/jme/src/org/thinlet/jme/event added to the repository |
From: Thomas <skj...@us...> - 2009-01-07 22:01:59
|
Update of /cvsroot/thinlet/thinlet/src/jme/res In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15209/src/jme/res Log Message: Directory /cvsroot/thinlet/thinlet/src/jme/res added to the repository |
From: Thomas <skj...@us...> - 2009-01-07 22:01:59
|
Update of /cvsroot/thinlet/thinlet/src/jme/src/org/xmlpull In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15209/src/jme/src/org/xmlpull Log Message: Directory /cvsroot/thinlet/thinlet/src/jme/src/org/xmlpull added to the repository |
From: Thomas <skj...@us...> - 2009-01-07 22:01:59
|
Update of /cvsroot/thinlet/thinlet/src/jme/res/icon In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15209/src/jme/res/icon Log Message: Directory /cvsroot/thinlet/thinlet/src/jme/res/icon added to the repository |
From: Thomas <skj...@us...> - 2009-01-07 22:01:59
|
Update of /cvsroot/thinlet/thinlet/src/jme/src/org/thinlet In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15209/src/jme/src/org/thinlet Log Message: Directory /cvsroot/thinlet/thinlet/src/jme/src/org/thinlet added to the repository |
From: Thomas <skj...@us...> - 2009-01-07 22:01:59
|
Update of /cvsroot/thinlet/thinlet/src/jme/src/org/thinlet/jme/demo In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15209/src/jme/src/org/thinlet/jme/demo Log Message: Directory /cvsroot/thinlet/thinlet/src/jme/src/org/thinlet/jme/demo added to the repository |
From: Thomas <skj...@us...> - 2009-01-07 22:01:59
|
Update of /cvsroot/thinlet/thinlet/src/jme/src/org/xmlpull/v1 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15209/src/jme/src/org/xmlpull/v1 Log Message: Directory /cvsroot/thinlet/thinlet/src/jme/src/org/xmlpull/v1 added to the repository |
From: Thomas <skj...@us...> - 2009-01-07 22:01:59
|
Update of /cvsroot/thinlet/thinlet/src/jme/src/org/kxml2/nonamespace In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15209/src/jme/src/org/kxml2/nonamespace Log Message: Directory /cvsroot/thinlet/thinlet/src/jme/src/org/kxml2/nonamespace added to the repository |
From: Thomas <skj...@us...> - 2009-01-07 22:01:57
|
Update of /cvsroot/thinlet/thinlet/src/jme In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15209/src/jme Log Message: Directory /cvsroot/thinlet/thinlet/src/jme added to the repository |
From: Thomas <skj...@us...> - 2009-01-07 22:01:56
|
Update of /cvsroot/thinlet/thinlet/src/jme/src/org/thinlet/jme In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15209/src/jme/src/org/thinlet/jme Log Message: Directory /cvsroot/thinlet/thinlet/src/jme/src/org/thinlet/jme added to the repository |
From: Thomas <skj...@us...> - 2009-01-07 22:01:56
|
Update of /cvsroot/thinlet/thinlet/src/jme/src/org In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15209/src/jme/src/org Log Message: Directory /cvsroot/thinlet/thinlet/src/jme/src/org added to the repository |
From: Thomas <skj...@us...> - 2009-01-07 22:01:56
|
Update of /cvsroot/thinlet/thinlet/src/jme/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15209/src/jme/src Log Message: Directory /cvsroot/thinlet/thinlet/src/jme/src added to the repository |
From: Andrzej B. <ab...@us...> - 2005-01-21 16:30:38
|
Update of /cvsroot/thinlet/thinlet/src/java/thinlet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21423 Modified Files: Thinlet.java Log Message: (This patch was supposed to go with the previous commit.. Sorry!) * Remove the use of String.intern() - MIDP API doesn't have this. Since we now compare the values of Object.toString() and not Object references this is not needed now. Index: Thinlet.java =================================================================== RCS file: /cvsroot/thinlet/thinlet/src/java/thinlet/Thinlet.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- Thinlet.java 21 Jan 2005 16:22:08 -0000 1.24 +++ Thinlet.java 21 Jan 2005 16:30:28 -0000 1.25 @@ -5808,7 +5808,7 @@ * @return the value, or null */ protected static String getDOMAttribute(Object node, String key) { - return (String) get(node, key.intern()); + return (String) get(node, key); } /** @@ -5829,7 +5829,7 @@ * @return the number of tags */ protected static int getDOMCount(Object node, String key) { - return getItemCountImpl(node, key.intern()); + return getItemCountImpl(node, key); } /** @@ -5841,7 +5841,7 @@ * @return the found tag, or null */ protected static Object getDOMNode(Object node, String key, int index) { - return getItemImpl(node, key.intern(), index); + return getItemImpl(node, key, index); } /** @@ -5953,7 +5953,7 @@ } else { if (dom) { Object parent = current; - current = createImpl(tagname = tagname.intern()); + current = createImpl(tagname); if (parent != null) { insertItem(parent, tagname, current, -1); //set(current, ":parent", parent); @@ -6036,7 +6036,7 @@ addAttribute(current, key, text.toString(), methods); } else { if (dom) { - set(current, key.intern(), text.toString()); + set(current, key, text.toString()); } else { if (attributelist == null) { attributelist = new Hashtable(); |
From: Andrzej B. <ab...@us...> - 2005-01-21 16:22:29
|
Update of /cvsroot/thinlet/thinlet/src/java/thinlet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19308 Modified Files: Thinlet.java Log Message: The object reference comparison here doesn't work, especially on the JVM running under Symbian OS. Replace it with equals(). This bug would cause certain non-typical operations to fail, like e.g. retrieving children created with parseDOM(). Index: Thinlet.java =================================================================== RCS file: /cvsroot/thinlet/thinlet/src/java/thinlet/Thinlet.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- Thinlet.java 19 Jan 2005 03:02:02 -0000 1.23 +++ Thinlet.java 21 Jan 2005 16:22:08 -0000 1.24 @@ -5139,7 +5139,7 @@ } // possibly fall-through from above for (Object[] entry = (Object[]) component; entry != null; entry = (Object[]) entry[2]) { - if (entry[0] == key) { + if (entry[0].equals(key)) { return entry[1]; } } |
From: Andrzej B. <ab...@ge...> - 2005-01-19 09:30:17
|
Michael Nascimento Santos wrote: > Update of /cvsroot/thinlet/thinlet/src/java/thinlet > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18207 > > Modified Files: > Thinlet.java > Log Message: > Lock up problem with lists/tables fixed. Since it used to affect tree, the new code > checks explicitly for tree/node and behaves as before. Thanks! This indeed fixes the problem. -- Best regards, Andrzej Bialecki ___. ___ ___ ___ _ _ __________________________________ [__ || __|__/|__||\/| Information Retrieval, Semantic Web ___|||__|| \| || | Embedded Unix, System Integration http://www.sigram.com Contact: info at sigram dot com |
From: Michael N. S. <sou...@us...> - 2005-01-19 03:02:26
|
Update of /cvsroot/thinlet/thinlet/src/java/thinlet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18207 Modified Files: Thinlet.java Log Message: Lock up problem with lists/tables fixed. Since it used to affect tree, the new code checks explicitly for tree/node and behaves as before. Simple test case: package thinlet; public class TestCase extends Thinlet { public TestCase() throws Exception { add(parse("testcase.xml")); } public void recreateTable(Object dynamic) { removeAll(dynamic); for (int i = 0; i < 5; i++) { Object row = create("row"); for (int j = 0; j <= 1; j++) { Object cell = create("cell"); setString(cell, "text", String.valueOf(j)); add(row, cell); } add(dynamic, row); } } public static void main(String[] args) throws Exception { new FrameLauncher("", new TestCase(), 800, 600); } } <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE panel SYSTEM 'https://thinlet.dev.java.net/thinlet.dtd'> <panel columns="1" weighty="1" weightx="1"> <tree selection="multiple" weighty="1" weightx="1"> <node text="Node A" icon="image.gif" selected="true"> <node text="Node B" icon="image.gif" /> <node text="Node C" icon="image.gif" /> </node> <node text="Node D" expanded="false"> <node text="Node E" icon="image.gif" /> </node> </tree> <table name="dynamic" weighty="1" weightx="1"> <header> <column text="First" /> <column text="Second" /> </header> <row> <cell text="1" /> <cell text="2" /> </row> <row> <cell text="1" /> <cell text="2" /> </row> </table> <button action="recreateTable(dynamic)" text="Recreate" mnemonic="0"/> </panel> Index: Thinlet.java =================================================================== RCS file: /cvsroot/thinlet/thinlet/src/java/thinlet/Thinlet.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Thinlet.java 18 Jan 2005 15:57:16 -0000 1.22 +++ Thinlet.java 19 Jan 2005 03:02:02 -0000 1.23 @@ -2235,9 +2235,12 @@ // ("tree" // == classname)) Object lead = get(component, ":lead"); - //if (getIndex(component, lead) == -1) { - // set(component, ":lead", lead = null); - //} + + if ("tree" != classname && "node" != classname && + getIndex(component, lead) == -1) { + set(component, ":lead", lead = null); + } + int[] columnwidths = ("table" == classname) ? ((int[]) get(component, ":widths")) : null; boolean line = getBoolean(component, "line", true); int iline = line ? 1 : 0; @@ -3460,9 +3463,13 @@ (keycode == KeyEvent.VK_DOWN) || (keycode == KeyEvent.VK_PAGE_UP) || (keycode == KeyEvent.VK_PAGE_DOWN) || (keycode == KeyEvent.VK_HOME) || (keycode == KeyEvent.VK_END)) { Object lead = get(component, ":lead"); - //if (getIndex(component, lead) == -1) { - // set(component, ":lead", lead = null); - //} + + String classname = getClass(component); + if ("tree" != classname && "node" != classname && + getIndex(component, lead) == -1) { + set(component, ":lead", lead = null); + } + Object row = getListItem(component, component, keycode, lead, recursive); if (row != null) { String selection = getString(component, "selection", "single"); |
From: Andrzej B. <ab...@us...> - 2005-01-18 15:57:30
|
Update of /cvsroot/thinlet/thinlet/src/java/thinlet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3660 Modified Files: Thinlet.java Log Message: Revert a fix for lock-up when traversing lists, where the selected item has been just deleted. Unfortunately the fix completely broke the keyboard navigation of trees. At this time a proper fix is not known, so the lock-up still occurs. Patches are welcome! Index: Thinlet.java =================================================================== RCS file: /cvsroot/thinlet/thinlet/src/java/thinlet/Thinlet.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- Thinlet.java 18 Jan 2005 12:00:14 -0000 1.21 +++ Thinlet.java 18 Jan 2005 15:57:16 -0000 1.22 @@ -2235,9 +2235,9 @@ // ("tree" // == classname)) Object lead = get(component, ":lead"); - if (getIndex(component, lead) == -1) { - set(component, ":lead", lead = null); - } + //if (getIndex(component, lead) == -1) { + // set(component, ":lead", lead = null); + //} int[] columnwidths = ("table" == classname) ? ((int[]) get(component, ":widths")) : null; boolean line = getBoolean(component, "line", true); int iline = line ? 1 : 0; @@ -3460,9 +3460,9 @@ (keycode == KeyEvent.VK_DOWN) || (keycode == KeyEvent.VK_PAGE_UP) || (keycode == KeyEvent.VK_PAGE_DOWN) || (keycode == KeyEvent.VK_HOME) || (keycode == KeyEvent.VK_END)) { Object lead = get(component, ":lead"); - if (getIndex(component, lead) == -1) { - set(component, ":lead", lead = null); - } + //if (getIndex(component, lead) == -1) { + // set(component, ":lead", lead = null); + //} Object row = getListItem(component, component, keycode, lead, recursive); if (row != null) { String selection = getString(component, "selection", "single"); |
From: Andrzej B. <ab...@us...> - 2005-01-18 12:00:27
|
Update of /cvsroot/thinlet/thinlet/src/java/thinlet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12851 Modified Files: Thinlet.java Log Message: Some JVMs don't tolerate deeply nested arrays, such as used in child lists of Thinlet widgets. This patch adds an alternative implementation based on Vectors. Note: this implementation has some limitations, such as the requirement that the list format should be selected BEFORE any Thinlets are instantiated, and may not be changed while there are any instances running. Proper solution to this would require significant changes in the way Thinlet framework uses the static method get(comp, key). Submitted by: Mike Hartshorn and Robert Piotrowski. Index: Thinlet.java =================================================================== RCS file: /cvsroot/thinlet/thinlet/src/java/thinlet/Thinlet.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- Thinlet.java 11 Oct 2004 19:43:48 -0000 1.20 +++ Thinlet.java 18 Jan 2005 12:00:14 -0000 1.21 @@ -83,6 +83,8 @@ private static Method wheelrotation = null; private static int evm = 0; + private static boolean useVectors = true; + static { try { WHEEL_MASK = AWTEvent.class.getField("MOUSE_WHEEL_EVENT_MASK").getLong(null); @@ -5079,6 +5081,23 @@ return false; } + /** Select whether widget child lists should use Vectors or Object[]. Some JVMs don't + * tolerate deeply nested arrays. + * <p><b>WARNING: this value MUST NOT be changed while running instances + * of Thinlet exist. The proper way to call this method is in the main() + * method before any Thinlets are instantiated.</b></p> + */ + public static void setUseVectors(boolean b) { + useVectors = b; + } + + /** If true, then Thinlet will use Vectors instead of Object[] to + * keep the child lists. + */ + public static boolean getUseVectors() { + return useVectors; + } + /** * Get a specified sub-component or component part. Key is e.g. "header" * (table header), ":parent" (parent component), ":comp" (head of a @@ -5086,6 +5105,32 @@ * popupmenu, etc ... */ static Object get(Object component, Object key) { + if (useVectors) { + if (key == ":comp") { + try { + return ((Vector)get(component, ":children")).elementAt(0); + } catch (Exception e) { + return null; + } + } else if (key == ":next") { + // the desktop doesn't have a parent so you can get + // null's here if you remove the only component + // from a desktop + Integer slotInteger = (Integer)get(component, ":slot"); + if (slotInteger != null) { + int nextSlot = ((Integer)get(component, ":slot")).intValue() + 1; + Object parent = get(component, ":parent"); + try { + return ((Vector)get(parent, ":children")).elementAt(nextSlot); + } catch (Exception e) { + return null; + } + } else { + return null; + } + } + } + // possibly fall-through from above for (Object[] entry = (Object[]) component; entry != null; entry = (Object[]) entry[2]) { if (entry[0] == key) { return entry[1]; @@ -5217,6 +5262,9 @@ public void removeAll(Object component) { if (get(component, ":comp") != null) { set(component, ":comp", null); + if (useVectors) { + set(component, ":children", null); + } update(component, "validate"); } } @@ -5328,14 +5376,36 @@ * Referenced by DOM */ private void insertItem(Object parent, Object key, Object component, int index) { - Object item = parent, next = get(parent, key); - for (int i = 0;; i++) { - if ((i == index) || (next == null)) { - set(item, key, component); - set(component, ":next", next); - break; + if (useVectors && key.equals(":comp")) { + Vector v = (Vector)get(parent, ":children"); + if (v == null) { + // tune here + v = new Vector(4, 4); + set(parent, ":children", v); + } + + if (index == -1) { + set(component, ":slot", new Integer(v.size())); + v.addElement(component); + } else { + set(component, ":slot", new Integer(index)); + v.insertElementAt(component, index); + int len = v.size(); + for (int i = 0; i < len; i++) { + Object child = v.elementAt(i); + set(child, ":slot", new Integer(i)); + } + } + } else { + Object item = parent, next = get(parent, key); + for (int i = 0;; i++) { + if ((i == index) || (next == null)) { + set(item, key, component); + set(component, ":next", next); + break; + } + next = get(item = next, key = ":next"); } - next = get(item = next, key = ":next"); } } @@ -5371,17 +5441,31 @@ * @param component */ private void removeItemImpl(Object parent, Object component) { - Object previous = null; // the widget before the given component - for (Object comp = get(parent, ":comp"); comp != null;) { - Object next = get(comp, ":next"); - if (next == component) { - previous = comp; - break; + if (useVectors) { + Vector v = (Vector)get(parent, ":children"); + if (v != null) { + v.removeElement(component); + int len = v.size(); + // rebuld slot list, should only do it from position + // where component was removed + for (int i = 0; i < len; i++) { + Object child = v.elementAt(i); + set(child, ":slot", new Integer(i)); + } } - comp = next; + } else { + Object previous = null; // the widget before the given component + for (Object comp = get(parent, ":comp"); comp != null;) { + Object next = get(comp, ":next"); + if (next == component) { + previous = comp; + break; + } + comp = next; + } + set((previous != null) ? previous : parent, (previous != null) ? ":next" : ":comp", get(component, ":next")); + set(component, ":next", null); } - set((previous != null) ? previous : parent, (previous != null) ? ":next" : ":comp", get(component, ":next")); - set(component, ":next", null); set(component, ":parent", null); // not required } |
From: Norbert B. <sj...@cl...> - 2004-11-30 18:20:04
|
Could these Thinlet modifications (only some method access modifications) by included on the Thinlet CVS repository? --- Norbert Barbosa --- RCS file: /cvsroot/thinlet/thinlet/src/java/thinlet/Thinlet.java,v retrieving revision 1.20 diff -r1.20 Thinlet.java 4457c4457 < private void invokeImpl(Object method, Object part) { --- > protected void invokeImpl(Object method, Object part) { 5052c5052 < private static Object createImpl(String classname) { --- > protected static Object createImpl(String classname) { 5059c5059 < static boolean set(Object component, Object key, Object value) { --- > protected static boolean set(Object component, Object key, Object value) { 5088c5088 < static Object get(Object component, Object key) { --- > protected static Object get(Object component, Object key) { 5227c5227 < private static int getItemCountImpl(Object component, String key) { --- > protected static int getItemCountImpl(Object component, String key) { 5330c5330 < private void insertItem(Object parent, Object key, Object component, int index) { --- > protected void insertItem(Object parent, Object key, Object component, int index) { 5778c5778 < private Object parse(InputStream inputstream, boolean validate, boolean dom, Object handler) throws IOException { --- > protected Object parse(InputStream inputstream, boolean validate, boolean dom, Object handler) throws IOException { 5984c5984 < private void finishParse(Vector methods, Object root, Object handler) { --- > protected void finishParse(Vector methods, Object root, Object handler) { 6016c6016 < private void addImpl(Object parent, Object component, int index) { --- > protected void addImpl(Object parent, Object component, int index) { 6044c6044 < private boolean instance(Object classname, Object extendclass) { --- > protected boolean instance(Object classname, Object extendclass) { 6059c6059 < private Object addElement(Object parent, String name) { --- > protected Object addElement(Object parent, String name) { 6069c6069 < private void addAttribute(Object component, String key, String value, Vector lasts) { --- > protected void addAttribute(Object component, String key, String value, Vector lasts) { 6165c6165 < private static Object[] getDefinition(Object classname, String key, String type) { --- > protected static Object[] getDefinition(Object classname, String key, String type) { 6457c6457 < private Object[] getMethod(Object component, String value, Object root, Object handler) { --- > protected Object[] getMethod(Object component, String value, Object root, Object handler) { 6588c6588 < private boolean setString(Object component, String key, String value, String defaultvalue) { --- > protected boolean setString(Object component, String key, String value, String defaultvalue) { 6888c6888 < private static Object[] dtd; --- > protected static Object[] dtd; |
From: Andrzej B. <ab...@us...> - 2004-10-11 19:43:58
|
Update of /cvsroot/thinlet/thinlet/src/java/thinlet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12644 Modified Files: Thinlet.java Log Message: Add missing getColor and getFont methods. Index: Thinlet.java =================================================================== RCS file: /cvsroot/thinlet/thinlet/src/java/thinlet/Thinlet.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- Thinlet.java 5 Oct 2004 21:02:44 -0000 1.19 +++ Thinlet.java 11 Oct 2004 19:43:48 -0000 1.20 @@ -6306,9 +6306,21 @@ } /** + * Get custom font of a component. This method may return null if the + * default font is used. + * @param component a component + * @param key the identifier of the parameter, e.g. "font" + * @return + */ + public Font getFont(Object component, String key) { + return (Font) get(component, key, "font"); + } + + /** * Set custom font on a component * * @param component component to use the custom font + * @param key currently only "font" is supported * @param font custom font to use, or null to reset component to use default * font */ @@ -6340,6 +6352,17 @@ } /** + * Get custom color of a component. This method may return null if the + * default color is used. + * @param component a component + * @param key the identifier of the parameter, e.g. "foreground" + * @return value of the custom color, or null if default color is used + */ + public Color getColor(Object component, String key) { + return (Color) get(component, key, "color"); + } + + /** * Set the AWT component for the given (currently <i>bean </i>) widget * * @param component a <i>bean </i> widget |
From: Andrzej B. <ab...@ge...> - 2004-10-06 10:57:03
|
Stephen Colebourne wrote: > Can we make these public? Most thinlet API methods are public so they can be > called from handler classes that are not subclasses of Thinlet. Well, sure we can - it's probably a matter of style... I made them protected, because most of them are not useful directly as action parameters in XML and have to be wrapped with some additional logic. -- Best regards, Andrzej Bialecki ------------------------------------------------- Software Architect, System Integration Specialist CEN/ISSS EC Workshop, ECIMF project chair EU FP6 E-Commerce Expert/Evaluator ------------------------------------------------- FreeBSD developer (http://www.freebsd.org) |
From: Stephen C. <sco...@bt...> - 2004-10-05 23:43:44
|
Can we make these public? Most thinlet API methods are public so they can be called from handler classes that are not subclasses of Thinlet. Stephen ----- Original Message ----- From: "Andrzej Bialecki" <ab...@us...> To: <thi...@li...> > Update of /cvsroot/thinlet/thinlet/src/java/thinlet > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3138 > > Modified Files: > Thinlet.java > Log Message: > Change some of the more useful methods from private to protected. > > > Index: Thinlet.java > =================================================================== > RCS file: /cvsroot/thinlet/thinlet/src/java/thinlet/Thinlet.java,v > retrieving revision 1.16 > retrieving revision 1.17 > diff -u -d -r1.16 -r1.17 > --- Thinlet.java 4 Oct 2004 21:27:53 -0000 1.16 > +++ Thinlet.java 4 Oct 2004 23:22:26 -0000 1.17 > @@ -178,7 +178,7 @@ > /** > * > */ > - private void doLayout(Object component) { > + protected void doLayout(Object component) { > String classname = getClass(component); > if ("combobox" == classname) { > if (getBoolean(component, "editable", true)) { > @@ -2242,7 +2242,7 @@ > // == classname)) > Object lead = get(component, ":lead"); > if (getIndex(component, lead) == -1) { > - set(component, ":lead", lead = null); > + set(component, ":lead", lead = null); > } > int[] columnwidths = ("table" == classname) ? ((int[]) get(component, ":widths")) : null; > boolean line = getBoolean(component, "line", true); > @@ -4441,7 +4441,7 @@ > /** > * > */ > - private boolean invoke(Object component, Object part, String event) { > + protected boolean invoke(Object component, Object part, String event) { > Object method = get(component, event); > if (method != null) { > if (focusowner != null && "action".equals(event)) requestFocus(component); > @@ -4869,7 +4869,7 @@ > * @param component a focusable component > * @return true if the focusowner was changed, otherwise false > */ > - private boolean setFocus(Object component) { > + protected boolean setFocus(Object component) { > if (!focusinside) { // request focus for the thinlet component > requestFocus(); > } > @@ -5278,6 +5278,7 @@ > * > */ > private int getIndex(Object component, Object value) { > + if (value == null) return -1; > int index = 0; > for (Object item = get(component, ":comp"); item != null; item = get(item, ":next")) { > if (value == item) { > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Thinlet-development mailing list > Thi...@li... > https://lists.sourceforge.net/lists/listinfo/thinlet-development |
From: Stephen C. <sco...@us...> - 2004-10-05 21:02:56
|
Update of /cvsroot/thinlet/thinlet/src/java/thinlet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12003/src/java/thinlet Modified Files: Thinlet.java Log Message: Refactor checkLocation to take the component as a parameter This separates mouseinside handling from other methods, and saves 22 bytes Index: Thinlet.java =================================================================== RCS file: /cvsroot/thinlet/thinlet/src/java/thinlet/Thinlet.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- Thinlet.java 5 Oct 2004 20:57:28 -0000 1.18 +++ Thinlet.java 5 Oct 2004 21:02:44 -0000 1.19 @@ -553,10 +553,8 @@ } i++; } - if (mouseinside == component) { // layout changed, check the hovered - // tab - checkLocation(); - } + // layout changed, check the hovered tab + checkLocation(component); return; } boolean horizontal = ((placement == "top") || (placement == "bottom")); @@ -601,10 +599,8 @@ } } } - if (mouseinside == component) { // layout changed, check the hovered - // tab - checkLocation(); - } + // layout changed, check the hovered tab + checkLocation(component); } } @@ -769,9 +765,7 @@ removeItemImpl(content, popup); set(popup, ":parent", null); set(component, ":popup", null); - if (mouseinside == popup) { - checkLocation(); - } + checkLocation(popup); popupMenu(popup); // remove recursively } // pop up the selected menu only @@ -913,9 +907,7 @@ repaint(combolist); set(combolist, ":parent", null); popupowner = null; - if (mouseinside == combolist) { - checkLocation(); - } + checkLocation(combolist); } /** @@ -2930,12 +2922,15 @@ } /** - * Check the previous mouse location again because of a possible layout - * change + * Check the previous mouse location again because of a possible layout change. + * + * @param component the component to check */ - private void checkLocation() { - findComponent(content, mousex, mousey); - handleMouseEvent(mousex, mousex, 1, false, false, false, MouseEvent.MOUSE_ENTERED, mouseinside, insidepart); + private void checkLocation(Object component) { + if (mouseinside == component) { + findComponent(content, mousex, mousey); + handleMouseEvent(mousex, mousex, 1, false, false, false, MouseEvent.MOUSE_ENTERED, mouseinside, insidepart); + } } /** |
From: Stephen C. <sco...@us...> - 2004-10-05 20:57:46
|
Update of /cvsroot/thinlet/thinlet/src/java/thinlet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10682/src/java/thinlet Modified Files: Thinlet.java Log Message: Comment the invoke method Index: Thinlet.java =================================================================== RCS file: /cvsroot/thinlet/thinlet/src/java/thinlet/Thinlet.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Thinlet.java 4 Oct 2004 23:22:26 -0000 1.17 +++ Thinlet.java 5 Oct 2004 20:57:28 -0000 1.18 @@ -4439,7 +4439,12 @@ } /** - * + * Invokes a method, such as an action, on the specified component. + * + * @param component the component to fire the event on, such as a textfield or table + * @param part the part of the component, null for a textfield, the row for a table + * @param event the event to send, such as 'action' + * @return true if a method object was fired */ protected boolean invoke(Object component, Object part, String event) { Object method = get(component, event); |