本文整理汇总了Java中com.google.gwt.user.client.ui.AbstractImagePrototype类的典型用法代码示例。如果您正苦于以下问题:Java AbstractImagePrototype类的具体用法?Java AbstractImagePrototype怎么用?Java AbstractImagePrototype使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractImagePrototype类属于com.google.gwt.user.client.ui包,在下文中一共展示了AbstractImagePrototype类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ComponentHelpWidget
import com.google.gwt.user.client.ui.AbstractImagePrototype; //导入依赖的package包/类
public ComponentHelpWidget(final SimpleComponentDescriptor scd) {
if (imageResource == null) {
Images images = Ode.getImageBundle();
imageResource = images.help();
}
AbstractImagePrototype.create(imageResource).applyTo(this);
addClickListener(new ClickListener() {
@Override
public void onClick(Widget sender) {
final long MINIMUM_MS_BETWEEN_SHOWS = 250; // .25 seconds
if (System.currentTimeMillis() - lastClosureTime >=
MINIMUM_MS_BETWEEN_SHOWS) {
new ComponentHelpPopup(scd, sender);
}
}
}
);
}
示例2: ComponentRemoveWidget
import com.google.gwt.user.client.ui.AbstractImagePrototype; //导入依赖的package包/类
public ComponentRemoveWidget(SimpleComponentDescriptor simpleComponentDescriptor) {
if (imageResource == null) {
Images images = Ode.getImageBundle();
imageResource = images.deleteComponent();
}
this.scd = simpleComponentDescriptor;
AbstractImagePrototype.create(imageResource).applyTo(this);
addClickListener(new ClickListener() {
@Override
public void onClick(Widget widget) {
if (Window.confirm(MESSAGES.reallyRemoveComponent())) {
long projectId = ode.getCurrentYoungAndroidProjectId();
YaProjectEditor projectEditor = (YaProjectEditor) ode.getEditorManager().getOpenProjectEditor(projectId);
SimpleComponentDatabase componentDatabase = SimpleComponentDatabase.getInstance();
componentDatabase.addComponentDatabaseListener(projectEditor);
componentDatabase.removeComponent(scd.getName());
}
}
});
}
示例3: scrollTableAscending
import com.google.gwt.user.client.ui.AbstractImagePrototype; //导入依赖的package包/类
@Override
public AbstractImagePrototype scrollTableAscending() {
return new AbstractImagePrototype() {
public void applyTo(Image image) {
image.setUrl("img/sort_asc.gif");
}
public Image createImage() {
return new Image("img/sort_asc.gif");
}
public String getHTML() {
return "<img border=\"0\" src=\"img/sort_asc.gif\"/>";
}
};
}
示例4: scrollTableDescending
import com.google.gwt.user.client.ui.AbstractImagePrototype; //导入依赖的package包/类
@Override
public AbstractImagePrototype scrollTableDescending() {
return new AbstractImagePrototype() {
public void applyTo(Image image) {
image.setUrl("img/sort_desc.gif");
}
public Image createImage() {
return new Image("img/sort_desc.gif");
}
public String getHTML() {
return "<img border=\"0\" src=\"img/sort_desc.gif\"/>";
}
};
}
示例5: scrollTableFillWidth
import com.google.gwt.user.client.ui.AbstractImagePrototype; //导入依赖的package包/类
@Override
public AbstractImagePrototype scrollTableFillWidth() {
return new AbstractImagePrototype() {
public void applyTo(Image image) {
image.setUrl("img/fill_width.gif");
}
public Image createImage() {
return new Image("img/fill_width.gif");
}
public String getHTML() {
return "<img border=\"0\" src=\"img/fill_width.gif\"/>";
}
};
}
示例6: getImageHtml
import com.google.gwt.user.client.ui.AbstractImagePrototype; //导入依赖的package包/类
private SafeHtml getImageHtml(ImageResource res, VerticalAlignmentConstant valign) {
AbstractImagePrototype proto = AbstractImagePrototype.create(res);
SafeHtml image = SafeHtmlUtils.fromTrustedString(proto.getHTML());
// Create the wrapper based on the vertical alignment.
SafeStylesBuilder cssStyles =
new SafeStylesBuilder().appendTrustedString(direction + ":0px;");
if (HasVerticalAlignment.ALIGN_TOP == valign) {
return templates.imageWrapperTop(cssStyles.toSafeStyles(), image);
} else if (HasVerticalAlignment.ALIGN_BOTTOM == valign) {
return templates.imageWrapperBottom(cssStyles.toSafeStyles(), image);
} else {
int halfHeight = (int) Math.round(res.getHeight() / 2.0);
cssStyles.appendTrustedString("margin-top:-" + halfHeight + "px;");
return templates.imageWrapperMiddle(cssStyles.toSafeStyles(), image);
}
}
示例7: onUpdate
import com.google.gwt.user.client.ui.AbstractImagePrototype; //导入依赖的package包/类
@Override
protected void onUpdate(double p_progress)
{
if( m_tokenWidget == null )
{
return;
}
AbstractImagePrototype newFrame = null;
if( m_layerToken.getZoom().getValue() == EnuZoom.Medium )
{
newFrame = getTacticFrame( p_progress );
}
else
{
newFrame = getStrategyFrame( p_progress );
}
if( newFrame != m_lastFrame )
{
m_lastFrame = newFrame;
m_layerToken.addWarningImage( m_tokenWidget.getTokenImage(), m_lastFrame, m_target,
m_landPixOffset );
}
}
示例8: RemoveActionHasCell
import com.google.gwt.user.client.ui.AbstractImagePrototype; //导入依赖的package包/类
public RemoveActionHasCell(String text,
ActionCell.Delegate<DataGridFilterSummary> delegate) {
cell = new ActionCell<DataGridFilterSummary>(text,
delegate) {
@Override
public void render(Cell.Context context,
final DataGridFilterSummary value,
SafeHtmlBuilder sb) {
AbstractImagePrototype imageProto = AbstractImagePrototype.create(images.close());
SafeHtmlBuilder mysb = new SafeHtmlBuilder();
mysb.appendHtmlConstant("<span title='" + CommonConstants.INSTANCE.RemoveFilter() + " " + value.getFilterName() + "' style='margin-right:5px;'>");
mysb.append(imageProto.getSafeHtml());
mysb.appendHtmlConstant("</span>");
sb.append(mysb.toSafeHtml());
}
};
}
示例9: addImage
import com.google.gwt.user.client.ui.AbstractImagePrototype; //导入依赖的package包/类
private Image addImage()
{
AbstractImagePrototype imageprototype = AbstractImagePrototype.create( Icons.s_instance
.strategy_padlock() );
if( GameEngine.model().getZoomDisplayed().getValue() == EnuZoom.Medium )
{
imageprototype = AbstractImagePrototype.create( Icons.s_instance.tactic_padlock() );
}
Image image = null;
if( !m_unusedImages.isEmpty() )
{
image = m_unusedImages.iterator().next();
imageprototype.applyTo( image );
image.setVisible( true );
m_unusedImages.remove( image );
}
else
{
image = imageprototype.createImage();
add( image );
DOM.setStyleAttribute( image.getElement(), "zIndex", "1000" );
image.addStyleName( "transparent50" );
}
m_usedImages.add( image );
return image;
}
示例10: getDataSourceForTypeSmallImageHtml
import com.google.gwt.user.client.ui.AbstractImagePrototype; //导入依赖的package包/类
/**
* Get the image html string for the provided datasource type
* @param dsType the dataSource type
* @return the image html
*/
public String getDataSourceForTypeSmallImageHtml(String dsType) {
String imageHtml = null;
if(dsType.equals(Constants.DS_TYPE_FILE)) {
imageHtml = AbstractImagePrototype.create(AppResource.INSTANCE.images().dsType_file_small_Image()).getHTML();
} else if(dsType.equals(Constants.DS_TYPE_ACCUMULO)) {
imageHtml = AbstractImagePrototype.create(AppResource.INSTANCE.images().dsType_accumulo_small_Image()).getHTML();
} else if(dsType.equals(Constants.DS_TYPE_GOOGLE)) {
imageHtml = AbstractImagePrototype.create(AppResource.INSTANCE.images().dsType_google_small_Image()).getHTML();
} else if(dsType.equals(Constants.DS_TYPE_H2)) {
imageHtml = AbstractImagePrototype.create(AppResource.INSTANCE.images().dsType_h2_small_Image()).getHTML();
} else if(dsType.equals(Constants.DS_TYPE_INFINISPAN)) {
imageHtml = AbstractImagePrototype.create(AppResource.INSTANCE.images().dsType_infinispan_small_Image()).getHTML();
} else if(dsType.equals(Constants.DS_TYPE_LDAP)) {
imageHtml = AbstractImagePrototype.create(AppResource.INSTANCE.images().dsType_ldap_small_Image()).getHTML();
} else if(dsType.equals(Constants.DS_TYPE_MODESHAPE)) {
imageHtml = AbstractImagePrototype.create(AppResource.INSTANCE.images().dsType_modeshape_small_Image()).getHTML();
} else if(dsType.equals(Constants.DS_TYPE_MONGODB)) {
imageHtml = AbstractImagePrototype.create(AppResource.INSTANCE.images().dsType_mongodb_small_Image()).getHTML();
} else if(dsType.equals(Constants.DS_TYPE_SALESFORCE)) {
imageHtml = AbstractImagePrototype.create(AppResource.INSTANCE.images().dsType_salesforce_small_Image()).getHTML();
} else if(dsType.equals(Constants.DS_TYPE_TEIID)) {
imageHtml = AbstractImagePrototype.create(AppResource.INSTANCE.images().dsType_teiid_small_Image()).getHTML();
} else if(dsType.equals(Constants.DS_TYPE_TEIID_LOCAL)) {
imageHtml = AbstractImagePrototype.create(AppResource.INSTANCE.images().dsType_teiid_local_small_Image()).getHTML();
} else if(dsType.equals(Constants.DS_TYPE_WEBSERVICE)) {
imageHtml = AbstractImagePrototype.create(AppResource.INSTANCE.images().dsType_webservice_small_Image()).getHTML();
} else if(dsType.toLowerCase().contains(Constants.MYSQL_FRAGMENT)) {
imageHtml = AbstractImagePrototype.create(AppResource.INSTANCE.images().dsType_mysql_small_Image()).getHTML();
} else if(dsType.toLowerCase().contains(Constants.POSTGRES_FRAGMENT)) {
imageHtml = AbstractImagePrototype.create(AppResource.INSTANCE.images().dsType_postgres_small_Image()).getHTML();
} else {
imageHtml = AbstractImagePrototype.create(AppResource.INSTANCE.images().dsType_blankbox_small_Image()).getHTML();
}
return imageHtml;
}
示例11: makeImage
import com.google.gwt.user.client.ui.AbstractImagePrototype; //导入依赖的package包/类
/**
* Make icons available as SafeHtml
*
* @param resource
* @return
*/
private static SafeHtml makeImage(ImageResource resource) {
AbstractImagePrototype proto = AbstractImagePrototype.create(resource);
// String html = proto.getHTML().replace("style='",
// "style='left:0px;top:0px;"); // position:absolute;
//
// return SafeHtmlUtils.fromTrustedString(html);
return proto.getSafeHtml();
}
示例12: drawImage
import com.google.gwt.user.client.ui.AbstractImagePrototype; //导入依赖的package包/类
private void drawImage(AbstractImagePrototype p_image, AnBoardPosition p_position)
{
Image image = m_images.getNextImage();
p_image.applyTo( image );
DOM.setStyleAttribute( image.getElement(), "zIndex", "1000" );
image.removeStyleName( "transparent50" );
setWidgetHexPosition( image, p_position );
}
示例13: getHighLightImage
import com.google.gwt.user.client.ui.AbstractImagePrototype; //导入依赖的package包/类
private AbstractImagePrototype getHighLightImage()
{
EventsPlayBuilder actionBuilder = GameEngine.model().getActionBuilder();
if( actionBuilder.getSelectedAction() != null
&& (actionBuilder.getSelectedAction().getType() == GameLogType.EvtLand || actionBuilder
.getSelectedAction().getType() == GameLogType.EvtDeployment) )
{
AnEventPlay action = (AnEventPlay)actionBuilder.getSelectedAction();
return AbstractImagePrototype.create( TokenImages.getTokenImage(
action.getToken( GameEngine.model().getGame() ), getZoom().getValue() ) );
}
return BoardIcons.hightlight_hexagon( getZoom().getValue() );
}
示例14: getStrategyFrame
import com.google.gwt.user.client.ui.AbstractImagePrototype; //导入依赖的package包/类
private AbstractImagePrototype getStrategyFrame(double p_progress)
{
switch( (int)(p_progress * 14) )
{
case 0:
return AnimationFrames.s_instance.strategy_blast01();
case 1:
return AnimationFrames.s_instance.strategy_blast02();
case 2:
return AnimationFrames.s_instance.strategy_blast03();
case 3:
return AnimationFrames.s_instance.strategy_blast04();
case 4:
return AnimationFrames.s_instance.strategy_blast05();
case 5:
return AnimationFrames.s_instance.strategy_blast06();
case 6:
return AnimationFrames.s_instance.strategy_blast07();
case 7:
return AnimationFrames.s_instance.strategy_blast08();
case 8:
return AnimationFrames.s_instance.strategy_blast09();
case 9:
return AnimationFrames.s_instance.strategy_blast10();
case 10:
return AnimationFrames.s_instance.strategy_blast11();
case 11:
return AnimationFrames.s_instance.strategy_blast12();
case 12:
return AnimationFrames.s_instance.strategy_blast13();
default:
case 13:
return AnimationFrames.s_instance.strategy_blast14();
}
}
示例15: onClick
import com.google.gwt.user.client.ui.AbstractImagePrototype; //导入依赖的package包/类
@Override
public void onClick(ClickEvent p_event)
{
TokenType token = m_tools.get( p_event.getSource() );
if( token != null )
{
m_wgtBoardEditTokens.setTokenType( token );
}
if( p_event.getSource() == m_currentTool )
{
m_wgtBoardEditTokens.setSector( m_wgtBoardEditTokens.getSector().getNext() );
}
AbstractImagePrototype.create(
TokenImages.getTokenImage( m_wgtBoardEditTokens.getColor(), EnuZoom.Medium,
m_wgtBoardEditTokens.getTokenType(), m_wgtBoardEditTokens.getSector() ) ).applyTo(
m_currentTool );
m_lblUnit.setText( Messages.getTokenString( 0, m_wgtBoardEditTokens.getTokenType() ) );
if( p_event.getSource() == m_btnOre )
{
if( m_chkOreInSea.getValue() ) {
GameEngine.generator().s_oreAllowedOnLands.add( LandType.Sea );
} else {
GameEngine.generator().s_oreAllowedOnLands.remove( LandType.Sea );
}
GameEngine.generator().s_useAllOre = m_chkUseAllOre.getValue();
GameEngine.generator().s_useOreGenerator = m_chkUseOreGenerator.getValue();
GameEngine.generator().populateOres();
m_wgtBoardEditTokens.m_layerToken.cleanToken();
AppRoot.getEventBus().fireEvent( new ModelUpdateEvent(GameEngine.model()) );
}
}