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


Java JsArrayNumber.push方法代码示例

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


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

示例1: doDeserializeArray

import com.google.gwt.core.client.JsArrayNumber; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public double[] doDeserializeArray( JsonReader reader, JsonDeserializationContext ctx, JsonDeserializerParameters params ) {
    JsArrayNumber jsArray = JsArrayNumber.createArray().cast();
    reader.beginArray();
    while ( JsonToken.END_ARRAY != reader.peek() ) {
        if ( JsonToken.NULL == reader.peek() ) {
            reader.skipValue();
            jsArray.push( DEFAULT );
        } else {
            jsArray.push( reader.nextDouble() );
        }
    }
    reader.endArray();

    if ( GWT.isScript() ) {
        return reinterpretCast( jsArray );
    } else {
        int length = jsArray.length();
        double[] ret = new double[length];
        for ( int i = 0; i < length; i++ ) {
            ret[i] = jsArray.get( i );
        }
        return ret;
    }
}
 
开发者ID:nmorel,项目名称:gwt-jackson,代码行数:27,代码来源:PrimitiveDoubleArrayJsonDeserializer.java

示例2: fromDoubles

import com.google.gwt.core.client.JsArrayNumber; //导入方法依赖的package包/类
public static JsArrayNumber fromDoubles(Collection<Double> collection) {
    JsArrayNumber array = JsArrayNumber.createArray().cast();
    for(Double item : collection) {
        array.push(item);
    }
    return array;
}
 
开发者ID:BenDol,项目名称:gwt-jui,代码行数:8,代码来源:JsArrayUtil.java

示例3: iterateConnectionProxies

import com.google.gwt.core.client.JsArrayNumber; //导入方法依赖的package包/类
private String iterateConnectionProxies(SearchResultProxy res) {
	List<ConnectionProxy> c = res.getConnections();
	Iterator<ConnectionProxy> cp_it = c.iterator();
	String total = "";
	while(cp_it.hasNext()) {
		ConnectionProxy cp = cp_it.next();
		String s = "Total distance: " + cp.getDistance() + "m: " + cp.getTime() + "min\n";
		Iterator<LineProxy> i = cp.getLines().iterator();
		while(i.hasNext()) {
			LineProxy lp = i.next();
			s += lp.toString();
			if(lp.getStartStreet() != null && lp.getDestStreet() != null) {
				s += " desde " + lp.getStartStreet() + " hasta " + lp.getDestStreet();
			}
			s += " /distance: " + lp.getDistance() + "m: " + lp.getTime() + "min\n";
			if(lp.getAlternativeLines().size() > 0) {
				s += "Alternatives: ";
				for(String ss : lp.getAlternativeLines()) {
					s += ss + ", ";
				}
				s = s.substring(0, s.length() - 2);
				s += "\n";
			}
			JsArrayNumber jsnums = getNativeArray();
			for(int j = 0; j < lp.getAllPoints().size(); j++) {
				jsnums.push(lp.getAllPoints().get(j));
			}
			drawPoly(jsnums, false, "#000000");
			jsnums = getNativeArray();
			for(int j = 0; j < lp.getRelevantPoints().size(); j++) {
				jsnums.push(lp.getRelevantPoints().get(j));
			}
			drawPoly(jsnums, false, "#ff0000");
		}
		s += "\n";
		total += s;
	}
	return total;
}
 
开发者ID:Hellek1,项目名称:viaja-facil,代码行数:40,代码来源:AdminInterface.java

示例4: setVisibleRange

import com.google.gwt.core.client.JsArrayNumber; //导入方法依赖的package包/类
public void setVisibleRange(double... values) {
	JsArrayNumber array = JsArrayNumber.createArray().cast();
	for (double value : values) {
		array.push(value);
	}
	_setVisibleRange(array);
}
 
开发者ID:ahome-it,项目名称:ahome-touch,代码行数:8,代码来源:AbstractAxis.java

示例5: updateSliderForNumberArray

import com.google.gwt.core.client.JsArrayNumber; //导入方法依赖的package包/类
private void updateSliderForNumberArray(SliderOption option, List<Double> value) {
    JsArrayNumber array = JavaScriptObject.createArray().cast();
    for (Double val : value) {
        array.push(val);
    }
    if (isAttached()) {
        setAttribute(getElement(), option.getName(), array);
        refresh();
    } else {
        String arrayStr = JsonUtils.stringify(array);
        attributeMixin.setAttribute(option.getDataAttribute(), arrayStr);
    }
}
 
开发者ID:gwtbootstrap3,项目名称:gwtbootstrap3-extras,代码行数:14,代码来源:SliderBase.java

示例6: toJsArray

import com.google.gwt.core.client.JsArrayNumber; //导入方法依赖的package包/类
/**
 * Converts the range to a JavaScript number array.
 *
 * @return a JavaScript number array
 */
public JsArrayNumber toJsArray() {
    JsArrayNumber array = JavaScriptObject.createArray().cast();
    array.push(minValue);
    array.push(maxValue);
    return array;
}
 
开发者ID:gwtbootstrap3,项目名称:gwtbootstrap3-extras,代码行数:12,代码来源:Range.java

示例7: setData

