Example #1
0
 @Override
 public void setForeground(UIColor fg) {
   np.setForeground(fg);
 }
Example #2
0
 @Override
 public iPlatformComponentPainter getComponentPainter() {
   return np.getComponentPainter();
 }
Example #3
0
 @Override
 public void setFont(UIFont f) {
   np.setFont(f);
 }
Example #4
0
 @Override
 public void setComponentPainter(iPlatformComponentPainter cp) {
   np.setComponentPainter(cp);
 }
Example #5
0
 @Override
 public void setBorder(iPlatformBorder b) {
   np.setBorder(b);
 }
Example #6
0
 @Override
 public void setBackground(UIColor bg) {
   np.setBackground(bg);
 }
Example #7
0
  /**
   * Configures the navigator
   *
   * @param cfg
   *          the navigator's configuration
   */
  protected void configureEx(Navigator cfg) {
    final aNavigatorPanel np = createNavigatorPanel();

    panel = np;

    iNavigatorPanel.PanelType pt;

    switch(cfg.type.intValue()) {
      case Navigator.CType.toggle :
        pt = iNavigatorPanel.PanelType.TOGGLE;

        break;

      case Navigator.CType.option :
        pt = iNavigatorPanel.PanelType.OPTION;

        break;

      default :
        pt = iNavigatorPanel.PanelType.HIERARCHICAL;

        break;
    }

    np.setPanelType(pt);
    formComponent = dataComponent = np;

    if (cfg.showBackButton.booleanValue() && (np.isHiearchical())) {
      BorderPanelEx p = new BorderPanelEx(createBorderLayoutView(), np);

      p.setPadding(new UIInsets(0, 0, 0, ScreenUtils.PLATFORM_PIXELS_4));
      p.add(np.getBackButton(), Location.LEFT);
      p.add(np, Location.CENTER);
      formComponent = p;
    }

    configure(cfg, true, false, false, true);

    UIColor sc = UIColorHelper.getColor(cfg.separatorLineColor.getValue());

    if (sc != null) {
      np.setSeparatorLineColor(sc);
    }

    np.setShowIconsOnly(cfg.showIconsOnly.booleanValue());

    if (cfg.iconPosition.spot_valueWasSet()) {
      np.setIconPosition(IconPosition.valueOf(cfg.iconPosition.stringValue().toUpperCase(Locale.US)));
    }

    PaintBucket               pb;
    iPlatformComponentPainter cp;
    UIFont                    font = null;
    UIColor                   fg   = null;

    pb = UIColorHelper.getPaintBucket(this, cfg.getSelectionPainter());
    cp = (pb == null)
         ? null
         : pb.getComponentPainter(true);

    if (cp != null) {
      np.setSelectedPainter(cp);
    }

    if (pb != null) {
      font = pb.getFont();
      fg   = pb.getForegroundColor();
    }

    pb = UIColorHelper.getPaintBucket(this, cfg.getPressedPainter());
    cp = (pb == null)
         ? null
         : pb.getComponentPainter(true);

    if (cp != null) {
      np.setPressedPainter(cp);
    }

    if (pb != null) {
      if (fg == null) {
        fg = pb.getForegroundColor();
      }

      if (font == null) {
        font = pb.getFont();
      }
    }

    np.setSelectedFont(font);
    np.setSelectedForeground(fg);

    if (cfg.buttonsSameSize.booleanValue()) {
      np.setButtonsSameSize(true);
    }

    Margin m = cfg.getContentPadding();

    if (m != null) {
      np.setInsets(m.getInsets());
    }

    SPOTSet    set = cfg.actions;
    int        len = set.getCount();
    ActionItem item;

    for (int i = 0; i < len; i++) {
      item = (ActionItem) set.get(i);

      iActionComponent b = np.addButton(UIAction.createAction(this, item));

      if ("false".equals(item.spot_getAttribute("visible"))) {
        b.setVisible(false);
      }
    }

    int n = cfg.selectedIndex.intValue();

    if (n > -1) {
      np.setSelectedIndex(n);
    }
  }