Examples of Image


Examples of org.vaadin.gwtgraphics.client.Image

  // ------------------------------------------------------------------------

  public void onDraw(final ViewPort viewPort, final ScreenContainer container) {
    this.container = container;

    Image panBg = new Image(5, 5, 50, 50, panBackgroundImage);
    Image left = new Image(5, 21, 18, 18, panLeftImage);
    Image right = new Image(37, 21, 18, 18, panRightImage);
    Image up = new Image(21, 5, 18, 18, panUpImage);
    Image down = new Image(21, 37, 18, 18, panDownImage);

    DOM.setStyleAttribute(left.getElement(), "cursor", "pointer");
    DOM.setStyleAttribute(right.getElement(), "cursor", "pointer");
    DOM.setStyleAttribute(up.getElement(), "cursor", "pointer");
    DOM.setStyleAttribute(down.getElement(), "cursor", "pointer");

    StopPropagationHandler handler = new StopPropagationHandler();
    left.addMouseUpHandler(new MouseUpHandler() {

      public void onMouseUp(MouseUpEvent event) {
        Bbox bounds = viewPort.getBounds();
        double deltaX = -bounds.getWidth() / 3;
        PanAnimation animation = new PanAnimation(viewPort);
        animation.panTo(deltaX, 0, 300);
        event.stopPropagation();
      }
    });
    left.addMouseDownHandler(handler);
    left.addClickHandler(handler);
    left.addDoubleClickHandler(handler);

    right.addMouseUpHandler(new MouseUpHandler() {

      public void onMouseUp(MouseUpEvent event) {
        Bbox bounds = viewPort.getBounds();
        double deltaX = bounds.getWidth() / 3;
        PanAnimation animation = new PanAnimation(viewPort);
        animation.panTo(deltaX, 0, 300);
        event.stopPropagation();
      }
    });
    right.addMouseDownHandler(handler);
    right.addClickHandler(handler);
    right.addDoubleClickHandler(handler);

    up.addMouseUpHandler(new MouseUpHandler() {

      public void onMouseUp(MouseUpEvent event) {
        Bbox bounds = viewPort.getBounds();
        double deltaY = bounds.getHeight() / 3;
        PanAnimation animation = new PanAnimation(viewPort);
        animation.panTo(0, deltaY, 300);
        event.stopPropagation();
      }
    });
    up.addMouseDownHandler(handler);
    up.addClickHandler(handler);
    up.addDoubleClickHandler(handler);

    down.addMouseUpHandler(new MouseUpHandler() {

      public void onMouseUp(MouseUpEvent event) {
        Bbox bounds = viewPort.getBounds();
        double deltaY = -bounds.getHeight() / 3;
        PanAnimation animation = new PanAnimation(viewPort);
        animation.panTo(0, deltaY, 300);
        event.stopPropagation();
      }
    });
    down.addMouseDownHandler(handler);
    down.addClickHandler(handler);
    down.addDoubleClickHandler(handler);

    container.add(panBg);
    container.add(left);
    container.add(right);
    container.add(up);
    container.add(down);

    // Zooming buttons:

    Image zoomBg = new Image(20, 60, 20, 60, zoomBackgroundImage);
    Image zoomIn = new Image(20, 60, 20, 20, zoomInImage);
    Image zoomExtent = new Image(20, 80, 20, 20, zoomExtentImage);
    Image zoomOut = new Image(20, 100, 20, 20, zoomOutImage);

    DOM.setStyleAttribute(zoomIn.getElement(), "cursor", "pointer");
    DOM.setStyleAttribute(zoomOut.getElement(), "cursor", "pointer");
    DOM.setStyleAttribute(zoomExtent.getElement(), "cursor", "pointer");

    zoomIn.addMouseUpHandler(new MouseUpHandler() {

      public void onMouseUp(MouseUpEvent event) {
        int index = viewPort.getZoomStrategy().getZoomStepIndex(viewPort.getScale());
        viewPort.applyScale(viewPort.getZoomStrategy().getZoomStepScale(index - 1));
        event.stopPropagation();
      }
    });
    zoomIn.addMouseDownHandler(handler);
    zoomIn.addClickHandler(handler);
    zoomIn.addDoubleClickHandler(handler);

    zoomExtent.addMouseUpHandler(new MouseUpHandler() {

      public void onMouseUp(MouseUpEvent event) {
        viewPort.applyBounds(viewPort.getMaximumBounds());
        event.stopPropagation();
      }
    });
    zoomExtent.addMouseDownHandler(handler);
    zoomExtent.addClickHandler(handler);
    zoomExtent.addDoubleClickHandler(handler);

    zoomOut.addMouseUpHandler(new MouseUpHandler() {

      public void onMouseUp(MouseUpEvent event) {
        int index = viewPort.getZoomStrategy().getZoomStepIndex(viewPort.getScale());
        viewPort.applyScale(viewPort.getZoomStrategy().getZoomStepScale(index + 1));
        event.stopPropagation();
      }
    });
    zoomOut.addMouseDownHandler(handler);
    zoomOut.addClickHandler(handler);
    zoomOut.addDoubleClickHandler(handler);

    container.add(zoomBg);
    container.add(zoomIn);
    container.add(zoomExtent);
    container.add(zoomOut);

    // Zoom to rectangle buttons:

    Image zoomToRectangle = new Image(20, 130, 20, 20, zoomToRectangleImage);
    zoomToRectangle.setTitle("Zoom to rectangle by dragging the mouse on the map.");
    DOM.setStyleAttribute(zoomToRectangle.getElement(), "cursor", "pointer");
    zoomToRectangle.addMouseUpHandler(new MouseUpHandler() {

      public void onMouseUp(MouseUpEvent event) {
        zoomToRectangleGroup = new ZoomToRectGroup(viewPort);
        container.add(zoomToRectangleGroup);
        event.stopPropagation();
      }
    });
    zoomToRectangle.addMouseDownHandler(handler);
    zoomToRectangle.addClickHandler(handler);
    zoomToRectangle.addDoubleClickHandler(handler);

    container.add(zoomToRectangle);
  }
