Beispiel #1
0
    /* Documented in super interface */
    public void paint(PaintTarget target) throws PaintException {
      target.startTag("error");
      target.addAttribute("level", getErrorLevel().getText());

      // Paint all the exceptions
      for (int i = 0; i < causes.length; i++) {
        if (causes[i] instanceof ErrorMessage) {
          ((ErrorMessage) causes[i]).paint(target);
        } else {
          new SystemError(causes[i]).paint(target);
        }
      }

      target.endTag("error");
    }
  /*
   * (non-Javadoc)
   *
   * @see
   * com.vaadin.ui.AbstractOrderedLayout#translateDropTargetDetails(java.util
   * .Map)
   */
  @Override
  public void paintContent(PaintTarget target) throws PaintException {
    super.paintContent(target);

    if (dropHandler != null) {
      dropHandler.getAcceptCriterion().paint(target);
    }

    // Drop ratio
    target.addAttribute(Constants.ATTRIBUTE_VERTICAL_DROP_RATIO, verticalDropRatio);

    // Drop ratio
    target.addAttribute(VHasDragMode.DRAGMODE_ATTRIBUTE, dragMode.ordinal());

    // Shims
    target.addAttribute(IframeCoverUtility.SHIM_ATTRIBUTE, iframeShims);

    // Paint the dragfilter into the paint target
    new DragFilterPaintable(this).paint(target);
  }
  @Override
  protected void paintOptions(
      Map<String, Object> ops,
      PaintTarget target,
      String attributeNamePrefix,
      String optionNames,
      String optionTypes)
      throws PaintException {

    if (colors != null) {
      target.addAttribute(COMMON_OPT_NAME_PREFIX + COLORS, colors);
    }
    super.paintOptions(ops, target, attributeNamePrefix, optionNames, optionTypes);
  }
Beispiel #4
0
  @Override
  public void paintContent(PaintTarget target) throws PaintException {
    super.paintContent(target);

    /* Register queued effects: */

    if (!fxQueue.isEmpty()) {
      target.startTag(VAnimooProxy.FX_QUEUE_TAG);
      for (FX fx : fxQueue) {
        int fxId = mapFx(fx);
        target.startTag(VAnimooProxy.FX_TAG);
        target.addAttribute(VAnimooProxy.FX_ID_ATTR, fxId);
        target.addAttribute(VAnimooProxy.FX_FPS_ATTR, fx.getFps());
        target.addAttribute(VAnimooProxy.FX_UNIT_ATTR, fx.getUnit().getUidlString());
        target.addAttribute(VAnimooProxy.FX_LINK_ATTR, fx.getLink().getUidlString());
        target.addAttribute(VAnimooProxy.FX_DURATION_ATTR, fx.getDuration());
        target.addAttribute(VAnimooProxy.FX_TRANSITION_ATTR, fx.getTransition().getUidlString());
        target.addAttribute(VAnimooProxy.FX_EASE_ATTR, fx.getEase().getUidlString());

        Map<String, String> cssProperties = new HashMap<String, String>();
        for (CssProperty cssp : fx.getCssProperties()) {
          String key = cssp.property;
          String value = "";
          if (cssp.fromInt != null && cssp.toInt != null) {
            value = "[" + cssp.fromInt.toString() + "," + cssp.toInt.toString() + "]";
          } else {
            value = "['" + cssp.fromStr + "','" + cssp.toStr + "']";
          }
          cssProperties.put(key, value);
        }
        target.addAttribute(VAnimooProxy.FX_CSSPROP_ATTR, cssProperties);
        target.endTag(VAnimooProxy.FX_TAG);
      }
      target.endTag(VAnimooProxy.FX_QUEUE_TAG);
      fxQueue.clear();
    }

    /* Fire queued effect events: */

    if (!eventsQueue.isEmpty()) {
      target.startTag(VAnimooProxy.EVENTS_QUEUE_TAG);
      for (FXEvent ev : eventsQueue) {
        target.startTag(VAnimooProxy.EVENT_TAG);
        target.addAttribute(VAnimooProxy.EVENT_TYPE_ATTR, ev.type);
        target.addAttribute(VAnimooProxy.EVENT_FXID_ATTR, this.getFxId(ev.fx));
        target.addAttribute(VAnimooProxy.EVENT_TARGET_ATTR, ev.target);
        target.addAttribute(VAnimooProxy.EVENT_CALLBACK_ATTR, ev.callback);
        target.endTag(VAnimooProxy.EVENT_TAG);
      }
      target.endTag(VAnimooProxy.EVENTS_QUEUE_TAG);
      eventsQueue.clear();
    }
  }