Examples of DcImageIcon


Examples of net.datacrow.util.DcImageIcon

                       
                        int size = (int) ze.getSize();
                        byte[] bytes = new byte[size];
                        bis.read(bytes);
                       
                        DcImageIcon icon = new DcImageIcon(bytes);
                        icon.setFilename(name.substring(name.indexOf("_") + 1));
                        c.add(icon);
                       
                        icons.put(moduleName, c);
                    } else if (name.toLowerCase().endsWith(".properties")) {
                        writeToFile(bis, new File(DataCrow.moduleDir, name));
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

    private void buildPanel() {
        //**********************************************************
        //Logo
        //**********************************************************
        JLabel logo = new JLabel(new DcImageIcon(DataCrow.installationDir + "icons/logo.jpg"));

        //**********************************************************
        //Status
        //**********************************************************
        status.setPreferredSize(new Dimension(500, 22));
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

                    // draw the first page to an image
                    PDFPage page = pdffile.getPage(0);
                    if (page != null) {
                        Rectangle rect = new Rectangle(0,0, (int)page.getBBox().getWidth(), (int)page.getBBox().getHeight());
                        Image front = page.getImage(rect.width, rect.height, rect, null, true, true);
                        book.setValue(Book._K_PICTUREFRONT, new DcImageIcon(Utilities.getBytes(new DcImageIcon(front))));
                    }
                } finally {
                    if (raf != null)
                        raf.close();
                   
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

     */
    public static SettingsView getView() {
        SettingsView view = new SettingsView(DcResources.getText("lblDataCrowSettings"),
                                             applicationSettings.getSettings());
       
        ImageIcon icon = new DcImageIcon(DataCrow.installationDir + "icons/logo.jpg");
        view.setDisclaimer(icon);

        view.setSize(new Dimension(875, 470));
        view.setCenteredLocation();
        return view;
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

        DcWebImage wi = (DcWebImage) vr.resolveVariable(fc, "image");
        byte[] b = uploadedFile.getBytes();
       
        DcWebObject wo = (DcWebObject) vr.resolveVariable(fc, "webObject");
        DcObject dco = wo.getDcObject();
        dco.setValue(wi.getFieldIdx(), new DcImageIcon(b));
       
        try {
            dco.saveUpdate(false);
            wi.setPicture((Picture) dco.getValue(wi.getFieldIdx()));
            wo.load();
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

                setValueNative(o, field);  
            } else {
                Picture picture = value == null ? (Picture) DcModules.get(DcModules._PICTURE).getItem() : (Picture) value;
                value = picture;

                DcImageIcon currentImage = (DcImageIcon) picture.getValue(Picture._D_IMAGE);
                DcImageIcon newImage = o instanceof DcImageIcon ? (DcImageIcon) o :
                                     o instanceof byte[] ? new DcImageIcon((byte[]) o) : null;

              // prevent empty and incorrect images to be saved
            if newImage != null &&
                newImage.getIconHeight() != 0 &&
                newImage.getIconWidth() != 0) {
             
                if (currentImage != null) currentImage.flush();
               
                  picture.setValue(Picture._D_IMAGE, newImage);
                  picture.isEdited(true);
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

    public DcImageIcon createIcon() {
        DcField field = getModule().getIconField();
       
        if (field != null) {
            String value = (String) getValue(field.getIndex());
            DcImageIcon icon = null;
           
            if (value != null && value.length() > 1)
                icon = Utilities.base64ToImage(value);
           
            return icon;
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

           
            String value = (String) getValue(field.getIndex());
           
            if (value != null && value.length() > 0) {
                byte[] bytes = Base64.decode(value.toCharArray());
                DcImageIcon current = new DcImageIcon(bytes);
               
                if (current.getIconHeight() > 16 || current.getIconWidth() > 16) {
                    BufferedImage img = Utilities.toBufferedImage(current, 16, 16);
                    try {
                        bytes = Utilities.getBytes(new DcImageIcon(img), DcImageIcon._TYPE_PNG);
                        setValue(field.getIndex(), new String(Base64.encode(bytes)));
                    } catch (Exception e) {
                        logger.error("Could not save scaled image for object with ID " + getID(), e);
                    }
                }
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

    public void flushImages() {
        for (DcField field : getFields()) {
            if (field.getValueType() == DcRepository.ValueTypes._PICTURE) {
                Picture picture = (Picture) getValue(field.getIndex());
                if (picture != null) {
                    DcImageIcon icon = (DcImageIcon) picture.getValue(Picture._D_IMAGE);
                    if (icon != null) icon.flush();
                }
            }
        }
    }   
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

                continue;
           
            if (field != _ID) {
              Object o = dco.getValue(field);
              if (o instanceof DcImageIcon) {
                DcImageIcon oldIcon = (DcImageIcon) o;
                DcImageIcon icon = new DcImageIcon(oldIcon.getImage());
                icon.setFilename(oldIcon.getFilename());
                setValue(field, icon);
              } else if (o != null && getField(field).getValueType() == DcRepository.ValueTypes._PICTURE) {
                    Picture curPic = (Picture) dco.getValue(field);
                   
                    Picture newPic = (Picture) DcModules.get(DcModules._PICTURE).getItem();
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.