Ignore:
Timestamp:
12/09/13 14:42:44 (11 years ago)
Author:
jts21
Message:

EXA save format working + automatically converting save files to it's own format
Pictures are no longer XRayables, working fine except for a bug with cropping, and some problems with the default image that I need to fix.
FramePicture/FrameImage/FrameBitmap are disabled because they need to be changed to work with the modified Picture format but I don't know what they do so couldn't test them (will need to look into fixing that)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/actions/Misc.java

    r585 r589  
    4343import org.expeditee.io.ExaWriter;
    4444import org.expeditee.io.flowlayout.XGroupItem;
     45import org.expeditee.items.DotType;
    4546import org.expeditee.items.Item;
    4647import org.expeditee.items.ItemUtils;
    4748import org.expeditee.items.Line;
     49import org.expeditee.items.Picture;
    4850import org.expeditee.items.Text;
    4951import org.expeditee.items.widgets.InteractiveWidget;
     
    13691371                        fw.writeFrame(frame);
    13701372                        String contents = fw.getFileContents();
    1371                         System.out.println("*****\n" + contents + "*****");
    13721373                        Frame newFrame;
    13731374                        try {
     
    13751376                                System.out.println(nextName);
    13761377                                newFrame = new ExaReader(nextName).readFrame(new BufferedReader(new StringReader(contents)));
     1378                                newFrame.setChanged(true);
    13771379                                newFrame.setPath(frame.getPath());
    1378                                 Text text = frame.addText(100, 100, "new Frame", null);
     1380                                FrameIO.SaveFrame(newFrame);
     1381                                Text text = new Text(DisplayIO.getCurrentFrame().getNextItemID(), "New frame");
     1382                                text.setPosition(FrameMouseActions.MouseX, FrameMouseActions.MouseY);
    13791383                                text.setLink(newFrame.getName());
    1380                                 FrameIO.SaveFrame(newFrame);
     1384                                FrameMouseActions.pickup(text);
     1385                               
    13811386                        } catch (Exception e) {
    13821387                                e.printStackTrace();
    13831388                        }
    1384                         System.out.println("*****");
    13851389
    13861390        } catch (Exception e) {
     
    13881392        }
    13891393        }
     1394       
     1395        public static Item testPicture(String string) {
     1396                // return new Picture(string, DisplayIO.getCurrentFrame());
     1397                Picture p = new Picture(DisplayIO.getCurrentFrame().getNextItemID());
     1398                // p.setPosition(100, 100);
     1399                // p.scale(0.1F, (int)FrameMouseActions.MouseX, (int)FrameMouseActions.MouseY);
     1400                p.setDateCreated("09Dec2013[12:17.43]");
     1401                p.setPosition(149, 189);
     1402                p.setGradientAngle(0);
     1403                p.setDotType(DotType.square);
     1404                p.setSize(18.f);
     1405                p.setImageSource("/home/jts21/wallpaper.png");
     1406                p.setScale(0.1f);
     1407               
     1408                // p.setImageSource(string);
     1409                return p;
     1410        }
     1411       
     1412        public static void getAllItems(Frame frame) {
     1413                System.out.println(frame.getAllItems());
     1414        }
     1415       
     1416        public static void getItemsToSave(Frame frame) {
     1417                System.out.println(frame.getItemsToSave());
     1418        }
    13901419}
Note: See TracChangeset for help on using the changeset viewer.