Changeset 766 for trunk/src/org/expeditee/actions
- Timestamp:
- 01/28/14 16:46:08 (10 years ago)
- Location:
- trunk/src/org/expeditee/actions
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/JfxBrowserActions.java
r748 r766 25 25 /** 26 26 * Launches items.widgets.JfxBrowser and uses Text item as URL. 27 * Note: currently doesn't work28 27 * @param text Text item which passes contents as URL for browser. 29 28 * @throws Exception … … 59 58 /** 60 59 * Text item becomes link to new frame containing items.widgets.JfxBrowser and uses Text item as URL for browser. 61 * Note: currently doesn't work62 60 * @param text Text item which passes contents as URL for browser and becomes link to the browser's new frame. 63 61 * @throws Exception … … 86 84 // Create widget via text annotation 87 85 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); 89 87 InteractiveWidget.createWidget(wt); 90 88 … … 111 109 } 112 110 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 link125 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 item132 if(!FreeItems.textOnlyAttachedToCursor()) {133 url = NetworkSettings.HomePage.get(); // use home page specified by settings134 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 possible140 }141 142 // Set text to session id. TODO: set session id.143 text.setText("Web Browser Session");144 145 // Create new frame146 Frame frame = FrameIO.CreateNewFrame(text);147 text.setLink("" + frame.getNumber()); // link this text item to new frame148 149 // Remove everything from new page150 frame.removeAllItems(frame.getItems());151 152 // Add web browser active overlay153 frame.addText(1100, 50, "@ao: 2", null, "overlayset2");154 // Add @old155 frame.addText(1100, 20, "@old", null);156 157 // Create widget via text annotation158 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 disk163 } catch(Exception e) {164 e.printStackTrace();165 }166 }167 168 111 public static void gotoURL(Text link, String URL) { 169 112 Frame frame = FrameIO.CreateNewFrame(link); -
trunk/src/org/expeditee/actions/Misc.java
r748 r766 1177 1177 FrameUtils.CreateDefaultProfile(UserSettings.UserName.get(), homeFrame); 1178 1178 } 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 mindmap1185 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 @old1193 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 }1199 1179 1200 1180 /**
Note:
See TracChangeset
for help on using the changeset viewer.