当前位置: 首页>>代码示例>>Java>>正文


Java Image.add方法代码示例

本文整理汇总了Java中org.apache.wicket.markup.html.image.Image.add方法的典型用法代码示例。如果您正苦于以下问题:Java Image.add方法的具体用法?Java Image.add怎么用?Java Image.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.wicket.markup.html.image.Image的用法示例。


在下文中一共展示了Image.add方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderImage

import org.apache.wicket.markup.html.image.Image; //导入方法依赖的package包/类
public Image renderImage(AjaxRequestTarget target, boolean fullRender) {
	if(returnPage != null || returnClass != null) {
		link.add(new AttributeModifier("title", new ResourceModel("click_to_max")));
		link.setEnabled(true);
	}
	link.removeAll();
	Image img = null;
	if(!autoDetermineChartSizeByAjax) {
		img = createImage("content", getImageData());
	}else{
		img = createImage("content", getImageData(selectedWidth, selectedHeight));
	}
	img.add(AttributeModifier.replace("style", "display: none; margin: 0 auto;"));
	link.add(img);
	setState((byte) 1);
	if(fullRender) {
		if(target != null) {
			target.add(link);	
			target.appendJavaScript("jQuery('#"+img.getMarkupId()+"').fadeIn();");
		}		
		setState((byte) 2);
	}
	return img;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:25,代码来源:AjaxLazyLoadImage.java

示例2: FieldInstanceImageField

import org.apache.wicket.markup.html.image.Image; //导入方法依赖的package包/类
public FieldInstanceImageField(String id, FieldValueModel _fieldValueModel, boolean readonly) {
  super(id);
  this.fieldValueModel = _fieldValueModel;
  
  image = new Image("image");
  image.add(new AttributeModifier("src", true, new AbstractReadOnlyModel<String>() {
    @Override
    public final String getObject() {
      TopicMap topicMap = fieldValueModel.getFieldInstanceModel().getFieldInstance().getInstance().getTopicMap();        
      Object o = fieldValueModel.getFieldValue();
      return getRequest().getRelativePathPrefixToContextRoot() + "occurrenceImages?topicMapId=" + topicMap.getId() + 
      "&occurrenceId=" + ((o instanceof OccurrenceIF ? ((OccurrenceIF)o).getObjectId(): "unknown"));
    }
  }));
  upload = new UploadPanel("upload", this);
  add(image);
  add(upload);
  if (fieldValueModel.isExistingValue()) {
    upload.setVisible(false);
  } else {
    image.setVisible(false);
    if (readonly)
      upload.setVisible(false);
  }
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:26,代码来源:FieldInstanceImageField.java

示例3: getLoadingComponent

import org.apache.wicket.markup.html.image.Image; //导入方法依赖的package包/类
protected Component getLoadingComponent(final String markupId) {
    Image image = new Image(markupId, PRELOADER);
    image.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return isLoadingVisible();
        }
    });

    return image;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:13,代码来源:AsyncUpdatePanel.java

示例4: onBeforeRender

import org.apache.wicket.markup.html.image.Image; //导入方法依赖的package包/类
@Override
protected void onBeforeRender()
{
    // Defer adding the image until rendering because we need to access the properties from
    // the embedding component/page
    if (!hasBeenRendered()) {
        ResourceReference _imageRes = imageRes;
        if (_imageRes == null) {
            _imageRes = new UrlResourceReference(Url.parse(getString("icon")))
                    .setContextRelative(true);
        }
        
        Image image = new Image("image", _imageRes);
        try {
            // The getString method throws an MissingResourceException if the property is
            // not available. In this case, we simply do not set a tooltip
            getString("tooltip");
            image.add(new AttributeModifier("title",
                    new StringResourceModel("tooltip", ActionBarLink.this)));
        }
        catch (MissingResourceException e) {
            // Nothing to do
        }
        link.add(image);
    }
    
    super.onBeforeRender();
}
 
开发者ID:webanno,项目名称:webanno,代码行数:29,代码来源:ActionBarLink.java

示例5: addIconToPanel

