Java 类com.google.gwt.core.client.JsArrayInteger 实例源码

项目:appinventor-extensions    文件:PZAwarePositionCallback.java   
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];
}-*/;
项目:che    文件:TerminalPresenter.java   
@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());
}
项目:appformer    文件:SaturationLightnessPicker.java   
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));
}
项目:yaph    文件:DataAccess.java   
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();
}
项目:yaph    文件:SQLite.java   
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();
}
项目:sigmah    文件:CategoryTypeAsyncDAO.java   
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);
        }
    }
}
项目:hexa.tools    文件:SQLite.java   
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();
}
项目:opennmszh    文件:DragObject.java   
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));
}
项目:sig-seguimiento-vehiculos    文件:LeafletStyle.java   
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;
    }
项目:LAS    文件:JsUtil.java   
static JsArrayInteger toIntegerArray(int... javaArray) {
  JsArrayInteger jsArray = JavaScriptObject.createArray().cast();
  for (int integer : javaArray) {
    jsArray.push(integer);
  }
  return jsArray;
}
项目:LAS    文件:JsUtil.java   
static JsArrayInteger toIntegerArray(final Collection<Integer> collection) {
  JsArrayInteger array = JavaScriptObject.createArray().cast();
  for (Integer integer : collection) {
    array.push(integer);
  }
  return array;
}
项目:dangchat-sdk    文件:JsMessage.java   
@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);
}
项目:gwt-cs    文件:Slider.java   
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);
    }
}
项目:gwt-cs    文件:Slider.java   
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);
    }
}
项目:gwt-cs    文件:Slider.java   
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);
    }
}
项目:gwt-cs    文件:Slider.java   
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;
}
项目:playn    文件:ArrayUtils.java   
public static JsArrayInteger toJsArray(byte[] data) {
  JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray();
  int len = data.length;
  for (int i = len - 1; i >= 0; i--) {
    jsan.set(i, data[i]);
  }
  return jsan;
}
项目:playn    文件:ArrayUtils.java   
public static JsArrayInteger toJsArray(int[] data) {
  JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray();
  int len = data.length;
  for (int i = len - 1; i >= 0; i--) {
    jsan.set(i, data[i]);
  }
  return jsan;
}
项目:playn    文件:ArrayUtils.java   
public static JsArrayInteger toJsArray(short[] data) {
  JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray();
  int len = data.length;
  for (int i = len - 1; i >= 0; i--) {
    jsan.set(i, data[i]);
  }
  return jsan;
}
项目:playn    文件:ArrayUtils.java   
public static JsArrayInteger toJsArrayUnsigned(byte[] data) {
  JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray();
  int len = data.length;
  for (int i = len - 1; i >= 0; i--) {
    jsan.set(i, data[i] & 255);
  }
  return jsan;
}
项目:playn    文件:ArrayUtils.java   
public static JsArrayInteger toJsArrayUnsigned(short[] data) {
  JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray();
  int len = data.length;
  for (int i = len - 1; i >= 0; i--) {
    jsan.set(i, data[i] & 65535);
  }
  return jsan;
}
项目:WebGL4J    文件:WEBGL_draw_buffers.java   
public static void glDrawBuffersWEBGL(int... buffers)
{
    JsArrayInteger array = JsArrayInteger.createArray(buffers.length).cast();

    for (int buffer : buffers)
        array.push(buffer);

    glDrawBuffersWEBGL(array);
}
项目:WebGL4J    文件:WEBGL_draw_buffers.java   
public static void glDrawBuffersWEBGL(Int32Array buffers)
{
    JsArrayInteger array = JsArrayInteger.createArray(buffers.length()).cast();

    for (int i = 0; i < buffers.length(); i++)
        array.push(buffers.get(i));

    glDrawBuffersWEBGL(array);
}
项目:forplay    文件:ArrayUtils.java   
public static JsArrayInteger toJsArray(byte[] data) {
  JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray();
  int len = data.length;
  for (int i = len - 1; i >= 0; i--) {
    jsan.set(i, data[i]);
  }
  return jsan;
}
项目:forplay    文件:ArrayUtils.java   
public static JsArrayInteger toJsArray(int[] data) {
  JsArrayInteger jsan = (JsArrayInteger) JsArrayNumber.createArray();
  int len = data.length;
  for (int i = len - 1; i >= 0; i--) {
    jsan.set(i, data[i]);
  }
  return jsan;
}
项目:forplay    文件:ArrayUtils.java   
public static JsArrayInteger toJsArray(short[] data) {
  JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray();
  int len = data.length;
  for (int i = len - 1; i >= 0; i--) {
    jsan.set(i, data[i]);
  }
  return jsan;
}
项目:forplay    文件:ArrayUtils.java   
public static JsArrayInteger toJsArrayUnsigned(byte[] data) {
  JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray();
  int len = data.length;
  for (int i = len - 1; i >= 0; i--) {
    jsan.set(i, data[i] & 255);
  }
  return jsan;
}
项目:forplay    文件:ArrayUtils.java   
public static JsArrayInteger toJsArrayUnsigned(short[] data) {
  JsArrayInteger jsan = (JsArrayInteger) JsArrayInteger.createArray();
  int len = data.length;
  for (int i = len - 1; i >= 0; i--) {
    jsan.set(i, data[i] & 65535);
  }
  return jsan;
}
项目:circuitjs1    文件:AudioOutputElm.java   
void play() {
    int i;
    JsArrayInteger arr = (JsArrayInteger)JsArrayInteger.createArray();
    int ct = dataPtr;
    int base = 0;
    if (dataFull) {
    ct = dataCount;
    base = dataPtr;
    }
    if (ct * sampleStep < .05) {
    Window.alert("Audio data is not ready yet.  Increase simulation speed to make data ready sooner.");
    return;
    }

    // rescale data to maximize
    double max = -1e8;
    double min =  1e8;
    for (i = 0; i != ct; i++) {
    if (data[i] > max) max = data[i];
    if (data[i] < min) min = data[i];
    }

    double adj = -(max+min)/2;
    double mult = 32766/(max+adj);
    for (i = 0; i != ct; i++) {
    int s = (int)((data[(i+base)%dataCount]+adj)*mult);
    arr.push(s);
    }
    playJS(arr, samplingRate);
}
项目:mgwt-traffic-flow    文件:SaturationLightnessPicker.java   
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));
}
项目:gwt-jui    文件:JsArrayUtil.java   
public static JsArrayInteger fromIntegers(Collection<Integer> collection) {
    JsArrayInteger array = JsArrayInteger.createArray().cast();
    for(Integer item : collection) {
        array.push(item);
    }
    return array;
}
项目:gwt-jui    文件:JsArrayUtil.java   
public static List<Integer> toList(JsArrayInteger array) {
    List<Integer> list = new ArrayList<>();
    if(array != null) {
        for (int i = 0; i < array.length(); i++) {
            list.add(array.get(i));
        }
    }
    return list;
}
项目:gwt-jui    文件:JsPoint.java   
public JsPoint(int x, int y) {
    JsArrayInteger jsX = (JsArrayInteger)JsArrayInteger.createArray();
    jsX.push(x);
    array.set(0, jsX);

    JsArrayInteger jsY = (JsArrayInteger)JsArrayInteger.createArray();
    jsY.push(y);
    array.set(1, jsY);
}
项目:actor-platform    文件:JsMessage.java   
@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);
}
项目:geowe-core    文件:LeafletStyle.java   
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;
    }
项目:firefly    文件:WebPlotResultParser.java   
private static void checkForIntAryResult(String key, WebPlotResult wpRes,PlotResultOverlay res)  {
    JsArrayInteger jsAry= res.getIntArrayResult(key);
    if (jsAry!=null) {
        int ary[]= new int[jsAry.length()];
        for(int i= 0; (i<ary.length); i++) ary[i]= jsAry.get(i);
        wpRes.putResult(key,new DataEntry.IntArray(ary));
    }

}
项目:firefly    文件:PlotResultOverlay.java   
public final native JsArrayInteger getIntArrayResult(String key) /*-{
    if (key in this) {
        return this[key];
    }
    else {
        return null;
    }
}-*/;
项目:sweng15    文件:Slider.java   
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);
    }
}
项目:sweng15    文件:Slider.java   
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);
    }
}
项目:sweng15    文件:Slider.java   
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);
    }
}