Example usage for com.google.gwt.query.client GQuery height

List of usage examples for com.google.gwt.query.client GQuery height

Introduction

In this page you can find the example usage for com.google.gwt.query.client GQuery height.

Prototype

public GQuery height(String height) 

Source Link

Document

Set the height style property of every matched element.

Usage

From source file:be.dramaix.ai.slidingpuzzle.client.Puzzle.java

License:Apache License

public void loadState(State s) {

    GQuery puzzle = SELECTOR.getPuzzleBoard();
    puzzle.empty();/* w  w w  . ja v a 2 s .  co m*/

    byte[] board = s.getAllCells();

    for (int i = 0; i < board.length; i++) {
        byte value = board[i];
        GQuery cell = $("<div class='tile'></div>");
        if (value == 0) {
            cell.addClass("empty");
        } else {
            cell.html("" + value);
        }
        puzzle.append(cell);

    }

    //
    int puzzleDimension = TILE_DIMENSION * dimension;
    puzzle.height(puzzleDimension).width(puzzleDimension);
}

From source file:com.pronoiahealth.olhie.client.pages.bulletinboard.BulletinboardPage.java

License:Open Source License

private void createAddDraggableWidgetToDroppablePanel(DroppablePanel panel, Widget w, String acceptClass) {

    // Set a filter on what types of widgets this panel will accept
    panel.setAccept(acceptClass);/*w w  w. j  a v a  2 s .c  o  m*/

    // Create the draggable widget
    DraggableWidget<Widget> dw = new DraggableWidget<Widget>(w);

    // Before drag start
    dw.addBeforeDragHandler(new BeforeDragStartEventHandler() {
        @Override
        public void onBeforeDragStart(BeforeDragStartEvent event) {
            $(event.getDraggable()).css("position", "absolute");
        }
    });

    // Drag start handler to dynamically adjust the size of the
    // droppable panel widgets on the page. Without this you can't
    // drag from column to column
    dw.addDragStartHandler(new DragStartEventHandler() {
        @Override
        public void onDragStart(DragStartEvent event) {
            int content = AppSelectors.INSTANCE.getCenterBackground().height();
            GQuery droppables = AppSelectors.INSTANCE.getAllDroppableWidgets();
            droppables.height(content);
        }
    });

    // On drag stop
    dw.addDragStopHandler(new DragStopEventHandler() {
        @Override
        public void onDragStop(DragStopEvent event) {
            $(event.getDraggable()).css("position", "relative").css("top", null).css("left", null);
        }
    });

    // Can't create and re-use
    // Must have unique set for application to each widget
    DraggableOptions dragOptions = new DraggableOptions();
    dragOptions.setOpacity(new Float(0.8));
    dragOptions.setZIndex(2000);
    dragOptions.setCursor(Cursor.MOVE);
    dragOptions.setRevert(RevertOption.NEVER);
    dragOptions.setRevertDuration(500);
    dragOptions.setHelper(HelperType.CLONE);

    // Set drag options
    dw.setDraggableOptions(dragOptions);

    // Add to column
    panel.addWidget(dw);
}