本文整理匯總了Java中com.google.gwt.core.shared.GWT.log方法的典型用法代碼示例。如果您正苦於以下問題:Java GWT.log方法的具體用法?Java GWT.log怎麽用?Java GWT.log使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.core.shared.GWT
的用法示例。
在下文中一共展示了GWT.log方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getContainerOffsetLeft
import com.google.gwt.core.shared.GWT; //導入方法依賴的package包/類
protected int getContainerOffsetLeft() {
if (containerOffsetLeft < 0 || !sync) {
int scrollLeft = 0;
Element parent = DOM.getParent(getWidget().getElement());
while (parent != null) {
if (getScrollLeft(parent) > 0) {
scrollLeft += getScrollLeft(parent);
GWT.log("Scroll left detected : " + scrollLeft);
}
if (containerFinder.isContainer(parent)) {
containerOffsetLeft = DOM.getAbsoluteLeft(parent) - scrollLeft;
}
parent = DOM.getParent(parent);
}
}
return containerOffsetLeft;
}
示例2: getContainerOffsetTop
import com.google.gwt.core.shared.GWT; //導入方法依賴的package包/類
protected int getContainerOffsetTop() {
if (containerOffsetTop < 0 || !sync) {
int scrollTop = 0;
Element parent = DOM.getParent(getWidget().getElement());
while (parent != null) {
if (getScrollTop(parent) > 0) {
scrollTop += getScrollTop(parent);
GWT.log("Scroll Top detected : " + scrollTop);
}
if (containerFinder.isContainer(parent)) {
containerOffsetTop = DOM.getAbsoluteTop(parent) - scrollTop;
}
parent = DOM.getParent(parent);
}
}
return containerOffsetTop;
}
示例3: getNewEntity
import com.google.gwt.core.shared.GWT; //導入方法依賴的package包/類
private Entity getNewEntity(Object value) {
String proptype = property.getRange();
String id = GUID.randomEntityId(software.getId(), proptype);
// Convert software entities to enumerations
MetadataClass topclass = vocabulary.getType(KBConstants.ONTNS()+"Software");
MetadataClass eclass = vocabulary.getType(proptype);
if(vocabulary.isA(eclass, topclass)) {
proptype = KBConstants.ONTNS()+"EnumerationEntity";
id = id.replace(software.getName()+"#", "");
}
try {
Entity entity = EntityRegistrar.getEntity(id, value, proptype);
entity.setType(property.getRange());
return entity;
} catch (Exception e) {
GWT.log("Coult not get a new entity", e);
return null;
}
}
示例4: getInput
import com.google.gwt.core.shared.GWT; //導入方法依賴的package包/類
public static IEntityInput getInput(Entity entity, MetadataProperty mprop, Vocabulary vocabulary)
throws Exception {
String inputClass = inputClasses.get(mprop.getRange());
if(inputClass != null) {
Object item = entityFactory.instantiate(inputClass);
if(item == null) {
GWT.log("Cannot instantiate input for "+mprop.getRange());
throw new Exception("Cannot instantiate input for "+mprop.getRange());
}
else if(item instanceof IEntityInput) {
((IEntityInput) item).createWidget(entity, mprop, vocabulary);
return (IEntityInput) item;
}
else {
GWT.log("Item not an extension of IEntityInput");
throw new Exception("Item not an extension of IEntityInput");
}
}
return null;
}
示例5: getEntity
import com.google.gwt.core.shared.GWT; //導入方法依賴的package包/類
public static Entity getEntity(String id, Object value, String type)
throws Exception {
String entityClass = entityClasses.get(type);
if(entityClass != null) {
Object item = entityFactory.instantiate(entityClass);
if(item == null) {
GWT.log("Cannot instantiate entity for "+type);
throw new Exception("Cannot instantiate entity for "+type);
}
else if(item instanceof Entity) {
Entity entity = (Entity) item;
entity.setId(id);
entity.setType(type);
if(value != null)
entity.setValue(value);
return entity;
}
else {
GWT.log("Item not an extension of Entity");
throw new Exception("Item not an extension of Entity");
}
}
return null;
}
示例6: registerEntityInputs
import com.google.gwt.core.shared.GWT; //導入方法依賴的package包/類
private void registerEntityInputs() {
final String pkg = EntityInput.class.getName().replaceAll("(.*\\.).*?$", "$1");
for(MetadataType type : vocabulary.getTypes().values()) {
ArrayList<String> queue = new ArrayList<String>();
//GWT.log("-------- "+type.getName());
queue.add(type.getId());
boolean registered = false;
while(!queue.isEmpty()) {
MetadataType qtype = vocabulary.getType(queue.remove(0));
if(qtype != null) {
String qInputWidgetClass = pkg + qtype.getName() + "Input";
//GWT.log("Checking for "+qtype.getName()+ " = "+qInputWidgetClass);
if(EntityRegistrar.registerInputClass(type.getId(), qInputWidgetClass)) {
registered = true;
break;
}
queue.add(qtype.getParent());
}
}
if(!registered)
GWT.log("** Cannot find adapter for "+type.getId());
}
}
示例7: registerEntities
import com.google.gwt.core.shared.GWT; //導入方法依賴的package包/類
private void registerEntities() {
final String pkg = Entity.class.getName().replaceAll("(.*\\.).*?$", "$1");
for(MetadataType type : vocabulary.getTypes().values()) {
ArrayList<String> queue = new ArrayList<String>();
//GWT.log("-------- "+type.getName());
queue.add(type.getId());
boolean registered = false;
while(!queue.isEmpty()) {
MetadataType qtype = vocabulary.getType(queue.remove(0));
if(qtype != null) {
String qInputWidgetClass = pkg + qtype.getName();
//GWT.log("Checking for "+qtype.getName()+ " = "+qInputWidgetClass);
if(EntityRegistrar.registerEntityClass(type.getId(), qInputWidgetClass)) {
registered = true;
break;
}
queue.add(qtype.getParent());
}
}
if(!registered)
GWT.log("** Cannot find adapter for "+type.getId());
}
}
示例8: decodePage
import com.google.gwt.core.shared.GWT; //導入方法依賴的package包/類
private boolean decodePage(PageItem pageItem) {
DjVuPage page = pageItem.page;
try {
if (page == null) {
page = pageItem.page = document.getPage(pageItem.pageNum);
if (page == null)
return true; // not downloaded yet
GWT.log("Decoding page " + pageItem.pageNum);
}
if (page.decodeStep()) {
pageItem.isDecoded = true;
if (pageItem.info == null) {
pageItem.setInfo(page.getInfo());
pageItem.setText(page.getText());
}
pageItem.memoryUsage = page.getMemoryUsage();
pagesMemoryUsage += pageItem.memoryUsage;
}
return true;
} catch (IOException e) {
GWT.log("Error while decoding page " + pageItem.pageNum, e);
return false;
}
}
示例9: update
import com.google.gwt.core.shared.GWT; //導入方法依賴的package包/類
/**
* Update Gantt chart's timeline and content for the given steps. This won't
* add any steps, but will update the content widths and heights.
*
* @param steps
*/
public void update(List<StepWidget> steps) {
if (startDate < 0 || endDate < 0 || startDate >= endDate) {
GWT.log("Invalid start and end dates. Gantt chart can't be rendered. Start: " + startDate + ", End: "
+ endDate);
return;
}
content.getStyle().setHeight(contentHeight, Unit.PX);
GWT.log("GanttWidget's active TimeZone: " + getLocaleDataProvider().getTimeZone().getID() + " (raw offset: "
+ getLocaleDataProvider().getTimeZone().getStandardOffset() + ")");
// tell timeline to notice vertical scrollbar before updating it
timeline.setNoticeVerticalScrollbarWidth(isContentOverflowingVertically());
timeline.update(resolution, startDate, endDate, firstDayOfRange, firstHourOfRange, localeDataProvider);
setContentMinWidth(timeline.getMinWidth());
updateContainerStyle();
updateContentWidth();
updateStepWidths(steps);
wasTimelineOverflowingHorizontally = timeline.isTimelineOverflowingHorizontally();
}
示例10: error
import com.google.gwt.core.shared.GWT; //導入方法依賴的package包/類
@Override
public void error(String tag, String message, Throwable exception) {
super.error(tag, message, exception);
GWT.log(message);
GWT.log(getStackTrace(exception));
consoleLog(message + exception.toString());
consoleLog(getStackTrace(exception));
}
示例11: debug
import com.google.gwt.core.shared.GWT; //導入方法依賴的package包/類
@Override
public void debug(String tag, String message, Throwable exception) {
super.debug(tag, message, exception);
GWT.log(message);
GWT.log(getStackTrace(exception));
consoleLog(message + exception.toString());
consoleLog(getStackTrace(exception));
}
示例12: equals
import com.google.gwt.core.shared.GWT; //導入方法依賴的package包/類
@Override
public boolean equals (Object obj) {
GWT.log(url());
GWT.log(((Filter) obj).url());
return obj != null && obj instanceof Filter
? url().equals(((Filter) obj).url())
: super.equals(obj);
}
示例13: parseFormData
import com.google.gwt.core.shared.GWT; //導入方法依賴的package包/類
public static FormData parseFormData(String text) {
FormData data = new FormData();
if ((text != null) && (text.trim().length() > 0)) {
try {
JSONValue value = JSONParser.parseLenient(text);
if (value != null) {
JSONObject obj = value.isObject();
if (obj != null) {
data.version = JsonUtil.parseVersion(obj.get("version"));
data.main = JsonUtil.parseMap(obj.get("main"));
data.calculator = JsonUtil.parseMap(obj.get("calculator"));
data.items = JsonUtil.parseMap(obj.get("items"));
data.passives = JsonUtil.parseMap(obj.get("passives"));
data.gems = JsonUtil.parseMap(obj.get("gems"));
data.specialItems = JsonUtil.parseMap(obj.get("equipment"));
data.skills = JsonUtil.parseMap(obj.get("skills"));
data.elementalDamage = JsonUtil.parseMap(obj.get("elementalDamage"));
data.skillDamage = JsonUtil.parseMap(obj.get("skillDamage"));
data.hero = null;
data.career = null;
}
}
} catch (Exception e) {
ApplicationPanel.showErrorDialog("Error Parsing Form Data");
GWT.log("Error Parsing JSON Data", e);
}
}
return data;
}
示例14: findStepElement
import com.google.gwt.core.shared.GWT; //導入方法依賴的package包/類
/**
* Helper method to find Step element by given starting point and y-position
* and delta-y. Starting point is there to optimize performance a bit as
* there's no need to iterate through every single step element.
*
* @param startFromBar
* Starting point element
* @param newY
* target y-axis position
* @param deltay
* delta-y relative to starting point element.
* @return Step element at y-axis position. May be same element as given
* startFromBar element.
*/
protected Element findStepElement(Element startFromBar, int startTopY, int startBottomY, int newY, double deltay) {
boolean subStep = isSubBar(startFromBar);
if (subStep) {
startFromBar = startFromBar.getParentElement();
}
if (isBetween(newY, startTopY, startBottomY)) {
GWT.log("findStepElement returns same: Y " + newY + " between " + startTopY + "-" + startBottomY);
return startFromBar;
}
int startIndex = getChildIndex(content, startFromBar);
Element barCanditate;
int i = startIndex;
if (deltay > 0) {
i++;
for (; i < content.getChildCount(); i++) {
barCanditate = Element.as(content.getChild(i));
if (isBetween(newY, barCanditate.getAbsoluteTop(), barCanditate.getAbsoluteBottom())) {
if (!subStep && i == (startIndex + 1)) {
// moving directly over the following step will be
// ignored (if not sub-step).
return startFromBar;
}
return barCanditate;
}
}
} else if (deltay < 0) {
i--;
for (; i >= getAdditonalContentElementCount(); i--) {
barCanditate = Element.as(content.getChild(i));
if (isBetween(newY, barCanditate.getAbsoluteTop(), barCanditate.getAbsoluteBottom())) {
return barCanditate;
}
}
}
return startFromBar;
}
示例15: parseInt
import com.google.gwt.core.shared.GWT; //導入方法依賴的package包/類
/**
* Convert a string to an integer
*
* @param str string to convert
* @return an integer
*/
public static int parseInt(String str) {
if (str == null)
return 0;
str = str.trim();
int val = 0;
try {
val = Integer.parseInt(str, 10);
} catch (Exception e) {
GWT.log(e.toString());
}
return val;
}