當前位置: 首頁>>代碼示例>>Java>>正文


Java Style.setZIndex方法代碼示例

本文整理匯總了Java中com.google.gwt.dom.client.Style.setZIndex方法的典型用法代碼示例。如果您正苦於以下問題:Java Style.setZIndex方法的具體用法?Java Style.setZIndex怎麽用?Java Style.setZIndex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.dom.client.Style的用法示例。


在下文中一共展示了Style.setZIndex方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onMouseDown

import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
@Override
public void onMouseDown(MouseDownEvent event) {

    startX = event.getClientX();
    startY = event.getClientY();

    if (isDisabled() || event.getNativeButton() != NativeEvent.BUTTON_LEFT) {
        return;
    }

    clickTarget = Element.as(event.getNativeEvent().getEventTarget());
    mouseMoveCanceled = false;

    if ((weekGrid.getCalendar().isItemMoveAllowed() && getCalendarItem().isMoveable())
            || (clickTargetsResize() && getCalendarItem().isResizeable())) {

        moveRegistration = addMouseMoveHandler(this);
        setFocus(true);
        try {
            startYrelative = (int) ((double) event.getRelativeY(caption) % slotHeight);
            startXrelative = (event.getRelativeX(weekGrid.getElement())
                    - weekGrid.timebar.getOffsetWidth())
                    % getDateCellWidth();
        } catch (Exception e) {
            GWT.log("Exception calculating relative start position", e);
        }
        mouseMoveStarted = false;
        Style s = getElement().getStyle();
        s.setZIndex(1000);
        startDatetimeFrom = (Date) calendarItem.getStartTime().clone();
        startDatetimeTo = (Date) calendarItem.getEndTime().clone();
        Event.setCapture(getElement());
    }

    // make sure the right cursor is always displayed
    if (clickTargetsResize() && getCalendarItem().isResizeable()) {
        addGlobalResizeStyle();
    }

    /*
     * We need to stop the event propagation or else the WeekGrid range
     * select will kick in
     */
    event.stopPropagation();
    event.preventDefault();
}
 
開發者ID:blackbluegl,項目名稱:calendar-component,代碼行數:47,代碼來源:DateCellDayItem.java

示例2: onMouseUp

import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
@Override
public void onMouseUp(MouseUpEvent event) {
    if (mouseMoveCanceled
            || event.getNativeButton() != NativeEvent.BUTTON_LEFT) {
        return;
    }

    Event.releaseCapture(getElement());
    setFocus(false);
    if (moveRegistration != null) {
        moveRegistration.removeHandler();
        moveRegistration = null;
    }

    int endX = event.getClientX();
    int endY = event.getClientY();
    int xDiff = 0, yDiff = 0;
    if (startX != -1 && startY != -1) {
        // Drag started
        xDiff = startX - endX;
        yDiff = startY - endY;
    }

    startX = -1;
    startY = -1;
    mouseMoveStarted = false;
    Style s = getElement().getStyle();
    s.setZIndex(1);

    if (!clickTargetsResize()) {

        // check if mouse has moved over threshold of 3 pixels
        boolean mouseMoved = (xDiff < -3 || xDiff > 3 || yDiff < -3 || yDiff > 3);

        if (!weekGrid.getCalendar().isDisabled() && mouseMoved) {
            // Item Move:
            // - calendar must be enabled
            // - calendar must not be in read-only mode
            weekGrid.itemMoved(this);

        } else if (!weekGrid.getCalendar().isDisabled() && getCalendarItem().isClickable()) {
            // Item Click:
            // - calendar must be enabled (read-only is allowed)
            EventTarget et = event.getNativeEvent().getEventTarget();
            Element e = Element.as(et);
            if (e == caption || e == eventContent
                    || e.getParentElement() == caption) {
                if (weekGrid.getCalendar().getItemClickListener() != null) {
                    weekGrid.getCalendar().getItemClickListener().itemClick(calendarItem);
                }
            }
        }

    } else {
        // click targeted resize bar
        removeGlobalResizeStyle();
        if (weekGrid.getCalendar().getItemResizeListener() != null) {
            weekGrid.getCalendar().getItemResizeListener().itemResized(calendarItem);
        }
        dateCell.recalculateItemWidths();
    }
}
 
