Examples of DcImageIcon


Examples of net.datacrow.util.DcImageIcon

                        } else {
                            DataManager.createReference(dco, field, o);
                        }
                    }
                } else if (value instanceof Picture) {
                    dco.setValue(field, new DcImageIcon(((Picture) value).getImage()));
                } else {
                    dco.setValue(field, value);   
                }               
            }
        }
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

        if (fldTitle != null)
            fldTitle.setBackground(color);
    }   
   
    private void addPicture(Collection<Picture> pictures) {
        DcImageIcon scaledImage;
        DcImageIcon image;
        for (Picture p : pictures) {
           
            if (p == null || !p.hasImage()) continue;
               
            scaledImage = p.getScaledPicture();
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

    }
   
    private void copyImage(Picture picture, File target) {
        try {
            picture.loadImage(false);
            DcImageIcon icon = (DcImageIcon) picture.getValue(Picture._D_IMAGE);

            if (icon != null) {
                if (settings.getBoolean(ItemExporterSettings._SCALE_IMAGES)) {
                    int width = settings.getInt(ItemExporterSettings._IMAGE_WIDTH);
                    int height = settings.getInt(ItemExporterSettings._IMAGE_HEIGHT);
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

        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.util.DcImageIcon

                         dco.setValue(field.getIndex(), Long.valueOf(sValue));
                }
            } else if (field.getValueType() == DcRepository.ValueTypes._PICTURE) {
                File file = getImagePath(value);
                if (file.exists())
                    dco.setValue(field.getIndex(), new DcImageIcon(file));
            } else if (field.getValueType() == DcRepository.ValueTypes._ICON) {
                File file = getImagePath(value);
                if (file.exists()) {
                    String s = Utilities.fileToBase64String(file);
                    s = Utilities.isEmpty(s) ? Utilities.fileToBase64String(new File(value)) : s;
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

            icons.put(file.substring(0, file.length() - 4), new DcImageIcon(DataCrow.iconsDir + file));
        }
    }
   
    public static DcImageIcon addIcon(String ID, String base64) {
        DcImageIcon icon = null;
        if (icons.containsKey(ID)) {
            icon = icons.get(ID);
        } else {
            if (base64 != null) {
                icon = Utilities.base64ToImage(base64);
                String filename = DataCrow.iconsDir + ID + ".png";
                icon.setFilename(filename);
                icon.save();
            }
            icons.put(ID, icon);
        }
       
        if (icon != null && !icon.exists())
            icon.save();
       
        // re-load image if necessary
        if (icon != null)
            icon.setImage(icon.getImage());
       
        return icon;
    }
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

       
        return icon;
    }

    public static DcImageIcon getIcon(DcObject dco) {
        DcImageIcon icon;
        if (icons.containsKey(dco.getID())) {
            icon = icons.get(dco.getID());
        } else {
            icon = dco.createIcon();
            if (icon != null) {
                String filename = DataCrow.iconsDir + dco.getID() + ".png";
                icon.setFilename(filename);
                icon.save();
            }
            icons.put(dco.getID(), icon);
        }
       
        if (icon != null && !icon.exists())
            icon.save();
       
        if (icon != null)
            icon.setImage(icon.getImage());
       
        return icon;
    }
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

    public static void removeIcon(String ID) {
        updateIcon(ID);
    }

    public static void updateIcon(String ID) {
        DcImageIcon icon = icons.remove(ID);
        if (icon != null) {
            new File(icon.getFilename()).delete();
            icon.flush();
        }
    }
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

                            2;
               
                tab.setValue(Tab._C_ORDER, Long.valueOf(order));
               
                if (name.equalsIgnoreCase(DcResources.getText("lblInformation")) || name.equals(DcResources.getText("lblSummary")))
                    tab.setValue(Tab._B_ICON, new DcImageIcon(DataCrow.installationDir + "icons" + File.separator + "information.png"));
                else if (name.equalsIgnoreCase(DcResources.getText("lblTechnicalInfo")))
                    tab.setValue(Tab._B_ICON, new DcImageIcon(DataCrow.installationDir + "icons" + File.separator + "informationtechnical.png"));
               
                tab.saveNew(false);
            } catch (Exception e) {
                logger.error(e, e);
                exists = false;
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

                     " order by 2";

        List<DcSimpleValue> values = new ArrayList<DcSimpleValue>();
        try {
            ResultSet rs = DatabaseManager.executeSQL(sql);
            DcImageIcon icon;
            DcSimpleValue sv;
            String s;
            while (rs.next()) {
                sv = new DcSimpleValue(rs.getString(1), rs.getString(2));
                if (useIcons) {
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.