View Full Code Here

Examples of org.wicketstuff.pickwick.bean.Image

    @Override
    protected void populateItem(Item item) {
      try {
        if (item.getModelObject() instanceof Image){
          Image imageProperties = (Image) item.getModelObject();
          if (!imageProperties.getFile().getCanonicalPath().startsWith(
              settings.getImageDirectoryRoot().getCanonicalPath()))
            throw new RuntimeException("Requested image directory not within the root image directory");
          WebMarkupContainer link;
          String imagePath = imageUtils.getRelativePath(imageProperties.getFile());
          PageParameters params = new PageParameters();
          params.add("uri", imagePath);
          item.add(link = new WebMarkupContainer("link"));
          link.add(new AttributeModifier("href", true, new Model(getRequest()
              .getRelativePathPrefixToContextRoot()
              + PickwickApplication.IMAGE_PAGE_PATH + "/" + imagePath)));
          WebComponent image;
          link.add(image = new WebComponent("thumbnail"));
          image.add(new AttributeModifier("src", true, new Model(getRequest()
              .getRelativePathPrefixToContextRoot()
              + PickwickApplication.THUMBNAIL_IMAGE_PATH + "/" + imagePath)));
          link.add(new Label("thumbnailLabel", imageProperties.getTitle()));
        } else if (item.getModelObject() instanceof Folder){
          final Folder folder = (Folder) item.getModelObject();
          Sequence sequence = imageUtils.readSequence(folder.getFile());
          WebMarkupContainer link;
          item.add(link = new WebMarkupContainer("link"){
View Full Code Here

Examples of org.wso2.carbon.ec2client.data.Image

        }
        DescribeImagesResponseItemType[] items =
                response.getDescribeImagesResponse().getImagesSet().getItem();
        List<Image> images = new ArrayList<Image>();
        for (DescribeImagesResponseItemType item : items) {
            Image image = new Image(item.getImageId());
            image.setImageId(item.getImageLocation());
            image.setState(item.getImageState());
            image.setType(item.getImageType());
            image.setOwnerId(item.getImageOwnerId());
            image.setPublic(item.getIsPublic());
            image.setKernelId(item.getKernelId());
            image.setArchitecture(item.getArchitecture());
            image.setRamDiskId(item.getRamdiskId());
            images.add(image);
        }
        return images;
    }
View Full Code Here

Examples of org.xith3d.ui.hud.widgets.Image

       
        // Add the foreground
        ( (Panel)hud.getContentPane() ).setForegroundTexture((Texture2D)ResBag.getTexture(ResourceNames.FOREGROUND));
       
        // Add the pause logo
        hourglass = new Image(332f / 2f, 161f / 2f,
                (Texture2D)ResBag.getTexture(ResourceNames.HOURGLASS));
        hourglass.setLocation(41.0f, 446.0f);
        hourglass.setVisible(false);
        hud.getContentPane().addWidget(hourglass);
       
        // Add a xith3d logo
        Widget xithLogo = new Image(100f, 100f, (Texture2D)ResBag.getTexture(ResourceNames.XITH3DLOGO));
        hud.getContentPane().addWidget(xithLogo);
        xithLogo.setLocation(680.29926f,26.688633f);
        xithLogo.setSize(101.99501f,72.32291f);
       
    }
View Full Code Here

Examples of org.xrace.model.Image

  public BlobImage(long id, ImageService imageService)
  {
    super();
    this.id = id;
    this.imageService = imageService;
    Image img = imageService.find(id);
    setFormat(img.getType());

  }
View Full Code Here

Examples of org.zkoss.zss.model.Image

  public void test2002276(){
    final String nm = "B-2002276.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    Iterator iter = sheet1.getImages().iterator();
    Image image = (Image)iter.next();
    assertEquals(1,image.getColumn());
    assertEquals(2,image.getRow());
    assertEquals(0.015625,image.getColumnFraction());
    assertEquals(0.05078125,image.getRowFraction());
    assertEquals(446,image.getFrameHeight());
    assertEquals(666,image.getFrameWidth());
    assertEquals(1547,image.getHeight());
    assertEquals(2323,image.getWidth());
   
    image = (Image)iter.next();
    assertEquals(1,image.getColumn());
    assertEquals(24,image.getRow());
    assertEquals(0.015625,image.getColumnFraction());
    assertEquals(0.1484375,image.getRowFraction());
    assertEquals(616,image.getFrameHeight());
    assertEquals(666,image.getFrameWidth());
    assertEquals(1811,image.getHeight());
    assertEquals(1969,image.getWidth());

   
  }
View Full Code Here

Examples of org.zkoss.zul.Image

  public void render(Row row, java.lang.Object data) {
    if(data instanceof String[]) {
      String[] ary = (String[]) data;
      Div div = new Div();
      Image icon = new Image();
      icon.setStyle("padding: 0px 10px");
      icon.setSrc("/img/Centigrade-Widget-Icons/EnvelopeOpen-16x16.png");
      div.appendChild(icon);
      new Label(ary[0]).setParent(div);
      row.appendChild(div);
      new Label(ary[1]).setParent(row);
      new Label(ary[2]).setParent(row);
View Full Code Here

Examples of pivot.wtk.media.Image

        // Images
        imageView.setDragSource(new DragSource() {
            private LocalManifest content = null;

            public boolean beginDrag(Component component, int x, int y) {
                Image image = imageView.getImage();

                if (image != null) {
                    content = new LocalManifest();
                    content.putImage(image);
                }

                return (content != null);
            }

            public void endDrag(Component component, DropAction dropAction) {
                content = null;
            }

            public boolean isNative() {
                return true;
            }

            public LocalManifest getContent() {
                return content;
            }

            public Visual getRepresentation() {
                return null;
            }

            public Point getOffset() {
                return null;
            }

            public int getSupportedDropActions() {
                return DropAction.COPY.getMask();
            }
        });

        imageView.setDropTarget(new DropTarget() {
            public DropAction dragEnter(Component component, Manifest dragContent,
                int supportedDropActions, DropAction userDropAction) {
                DropAction dropAction = null;

                if (dragContent.containsImage()
                    && DropAction.COPY.isSelected(supportedDropActions)) {
                    dropAction = DropAction.COPY;
                }

                return dropAction;
            }

            public void dragExit(Component component) {
            }

            public DropAction dragMove(Component component, Manifest dragContent,
                int supportedDropActions, int x, int y, DropAction userDropAction) {
                return (dragContent.containsImage() ? DropAction.COPY : null);
            }

            public DropAction userDropActionChange(Component component, Manifest dragContent,
                int supportedDropActions, int x, int y, DropAction userDropAction) {
                return (dragContent.containsImage() ? DropAction.COPY : null);
            }

            public DropAction drop(Component component, Manifest dragContent,
                int supportedDropActions, int x, int y, DropAction userDropAction) {
                DropAction dropAction = null;

                if (dragContent.containsImage()) {
                    try {
                        imageView.setImage(dragContent.getImage());
                        dropAction = DropAction.COPY;
                    } catch(IOException exception) {
                        System.err.println(exception);
                    }
                }

                dragExit(component);

                return dropAction;
            }
        });

        copyImageButton.getButtonPressListeners().add(new ButtonPressListener() {
            public void buttonPressed(Button button) {
                Image image = imageView.getImage();
                if (image != null) {
                    LocalManifest clipboardContent = new LocalManifest();
                    clipboardContent.putImage(image);
                    Clipboard.setContent(clipboardContent);
                }
View Full Code Here

Examples of playn.core.Image

    @Override protected String title () {
        return "UI: Backgrounds";
    }

    @Override protected Group createIface () {
        Image testBg = PlayN.assets().getImage("images/background.png");

        // Have to do async shenanigans with scale9 backgrounds
        final Label scale9Labels[] = {
            label("Scale 9", Background.blank()),
            label("Scale 9\nSomewhat\nTaller\nAnd\nWider", Background.blank()),
View Full Code Here

Examples of railo.runtime.img.Image

      String[] strSrcs=ListUtil.listToStringArray(_srcs, ',');
      Resource[] srcs=new Resource[strSrcs.length];
      Image[] images=new Image[strSrcs.length];
      for(int i=0;i<srcs.length;i++){
        srcs[i]=ResourceUtil.toResourceExisting(pageContext, strSrcs[i]);
        images[i] = new Image(srcs[i]);
      }
     
      // TODO use the same resource as for cfimage
      PageSource ps = pageContext.getCurrentTemplatePageSource();
      Resource curr = ps.getResource();
      Resource dir = curr.getParentResource();
      Resource cssDir = dir.getRealResource("css");
      Resource pathdir = cssDir;
      cssDir.mkdirs();
     
     
      //the base name for the files we are going to create as a css and image
      String baseRenderedFileName = MD5.getDigestAsString(_ids);
      Resource cssFileName = cssDir.getRealResource(baseRenderedFileName+".css");
      Resource imgFileName = pathdir.getRealResource(baseRenderedFileName+"."+ResourceUtil.getExtension(src,""));
     
      //if the files don't exist, then we create them, otherwise
      boolean bCreate = !cssFileName.isFile() || !imgFileName.isFile();
     
     
      //Are we going to create it, let's say no
      String css = "";
      if(bCreate){
        int imgMaxHeight = 0;
        int imgMaxWidth = 0;
        Image img;
        int actualWidth,actualHeight;
        //Setup the max height and width of the new image.
        for(int i=0;i<srcs.length;i++){
          img = images[i];
         
          //set the image original height and width
          actualWidth = img.getWidth();;
          actualHeight = img.getHeight();
                 
                 
         
          //Check if there is a height,
          imgMaxHeight += actualHeight;
          if(actualWidth  > imgMaxWidth) imgMaxWidth  =  actualWidth;
        }
       
        //Create the new image (hence we needed to do two of these items)
        Image spriteImage = (Image) ImageNew.call(pageContext,"", ""+imgMaxWidth,""+imgMaxHeight, "argb");
       
        int placedHeight = 0;
        //Loop again but this time, lets do the copy and paste
        for(int i=0;i<srcs.length;i++){
          img = images[i];
          spriteImage.paste(img,1,placedHeight);
         
            css += "#"+ids[i]+" {\n\tbackground: url("+baseRenderedFileName+"."+ResourceUtil.getExtension(strSrcs[i],"")+") 0px -"+placedHeight+"px no-repeat; width:"+img.getWidth()+"px; height:"+img.getHeight()+"px;\n} \n";
            placedHeight += img.getHeight();
        }
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.