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


Java LogUtils.log方法代码示例

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


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

示例1: autoWeight

import com.akjava.gwt.lib.client.LogUtils; //导入方法依赖的package包/类
public static void autoWeight(Geometry geometry,JsArray<AnimationBone> bones,List<List<Vector3>> endSites,int mode,JsArray<Vector4> bodyIndices,JsArray<Vector4> bodyWeight){
LogUtils.log("makehuman-auto-weight:");
List<NameAndVector3> nameAndPositions=boneToNameAndPosition(bones,endSites);
for(int i=0;i<geometry.vertices().length();i++){
	Vector4 ret=null;
	if(mode==MODE_MAKEHUMAN_SECOND_LIFE19){
		ret=makehuman(nameAndPositions, bones, geometry, i);
	}else{
		Window.alert("null mode");
	}
	
	//now support only 2 bones
	Vector4 v4=THREE.Vector4();
	v4.set(ret.getX(), ret.getY(), 0, 0);
	bodyIndices.push(v4);
	
	Vector4 v4w=THREE.Vector4();
	v4w.set(ret.getZ(), ret.getW(), 0, 0);
	bodyWeight.push(v4w);
	}
}
 
开发者ID:akjava,项目名称:GWTModelWeight,代码行数:22,代码来源:MakehumanWeightBuilder.java

示例2: selectVertex

import com.akjava.gwt.lib.client.LogUtils; //导入方法依赖的package包/类
private void selectVertex(int index){
	if(lastSelection!=-1){
		vertexMeshs.get(lastSelection).getMaterial().gwtGetColor().setHex(getVertexColor(lastSelection));
	}
	Vector4 in=bodyIndices.get(index);
	Vector4 we=bodyWeight.get(index);
	
	LogUtils.log("select:"+index+","+we.getX()+","+we.getY());
	
	//change selected point to selection color,multiple selection is avaiable and to detect change point color.
	vertexMeshs.get(index).getMaterial().gwtGetColor().setHex(selectColor);
	
	indexWeightEditor.setAvailable(true);
	updateWeightButton.setEnabled(true);
	
	indexWeightEditor.setValue(index, in, we);
	
	//show which point selection,with wireframe weight-color
	boneSelectionIndicateBoxMesh.setVisible(true);
	boneSelectionIndicateBoxMesh.setPosition(vertexMeshs.get(index).getPosition());
	boneSelectionIndicateBoxMesh.getMaterial().gwtGetColor().setHex(getVertexColor(index));
	
	stackPanel.showWidget(1); //bone & weight panel
	lastSelection=index;
}
 
开发者ID:akjava,项目名称:GWTModelWeight,代码行数:26,代码来源:CopyOfGWTModelWeight.java

示例3: drawImage

import com.akjava.gwt.lib.client.LogUtils; //导入方法依赖的package包/类
protected void drawImage(ImageElement img) {
	try{
	
	//need for some transparent image
	canvas.getContext2d().clearRect(0, 0, canvas.getCoordinateSpaceWidth(), canvas.getCoordinateSpaceHeight());
	
	//canvas.getContext2d().save();
	
	//no need to flip
	//canvas.getContext2d().translate(originImage.getCoordinateSpaceWidth(), 0); //flip horizontal
	//canvas.getContext2d().scale(-1, 1);
	//canvas.getContext2d().transform(-1, 0, 0, 1, 0, 0);
	canvas.getContext2d().drawImage(selection.getImageElement(), 0, 0);
	//canvas.getContext2d().restore();
	
	}catch(Exception e){
		LogUtils.log("error:"+e.getMessage());
	}
	
	//canvas.getContext2d().setFillStyle("rgba(0,0,0,0)");
	//canvas.getContext2d().setGlobalCompositeOperation("destination-out");
	//canvas.getContext2d().fillRect(100, 100, 100, 100);
}
 
开发者ID:akjava,项目名称:gwthtml5apps,代码行数:24,代码来源:TransparentIt.java

示例4: copyValue

