Ignore:
Timestamp:
02/13/14 17:12:35 (10 years ago)
Author:
csl14
Message:

Made changes to Exploratory Search interface and minor fixes to various things

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

Legend:

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

    r877 r885  
    55import org.expeditee.gui.Frame;
    66import org.expeditee.gui.FrameIO;
     7import org.expeditee.gui.FrameKeyboardActions;
    78import org.expeditee.gui.FrameMouseActions;
    89import org.expeditee.gui.FreeItems;
    910import org.expeditee.items.Item;
     11import org.expeditee.items.Justification;
    1012import org.expeditee.items.Text;
    1113import org.expeditee.settings.exploratorysearch.ExploratorySearchSettings;
     
    3941                        }
    4042                       
    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);
    4244                        linkToBrowserSession.setParent(DisplayIO.getCurrentFrame());
     45                        FrameKeyboardActions.AddDate(linkToBrowserSession);
    4346                        FrameMouseActions.pickup(linkToBrowserSession);
    4447                       
     
    5356                       
    5457                        // 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);
    5970                       
    6071                        Text wt;
     
    6879                        // Start Browser in fullscreen or default, depending on settings
    6980                        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) + " "
    7386                                                + (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 " +
    7790                                                (ExploratorySearchSettings.BrowserDefaultWidth.get() - lm - rm) + " " +
    7891                                                (ExploratorySearchSettings.BrowserDefaultHeight.get() - tm - bm) + " : " + url, null);
     
    91104                // Replace any text item on cursor with link to a new mindmap
    92105                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);
    94107                text.setParent(DisplayIO.getCurrentFrame());
     108                FrameKeyboardActions.AddDate(text);
    95109                FrameMouseActions.pickup(text);
    96110                Frame frame = FrameIO.CreateNewFrame(text);
     
    99113                // Clear new frame and add active overlay and @old
    100114                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);
    105127               
    106128                FrameIO.SaveFrame(frame);
    107129        }
    108130       
     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       
    109208}
  • trunk/src/org/expeditee/actions/Navigation.java

    r669 r885  
    4343        public static void GotoHome() {
    4444                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);
    4554        }
    4655
Note: See TracChangeset for help on using the changeset viewer.