本文整理汇总了Java中com.google.gwt.core.client.JsArrayInteger类的典型用法代码示例。如果您正苦于以下问题:Java JsArrayInteger类的具体用法?Java JsArrayInteger怎么用?Java JsArrayInteger使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JsArrayInteger类属于com.google.gwt.core.client包,在下文中一共展示了JsArrayInteger类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAbsolutePosition
import com.google.gwt.core.client.JsArrayInteger; //导入依赖的package包/类
private native JsArrayInteger getAbsolutePosition(Element elem) /*-{
var curr = elem;
var left = 0;
var top = 0;
if ($doc.getElementById) {
do {
left += elem.offsetLeft - elem.scrollLeft;
top += elem.offsetTop - elem.scrollTop;
elem = elem.offsetParent;
curr = curr.parentNode;
while (curr != elem) {
left -= curr.scrollLeft;
top -= curr.scrollTop;
curr = curr.parentNode;
}
} while (elem.offsetParent);
}
return [left, top];
}-*/;
示例2: setTerminalSize
import com.google.gwt.core.client.JsArrayInteger; //导入依赖的package包/类
@Override
public void setTerminalSize(int x, int y) {
if (!connected) {
return;
}
if (width == x && height == y) {
return;
}
terminal.resize(x, y);
width = x;
height = y;
Jso jso = Jso.create();
JsArrayInteger arr = Jso.createArray().cast();
arr.set(0, x);
arr.set(1, y);
jso.addField("type", "resize");
jso.addField("data", arr);
socket.send(jso.serialize());
}
示例3: getColorAtPixel
import com.google.gwt.core.client.JsArrayInteger; //导入依赖的package包/类
private String getColorAtPixel(int x,
int y) {
x = Math.max(Math.min(x,
179),
0);
y = Math.max(Math.min(y,
179),
0);
RenderingContext ctx = canvas.getContext();
ImageData imageData = ctx.getImageData(x,
y,
1,
1);
JsArrayInteger data = imageData.getData();
return ColorUtils.rgb2hex(data.get(0),
data.get(1),
data.get(2));
}
示例4: init
import com.google.gwt.core.client.JsArrayInteger; //导入依赖的package包/类
public void init() {
// try to get the serialized representation of the SQLite DB from the
// local storage
String serializedDb = storage.getItem(LOCALSTORAGE_KEY_DB);
if (serializedDb == null || serializedDb.isEmpty()) {
// if nothing is found, we create the database from scratch
sqlDb = SQLite.create();
// and inject the SQL file which creates the tables structure
DbSchema dbSchema = (DbSchema) GWT.create(DbSchema.class);
sqlDb.execute(dbSchema.sqlForSchema().getText());
} else {
// if the local storage already contains some data, parse it as a
// JSON integer array
JSONValue dbContent = JSONParser.parseStrict(serializedDb);
// and initialize SQLite with this "file"
sqlDb = SQLite.create(dbContent.isArray().getJavaScriptObject()
.<JsArrayInteger> cast());
}
persistDB();
getMinIdPasswd();
getMinIdField();
}
示例5: create
import com.google.gwt.core.client.JsArrayInteger; //导入依赖的package包/类
public final static SQLite create(JsArrayInteger data) {
// Loads the SQLite.js script if not done already
if (bundle == null) {
bundle = (SQLiteBundle) GWT.create(SQLiteBundle.class);
Document doc = Document.get();
ScriptElement sqljs = doc.createScriptElement();
sqljs.setAttribute("type", "text/javascript");
sqljs.setInnerText(bundle.SqlJs().getText());
doc.getDocumentElement().getFirstChildElement().appendChild(sqljs);
}
if (data != null)
return createWithDataJsni(data);
return createJsni();
}
示例6: loadCategoryElements
import com.google.gwt.core.client.JsArrayInteger; //导入依赖的package包/类
private <M> void loadCategoryElements(final CategoryTypeJS categoryTypeJS, final CategoryTypeDTO categoryTypeDTO,
final RequestManager<M> requestManager, final Transaction transaction) {
if(categoryTypeJS.getCategoryElements() != null) {
categoryTypeDTO.setCategoryElementsDTO(new ArrayList<CategoryElementDTO>());
final JsArrayInteger categoryElements = categoryTypeJS.getCategoryElements();
final int size = categoryElements.length();
for(int index = 0; index < size; index++) {
categoryElementAsyncDAO.get(categoryElements.get(index), new RequestManagerCallback<M, CategoryElementDTO>(requestManager) {
@Override
public void onRequestSuccess(CategoryElementDTO result) {
result.setParentCategoryDTO(categoryTypeDTO);
categoryTypeDTO.getCategoryElementsDTO().add(result);
}
}, transaction);
}
}
}
示例7: create
import com.google.gwt.core.client.JsArrayInteger; //导入依赖的package包/类
public final static SQLite create( JsArrayInteger data )
{
if( bundle == null )
{
bundle = (SQLiteBundle) GWT.create( SQLiteBundle.class );
Document doc = Document.get();
ScriptElement sqljs = doc.createScriptElement();
sqljs.setAttribute( "type", "text/javascript" );
sqljs.setInnerText( bundle.SqlJs().getText() );
doc.getDocumentElement().getFirstChildElement().appendChild( sqljs );
}
if( data != null )
return createWithDataJsni( data );
return createJsni();
}
示例8: DragObject
import com.google.gwt.core.client.JsArrayInteger; //导入依赖的package包/类
public DragObject(TopologyView<TopologyViewRenderer> svgTopologyMap, Element draggableElement, Element containerElement, D3 selection) {
m_svgTopologyMap = svgTopologyMap;
m_draggableElement = draggableElement;
m_containerElement = containerElement;
m_selection = selection;
m_selection.each(new Handler<GWTVertex>() {
@Override
public void call(GWTVertex vertex, int index) {
Point p = new Point(vertex.getX(), vertex.getY());
m_startPosition.put(vertex.getId(), p);
}
});
//User m_vertexgroup because this is what we scale instead of every vertex element
m_transform = D3.getTransform(D3.d3().select(getTopologyView().getVertexGroup()).attr("transform"));
JsArrayInteger position = D3.getMouse(containerElement);
m_startX = (int) (position.get(0) / m_transform.getScale().get(0));
m_startY = (int) (position.get(1) / m_transform.getScale().get(1));
}
示例9: getStyle
import com.google.gwt.core.client.JsArrayInteger; //导入依赖的package包/类
public static JSObject getStyle(VectorStyleDef def) {
String fillColor = def.getFill().getNormalColor();
Double fillOpacity = def.getFill().getOpacity();
String strokeColor = def.getLine().getNormalColor();
Double strokeWidth = new Double(def.getLine().getThickness());
JSObject styleObject = JSObject.createJSObject();
styleObject.setProperty(FILL_NAME, true);
styleObject.setProperty(FILL_COLOR_NAME, fillColor);
styleObject.setProperty(FILL_OPACITY_NAME, fillOpacity);
styleObject.setProperty(STROKE_COLOR_NAME, strokeColor);
styleObject.setProperty(STROKE_WIDTH_NAME, strokeWidth);
styleObject.setProperty(RADIUS_NAME, RADIUS_VALUE);
//icon
String iconUrl = def.getPoint().getExternalGraphic();
if (iconUrl != null) {
JSObject iconObject = JSObject.createJSObject();
iconObject.setProperty(ICON_URL_NAME, iconUrl);
JsArrayInteger iconSize = JSObject.createArray().cast();
iconSize.push(def.getPoint().getGraphicWidth());
iconSize.push(def.getPoint().getGraphicHeight());
JSObject iconSizeObject = iconSize.cast();
iconObject.setProperty(ICON_SIZE_NAME, iconSizeObject);
styleObject.setProperty(ICON_NAME, iconObject);
}
return styleObject;
}
示例10: toIntegerArray
import com.google.gwt.core.client.JsArrayInteger; //导入依赖的package包/类
static JsArrayInteger toIntegerArray(int... javaArray) {
JsArrayInteger jsArray = JavaScriptObject.createArray().cast();
for (int integer : javaArray) {
jsArray.push(integer);
}
return jsArray;
}
示例11: convert
import com.google.gwt.core.client.JsArrayInteger; //导入依赖的package包/类
@Override
public JsMessage convert(Message value) {
JsMessenger messenger = JsMessenger.getInstance();
String rid = value.getRid() + "";
String sortKey = value.getSortDate() + "";
JsPeerInfo sender = messenger.buildPeerInfo(Peer.user(value.getSenderId()));
boolean isOut = value.getSenderId() == messenger.myUid();
boolean isOnServer = value.isOnServer();
String date = messenger.getFormatter().formatTime(value.getDate());
JsDate fullDate = JsDate.create(value.getDate());
JsContent content = JsContent.createContent(value.getContent(),
value.getSenderId());
JsArray<JsReaction> reactions = JsArray.createArray().cast();
for (Reaction r : value.getReactions()) {
JsArrayInteger uids = (JsArrayInteger) JsArrayInteger.createArray();
boolean isOwnSet = false;
for (Integer i : r.getUids()) {
uids.push(i);
if (i == messenger.myUid()) {
isOwnSet = true;
}
}
reactions.push(JsReaction.create(r.getCode(), uids, isOwnSet));
}
double sortDate = value.getDate() / 1000.0;
return create(rid, sortKey, sender, isOut, date, fullDate, Enums.convert(value.getMessageState()), isOnServer, content,
reactions, sortDate);
}
示例12: fireOnStartEvent
import com.google.gwt.core.client.JsArrayInteger; //导入依赖的package包/类
private void fireOnStartEvent(Event evt, JsArrayInteger values)
{
int[] vals = jsArrayIntegerToIntArray(values);
SliderEvent e = new SliderEvent(evt, this, vals);
for (SliderListener l : m_listeners) {
l.onStart(e);
}
}
示例13: fireOnChangeEvent
import com.google.gwt.core.client.JsArrayInteger; //导入依赖的package包/类
private void fireOnChangeEvent(Event evt, JsArrayInteger values, boolean hasOriginalEvent)
{
int[] vals = jsArrayIntegerToIntArray(values);
SliderEvent e = new SliderEvent(evt, this, vals, hasOriginalEvent);
for (SliderListener l : m_listeners) {
l.onChange(e);
}
}
示例14: fireOnStopEvent
import com.google.gwt.core.client.JsArrayInteger; //导入依赖的package包/类
private void fireOnStopEvent(Event evt, JsArrayInteger values)
{
int[] vals = jsArrayIntegerToIntArray(values);
SliderEvent e = new SliderEvent(evt, this, vals);
for (SliderListener l : m_listeners) {
l.onStop(e);
}
}
示例15: jsArrayIntegerToIntArray
import com.google.gwt.core.client.JsArrayInteger; //导入依赖的package包/类
private int[] jsArrayIntegerToIntArray(JsArrayInteger values)
{
int len = values.length();
int[] vals = new int[len];
for (int i = 0; i < len; i++) {
vals[i] = values.get(i);
}
return vals;
}