Tuesday, August 18, 2009

Font sizer in OpenMap statusbar

If you run OpenMap (beta5) under the Substance 5.2 LAF you can add a font size slider to the OpenMap statusbar doing this:

public class FontPanel extends OMComponentPanel {

public FontPanel() {

public void findAndInit(Object obj) {
if (obj instanceof InformationDelegator) {
InformationDelegator delgator = (InformationDelegator) obj;
GridBagConstraints c = new GridBagConstraints();
c.weightx = 1;
c.weighty = 1;
c.anchor = GridBagConstraints.EAST;
c.fill = GridBagConstraints.HORIZONTAL;
c.insets = new Insets(0, 0, 0, 4);
Component statusPanel = DialogUtils.getChildNamed(delgator,
delgator.add(FontSizePanel.getPanel(), c);

Add the above class to your openmap.components in openmap.properties and then run OM with
Click here to see how this looks.

FontSizePanel.java can be found here or downloaded from the Substance homepage.

No comments:

Live Traffic Map