import com.akjava.gwt.lib.client.LogUtils; //导入方法依赖的package包/类
public void copyValue(VertexBoneData copyFrom) {
	if(value==null){
		LogUtils.log("selection is null");
		return;
	}
	if(value.getVertexIndex()!=copyFrom.getVertexIndex()){
		LogUtils.log("vertexindex not same");
		return;
	}
	
	value.getIndices().copy(copyFrom.getIndices());
	value.getWeights().copy(copyFrom.getWeights());
	setValue(value);
	
}
 
开发者ID:akjava,项目名称:GWTModelWeight,代码行数:16,代码来源:VertexBoneDataEditor.java

示例5: updateImageSize

import com.akjava.gwt.lib.client.LogUtils; //导入方法依赖的package包/类
private void updateImageSize(){
	int selection=sizeBox.getSelectedIndex();
	if(selection==0){
		image.getElement().removeAttribute("style");//I'm not sure right way to remove width
		image.setHeight("100%");
	}else if(selection==1){
		image.getElement().removeAttribute("style");
		image.setWidth("100%");
	}else{
		image.getElement().removeAttribute("style");
		
	}
	
	LogUtils.log(image);
}
 
开发者ID:akjava,项目名称:gwthtml5apps,代码行数:16,代码来源:GifPlayer.java

示例6: execBoneIndicesReplace

import com.akjava.gwt.lib.client.LogUtils; //导入方法依赖的package包/类
protected void execBoneIndicesReplace() {
	AnimationBone srcBone=boneReplaceSrcBox.getValue();
	AnimationBone destBone=boneReplaceDestBox.getValue();
	if(srcBone==null || destBone==null){
		LogUtils.log("execBoneIndicesReplace:null bone");
		return;
	}
	if(srcBone==destBone){
		LogUtils.log("execBoneIndicesReplace:same bone");
		return;
	}
	
	int srcIndex=baseCharacterModelBones.indexOf(srcBone);
	int destIndex=baseCharacterModelBones.indexOf(destBone);
	
	if(srcIndex==-1 || destIndex==-1){
		LogUtils.log("execBoneIndicesReplace:not indexOf");
		return;
	}
	
	for(int i=0;i<editingGeometry.getSkinIndices().length();i++){
		Vector4 vec4=editingGeometry.getSkinIndices().get(i);
		for(int j=0;j<4;j++){
			double value=vec4.gwtGet(j);
			if(value==srcIndex){
				vec4.gwtSet(j, destIndex);
			}
		}
	}
	
	createEditingClothSkin();
	updateSelectionBoneInfluence();
}
 
开发者ID:akjava,项目名称:GWTModelWeight,代码行数:34,代码来源:GWTModelWeight.java

示例7: getVertexColor

import com.akjava.gwt.lib.client.LogUtils; //导入方法依赖的package包/类
public int getVertexColor(int vertexIndex,int boneIndex){
	
	double v=0;
	
	Vector4 indices=geometry.getSkinIndices().get(vertexIndex);
	
	if(indices==null){
		LogUtils.log("no skinIndices: at "+vertexIndex+","+(geometry.getSkinIndices()==null?"null indices":"length="+geometry.getSkinIndices().length()));
	}
	
	for(int i=0;i<4;i++){
		if(indices.gwtGet(i)==boneIndex){
			v+=geometry.getSkinWeights().get(vertexIndex).gwtGet(i);
		}
	}
	
	if(v==1){
		return 0xffffff;
	}else if(v==0){
		return 0;
	}
	
	int[] cv=toColorByDouble(v);
	
	int color=ColorUtils.toColor(cv);
	return color;
	
}
 
开发者ID:akjava,项目名称:GWTModelWeight,代码行数:29,代码来源:BoneVertexColorTools.java

示例8: selectBone

