Package org.wicketstuff.yui.helper

Examples of org.wicketstuff.yui.helper.YuiImage


      @Override
      public void populateItem(final ListItem listItem) {
        if (listItem.getModelObject().getClass().getSimpleName()
            .equals("YuiImage")) {
          final YuiImage aImage = (YuiImage) listItem
              .getModelObject();
          SelectionBox sBox = new SelectionBox("box", count++);
          listItem.add(sBox);
          MultiLineLabel aLabel = new MultiLineLabel("caption",
              aImage.getDesc());
          sBox.add(aLabel);
        } else {
          final YuiTextBox aTextBox = (YuiTextBox) listItem
              .getModelObject();
          SelectionBox sBox = new SelectionBox("box", count++);
View Full Code Here


    setThickness(thickness);
    setList(list);

    for (int i = list.size() - 1; i >= 0; i--) {
      if (list.get(i).getClass().getSimpleName().equals("YuiImage")) {
        YuiImage aImage = (YuiImage) list.get(i);
        ResourceReference aResourceReference = new ResourceReference(
            Selection.class, aImage.getFileName());

        ImageResourceInfo backgroundInfo = new ImageResourceInfo(
            aResourceReference);
        int width = backgroundInfo.getWidth();
        int height = backgroundInfo.getHeight();
View Full Code Here

  public void setDragableImageResources(DragableSlotList dragableSlotList) {

    for (int i = 0; i < dragableSlotList.getSize(); i++) {
      DragableSlot slot = (DragableSlot) dragableSlotList.getDragableSlot(i);
      YuiImage img = slot.getImage();

      ResourceReference imgRR = new ResourceReference(
          DragDropSettings.class, img.getFileName());

      ImageResourceInfo imgInfo = new ImageResourceInfo(imgRR);
      int imgWidth = imgInfo.getWidth();
      int imgHeight = imgInfo.getHeight();

      CSSInlineStyle imgStyle = new CSSInlineStyle();

      imgStyle.add("background", "url("
          + RequestCycle.get().urlFor(imgRR) + ")");

      imgStyle.add("width", imgWidth + "px");
      imgStyle.add("height", imgHeight + "px");

      imgStyle.add("top", img.getTop() + "px");
      imgStyle.add("left", img.getLeft() + "px");

      dragableImgStyleList.add(imgStyle);

      this.dragableImgWidth = imgWidth;
      this.dragableImgHeight = imgHeight;
View Full Code Here

  }

  public void setDragableSlotResources(DragableSlotList dragableSlotList) {
    for (int i = 0; i < dragableSlotList.getSize(); i++) {
      DragableSlot slot = (DragableSlot) dragableSlotList.getDragableSlot(i);
      YuiImage img = slot.getSlot();

      ResourceReference imgRR = new ResourceReference(
          DragDropSettings.class, img.getFileName());

      ImageResourceInfo imgInfo = new ImageResourceInfo(imgRR);
      int imgWidth = imgInfo.getWidth();
      int imgHeight = imgInfo.getHeight();

      CSSInlineStyle imgStyle = new CSSInlineStyle();
      imgStyle.add("background", "url("
          + RequestCycle.get().urlFor(imgRR) + ")");
      imgStyle.add("width", imgWidth + "px");
      imgStyle.add("height", imgHeight + "px");

      imgStyle.add("top", img.getTop() + "px");
      imgStyle.add("left", img.getLeft() + "px");

      dragableSlotStyleList.add(imgStyle);

      this.dragableSlotWidth = imgWidth;
      this.dragableSlotHeight = imgHeight;
View Full Code Here

  }

  public void setTargetSlotResources(TargetSlotList targetSlotList) {
    for (int i = 0; i < targetSlotList.getSize(); i++) {
      TargetSlot slot = (TargetSlot) targetSlotList.getTargetSlot(i);
      YuiImage img = slot.getSlot();

      ResourceReference imgRR = new ResourceReference(
          DragDropSettings.class, img.getFileName());

      ImageResourceInfo imgInfo = new ImageResourceInfo(imgRR);
      int imgWidth = imgInfo.getWidth();
      int imgHeight = imgInfo.getHeight();

      CSSInlineStyle imgStyle = new CSSInlineStyle();
      imgStyle.add("background", "url("
          + RequestCycle.get().urlFor(imgRR) + ")");
      imgStyle.add("width", imgWidth + "px");
      imgStyle.add("height", imgHeight + "px");

      imgStyle.add("top", img.getTop() + "px");
      imgStyle.add("left", img.getLeft() + "px");

      targetSlotStyleList.add(imgStyle);

      this.targetSlotWidth = imgWidth;
      this.targetSlotHeight = imgHeight;
View Full Code Here

   * @param animOptionList -
   *            a list of the animOptions
   */
  public void setImageResources(List<AnimOption> animOptionList) {
    for (int i = animOptionList.size() - 1; i >= 0; i--) {
      YuiImage defaultImg = ((AnimOption) animOptionList.get(i))
          .getDefaultImg();
      YuiImage defaultImgOver = ((AnimOption) animOptionList.get(i))
          .getDefaultImgOver();
      YuiImage selectedImg = ((AnimOption) animOptionList.get(i))
          .getSelectedImg();
      YuiImage selectedImgOver = ((AnimOption) animOptionList.get(i))
          .getSelectedImgOver();

      ResourceReference defaultImgRR = new ResourceReference(
          AnimSettings.class, defaultImg.getFileName());
      ResourceReference defaultImgOverRR = new ResourceReference(
          AnimSettings.class, defaultImgOver.getFileName());
      ResourceReference selectedImgRR = new ResourceReference(
          AnimSettings.class, selectedImg.getFileName());
      ResourceReference selectedImgOverRR = new ResourceReference(
          AnimSettings.class, selectedImgOver.getFileName());

      ImageResourceInfo defaultImgInfo = new ImageResourceInfo(
          defaultImgRR);
      int defaultImgWidth = defaultImgInfo.getWidth();
      int defaultImgHeight = defaultImgInfo.getHeight();
View Full Code Here

      private static final long serialVersionUID = 1L;

      protected void populateItem(ListItem item) {
        TargetSlot targetSlot = (TargetSlot) item.getModelObject();
        YuiImage slot = targetSlot.getSlot();
        item.add(new DragDropTargetSlot(targetSlotList.getSlotId(),
            item.getIndex(), slot, settings));
      };
    };
    add(targetSlotView);

    // Add the dragable slots and dragable images
    ListView dragableSlotView = new ListView(dragableSlotList.getId(),
        dragableSlotList.getDragableList()) {

      private static final long serialVersionUID = 1L;

      protected void populateItem(ListItem item) {
        DragableSlot dragableSlot = (DragableSlot) item
            .getModelObject();
        YuiImage slot = dragableSlot.getSlot();
        YuiImage img = dragableSlot.getImage();
        item.add(new DragDropDragableSlot(dragableSlotList.getSlotId(),
            item.getIndex(), slot, settings));
        item.add(new DragDropPlayer(dragableSlotList.getImgId(), item
            .getIndex(), img, settings));
      };
View Full Code Here

   */
  public void setImageResources(List<AnimSelectOption> animSelectOptionList)
  {

    for (int i = animSelectOptionList.size() - 1; i >= 0; i--) {
      YuiImage defaultImg = (animSelectOptionList.get(i)).getDefaultImg();
      YuiImage defaultImgOver = (animSelectOptionList.get(i)).getDefaultImgOver();
      YuiImage selectedImg = (animSelectOptionList.get(i)).getSelectedImg();
      YuiImage selectedImgOver = (animSelectOptionList.get(i)).getSelectedImgOver();

      ResourceReference defaultImgRR = new ResourceReference(AnimSelectSettings.class, defaultImg.getFileName());
      ResourceReference defaultImgOverRR = new ResourceReference(AnimSelectSettings.class, defaultImgOver.getFileName());
      ResourceReference selectedImgRR = new ResourceReference(AnimSelectSettings.class, selectedImg.getFileName());
      ResourceReference selectedImgOverRR = new ResourceReference(AnimSelectSettings.class, selectedImgOver.getFileName());

      ImageResourceInfo defaultImgInfo = new ImageResourceInfo(defaultImgRR);
      int defaultImgWidth = defaultImgInfo.getWidth();
      int defaultImgHeight = defaultImgInfo.getHeight();
      ImageResourceInfo defaultImgOverInfo = new ImageResourceInfo(defaultImgOverRR);
View Full Code Here

   * @param sortList -
   *            the new image resources
   */
  public void setImageResources(List<YuiImage> sortList) {
    for (int i = 0; i < sortList.size(); i++) {
      YuiImage img = (YuiImage) sortList.get(i);

      ResourceReference imgRR = new ResourceReference(SortSettings.class,
          img.getFileName());

      ImageResourceInfo imgInfo = new ImageResourceInfo(imgRR);
      int imgWidth = imgInfo.getWidth();
      int imgHeight = imgInfo.getHeight();

      CSSInlineStyle imgStyle = new CSSInlineStyle();
      imgStyle.add("background", "url("
          + RequestCycle.get().urlFor(imgRR) + ")");
      imgStyle.add("width", imgWidth + "px");
      imgStyle.add("height", imgHeight + "px");

      imgStyle.add("top", img.getTop() + "px");
      imgStyle.add("left", img.getLeft() + "px");

      imgStyleList.add(imgStyle);

      this.width = imgWidth;
      this.height = imgHeight;
View Full Code Here

  protected String getJavaScriptComponentInitializationScript() {
    String sortValues = "";
    String sortIds = "";

    for (int i = 0; i < sortList.size(); i++) {
      YuiImage yuiImage = (YuiImage) sortList.get(i);
      if (sortValues.equals("") || sortValues == "") {
        sortValues = "'" + yuiImage.getDesc() + "'";
        sortIds = "'dd" + i + "_" + id + "'";
      } else {
        sortValues = sortValues + ", '" + yuiImage.getDesc() + "'";
        sortIds = sortIds + ", 'dd" + i + "_" + id + "'";
      }
    }
    PackagedTextTemplate template = new PackagedTextTemplate(
        SortGroup.class, "init.js");
View Full Code Here

TOP

Related Classes of org.wicketstuff.yui.helper.YuiImage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.