OK, here's what I've come up with for the pop-up menu, for discussion.
The goal here is (1) simplicity, (2) consistency, (3) easy
maintainability, and (4) file size reduction.
This is in org/jmol/popup/PopupResourceBundle.Java
What follows is a list of what is possible for what type of object we
are coloring:
{ "colorAtomMenu", "@ SCHEME COLOR TRANSLUCENCY" },
{ "colorBondMenu", "@ INHERIT COLOR TRANSLUCENCY" },
{ "colorHbondMenu", null},
{ "colorSSbondMenu", null},
{ "colorLabelMenu", null},
{ "colorVectorMenu", null},
{ "colorBackboneMenu", "@ INHERIT SCHEME COLOR TRANSLUCENCY" },
{ "colorCartoonMenu", null},
{ "colorRibbonsMenu", null},
{ "colorRocketsMenu", null},
{ "colorStrandsMenu", null},
{ "colorTraceMenu", null},
{ "colorBackgroundMenu", "@ COLOR" },
{ "colorIsoSurfaceMenu", "@ COLOR TRANSLUCENCY" },
{ "colorAxesMenu", "@ AXESCOLOR" },
{ "colorBoundBoxMenu", null},
{ "colorUnitCellMenu", null},
The "@" sign there just tells Jmol to replace the capitalized words with
their equivalent (below).
"null" just means "ditto"
I set up the submenuing system to track where it is using
Component.set/getName(), so the same menu item "black" can be identified
as "colorAtomMenu black" or "colorBondMenu black", etc., and we no
longer need separate line items for "colorAxesBlack" "colorAtomBlack"
"colorBondBlack".... Believe it or not, this, with a few other similar
simplifications for setSpin, set, and select, reduces that file by 520
lines -- from 1301 to 781.
The basic possibilities:
final static String INHERIT = "none";
final static String COLOR = "black white red orange yellow green cyan
blue indigo violet";
final static String SCHEME = "SchemeMenu";
final static String TRANSLUCENCY = "opaque translucent";
final static String AXESCOLOR = "gray salmon maroon olive slateblue
gold orchid";
where
{ "SchemeMenu", "cpk amino structure chain formalcharge
partialcharge" },
Q: Note that I removed a WHOLE BUNCH of esoteric "designer" colors --
can we do without them on this menu?
Q: I think several scheme names are missing -- should we add them?
Whatever the answers to these questions -- it should be much easier now
to make these changes, as they just involve adding a new color name ONE
PLACE along with it's translation equivalent.
Bob
Bob Hanson wrote:
>I'm working on simplifying the color part of the pop-up menu. Is there
>just a basic set of options we want for the pop-up menu? I'd like to
>implement it as the SAME list regardless of the item chosen. Basically,
>the item chosen just sets the context for the color, but it's the same
>color menu that shows up under different items.
>
>What I propose is a GENERAL philosophy regarding the pop-up menu:
>
>"The pop-up menu is for selected options that the general user might
>like for any model and for which one would like to have quick access
>that does not require a console."
>
>With that in mind, can we prune this? augment it reasonably?
>
>Bob
>
>
>
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers