Examples of DcImageIcon


Examples of net.datacrow.util.DcImageIcon

   
    public DcImageIcon getScaledPicture() {
        String filename = getScaledFilename();
        if (filename != null) {
            if (scaledImage != null) scaledImage.flush();
            return new DcImageIcon(new File(DataCrow.imageDir, filename));
        }
        return null;
    }
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

                NodeElement existingNe;
                NodeElement ne;
                String id = null;
                String value = null;
                Object key = null;
                DcImageIcon icon = null;
                String iconBase64 = null;
                DcField field = null;
                int module;

                DefaultTreeModel model = (DefaultTreeModel) tree.getModel();
               
                DefaultMutableTreeNode current;
                DefaultMutableTreeNode parent;
                DefaultMutableTreeNode previous;
                boolean exists = false;
               
                Map<String, Integer> items = DataManager.getKeys(DataFilters.getCurrent(getModule()));
               
                Collection<String> keys = null;
                if (DataFilters.isFilterActive(getModule())) {
                    keys = new ArrayList<String>(items.keySet());
                }
               
                while (rs.next() && !stop) {
                    int level = 0;
                    parent = top;
                   
                    for (int idx = 0; idx < fields.length; idx++) {
                     
                      field = DcModules.get(getModule()).getField(fields[idx]);
                      if (field.isUiOnly() &&
                          field.getIndex() != DcObject._SYS_MODULE &&
                          field.getValueType() != DcRepository.ValueTypes._DCOBJECTCOLLECTION &&
                          field.getFieldType() != ComponentFactory._REFERENCEFIELD)
                        continue;
                     
                       
                        if (stop) break;
                       
                        // for each level the field index is shifted to the end.
                        id = rs.getString(1);
                        module = rs.getInt(2);
                        key = field.getIndex() == DcObject._SYS_MODULE ? DcModules.get(module).getLabel() : rs.getObject((level * 3) + 3);
                        value =  field.getIndex() == DcObject._SYS_MODULE ? DcModules.get(module).getLabel() : rs.getString((level * 3) + 4);
                        iconBase64 = field.getIndex() != DcObject._SYS_MODULE ? rs.getString((level * 3) + 5) : null;
                       
                        icon = field.getIndex() == DcObject._SYS_MODULE ?
                                new DcImageIcon(DcModules.get(module).getIcon16().getImage()) :
                                iconBase64 != null ? DataManager.addIcon(String.valueOf(key), iconBase64) : null;
                       
                        if (keys != null && !keys.contains(id)) continue;
                       
                        previous = parent.getChildCount() == 0 ? null : ((DefaultMutableTreeNode) parent.getChildAt(parent.getChildCount() - 1));
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

        checkCanBeLended.setSelected(module.canBeLend());
        checkFileBacked.setSelected(module.isFileBacked());
        checkContainerManaged.setSelected(module.isContainerManaged());
       
        if (module.getIcon16() != null)
            pic16.setIcon(new DcImageIcon(module.getIcon16()));
       
        if (module.getIcon32() != null)
            pic32.setIcon(new DcImageIcon(module.getIcon32()));
       
        boolean simpleMod = getModule().getModuleClass().equals(DcPropertyModule.class) ||    
                                 getModule().getModuleClass().equals(DcAssociateModule.class);
       
        checkFileBacked.setVisible(!simpleMod);
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

        ImageIcon icon32 = pic32.getIcon();

        try {
            if (pic16.isChanged() || getWizard() instanceof CreateModuleWizard) {
                module.setIcon16(Utilities.getBytes(icon16.getImage(), DcImageIcon._TYPE_PNG));
                module.setIcon16Filename(saveIcon(new DcImageIcon(module.getIcon16()), "_small"));
            }
           
            if (pic32.isChanged() || getWizard() instanceof CreateModuleWizard) {
                module.setIcon32(Utilities.getBytes(icon32.getImage(), DcImageIcon._TYPE_PNG));
                module.setIcon32Filename(saveIcon(new DcImageIcon(module.getIcon32()), ""));               
            }
        } catch (Exception e) {
          logger.error("Error while reading the icons", e);
          throw new WizardException("Could not store / use the selected icons");
        }
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

        add(checkCanBeLended,
                Layout.getGBC(1, y++, 2, 1, 1.0, 1.0
               ,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
                new Insets( 5, 5, 5, 5), 0, 0));

        pic16 = ComponentFactory.getIconSelectField(new DcImageIcon(DataCrow.installationDir + "icons/icon16.png"));
        pic32 = ComponentFactory.getIconSelectField(new DcImageIcon(DataCrow.installationDir + "icons/icon32.png"));
           
        add(ComponentFactory.getLabel(DcResources.getText("lblIcon16")),
                     Layout.getGBC(0, y, 1, 1, 1.0, 1.0
                    ,GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
                     new Insets(5, 5, 5, 5), 0, 0));
View Full Code Here

Examples of net.datacrow.util.DcImageIcon

            return;
       
        try {
            byte[] bytes = Utilities.readFile(file);
            Image image = Utilities.getScaledImage(bytes, size.width, size.height);
            setIcon(new DcImageIcon(image));
            image = null;
            changed = true;
        } catch (Exception exp) {
            DcSwingUtilities.displayErrorMessage(exp.toString());
        }
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.