import com.google.gwt.core.client.JsArrayNumber; //导入方法依赖的package包/类
public final void setData(double[] data){
	JsArrayNumber array = JsArrayNumber.createArray().cast();
	for(double str : data)
		array.push(str);
	setData(array);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:7,代码来源:AreaSeries.java

示例8: toJsonText

import com.google.gwt.core.client.JsArrayNumber; //导入方法依赖的package包/类
/**
 * i can't trust this maybe 2 influence fixed
 * @return
 */
public String toJsonText(){
	JsArray<AnimationBone> clonedBone=cloneBones(bones);
	JSONArray arrays=new JSONArray(clonedBone);
	lastJsonObject.put("bones", arrays);
	//AnimationBoneConverter.setBoneAngles(clonedBone, rawAnimationData, 0); //TODO
	if(withAnimation.getValue()){
		lastJsonObject.put("animation", new JSONObject(rawAnimationData));
	}
	//private JsArray<Vector4> bodyIndices;
	//private JsArray<Vector4> bodyWeight;
	/*
	List<String> lines=new ArrayList<String>();
	for(int i=0;i<bodyWeight.length();i++){
		lines.add(i+get(bodyWeight.get(i)));
	}
	LogUtils.log("after");
	LogUtils.log(Joiner.on("\n").join(lines));f
	*/
	
	//LogUtils.log(bodyIndices);
	
	//LogUtils.log(bodyWeight);
	JsArrayNumber indices=(JsArrayNumber) JsArrayNumber.createArray();
	for(int i=0;i<bodyIndices.length();i++){
		indices.push(bodyIndices.get(i).getX());
		indices.push(bodyIndices.get(i).getY());
	}
	lastJsonObject.put("skinIndices", new JSONArray(indices));
	
	JsArrayNumber weights=(JsArrayNumber) JsArrayNumber.createArray();
	for(int i=0;i<bodyWeight.length();i++){
		weights.push(bodyWeight.get(i).getX());
		weights.push(bodyWeight.get(i).getY());
	}
	lastJsonObject.put("skinWeights", new JSONArray(weights));
	
	//rewrite gen
	
	JSONModelFile file=(JSONModelFile) lastJsonObject.getJavaScriptObject();
	file.getMetaData().setGeneratedBy(getGeneratedBy());
	
	return stringify(lastJsonObject.getJavaScriptObject());
	//return lastJsonObject.toString();
}
 
开发者ID:akjava,项目名称:GWTModelWeight,代码行数:49,代码来源:CopyOfGWTModelWeight.java

示例9: setWindowPaddingTopRightBottomLeft

import com.google.gwt.core.client.JsArrayNumber; //导入方法依赖的package包/类
/**
 * Sets the window padding to top, right, bottom, and right sides. This
 * is useful in cases where the window has areas that the drop-down menu
 * should not cover - for instance a fixed header.
 *
 * @param top
 * @param right
 * @param bottom
 * @param left
 */
public void setWindowPaddingTopRightBottomLeft(final int top, final int right,
        final int bottom, final int left) {
    JsArrayNumber array = JavaScriptObject.createArray(4).cast();
    array.push(top);
    array.push(right);
    array.push(bottom);
    array.push(left);
    attrMixin.setAttribute(WINDOW_PADDING, JsonUtils.stringify(array));
}
 
开发者ID:gwtbootstrap3,项目名称:gwtbootstrap3-extras,代码行数:20,代码来源:SelectBase.java

示例10: createAnimation

import com.google.gwt.core.client.JsArrayNumber; //导入方法依赖的package包/类
public AnimationClip createAnimation(int boneIndex,double x,double y,double z,boolean both){
	
	Quaternion q=THREE.Quaternion();
	
	Quaternion xq=THREE.Quaternion().setFromAxisAngle(THREE.Vector3(1, 0, 0), x);
	q.multiply(xq);
	
	Quaternion yq=THREE.Quaternion().setFromAxisAngle(THREE.Vector3(0, 1, 0), y);
	q.multiply(yq);
	
	Quaternion zq=THREE.Quaternion().setFromAxisAngle(THREE.Vector3(0, 0, 1), z);
	q.multiply(zq);
	
	Quaternion q2=THREE.Quaternion();
	
	Quaternion xq2=THREE.Quaternion().setFromAxisAngle(THREE.Vector3(1, 0, 0), x*-1);
	q2.multiply(xq2);
	
	Quaternion yq2=THREE.Quaternion().setFromAxisAngle(THREE.Vector3(0, 1, 0), y*-1);
	q2.multiply(yq2);
	
	Quaternion zq2=THREE.Quaternion().setFromAxisAngle(THREE.Vector3(0, 0, 1), z*-1);
	q2.multiply(zq2);
	
	double duration=1.0;
	
	JsArray<KeyframeTrack> tracks=JavaScriptObject.createArray().cast();
	
	JsArrayNumber times=JavaScriptObject.createArray().cast();
	times.push(0);
	times.push(duration);
	times.push(duration*2);
	if(both){
	times.push(duration*3);
	times.push(duration*4);
	}
	JsArrayNumber values=JsArray.createArray().cast();
	
	
	
	
	
	JavaScriptUtils.concat(values,THREE.Quaternion().toArray());
	JavaScriptUtils.concat(values,q.toArray());
	JavaScriptUtils.concat(values,THREE.Quaternion().toArray());
	if(both){
		JavaScriptUtils.concat(values,q2.toArray());
		JavaScriptUtils.concat(values,THREE.Quaternion().toArray());
	}
	
	//LogUtils.log(values);
	
	//value is not valid number
	
	//head fixed
	//quaternion is alias for rot
	QuaternionKeyframeTrack track=THREE.QuaternionKeyframeTrack(".bones["+boneIndex+"].quaternion", times, values);
	
	tracks.push(track);
	
	AnimationClip clip=THREE.AnimationClip(name, -1, tracks);
	//LogUtils.log(track.validate());
	
	return clip;
}
 
开发者ID:akjava,项目名称:GWTModelWeight,代码行数:66,代码来源:QuickBoneAnimationWidget.java


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