import com.akjava.gwt.lib.client.LogUtils; //导入方法依赖的package包/类
private void selectBone(Object3D target) {
	
	lastSelection=-1;
	//right now off boneSelectionMesh
	double boneSelectionSize=0.1*baseScale;
	if(boneSelectionMesh==null){
		boneSelectionMesh=THREE.Mesh(THREE.BoxGeometry(boneSelectionSize, boneSelectionSize, boneSelectionSize), THREE.MeshLambertMaterial(
				GWTParamUtils.MeshLambertMaterial().color(0x00ff00)
				));
		boneAndVertex.add(boneSelectionMesh);
	}else{
		
	}
	
	boneSelectionMesh.setVisible(false);//temporaly
	boneSelectionMesh.setPosition(target.getPosition());
	
	changeBoneSelectionColor(target.getName());
	
	
	selectionBoneIndex=findBoneIndex(target.getName());
	
	boneListBox.setSelectedIndex(selectionBoneIndex);
	selectVertexsByBone(selectionBoneIndex);
	
	int selectionIndex=indexWeightEditor.getArrayIndex();
	
	
	if(vertexMeshs.size()<=selectionIndex){
		LogUtils.log("some how vertexMesh index problem:"+vertexMeshs.size());
		return;
	}
	
	if(selectionIndex!=-1 && !vertexMeshs.get(selectionIndex).isVisible()){
		indexWeightEditor.setAvailable(false);
		updateWeightButton.setEnabled(false);
		boneSelectionIndicateBoxMesh.setVisible(false);
	}
	
}
 
开发者ID:akjava,项目名称:GWTModelWeight,代码行数:41,代码来源:CopyOfGWTModelWeight.java

示例9: autoWeight

import com.akjava.gwt.lib.client.LogUtils; //导入方法依赖的package包/类
private void autoWeight(){
	clearBodyIndicesAndWeightArray();
	LogUtils.log(loadedGeometry);
	
	//have valid skinIndices and weight use from that.
	if(GWTGeometryUtils.isValidSkinIndicesAndWeight(loadedGeometry)){
		WeightBuilder.autoWeight(loadedGeometry, bones, endSites,WeightBuilder.MODE_FROM_GEOMETRY, bodyIndices, bodyWeight);
	
		//changeAutoWeightListBox(0);
		
		//wait must be 1.0
		for(int i=0;i<bodyWeight.length();i++){
			Vector4 vec4=bodyWeight.get(i);
			double total=vec4.getX()+vec4.getY();
			double remain=(1.0-total)/2;
			//vec4.setX(vec4.getX()+remain);// i guess this is problem
			//vec4.setY(vec4.getY()+remain);
		}
		/*
		List<String> lines=new ArrayList<String>();
		for(int i=0;i<bodyWeight.length();i++){
			lines.add(i+get(bodyWeight.get(i)));
		}
		LogUtils.log("before:");
		LogUtils.log(Joiner.on("\n").join(lines));
		*/
		
	}else{
		LogUtils.log("empty indices&weight auto-weight from geometry:this action take a time");
		//can't auto weight algo change? TODO it
		WeightBuilder.autoWeight(loadedGeometry, bones, endSites,WeightBuilder.MODE_MODE_Start_And_Half_ParentAndChildrenAgressive, bodyIndices, bodyWeight);
		//changeAutoWeightListBox(1);
	}
}
 
开发者ID:akjava,项目名称:GWTModelWeight,代码行数:35,代码来源:CopyOfGWTModelWeight.java

示例10: parseJsonObject

import com.akjava.gwt.lib.client.LogUtils; //导入方法依赖的package包/类
private JSONObject parseJsonObject(String jsonText){
	JSONValue lastJsonValue = JSONParser.parseStrict(jsonText);
	JSONObject object=lastJsonValue.isObject();
	if(object==null){
		LogUtils.log("invalid-json object");
	}
	return object;
}
 
开发者ID:akjava,项目名称:GWTModelWeight,代码行数:9,代码来源:CopyOfGWTModelWeight.java

示例11: pickBone

