Package elemental.css

Examples of elemental.css.CSSStyleDeclaration$Display


            }
            return 0;
        }
        public boolean isPressed(int keycode, int location) {
            X11 lib = X11.INSTANCE;
            Display dpy = lib.XOpenDisplay(null);
            if (dpy == null) {
                throw new Error("Can't open X Display");
            }
            try {
                byte[] keys = new byte[32];
View Full Code Here


            if (didCheck) {
                return alphaVisualIDs;
            }
            didCheck = true;
            X11 x11 = X11.INSTANCE;
            Display dpy = x11.XOpenDisplay(null);
            if (dpy == null)
                return alphaVisualIDs;
            XVisualInfo info = null;
            try {
                int screen = x11.XDefaultScreen(dpy);
View Full Code Here

                throw new UnsupportedOperationException("This X11 display does not provide a 32-bit visual");
            }
            Runnable action = new Runnable() {
                public void run() {
                    X11 x11 = X11.INSTANCE;
                    Display dpy = x11.XOpenDisplay(null);
                    if (dpy == null)
                        return;
                    try {
                        X11.Window win = getDrawable(w);
                        if (alpha == 1f) {
View Full Code Here

        private void setWindowShape(final Window w, final PixmapSource src) {
            Runnable action = new Runnable() {
                public void run() {
                    X11 x11 = X11.INSTANCE;
                    Display dpy = x11.XOpenDisplay(null);
                    if (dpy == null) {
                        return;
                    }
                    Pixmap pm = null;
                    try {
View Full Code Here

    attachEvents();
  }
 
  private void setupClone() {
    clone.setClassName(element.getClassName());
    CSSStyleDeclaration style = clone.getStyle();
    style.setVisibility(CSSStyleDeclaration.Visibility.HIDDEN);
    style.setPosition(CSSStyleDeclaration.Position.ABSOLUTE);
    style.setOverflow(CSSStyleDeclaration.Overflow.AUTO);
    style.setLeft("-5000px");
    style.setTop("-5000px");
   
    clone.setRows(1);
  }
View Full Code Here

  private void updateWidthAndHeight(Element dropdownElement) {
    /*
     * The 'outline' is drawn to the left of and above where the absolute top
     * and left are, so account for them in the top and right.
     */
    CSSStyleDeclaration style = dropdownElement.getStyle();

    /*
     * This width will either be 0 if we're being positioned by the mouse or the width of our
     * anchor.
     */
    int widthOfAnchorOrZero = positioner.getMinimumWidth();

    // set the minimum width
    int dropdownViewMinWidth =
        widthOfAnchorOrZero - (2 * res.defaultSimpleListCss().menuListBorderPx());
    style.setProperty("min-width", dropdownViewMinWidth + "px");

    // sets the maximum width
    boolean useWidthOfAnchor = maxWidth == Builder.WIDTH_OF_ANCHOR && widthOfAnchorOrZero != 0;
    if (maxWidth != 0 && useWidthOfAnchor) {
      int curMaxWidth = useWidthOfAnchor ? widthOfAnchorOrZero : maxWidth;
      style.setProperty("max-width", curMaxWidth + "px");
    }

    if (maxHeight != 0) {
      style.setProperty("max-height", maxHeight + "px");
    }
  }
View Full Code Here

  /**
   * Sets an elements left and top to the provided values.
   */
  private void setElementLeftAndTop(double left, double top) {
    CSSStyleDeclaration style = element.getStyle();
    if (left != IGNORE) {
      style.setLeft(left, Unit.PX);
    }
    if (top != IGNORE) {
      style.setTop(top, Unit.PX);
    }
  }
View Full Code Here

  /**
   * Resets an element's position by removing top/right/bottom/left and setting position to
   * absolute.
   */
  private void resetElementPosition() {
    CSSStyleDeclaration style = element.getStyle();
    style.setPosition("absolute");
    style.clearTop();
    style.clearRight();
    style.clearBottom();
    style.clearLeft();

    elementPositioner.appendElementToContainer(element);
  }
View Full Code Here

    if (rectSum != 0) {
      return rect;
    }

    // We make an attempt to get an accurate measurement of the element
    CSSStyleDeclaration style = element.getStyle();
    String visibility = CssUtils.setAndSaveProperty(element, "visibility", "hidden");
    String display = style.getDisplay();

    // if display set to none we remove it and let its normal style show through
    if (style.getDisplay().equals("none")) {
      style.removeProperty("display");
    } else {
      // it's likely display: none in a css class so we just have to guess.
      // We guess display:block since that's common on containers.
      style.setDisplay("block");
    }
    rect = element.getBoundingClientRect();
    style.setDisplay(display);
    style.setVisibility(visibility);

    return rect;
  }
View Full Code Here

  /**
   * Refreshes the background image of the image button.
   */
  private void refresh() {
    CSSStyleDeclaration declaration = CssUtils.getComputedStyle(buttonElement);
    if (StringUtils.isNullOrEmpty(declaration.getPropertyValue("background"))) {
      // bail if we're not attached to the dom
      return;
    }

    buttonElement.getStyle().removeProperty("background");
    String currentBackgroundImage = declaration.getPropertyValue("background");
    buttonElement.getStyle().setProperty("background", ourTopLayer + "," + currentBackgroundImage);
  }
View Full Code Here

TOP

Related Classes of elemental.css.CSSStyleDeclaration$Display

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.