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


Java Encoder.writeStatement方法代码示例

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


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

示例1: initialize

import java.beans.Encoder; //导入方法依赖的package包/类
@Override
        protected void initialize(Class type, Object oldInstance,
                Object newInstance, Encoder out) {
//            p("image painter delegate called");
            super.initialize(type, oldInstance,  newInstance, out);
            //p("old instance = " + oldInstance);
            //p("owner = " + ((XMLEncoder)out).getOwner());
            PersistenceOwner owner = (PersistenceOwner)((XMLEncoder)out).getOwner();
            ImagePainter ip = (ImagePainter)oldInstance;
//            p("need to convert string: " + ip.getImageString());
//            String s = owner.toXMLURL(ip.getImageString());
//            p("converted to: " + s);
                //out.writeExpression(new Expression(oldInstance,owner,"fromXMLURL",new Object[]{ip.getImageString()}));
                //out.writeStatement(new Statement(owner,"fromXMLURL",new Object[]{ip.getImageString()}));
                //out.writeStatement(new Statement(oldInstance,"setImageString",new Object[]{
                //new Expression(oldInstance,owner,"fromXMLURL",new Object[]{ip.getImageString()})
                //}));
                
            out.writeStatement(new Statement(oldInstance,"setResolver",new Object[]{owner}));
//            out.writeStatement(new Statement(oldInstance,"setImageString",new Object[]{s}));
        }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:22,代码来源:PainterUtil.java

示例2: initialize

import java.beans.Encoder; //导入方法依赖的package包/类
@Override
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    super.initialize(type, oldInstance, newInstance, out);

    Public<String, String> map = (Public) oldInstance;
    for (Entry<String, String> entry : map.getAll()) {
        String[] args = {entry.getKey(), entry.getValue()};
        out.writeStatement(new Statement(oldInstance, "put", args));
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:11,代码来源:Test8013416.java

示例3: initialize

import java.beans.Encoder; //导入方法依赖的package包/类
@Override
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
  java.util.Collection oldO = (java.util.Collection) oldInstance;
  java.util.Collection newO = (java.util.Collection) newInstance;

  if (newO.size() != 0) {
    out.writeStatement(new Statement(oldInstance, "clear", new Object[] {}));
  }
  for (Iterator i = oldO.iterator(); i.hasNext();) {
    out.writeStatement(new Statement(oldInstance, "add", new Object[] {i.next()}));
  }
}
 
开发者ID:mini666,项目名称:hive-phoenix-handler,代码行数:13,代码来源:Utilities.java

示例4: initialize

import java.beans.Encoder; //导入方法依赖的package包/类
protected void initialize(Class type, Object oldInstance, Object newInstance,
                          Encoder out)
{
  Iterator ite = ((Collection) oldInstance).iterator();

  while (ite.hasNext())
    {
      out.writeStatement(new Statement(oldInstance, "add",
                                       new Object[] { ite.next() }));

    }

}
 
开发者ID:vilie,项目名称:javify,代码行数:14,代码来源:CollectionPersistenceDelegate.java

示例5: initialize

import java.beans.Encoder; //导入方法依赖的package包/类
protected void initialize(Class type, Object oldInstance, Object newInstance,
                          Encoder out)
{
  Map map = (Map) oldInstance;
  Iterator ite = map.keySet().iterator();

  while (ite.hasNext())
    {
      Object key = ite.next();
      out.writeStatement(new Statement(oldInstance, "put",
                                       new Object[] { key, map.get(key) }));

    }

}
 
开发者ID:vilie,项目名称:javify,代码行数:16,代码来源:MapPersistenceDelegate.java

示例6: instantiate

import java.beans.Encoder; //导入方法依赖的package包/类
@Override
protected Expression instantiate(Object oldInstance, Encoder out) {
    Area a = (Area)oldInstance;
    
    //use the default constructor
    AffineTransform tx = new AffineTransform();
    PathIterator itr = a.getPathIterator(tx);
    
    GeneralPath path = new GeneralPath();
    out.writeExpression(new Expression(path, GeneralPath.class, "new", new Object[0]));
    
    while (!itr.isDone()) {
        float[] segment = new float[6]; //must use floats because lineTo etc use floats
        int pathType = itr.currentSegment(segment);
        
        switch (pathType) {
            case PathIterator.SEG_CLOSE:
                out.writeStatement(new Statement(path, "closePath", new Object[0]));
                break;
            case PathIterator.SEG_CUBICTO:
                out.writeStatement(new Statement(path, "curveTo", new Object[] {segment[0], segment[1], segment[2], segment[3], segment[4], segment[5]}));
                break;
            case PathIterator.SEG_LINETO:
                out.writeStatement(new Statement(path, "lineTo", new Object[] {segment[0], segment[1]}));
                break;
            case PathIterator.SEG_MOVETO:
                out.writeStatement(new Statement(path, "moveTo", new Object[] {segment[0], segment[1]}));
                break;
            case PathIterator.SEG_QUADTO:
                out.writeStatement(new Statement(path, "quadTo", new Object[] {segment[0], segment[1], segment[2], segment[3]}));
                break;
        }
        itr.next();
    }
    
    return new Expression(a, Area.class, "new", new Object[] {path});
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:38,代码来源:PainterPropertyEditor.java

示例7: initialize

import java.beans.Encoder; //导入方法依赖的package包/类
@Override
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
    GeneralPath a = (GeneralPath)oldInstance;
    
    AffineTransform tx = new AffineTransform();
    PathIterator itr = a.getPathIterator(tx);
    
    out.writeStatement(new Statement(a, "setWindingRule", new Object[] {a.getWindingRule()}));
    
    while (!itr.isDone()) {
        float[] segment = new float[6]; //must use floats because lineTo etc use floats
        int pathType = itr.currentSegment(segment);
        
        switch (pathType) {
            case PathIterator.SEG_CLOSE:
                out.writeStatement(new Statement(a, "closePath", new Object[0]));
                break;
            case PathIterator.SEG_CUBICTO:
                out.writeStatement(new Statement(a, "curveTo", new Object[] {segment[0], segment[1], segment[2], segment[3], segment[4], segment[5]}));
                break;
            case PathIterator.SEG_LINETO:
                out.writeStatement(new Statement(a, "lineTo", new Object[] {segment[0], segment[1]}));
                break;
            case PathIterator.SEG_MOVETO:
                out.writeStatement(new Statement(a, "moveTo", new Object[] {segment[0], segment[1]}));
                break;
            case PathIterator.SEG_QUADTO:
                out.writeStatement(new Statement(a, "quadTo", new Object[] {segment[0], segment[1], segment[2], segment[3]}));
                break;
        }
        itr.next();
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:34,代码来源:PainterPropertyEditor.java

示例8: testWriteStatement_Null

import java.beans.Encoder; //导入方法依赖的package包/类
public void testWriteStatement_Null() {
    Encoder enc = new Encoder();
    try {
        enc.writeStatement(null);
        fail("NPE expected");
    } catch (NullPointerException e) {
        // expected
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:10,代码来源:EncoderTest.java

示例9: initialize

import java.beans.Encoder; //导入方法依赖的package包/类
protected void initialize( Class type, Object oldInstance, Object newInstance, Encoder out ) {
    Point2D point = (Point2D) oldInstance;
    out.writeStatement( new Statement( oldInstance,
                                       "setLocation",
                                       new Object[] { new Double( point.getX() ), new Double( point.getY() ) } ) );
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:7,代码来源:Point2DPersistenceDelegate.java


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