import com.akjava.gwt.lib.client.LogUtils; //导入方法依赖的package包/类
public int pickBone(int mx,int my){
	int result=-1;
	
	JsArray<Intersect> intersects=pickIntersects(mx,my,group.getChildren());
	if(intersects!=null && intersects.length()>0){
		Object3D object=intersects.get(0).getObject();
		String[] name=object.getName().split(":");
		if(name.length>1){
			String boneName=name[1];
			Integer boneIndex=boneMap.get(boneName);
			if(boneIndex==null){
				LogUtils.log("invalid bone not exist:"+boneName);
			}else{
				
				setBoneSelection(boneName);
				
				return boneIndex;
			}
		}else{
			LogUtils.log("invalid selection bone name:"+object.getName());
		}
	}
	
	//TODO update selected bone-mesh color
	if(enableUnselectFromPick){
		setBoneSelection(null);
	}
	
	return result;
}
 
开发者ID:akjava,项目名称:GWTModelWeight,代码行数:31,代码来源:BoneMeshMouseSelector.java

示例12: doReset

import com.akjava.gwt.lib.client.LogUtils; //导入方法依赖的package包/类
protected void doReset() {
	if(selection==null){
		canvas.setVisible(false);
		return;
	}
	currentCommand=new DataUriCommand();
	currentCommand.setBeforeUri(canvas.toDataUrl("image/png"));
	
	
	
	//canvas.getContext2d().save();
	//canvas.getContext2d().setGlobalCompositeOperation(Composite.COPY);//seems broken in Chrome32
	//canvas.getContext2d().translate(originImage.getCoordinateSpaceWidth(), 0); //flip horizontal
	//canvas.getContext2d().scale(-1, 1);
	canvas.getContext2d().clearRect(0, 0, canvas.getCoordinateSpaceWidth(), canvas.getCoordinateSpaceHeight());
	//no need to flip
	//canvas.getContext2d().translate(originImage.getCoordinateSpaceWidth(), 0); //flip horizontal
	//canvas.getContext2d().scale(-1, 1);
	//canvas.getContext2d().transform(-1, 0, 0, 1, 0, 0);
	canvas.getContext2d().drawImage(selection.getImageElement(), 0, 0);
	//canvas.getContext2d().restore();
	
	String dataUrl=canvas.toDataUrl("image/png");
	currentCommand.setAfterUri(dataUrl);
	
	
	undoBt.setEnabled(true);
	redoBt.setEnabled(false);
	updateCurrentSelectionDataUrl(dataUrl);
	
	LogUtils.log("after-reset:"+canvas.getContext2d().getGlobalCompositeOperation());
}
 
开发者ID:akjava,项目名称:gwthtml5apps,代码行数:33,代码来源:TransparentIt.java

示例13: loadFile

import com.akjava.gwt.lib.client.LogUtils; //导入方法依赖的package包/类
protected void loadFile(final File file,final String asStringText) {
	try{
		//TODO create method
	
	new ImageElementLoader().load(asStringText, new ImageElementListener() {
		@Override
		public void onLoad(ImageElement element) {
			LogUtils.log(file.getFileName()+","+element.getWidth()+"x"+element.getHeight());
			
			
			final ImageElementData data=new ImageElementData(file.getFileName(),element,asStringText);
			
			EasyCellTableObjects.addItem(data);
			
			//stack on mobile,maybe because of called async method
			Scheduler.get().scheduleDeferred(new ScheduledCommand() {
				@Override
				public void execute() {
					EasyCellTableObjects.setSelected(data, true);
				}
			});
		}
		
		@Override
		public void onError(String url, ErrorEvent event) {
			Window.alert(event.toDebugString());
		}
		
		
	});
	
	
	
	//doSelecct(data);//only way to update on Android Chrome
	}catch (Exception e) {
		e.printStackTrace();
		LogUtils.log(e.getMessage());
	}
	
	
}
 
开发者ID:akjava,项目名称:gwthtml5apps,代码行数:42,代码来源:TransparentIt.java

示例14: onEditingClothJsonLoaded

