Examples of Picture


Examples of com.restfb.types.User.Picture

    public void checkUserPicture() {
        User exampleUser
                = createJsonMapper().toJavaObject(jsonFromClasspath("v1_0/user-picture"), User.class);
        assertEquals("Tester", exampleUser.getName());
        assertEquals("123456789", exampleUser.getId());
        Picture pic = exampleUser.getPicture();
        assertFalse(pic.getIsSilhouette());
        assertNotNull(pic.getUrl());
        assertEquals("https://fbcdn-profile-a.akamaihd.net/profilepic", pic.getUrl());
    }
View Full Code Here

Examples of gallery.picture.entities.Picture

        Path picturePath = Paths.get("C:/Benutzer/Theo/Eiegene Bilder");
        try
        {
            for (Path pictureFile : DirectoryScanner.scan(picturePath))
            {
                Picture picture = new Picture(pictureFile, pictureFile.getFileName().toString());
                result.add(picture);
            }
        } catch (IOException e)
        {
            LOG.error("Scanning of Pictures Directory failed", e);
View Full Code Here

Examples of geodress.model.Picture

   *             may cause an exception
   */
  @Before
  public void setUp() throws Exception {
    /* latitude: +39.50972222 longitude: +2.74916667 */
    testPictureWithExifBeach = new Picture(new File("testfiles"
        + File.separator + "beach.jpg"));
    testPictureWithExifBeach.registerMetaDataReader(new SanselanReader());

    /* latitude: +39.50976 longitude: +2.74928 */
    testPictureWithExifSky = new Picture(new File("testfiles"
        + File.separator + "sky.jpg"));
    testPictureWithExifSky.registerMetaDataReader(new SanselanReader());

    testPictureWithoutExif = new Picture(new File("testfiles"
        + File.separator + "field.jpg"));
    testPictureWithoutExif.registerMetaDataReader(new SanselanReader());
  }
View Full Code Here

Examples of net.datacrow.core.objects.Picture

            valueIdent -= (stepSize * 2);
            tagIdent -= (stepSize * 2);
            ident(valueIdent);           
           
        } else if (o instanceof Picture) {
            Picture picture = (Picture) o;
            String filename = utilities.getImageURL(picture);
            write(filename);
        } else if (o instanceof Date) {
            Date date = (Date) o;
            write(new SimpleDateFormat("yyyy-MM-dd").format(date));
View Full Code Here

Examples of net.datacrow.core.objects.Picture

        int[] fields = dco.getFieldIndices();

        int row = position == -1 ? addRow() : position;
        int field;
        int col;
        Picture picture;
        Object value;
        DcImageIcon old_image;
        Picture p;
        for (int i = 0; i < fields.length; i++) {
            field = fields[i];
            col = getColumnIndexForField(field);
            value = dco.getValue(fields[i]);
           
            if (view != null && view.getType() == View._TYPE_INSERT &&  value instanceof Picture) {
               
                // TODO: test this, worked with bytes..
               
                // keep images save
                picture = (Picture) value;
                old_image = (DcImageIcon) picture.getValue(Picture._D_IMAGE);;
               
                if (old_image != null) {
                    p = (Picture) DcModules.get(DcModules._PICTURE).getItem();
                    p.setValue(Picture._A_OBJECTID, picture.getValue(Picture._A_OBJECTID));
                    p.setValue(Picture._B_FIELD, picture.getValue(Picture._B_FIELD));
                    p.setValue(Picture._C_FILENAME, picture.getValue(Picture._C_FILENAME));
                    p.setValue(Picture._E_HEIGHT, picture.getValue(Picture._E_HEIGHT));
                    p.setValue(Picture._F_WIDTH, picture.getValue(Picture._F_WIDTH));
                    p.setValue(Picture._D_IMAGE, new DcImageIcon(old_image.getImage()));
                    picture = p;
                }
                model.setValueAt(picture, row, col);
            } else {
                model.setValueAt(value, row, col);   
View Full Code Here

Examples of net.datacrow.core.objects.Picture

     * Creates a new picture instance.
     * @see Picture
     */
    @Override
    public DcObject createItem() {
        return new Picture();
    }
View Full Code Here

Examples of net.datacrow.core.objects.Picture

            conn = DatabaseManager.getConnection();
            stmt = conn.createStatement();
       
            for (DcField field : dco.getFields()) {
                if (field.getValueType() == DcRepository.ValueTypes._PICTURE) {
                    Picture picture = (Picture) dco.getValue(field.getIndex());
                    ImageIcon image = picture != null ? (ImageIcon) picture.getValue(Picture._D_IMAGE) : null;
                    if (image != null) {
                        if (image.getIconHeight() == 0 || image.getIconWidth() == 0) {
                            logger.warn("Image " + dco.getID() + "_" + field.getDatabaseFieldName() + ".jpg" + " is invalid and will not be saved");
                        } else {
                            picture.setValue(Picture._A_OBJECTID, dco.getID());
                            picture.setValue(Picture._B_FIELD, field.getDatabaseFieldName());
                            picture.setValue(Picture._C_FILENAME, dco.getID() + "_" + field.getDatabaseFieldName() + ".jpg");
                            picture.setValue(Picture._E_HEIGHT, image.getIconHeight());
                            picture.setValue(Picture._F_WIDTH, image.getIconWidth());
                            picture.isEdited(true);
                            pictures.add(picture);
                        }
                    }
                } else if (field.getValueType() == DcRepository.ValueTypes._DCOBJECTCOLLECTION) {
                    Collection<DcMapping> c = (Collection<DcMapping>) dco.getValue(field.getIndex());
View Full Code Here

Examples of net.datacrow.core.objects.Picture

        DcWebImages images = (DcWebImages) vr.resolveVariable(fc, "images");
        images.clear();
       
        for (DcField field : dco.getFields()) {
            if (field.getFieldType() == ComponentFactory._PICTUREFIELD) {
                Picture picture = (Picture) dco.getValue(field.getIndex());
               
                if (picture == null) continue;
               
                picture.loadImage(false);
                if (picture.getValue(Picture._D_IMAGE) != null) {
                    DcWebImage wi = new DcWebImage();
                    wi.setFieldIdx(field.getIndex());
                    wi.setModuleIdx(field.getModule());
                    wi.setPicture(picture);
                    images.add(wi);
View Full Code Here

Examples of net.datacrow.core.objects.Picture

       
        DcWebObject wo = (DcWebObject) vr.resolveVariable(fc, "webObject");
        Map map = fc.getExternalContext().getRequestParameterMap();

        int fieldIdx = Integer.valueOf((String) map.get("fieldIdx"));
        Picture picture = (Picture) wo.getDcObject().getValue(fieldIdx);
        DcWebImage wi = (DcWebImage) vr.resolveVariable(fc, "image");
        wi.setFieldIdx(fieldIdx);
        wi.setModuleIdx(wo.getModule());

        if (picture != null) {
View Full Code Here

Examples of net.datacrow.core.objects.Picture

   
    @Override
    protected void beforeSave() throws ValidationException {
        super.beforeSave();

        Picture picture = (Picture) getValue(_E_PHOTO);
        if (picture == null || picture.getValue(Picture._D_IMAGE) == null) {
            setValue(User._E_PHOTO, new DcImageIcon(DataCrow.installationDir + "icons/" + "user.png"));
        }
       
        String loginname = (String) getValue(_A_LOGINNAME);
        if (loginname != null)
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.