Ignore:
Timestamp:
01/28/14 16:46:08 (10 years ago)
Author:
csl14
Message:

Added Exploratory Search settings package; can now specify height and width or fullscreen mode for JfxBrowser and specify whitespace margins

Location:
trunk/src/org/expeditee/actions
Files:
1 added
2 edited

Legend:

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

    r748 r766  
    2525        /**
    2626         * Launches items.widgets.JfxBrowser and uses Text item as URL.
    27          * Note: currently doesn't work
    2827         * @param text Text item which passes contents as URL for browser.
    2928         * @throws Exception
     
    5958        /**
    6059         * Text item becomes link to new frame containing items.widgets.JfxBrowser and uses Text item as URL for browser.
    61          * Note: currently doesn't work
    6260         * @param text Text item which passes contents as URL for browser and becomes link to the browser's new frame.
    6361         * @throws Exception
     
    8684                // Create widget via text annotation
    8785                Text wt = frame.addText(0, JfxBrowser.VERT_OFFSET, "@iw: org.expeditee.items.widgets.JfxBrowser "+ (Browser._theBrowser.getWidth() - JfxBrowser.HORZ_CROP)+
    88                                  " " + (Browser._theBrowser.getHeight() - JfxBrowser.VERT_CROP) + " : ".concat(text.getText()), null);
     86                                 " " + (Browser._theBrowser.getHeight() - JfxBrowser.VERT_CROP - JfxBrowser.VERT_OFFSET) + " : ".concat(text.getText()), null);
    8987                InteractiveWidget.createWidget(wt);
    9088               
     
    111109        }
    112110       
    113         /**
    114          * Adds a text item to the cursor which is linked to a new frame with the web browser active overlay and a JavaFX browser.
    115          * @param text The text item attached to the cursor.
    116          */
    117         public static void startBrowserSession(Text text) {
    118                 try {
    119                         if (!(text instanceof Text)) {
    120                                 MessageBay.errorMessage("Must be a text item.");
    121                                 return;
    122                         }
    123                        
    124                         if(text.getLink() != null) {                                            // text item can't already have a link
    125                                 MessageBay.errorMessage("Text item already has link.");
    126                                 return;
    127                         }
    128                        
    129                         String url = "";
    130                        
    131                         // If no text with url is passed to action create a new text item
    132                         if(!FreeItems.textOnlyAttachedToCursor()) {
    133                                 url = NetworkSettings.HomePage.get();                                   // use home page specified by settings
    134                                 text = DisplayIO.getCurrentFrame().addText(FrameMouseActions.getX(), FrameMouseActions.getY(),
    135                                                 "Web Browser Session", null);
    136                                 text.setParent(DisplayIO.getCurrentFrame());
    137                                 FrameMouseActions.pickup(text);
    138                         } else {
    139                                 url = text.getText();                                                   // get url from text attached to cursor if possible
    140                         }
    141                        
    142                         // Set text to session id. TODO: set session id.
    143                         text.setText("Web Browser Session");
    144                        
    145                         // Create new frame
    146                         Frame frame = FrameIO.CreateNewFrame(text);
    147                         text.setLink("" + frame.getNumber());                           // link this text item to new frame
    148                        
    149                         // Remove everything from new page
    150                         frame.removeAllItems(frame.getItems());
    151                        
    152                         // Add web browser active overlay
    153                         frame.addText(1100, 50, "@ao: 2", null, "overlayset2");
    154                         // Add @old
    155                         frame.addText(1100, 20, "@old", null);
    156                        
    157                         // Create widget via text annotation
    158                         Text wt = frame.addText(0, 80, "@iw: org.expeditee.items.widgets.JfxBrowser "+ (Browser._theBrowser.getWidth() - JfxBrowser.HORZ_CROP)+
    159                                          " " + (Browser._theBrowser.getHeight() - JfxBrowser.VERT_CROP) + " : ".concat(url), null);
    160                         InteractiveWidget.createWidget(wt);
    161                        
    162                         FrameIO.SaveFrame(frame);                                                       // save frame to disk
    163                 } catch(Exception e) {
    164                         e.printStackTrace();
    165                 }
    166         }
    167        
    168111        public static void gotoURL(Text link, String URL) {
    169112                Frame frame = FrameIO.CreateNewFrame(link);
  • trunk/src/org/expeditee/actions/Misc.java

    r748 r766  
    11771177                FrameUtils.CreateDefaultProfile(UserSettings.UserName.get(), homeFrame);
    11781178        }
    1179 
    1180         /**
    1181          * Adds a text item to the cursor which is linked to a new frame with the mindmap active overlay.
    1182          */
    1183         public static void startMindmapSession() {
    1184                 // Replace any text item on cursor with link to a new mindmap
    1185                 FreeItems.getInstance().clear();
    1186                 Text text = DisplayIO.getCurrentFrame().addText(FrameMouseActions.getX(), FrameMouseActions.getY(), "Mindmap Session", null);
    1187                 text.setParent(DisplayIO.getCurrentFrame());
    1188                 FrameMouseActions.pickup(text);
    1189                 Frame frame = FrameIO.CreateNewFrame(text);
    1190                 text.setLink("" + frame.getNumber());
    1191                
    1192                 // Clear new frame and add active overlay and @old
    1193                 frame.removeAllItems(frame.getItems());
    1194                 frame.addText(1100, 50, "@ao: 2", null, "overlayset3");
    1195                 frame.addText(1100, 20, "@old", null);
    1196                
    1197                 FrameIO.SaveFrame(frame);
    1198         }
    11991179       
    12001180        /**
Note: See TracChangeset for help on using the changeset viewer.