org.eclipse.swt.widgets.Canvas.getAdapter()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(168)

本文整理了Java中org.eclipse.swt.widgets.Canvas.getAdapter()方法的一些代码示例,展示了Canvas.getAdapter()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Canvas.getAdapter()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Canvas
类名称:Canvas
方法名:getAdapter

Canvas.getAdapter介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

@Override
@SuppressWarnings( "unchecked" )
public <T> T getAdapter( Class<T> adapter ) {
 if( adapter == WidgetLCA.class ) {
  return ( T )CLabelLCA.INSTANCE;
 }
 return super.getAdapter( adapter );
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

@Override
@SuppressWarnings("unchecked")
public <T> T getAdapter( Class<T> adapter ) {
 if( adapter == IFileUploadAdapter.class ) {
  return ( T )fileUploadAdapter;
 }
 if( adapter == WidgetLCA.class ) {
  return ( T )FileUploadLCA.INSTANCE;
 }
 return super.getAdapter( adapter );
}

代码示例来源:origin: com.eclipsesource.tabris/tabris

@SuppressWarnings({ "unchecked", "deprecation" })
@Override
public <T> T getAdapter( Class<T> adapter ) {
 T result = super.getAdapter( adapter );
 if( adapter == DrawingsCache.class ) {
  result = ( T )cache;
 } else if( adapter == WidgetLifeCycleAdapter.class || adapter == org.eclipse.rap.rwt.lifecycle.WidgetLifeCycleAdapter.class ) {
  return ( T )CLIENT_CANVAS_LCA;
 } else if( adapter == List.class ) {
  return ( T )drawListeners;
 }
 return result;
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

@Override
@SuppressWarnings("unchecked")
public <T> T getAdapter( Class<T> adapter ) {
 if( adapter == MenuHolder.class ) {
  if( menuHolder == null ) {
   menuHolder = new MenuHolder();
  }
  return ( T )menuHolder;
 }
 return super.getAdapter( adapter );
}

代码示例来源:origin: com.eclipsesource.tabris/tabris

@Override
 public void run() {
  DrawingsCache cache = control.getAdapter( DrawingsCache.class );
  JsonValue drawings = properties.get( DRAWINGS_PROPERTY );
  if( drawings != null ) {
   cache.cache( drawings.asString() );
   cache.clearRemoved();
   fireDrawEvent( ( ClientCanvas )control );
  }
 }
} );

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07

private static void writeGCOperations( final Canvas canvas )
  throws IOException
 {
  IGCAdapter adapter = ( IGCAdapter )canvas.getAdapter( IGCAdapter.class );
  GCOperation[] operations = adapter.getTrimmedGCOperations();
  if( operations.length > 0 || adapter.getForceRedraw() ) {
   GCOperationWriter operationWriter = new GCOperationWriter( canvas );
   operationWriter.initialize();
   for( int i = 0; i < operations.length; i++ ) {
    operationWriter.write( operations[ i ] );
   }
  }
  adapter.clearGCOperations();
  adapter.setForceRedraw( false );
 }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

private static void writeGCOperations( Canvas canvas ) {
 GCAdapter adapter = canvas.getAdapter( GCAdapter.class );
 GCOperation[] operations = adapter.getTrimmedGCOperations();
 if( operations.length > 0 || adapter.getForceRedraw() ) {
  GCOperationWriter operationWriter = new GCOperationWriter( canvas );
  operationWriter.initialize();
  for( int i = 0; i < operations.length; i++ ) {
   operationWriter.write( operations[ i ] );
  }
  operationWriter.render();
 }
 adapter.clearGCOperations();
 adapter.setForceRedraw( false );
}

相关文章

Canvas类方法