import org.apache.wicket.markup.html.image.Image; //导入方法依赖的package包/类
private void addIconToPanel(final String imageUrl) {
    Image packageIcon = new Image("packageIcon", "Icon");
    packageIcon.add(new AttributeModifier("src", new AbstractReadOnlyModel() {
        @Override
        public Object getObject() {
            return imageUrl;
        }
    }));
    infoBorder.add(packageIcon);
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:11,代码来源:BintrayInfoPanel.java

示例6: adddIconToPanel

import org.apache.wicket.markup.html.image.Image; //导入方法依赖的package包/类
private void adddIconToPanel() {
    final String imageUrl = ConstantValues.bintrayApiUrl.getString() + "/packages/bintray/jcenter/unknownPackage/images/avatar";
    Image packageIcon = new Image("packageIcon", "Icon");
    packageIcon.add(new AttributeModifier("src", new AbstractReadOnlyModel() {
        @Override
        public Object getObject() {
            return imageUrl;
        }
    }));
    add(packageIcon);
}
 
开发者ID:alancnet,项目名称:artifactory,代码行数:12,代码来源:BintrayInfoLinkMessagePanel.java

示例7: GalleryImageRenderer

import org.apache.wicket.markup.html.image.Image; //导入方法依赖的package包/类
/**
 * Creates a new instance of <code>GalleryImageRenderer</code>.
 */
public GalleryImageRenderer(String id, String imageResourceId) {
	super(id);
	
	if (imageResourceId == null) {
		add(new ContextImage("img",new Model(ProfileConstants.UNAVAILABLE_IMAGE)));
		return;
	}
	else if (sakaiProxy.getResource(imageResourceId) == null) {
		// may have been deleted in CHS
		add(new ContextImage("img",new Model(ProfileConstants.UNAVAILABLE_IMAGE)));
		return;
	}

	final byte[] imageBytes = sakaiProxy.getResource(imageResourceId).getBytes();
	
	if (imageBytes != null && imageBytes.length > 0) {

		BufferedDynamicImageResource imageResource = new BufferedDynamicImageResource() {

			private static final long serialVersionUID = 1L;
			@Override
			protected byte[] getImageData(IResource.Attributes ignored) {
				return imageBytes;
			}
		};

		Image myPic = new Image("img", new Model(imageResource));
		myPic.add(new AttributeModifier("alt", new StringResourceModel("profile.gallery.image.alt",this,null).getString()));
		add(myPic);

	} else {
		add(new ContextImage("img",new Model(ProfileConstants.UNAVAILABLE_IMAGE)));
	}
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:38,代码来源:GalleryImageRenderer.java

示例8: LinkImagePanel

import org.apache.wicket.markup.html.image.Image; //导入方法依赖的package包/类
/**
 * Instantiates a new link image panel.
 *
 * @param id the id
 * @param column the column
 * @param rowModel the row model
 */
public LinkImagePanel(String id, final AjaxActionIconColumn<T> column, IModel<T> rowModel) {
    super(id);

    AjaxLink<T> link = new AjaxLink<T>("link", rowModel) {
        @Override
        public void onClick(AjaxRequestTarget target) {
            column.onClick(getModel(), target);
        }

        @Override
        public boolean isEnabled() {
            return column.isEnabled(getModel());
        }

        @Override
        public boolean isVisible() {
            return column.isVisible(getModel());
        }
    };
    add(link);

    Image icon = new Image("icon", column.getIcon(rowModel)) {

        @Override
        protected boolean shouldAddAntiCacheParameter() {
            return WebApplication.get().usesDevelopmentConfig();
        }

    };

    String tooltip = column.getTooltip(rowModel);
    if (tooltip != null) {
        icon.add(new AttributeAppender("title", tooltip));
    }

    link.add(icon);
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:45,代码来源:AjaxActionIconColumn.java

示例9: LinkImagePanel

import org.apache.wicket.markup.html.image.Image; //导入方法依赖的package包/类
/**
 * Instantiates a new link image panel.
 *
 * @param id the id
 * @param column the column
 * @param rowModel the row model
 */
public LinkImagePanel(String id, final ActionIconColumn<T> column, IModel<T> rowModel) {
    super(id);

    Link<T> link = new Link<T>("link", rowModel) {
        @Override
        public void onClick() {
            column.onClick(getModel());
        }

        @Override
        public boolean isEnabled() {
            return column.isEnabled(getModel());
        }

        @Override
        public boolean isVisible() {
            return column.isVisible(getModel());
        }
    };
    add(link);

    Image icon = new Image("icon", column.getIcon(rowModel)) {

        @Override
        protected boolean shouldAddAntiCacheParameter() {
            return WebApplication.get().usesDevelopmentConfig();
        }

    };

    String tooltip = column.getTooltip(rowModel);
    if (tooltip != null) {
        icon.add(new AttributeAppender("title", tooltip));
    }

    link.add(icon);

}
 
开发者ID:Nocket,项目名称:nocket,代码行数:46,代码来源:ActionIconColumn.java


注:本文中的org.apache.wicket.markup.html.image.Image.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。