開發者ID:blackbluegl,項目名稱:calendar-component,代碼行數:63,代碼來源:DateCellDayItem.java

示例3: setLine

import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
private static void setLine(final Style style,
                            final int width,
                            final int top,
                            final int height,
                            final String color) {
    style.setPosition(Position.ABSOLUTE);
    style.setTop(top,
                 PX);
    style.setHeight(height,
                    PX);
    style.setWidth(width,
                   PX);
    style.setBackgroundColor(color);
    style.setZIndex(Integer.MAX_VALUE);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:16,代碼來源:ResizableMovableHeader.java

示例4: setDragProxyPosition

import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
private void setDragProxyPosition(final LienzoPanel dragProxyParentPanel,
                                  final LienzoPanel dragProxyPanel,
                                  final double proxyWidth,
                                  final double proxyHeight,
                                  final NodeMouseDownEvent event) {
    Style style = dragProxyPanel.getElement().getStyle();
    style.setPosition(Style.Position.ABSOLUTE);
    style.setLeft(dragProxyParentPanel.getAbsoluteLeft() + event.getX() - (proxyWidth / 2),
                  Style.Unit.PX);
    style.setTop(dragProxyParentPanel.getAbsoluteTop() + event.getY() - (proxyHeight / 2),
                 Style.Unit.PX);
    style.setZIndex(ZINDEX);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:14,代碼來源:StencilPaletteBuilder.java

示例5: Splitter

import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
public Splitter(Widget target,
                boolean reverse) {
    this.target = target;
    this.reverse = reverse;

    final ResizeFlowPanel widget = new ResizeFlowPanel();

    sinkEvents(Event.ONMOUSEDOWN | Event.ONMOUSEUP | Event.ONMOUSEMOVE | Event.ONDBLCLICK);

    this.hover = new FlowPanel();
    final Style style = hover.getElement().getStyle();
    style.setOpacity(0);
    style.setZIndex(2);
    style.setPosition(Position.FIXED);
    setUpHoverStyle(style,
                    DEFAULT_SPLITTER_HOVER_SIZE);
    widget.add(hover);
    initWidget(widget);

    mouseTracker = Document.get().createDivElement();
    mouseTracker.getStyle().setCursor(getHoverCursorStyle());
    mouseTracker.getStyle().setZIndex(Integer.MAX_VALUE);
    mouseTracker.getStyle().setPosition(Position.ABSOLUTE);
    mouseTracker.getStyle().setHeight(50,
                                      Unit.PX);
    mouseTracker.getStyle().setWidth(50,
                                     Unit.PX);
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:29,代碼來源:WorkbenchSplitLayoutPanel.java

示例6: cancelMouseMove

import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
private void cancelMouseMove() {
    mouseMoveCanceled = true;

    // reset and remove everything related to the event handling
    Event.releaseCapture(getElement());
    setFocus(false);

    if (moveRegistration != null) {
        moveRegistration.removeHandler();
        moveRegistration = null;
    }

    mouseMoveStarted = false;
    removeGlobalResizeStyle();

    Style s = getElement().getStyle();
    s.setZIndex(1);

    // reset the position of the event
    int dateCellWidth = getDateCellWidth();
    int dayOffset = startXrelative / dateCellWidth;
    s.clearLeft();

    calendarItem.setStartTime(startDatetimeFrom);
    calendarItem.setEndTime(startDatetimeTo);

    long startFromMinutes = (startDatetimeFrom.getHours() * 60)
            + startDatetimeFrom.getMinutes();
    long range = calendarItem.getRangeInMinutes();

    startFromMinutes = calculateStartFromMinute(startFromMinutes,
            startDatetimeFrom, startDatetimeTo, dayOffset);
    if (startFromMinutes < 0) {
        range += startFromMinutes;
    }

    updatePosition(startFromMinutes, range);

    startY = -1;
    startX = -1;

    // to reset the event width
    ((DateCell) getParent()).recalculateItemWidths();
}
 
開發者ID:blackbluegl,項目名稱:calendar-component,代碼行數:45,代碼來源:DateCellDayItem.java


注:本文中的com.google.gwt.dom.client.Style.setZIndex方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。