Changeset 885 for trunk/src/org/expeditee/actions
- Timestamp:
- 02/13/14 17:12:35 (10 years ago)
- Location:
- trunk/src/org/expeditee/actions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/ExploratorySearchActions.java
r877 r885 5 5 import org.expeditee.gui.Frame; 6 6 import org.expeditee.gui.FrameIO; 7 import org.expeditee.gui.FrameKeyboardActions; 7 8 import org.expeditee.gui.FrameMouseActions; 8 9 import org.expeditee.gui.FreeItems; 9 10 import org.expeditee.items.Item; 11 import org.expeditee.items.Justification; 10 12 import org.expeditee.items.Text; 11 13 import org.expeditee.settings.exploratorysearch.ExploratorySearchSettings; … … 39 41 } 40 42 41 Item linkToBrowserSession = DisplayIO.getCurrentFrame().addText(FrameMouseActions.getX(), FrameMouseActions.getY(), "Web Browser Session", null);43 Text linkToBrowserSession = DisplayIO.getCurrentFrame().addText(FrameMouseActions.getX(), FrameMouseActions.getY(), " - Web Browser Session", null); 42 44 linkToBrowserSession.setParent(DisplayIO.getCurrentFrame()); 45 FrameKeyboardActions.AddDate(linkToBrowserSession); 43 46 FrameMouseActions.pickup(linkToBrowserSession); 44 47 … … 53 56 54 57 // Add web browser active overlay and @old 55 Text t = (Text) frame.addText(1100, 50, "@ao: 2", null, "overlayset2"); 56 t.setAnchorLeft(1087.0f); 57 t = (Text) frame.addText(1100, 20, "@old", null); 58 t.setAnchorLeft(1087.0f); 58 Text t = (Text) frame.addText(-150, 50, "@ao: 2", null, "overlayset2"); 59 t.setAnchorRight(-100.0f); 60 t.setAnchorTop(50.0f); 61 t = (Text) frame.addText(-150, 50, "@old", null); 62 t.setFamily("Roboto Condensed"); 63 t.setSize(15.0f); 64 t.setColor(null); 65 t.setWidth(116); 66 t.setJustification(Justification.right); 67 t.setLinkMark(false); 68 t.setAnchorLeft(9.0f); 69 t.setAnchorBottom(114.0f); 59 70 60 71 Text wt; … … 68 79 // Start Browser in fullscreen or default, depending on settings 69 80 if(ExploratorySearchSettings.BrowserFullScreen.get()) { 70 wt = frame.addText(144 + lm, 0 + tm, "@iw: org.expeditee.items.widgets.JfxBrowser " 71 + ("--anchorLeft " + lm + " --anchorRight " + rm + " --anchorTop " + (tm + ExploratorySearchSettings.BROWSER_VERT_OFFSET) + " --anchorBottom " + bm + " ") 72 + (Browser._theBrowser.getContentPane().getWidth() - lm - rm) + " " 81 wt = frame.addText(ExploratorySearchSettings.BROWSER_HORZ_OFFSET + lm, ExploratorySearchSettings.BROWSER_VERT_OFFSET + tm, 82 "@iw: org.expeditee.items.widgets.JfxBrowser " 83 + ("--anchorLeft " + (lm + ExploratorySearchSettings.BROWSER_HORZ_OFFSET) + " --anchorRight " + rm + " --anchorTop " 84 + (ExploratorySearchSettings.BROWSER_VERT_OFFSET + tm) + " --anchorBottom " + bm + " ") 85 + (Browser._theBrowser.getContentPane().getWidth() - ExploratorySearchSettings.BROWSER_HORZ_OFFSET - lm - rm) + " " 73 86 + (Browser._theBrowser.getContentPane().getHeight() - ExploratorySearchSettings.BROWSER_VERT_OFFSET - tm - bm) + " : " + url, null); 74 System.err.println(wt.getText());75 } else {76 wt = frame.addText(144 + lm, 0 + tm,"@iw: org.expeditee.items.widgets.JfxBrowser " +87 } else { 88 wt = frame.addText(ExploratorySearchSettings.BROWSER_HORZ_OFFSET + lm, ExploratorySearchSettings.BROWSER_VERT_OFFSET + tm, 89 "@iw: org.expeditee.items.widgets.JfxBrowser " + 77 90 (ExploratorySearchSettings.BrowserDefaultWidth.get() - lm - rm) + " " + 78 91 (ExploratorySearchSettings.BrowserDefaultHeight.get() - tm - bm) + " : " + url, null); … … 91 104 // Replace any text item on cursor with link to a new mindmap 92 105 FreeItems.getInstance().clear(); 93 Text text = DisplayIO.getCurrentFrame().addText(FrameMouseActions.getX(), FrameMouseActions.getY(), " Mindmap Session", null);106 Text text = DisplayIO.getCurrentFrame().addText(FrameMouseActions.getX(), FrameMouseActions.getY(), " - Mindmap Session", null); 94 107 text.setParent(DisplayIO.getCurrentFrame()); 108 FrameKeyboardActions.AddDate(text); 95 109 FrameMouseActions.pickup(text); 96 110 Frame frame = FrameIO.CreateNewFrame(text); … … 99 113 // Clear new frame and add active overlay and @old 100 114 frame.removeAllItems(frame.getItems()); 101 Text t = (Text) frame.addText(1100, 50, "@ao: 2", null, "overlayset3"); 102 t.setAnchorLeft(1087.0f); 103 t = (Text) frame.addText(1100, 20, "@old", null); 104 t.setAnchorLeft(1087.0f); 115 Text t = (Text) frame.addText(-150, 50, "@ao: 2", null, "overlayset3"); 116 t.setAnchorLeft(-150.0f); 117 t.setAnchorTop(50.0f); 118 t = (Text) frame.addText(-150, 50, "@old", null); 119 t.setFamily("Roboto Condensed"); 120 t.setSize(15.0f); 121 t.setColor(null); 122 t.setWidth(116); 123 t.setJustification(Justification.right); 124 t.setLinkMark(false); 125 t.setAnchorLeft(9.0f); 126 t.setAnchorBottom(114.0f); 105 127 106 128 FrameIO.SaveFrame(frame); 107 129 } 108 130 131 /** 132 * Adds a text item to the cursor which is linked to a new frame with the web browser active overlay and a JavaFX browser. 133 * @param caller The item that the action is called from 134 */ 135 public static void startBrowserWithOverlay(Item caller) { 136 try { 137 String url; 138 139 Text urlItem = FreeItems.getTextAttachedToCursor(); 140 141 // If there is a text item attached to the cursor, use it as the URL to load 142 if (urlItem != null) { 143 url = urlItem.getText(); 144 145 // Remove the item, since the link to the browser session will added to the cursor 146 urlItem.delete(); 147 } else { 148 // Otherwise use the home page specified in the settings 149 url = NetworkSettings.HomePage.get(); 150 } 151 152 Text linkToBrowserSession = DisplayIO.getCurrentFrame().addText(FrameMouseActions.getX(), FrameMouseActions.getY(), url, null); 153 linkToBrowserSession.setParent(DisplayIO.getCurrentFrame()); 154 FrameMouseActions.pickup(linkToBrowserSession); 155 156 // Create new frame 157 Frame frame = FrameIO.CreateNewFrame(linkToBrowserSession); 158 159 // link this text item to new frame 160 linkToBrowserSession.setLink("" + frame.getNumber()); 161 162 // Remove everything from new frame 163 frame.removeAllItems(frame.getItems()); 164 165 // Add web browser active overlay and @old 166 Text t = (Text) frame.addText(-150, 50, "@ao: 2", null, "overlayset2"); 167 t.setAnchorLeft(-150.0f); 168 t.setAnchorTop(50.0f); 169 t = (Text) frame.addText(-150, 50, "@old", null); 170 t.setFamily("Roboto Condensed"); 171 t.setSize(15.0f); 172 t.setColor(null); 173 t.setWidth(116); 174 t.setJustification(Justification.right); 175 t.setLinkMark(false); 176 t.setAnchorLeft(9.0f); 177 t.setAnchorBottom(114.0f); 178 179 Text wt; 180 181 // Extract marigns from settings 182 int lm = ExploratorySearchSettings.BrowserLeftMargin.get(); 183 int rm = ExploratorySearchSettings.BrowserRightMargin.get(); 184 int tm = ExploratorySearchSettings.BrowserTopMargin.get(); 185 int bm = ExploratorySearchSettings.BrowserBottomMargin.get(); 186 187 // Start Browser in fullscreen or default, depending on settings 188 if(ExploratorySearchSettings.BrowserFullScreen.get()) { 189 wt = frame.addText(ExploratorySearchSettings.BROWSER_HORZ_OFFSET + lm, ExploratorySearchSettings.BROWSER_VERT_OFFSET + tm, 190 "@iw: org.expeditee.items.widgets.JfxBrowser " 191 + ("--anchorLeft " + (lm + ExploratorySearchSettings.BROWSER_HORZ_OFFSET) + " --anchorRight " + rm + " --anchorTop " 192 + (ExploratorySearchSettings.BROWSER_VERT_OFFSET + tm) + " --anchorBottom " + bm + " ") 193 + (Browser._theBrowser.getContentPane().getWidth() - ExploratorySearchSettings.BROWSER_HORZ_OFFSET - lm - rm) + " " 194 + (Browser._theBrowser.getContentPane().getHeight() - ExploratorySearchSettings.BROWSER_VERT_OFFSET - tm - bm) + " : " + url, null); 195 } else { 196 wt = frame.addText(ExploratorySearchSettings.BROWSER_HORZ_OFFSET + lm, ExploratorySearchSettings.BROWSER_VERT_OFFSET + tm, 197 "@iw: org.expeditee.items.widgets.JfxBrowser " + 198 (ExploratorySearchSettings.BrowserDefaultWidth.get() - lm - rm) + " " + 199 (ExploratorySearchSettings.BrowserDefaultHeight.get() - tm - bm) + " : " + url, null); 200 } 201 202 FrameIO.SaveFrame(frame); // save frame to disk 203 } catch(Exception e) { 204 e.printStackTrace(); 205 } 206 } 207 109 208 } -
trunk/src/org/expeditee/actions/Navigation.java
r669 r885 43 43 public static void GotoHome() { 44 44 FrameUtils.DisplayFrame(UserSettings.HomeFrame.get()); 45 } 46 47 /** 48 * Displays the user's first settings frame - should be `username`2 49 */ 50 public static void GotoSettings() { 51 String framename = UserSettings.HomeFrame.get(); 52 framename = framename.substring(0, framename.length() - 1) + '2'; 53 FrameUtils.DisplayFrame(framename); 45 54 } 46 55
Note:
See TracChangeset
for help on using the changeset viewer.