Ignore:
Timestamp:
02/05/14 15:30:07 (10 years ago)
Author:
jts21
Message:

Implement uploading images to FrameServer so other people can see them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/items/Picture.java

    r793 r843  
    2626
    2727import org.expeditee.gui.FrameGraphics;
     28import org.expeditee.gui.FrameIO;
    2829import org.expeditee.gui.FrameMouseActions;
     30import org.expeditee.gui.FrameUtils;
    2931import org.expeditee.stats.Logger;
    3032
     
    740742                return _fileName;
    741743        }
     744       
     745        public String getPath() {
     746                return _path;
     747        }
     748       
     749        /**
     750         * Copies the image to the default images folder and updates the reference to it in Expeditee
     751         * Used for correcting image references for FrameShare
     752         */
     753        public void moveToImagesFolder() {
     754                File f = new File(getPath());
     755                // if the file is not in the default images folder, copy it there
     756                if(! f.getParentFile().equals(new File(FrameIO.IMAGES_PATH))) {
     757                        try {
     758                                File f2 = new File(FrameIO.IMAGES_PATH + f.getName());
     759                FrameUtils.copyFile(f, f2, false);
     760                f = f2;
     761            } catch (IOException e) {
     762                e.printStackTrace();
     763                f = null;
     764            }
     765                }
     766                _path = f.getPath();
     767                _fileName = f.getName();
     768                updateSource();
     769        }
    742770
    743771        protected String getTagText() {
Note: See TracChangeset for help on using the changeset viewer.