Examples of ImageModel


Examples of clips.dicom.model.ImageModel

  public void itemStateChanged(ItemEvent e) {
   
  }
 
  public void setImages(AgregatorItem imgs){
    ImageModel        oldImageControl = imageModel;
    if (imgs == null) {
      imageModel = null;
    }
    else {
      imageModel = imgs.getImageModel();
    }
    if (imageModel != oldImageControl){
      for (TypedChangeListener<ImageModel.Params> listener: controlList) {
        if (oldImageControl != null) {
          oldImageControl.removeChangeListener(listener.getType(), listener);
        }
        if (imageModel != null) {
          imageModel.addChangeListener(listener.getType(), listener);
        }
        listener.stateChanged(null);
      }
     
      if (oldImageControl != null) {
        oldImageControl.removeChangeListener(null, this);
      }
      if (imageModel != null) {
        imageModel.addChangeListener(null, this);
      }
      curImageID = -1;
View Full Code Here

Examples of com.aurifa.struts2.plugin.image.component.ImageModel

public class ImageTagLibrary implements TagLibrary{
 
  public Object getFreemarkerModels(ValueStack stack,
          HttpServletRequest req, HttpServletResponse res) {
          return new ImageModel(stack, req, res);
      }
View Full Code Here

Examples of com.sparc.knappsack.models.ImageModel

        List<ApplicationModel> searchResults = new ArrayList<ApplicationModel>();
        try {
            searchResults = searchService.searchApplications(URLDecoder.decode(searchCriteria.toLowerCase(), "UTF-8"), user, userAgentInfo.getApplicationType());
            for (ApplicationModel applicationModel : searchResults) {
                ImageModel imageModel = applicationModel.getIcon();
                if (imageModel != null) {
                    imageModel.setUrl(WebRequest.getInstance().generateURL(imageModel.getUrl()));
                }
            }
        } catch (UnsupportedEncodingException e) {
            log.error("UnsupportedEncodingException caught performing a search with the following criteria: " + searchCriteria);
        }
View Full Code Here

Examples of com.sparc.knappsack.models.ImageModel

        return "";
    }

    @Override
    public ImageModel createImageModel(AppFile appFile) {
        ImageModel imageModel = null;
        if (appFile != null) {
            imageModel = new ImageModel();
            imageModel.setId(appFile.getId());
            imageModel.setUrl(getImageUrl(appFile));
        }

        return imageModel;
    }
View Full Code Here

Examples of com.sparc.knappsack.models.ImageModel

        appFileService.add(appFile);

        List<AppFile> appFiles = appFileService.getAll();
        assertTrue(appFiles.size() == 1);

        ImageModel imageModel = appFileService.createImageModel(appFile);
        assertNotNull(imageModel);
        assertTrue(imageModel.getUrl().equals("http://serverName/knappsack/image/" + appFile.getId()));
    }
View Full Code Here

Examples of com.sparc.knappsack.models.api.v1.ImageModel

    private AppFileService appFileService;

    @Override
    public ImageModel convert(AppFile source, Type<? extends ImageModel> destinationType) {
        com.sparc.knappsack.models.ImageModel model = appFileService.createImageModel(source);
        ImageModel imageModel = new ImageModel();
        imageModel.setId(model.getId());
        imageModel.setUrl(model.getUrl());
        return imageModel;
    }
View Full Code Here

Examples of com.sparc.knappsack.models.api.v1.ImageModel

            return imageModels;
        }

        for (AppFile appFile : source) {
            com.sparc.knappsack.models.ImageModel model = appFileService.createImageModel(appFile);
            ImageModel imageModel = new ImageModel();
            imageModel.setId(model.getId());
            imageModel.setUrl(model.getUrl());
            imageModels.add(imageModel);
        }

        return imageModels;
    }
View Full Code Here

