Posted by: kahgoh on: 6 February, 2010
In Creating a File Set Processing Script with Vim, Vim was used to quickly create a script for processing a set of files. Using Vim to generate the script works well if the operation only needs to done once. However, if you have to perform the whole operation later on another set of file, you would have to repeat the whole process. If you have Sed installed, the process may be simplified so that you can do it all on the command line.
Posted by: kahgoh on: 5 February, 2010
Finding the vertex or edge at a specific point, or the set of vertices in a certain area, requires the graph’s pick support. The support is obtainable from VisualizationViewer’s getPickSupport method. The support is actually an implementation of GraphElementAccessor and contains the following methods:
V getVertex(Layout<V,E> layout, double x, double y);
Collection<V> getVertices(Layout<V,E> layout, Shape rectangle);
E getEdge(Layout<V,E> layout, double x, double y);
Posted by: kahgoh on: 3 February, 2010
Posted by: kahgoh on: 30 January, 2010
In Jung, if you want to control of the vertices or edges, you need to provide the appropriate Transformer to the RenderContext in the BasicVisualizationServer. From the Transformer’s documentation it is simply an interface that is “implemented by classes that transform one object into another“. In Jung the Transformer “transforms” a vertex or edge to a colour, shape, text or something else that controls their appearance.
Posted by: kahgoh on: 17 January, 2010
Custom Swing popups are often created using a JPopupMenu. Some custom popups may contain input fields, such as a JTextField or a JSpinner. For these fields to be able to gain focus when the popup (or popup menu) is displayed, the invoker should be set prior to making it visible with setVisible. The invoker is usually the component that the user has to interact with in order to cause the popup to show. The invoker is set by calling the popup menu’s setInvoker.
Posted by: kahgoh on: 2 January, 2010
In this tutorial, Javascript is used to update the contents of elements on a page according to user inputs. A HTML page contains buttons for three random Korean characters, a copyright symbol and a square root sybmol and a text area for textual input. When a button is pressed, the character’s unicode is passed to the script, which converts it and appends it to the text area. The script also updates displays the contents of the text area on the same page.
Posted by: kahgoh on: 12 December, 2009
Many forms have at least one drop down field that provides a list of choices, with one option being an “other, please specify” type field. In OpenOffice Base, the source providing the list of options could be another table. In this case, you do not want to add an entry into the source table just to represent other. In such a case, you can use a macro to make the option appear.