import com.akjava.gwt.lib.client.LogUtils; //导入方法依赖的package包/类
public void onEditingClothJsonLoaded(String text){

		JSONObject jsonObject=parseJSONGeometry(text);
		editingGeometryJsonObject=jsonObject;
		
		
		editingGeometryOrigin=THREE.JSONLoader().parse(jsonObject.getJavaScriptObject()).getGeometry();
		
		//TODO bone check
		
		//TODO make gwtCloneWithBones()
		
		
		editingGeometry=THREE.JSONLoader().parse(jsonObject.getJavaScriptObject()).getGeometry();
	
		setInfluencePerVertexFromJSON(editingGeometry,jsonObject);
		
		boolean needAutoSkinning=editingGeometry.getSkinIndices()==null || editingGeometry.getSkinIndices().length()==0;
		//todo more check
		
		if(editingGeometry.getBones()==null || editingGeometry.getBones().length()==0){
			needAutoSkinning=true;
		}else{
			if(editingGeometry.getBones().length()!=baseCharacterModelGeometry.getBones().length()){
				LogUtils.log("editingGeometry has bone,but size different:base-bone-size="+baseCharacterModelGeometry.getBones().length()+",editing-size="+editingGeometry.getBones().length());
				needAutoSkinning=true;
			}	
		}
		
		if(needAutoSkinning){
			//Window.alert("has no skin indices");
			LogUtils.log("No skin indices.it would auto skinning.");
			Stopwatch watch=LogUtils.stopwatch();
			editingGeometry.computeBoundingBox();
			//double maxDistance=editingGeometry.getBoundingBox().getMax().distanceTo(editingGeometry.getBoundingBox().getMin());
			int influence=3;
			WeightResult result= new SimpleAutoWeight(influence).autoWeight(editingGeometry, baseCharacterModelGeometry.getBones());
			result.insertToGeometry(editingGeometry);
			//new CloseVertexAutoWeight().autoWeight(editingGeometry, baseCharacterModelGeometry,maxDistance).insertToGeometry(editingGeometry);
			//LogUtils.millisecond("auto-weight vertex="+editingGeometry.getVertices().length(), watch);
			//editingGeometry.gwtSetInfluencesPerVertex(baseCharacterModelGeometry.gwtGetInfluencesPerVertex());
			editingGeometry.gwtSetInfluencesPerVertex(influence);
			
			editingGeometryOrigin.gwtSetInfluencesPerVertex(baseCharacterModelGeometry.gwtGetInfluencesPerVertex());
			editingGeometry.gwtHardCopyToWeightsAndIndices(editingGeometryOrigin);
		}
		
		
		createEditingClothSkin();
		createEditingClothWireframe();
		createVertexSelections();
	}
 
开发者ID:akjava,项目名称:GWTModelWeight,代码行数:53,代码来源:GWTModelWeight.java

示例15: autoBalanceWeights

import com.akjava.gwt.lib.client.LogUtils; //导入方法依赖的package包/类
protected void autoBalanceWeights(Vector4 weights,int target,double newvalue) {
		if(newvalue<0 || newvalue>1){
			LogUtils.log("invalid newvalue(0-1.0):"+newvalue);
		}
		if(target<0 || target>3){
			LogUtils.log("invalid target(0-3):"+target);
		}
		//ThreeLog.log("before:",weights);
		//ThreeLog.log("target="+target+",value="+newvalue);
		
		double remain=1.0-newvalue;
		double total=0;
		
		for(int i=0;i<4;i++){
			if(i!=target){
				total+=weights.gwtGet(i);
			}
		}
		
		List<Double> ratios=Lists.newArrayList();
		for(int i=0;i<4;i++){
			if(i==target){
				ratios.add(0.0);
			}else{
				if(total==0){
				ratios.add(1.0/3);
				}else{
					if(weights.gwtGet(i)==0){
						ratios.add(0.0);
					}else{
						ratios.add(weights.gwtGet(i)/total);
					}
				}
			}
		}
		
		for(int i=0;i<4;i++){
			if(i!=target){
				
				weights.gwtSet(i, remain*ratios.get(i));
			}else{
				weights.gwtSet(i, newvalue);
			}
		}
		//ThreeLog.log("after:",weights);
}
 
开发者ID:akjava,项目名称:GWTModelWeight,代码行数:47,代码来源:GWTModelWeight.java


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