Examples of de.offis.faint.model.ImageModel

  public Region[] detectFaces(String file, int minScanWindowSize) {
   
    try {
      byte[] bytes = null;
      double scaleFactor = 1;
      ImageModel image = new ImageModel(file);
      image.getImage(true);

     
      // Prepare byte array to send
      if (downScale){
       
        int height = image.getHeight();
        int width = image.getWidth();

        if (height > MAXSIZE.getHeight() || width > MAXSIZE.getWidth()){
          double aspect = (double) width / (double) height;
          scaleFactor = width;
          if (aspect > (MAXSIZE.getWidth() / MAXSIZE.getHeight())) {
            width = (int) Math.round(MAXSIZE.getWidth());
            height = (int) Math.round((1.0 /aspect) * width);
          }
          else
          {
            height = (int) Math.round(MAXSIZE.getHeight());
            width = (int) Math.round(aspect * height);
          }
          scaleFactor = (double) width / scaleFactor; // scale = newWidth / oldWidth
          minScanWindowSize = (int) Math.round(minScanWindowSize * scaleFactor);
        }
       
        BufferedImage i = Utilities.getScaledCopy(image.getImage(false),width, height, Image.SCALE_SMOOTH);
        ByteArrayOutputStream o = new ByteArrayOutputStream();
        ImageIO.write(i ,"jpg", o);
        o.close();
        bytes = o.toByteArray();
      }
      else {
       
        bytes = new byte[(int) image.getFile().length()];
       
        InputStream is = new FileInputStream(file);
        int offset = 0;
        int numRead = 0;
        while (offset < bytes.length && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0) {
View Full Code Here

Examples of de.offis.faint.model.ImageModel

    }
   
    // Open Image
    else if (incomingEvent instanceof EventOpenImage){
      EventOpenImage event = (EventOpenImage) incomingEvent;
      ImageModel image = event.getImage();
     
     
      if (image == null || image.isAvailable()){
      mainFrame.setEnabled(false);
     
      if (currentImage == null || !currentImage.equals(image)) {
        currentImage = image;
       
        // Cache BufferedImage
        if (image != null)
          MainController.getInstance().getBufferedImageCache().cacheImage(image.getFile().getPath());
       
        // Update Image
        mainFrame.browserTab.getImagePanel().setImage(image);

        // Update AnnotationTable and selected region
        mainFrame.browserTab.getAnnotationPanel().setImage(currentImage);
       
        // Make sure that the right folder is opened.
        if (currentImage!=null)
          dispatchEvent(new EventOpenFolder(currentImage.getFolder()));
       
        // Make sure that the right thumbnail is selected
        mainFrame.browserTab.getThumbnailPanel().setSelectedImage(image);
       
        // Update Buttons
        dispatchEvent(new EventUpdateMenuBar(currentImage != null));
      }
     
      mainFrame.setEnabled(true);
      }
      else {
        new InfoDialog(mainFrame," Image "+image.getFile().getPath()+" not available!");       
      }
    }
   
    // Delete Person
    else if (incomingEvent instanceof EventDeletePerson){
      EventDeletePerson event = (EventDeletePerson) incomingEvent;
     
      String[] options = { "Ok", "Cancel"};
      int n = JOptionPane.showOptionDialog( mainFrame,
          "Remove "+event.getName()+" from database?",
          "Delete Person",
          JOptionPane.YES_NO_OPTION,
          JOptionPane.QUESTION_MESSAGE,
          null, options,options[0] );
      if ( n == JOptionPane.YES_OPTION )
      {
        MainController.getInstance().getFaceDB().deleteAnnotation(event.getName());
        mainFrame.browserTab.getAnnotationPanel().updateFromModel();
        mainFrame.browserTab.getImagePanel().getClassificationPanel().updateFromModel();
        mainFrame.faceDBTab.getPersonPanel().updateFromModel();       
      }
    }
   
        // Set the classification of a region
    else if (incomingEvent instanceof EventClassifyRegion){
      EventClassifyRegion event = (EventClassifyRegion) incomingEvent;     
               
      // Save classification in database
      MainController.getInstance().getFaceDB().put(event.getRegion(),event.getAnnotation());
     
      // Update view
      mainFrame.browserTab.getAnnotationPanel().repaint();
      mainFrame.browserTab.getImagePanel().getClassificationPanel().repaint();
    }
   
    // Rename a person
    else if (incomingEvent instanceof EventRenamePerson){
      EventRenamePerson event = (EventRenamePerson) incomingEvent;
      MainController.getInstance().getFaceDB().renameAnnotation(event.getOldName(), event.getNewName());
      mainFrame.browserTab.getAnnotationPanel().updateFromModel();
      mainFrame.browserTab.getImagePanel().getClassificationPanel().updateFromModel();
      mainFrame.faceDBTab.getPersonPanel().updateFromModel();
    }
   
        // Change training flag of region
    else if (incomingEvent instanceof EventModifyTrainingData){
      EventModifyTrainingData event = (EventModifyTrainingData) incomingEvent;
      event.getRegion().setUsedForTraining(event.getValue())
    }

   
    // Add a new person to the database
    else if (incomingEvent instanceof EventAddKnownPerson){
      EventAddKnownPerson event = (EventAddKnownPerson) incomingEvent;
      MainController.getInstance().getFaceDB().put(null, event.getName());
    }
   
    // Selected region changed
    else if (incomingEvent instanceof EventRegionSelectionChanged){
      EventRegionSelectionChanged event = (EventRegionSelectionChanged) incomingEvent;
      Region newRegion = event.getRegion();
     
      if (newRegion != null){
        ImageModel image = new ImageModel(newRegion.getImage());
        if (currentImage == null || !currentImage.equals(image))
        {
          dispatchEvent(new EventOpenImage(image));
         
          if (currentImage == null || !currentImage.equals(image))
View Full Code Here

Examples of de.offis.faint.model.ImageModel

 
  @Override
  public void run() {
    while(true){
      while(!thumbNailsToPreload.isEmpty()){
        ImageModel model = thumbNailsToPreload.firstElement();
        model.initThumbnail();
        thumbModel.reportThumbnailUpdate();
        thumbNailsToPreload.remove(model);
      }
      suspended = true;
      synchronized(this) {
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.