
:)
A weblog built the way that fate intended - an online record of what I am doing at work.
(in fact, this was drawn by David Westhead's code). There is a small design decision to be made between representing drawing elements as basic geometry or as symbols. A symbol may be the same as a geometric element (like a circle), but it might be a combination of them. Consider the 'N' and 'C' in boxes, above. Or this image:
where the mass number and charge are separate text elements on the left, and part of the whole symbol on the right. Neither is a 'better' way of doing things; they each have their advantages - and disadvantages.
if (clicked) diagram.accept(new DropShadowVisitor(g, 5, -5);
else diagram.accept(new DrawVisitor(g));

g.setColor(Color.LIGHT_GRAY);
g.drawString(text.text, text.x, text.y);
g.setColor(Color.BLACK);
g.drawString(text.text, text.x + dx, text.y + dy);
this.drawingShadow = true;
for (DiagramElement element : diagram.children) { element.accept(this); }
this.drawingShadow = false;
for (DiagramElement element : diagram.children) { element.accept(this); }
if (this.drawingShadow) {
g.setColor(Color.LIGHT_GRAY);
g.drawString(text.text, text.x, text.y);
} else {
g.setColor(Color.BLACK);
g.drawString(text.text, text.x + dx, text.y + dy);
}

JButton inButton = new JButton("IN");I got center scaling implemented in my branch. Which lets me test a different approach to managing fonts. I had tried to be clever and do something like:
inButton.setActionCommand("IN");
JButton outButton = new JButton("OUT");
inButton.setActionCommand("OUT");
GlyphVector glyphs = font.createGlyphVector("N");but letter shapes fill horribly with lots of missing pixels. Anyway, I eventually settled on just storing the Glyphs themselves. Less pure, but it works, and it allows the size of TextSymbols to be computed and used by the class in between drawing.
ArrayListshapes = new ArrayList ();
for (int i = 0; i < glyphs.getNumberOfGlyphs(); i++) {
shapes.add(affineTransform.getTransformedShape(glyphs.get(i)));
}
which shows rings at various sizes, with the numbers at their centers showing the font size at that scale. An important one is the 'size' (9-5) - which is 4, but there is no readable size of font at that size. However, the FontManager class keeps track of how far below (or above) the minimum and maximum font sizes, and then returns to that size at the appropriate point.
Here, the rows are neither in order (I'm not sure from their paper whether the ordering is an expected outcome for all structures, nor have I checked...) nor is their sum less than for PVR scheme - 765 vs 753.
Which also look quite random; or, as they say :"... we admit that the final labels ... do not appear »orderly« but one has to recognise that there is no »simple« labelling in [fullerenes] that will appear simple"
SymbolTree tree = createTree(); // get a tree somehowOf course, this is really only useful for a) large trees and b) when doing many "closest symbol" operations. For example, highlighting when moving the mouse.
tree.setHitDistance(minDistance); // the minimum distance from mouse to symbol
tree.useKDTree(true); // essential
tree.highlightClosestSymbol(point); // will now do a fast search for the closest
The compilation of metabolic data sets comprises three aspects. Each analytical data aquisition produces numerical values as estimates of metabolite concentration [...] Second, all such studies involve biological material [...] and a particular study context and this produces a wide variety of supplementary data (metadata). Finally, many studies process the data further using a variety of algorithms and then subject the data to statistical or bioinformatic analysis..