Package com.mucommander.ui.main

Examples of com.mucommander.ui.main.MainFrame


        run = false;
    }

    public void run() {
        Random random = new Random();
        MainFrame mainFrame = WindowManager.getCurrentMainFrame();

        while(run) {
            if(random.nextInt(2)==0)
                ActionManager.performAction(com.mucommander.ui.action.impl.SwitchActiveTableAction.Descriptor.ACTION_ID, mainFrame);   

            FolderPanel folderPanel = mainFrame.getActivePanel();
            FileTable fileTable = mainFrame.getActiveTable();
            AbstractFile currentFolder = folderPanel.getCurrentFolder();

            try {
                AbstractFile parentFolder = currentFolder.getParent();
                AbstractFile children[] = currentFolder.ls();
View Full Code Here


    /**
     * Shows the 'About' dialog.
     */
    public static void showAbout() {
        MainFrame mainFrame = WindowManager.getCurrentMainFrame();
       
        // Do nothing (return) when in 'no events mode'
        if(mainFrame.getNoEventsMode())
            return;

        new AboutDialog(mainFrame).showDialog();
    }
View Full Code Here

    /**
     * Shows the 'Preferences' dialog.
     */
    public static void showPreferences() {
        MainFrame mainFrame = WindowManager.getCurrentMainFrame();

        // Do nothing (return) when in 'no events mode'
        if(mainFrame.getNoEventsMode())
            return;

        ActionManager.performAction(com.mucommander.ui.action.impl.ShowPreferencesAction.Descriptor.ACTION_ID, mainFrame);
    }
View Full Code Here

            // Request focus on the FolderPanel
            folderPanel.requestFocus();
        }
        // Normal mode: copy or move dropped files to the FolderPanel's current folder
        else {
            MainFrame mainFrame = folderPanel.getMainFrame();
            AbstractFile destFolder = folderPanel.getCurrentFolder();
            if(currentDropAction==DnDConstants.ACTION_MOVE) {
                // Start moving files
                ProgressDialog progressDialog = new ProgressDialog(mainFrame, Translator.get("move_dialog.moving"));
                MoveJob moveJob = new MoveJob(progressDialog, mainFrame, droppedFiles, destFolder, null, FileCollisionDialog.ASK_ACTION, false);
View Full Code Here

        acceleratorMap.putAlternativeAccelerator(alternateAccelerator, actionId);
      }
     
      // Update each MainFrame's action instance and input map
      for(MuAction action : ActionManager.getActionInstances(actionId)) {
        MainFrame mainFrame = action.getMainFrame();

        // Remove action from MainFrame's action and input maps
        unregisterAction(mainFrame, action);

        // Change action's accelerators
View Full Code Here

            return false;
        }

        if (filesToDelete.size() > 0) {
            // Starts deleting files
            MainFrame mainFrame = WindowManager.getCurrentMainFrame();
            ProgressDialog progressDialog = new ProgressDialog(mainFrame, Translator.get("delete_dialog.deleting"));
            DeleteJob deleteJob = new DeleteJob(progressDialog, mainFrame, filesToDelete, false);
            progressDialog.start(deleteJob);
        }
           
View Full Code Here

    public ServerConnectDialog(FolderPanel folderPanel, Class<? extends ServerPanel> selectPanelClass) {
        super(folderPanel.getMainFrame(), ActionProperties.getActionLabel(ConnectToServerAction.Descriptor.ACTION_ID), folderPanel.getMainFrame());
        this.folderPanel = folderPanel;
        lastPanelClass = selectPanelClass;

        MainFrame mainFrame = folderPanel.getMainFrame();
        Container contentPane = getContentPane();
   
        this.tabbedPane = new JTabbedPane(JTabbedPane.TOP);

        addTab(FileProtocols.FTP, new FTPPanel(this, mainFrame), selectPanelClass);
View Full Code Here

            return false;
        }

        if (filesToDelete.size() > 0) {
            // Starts deleting files
            MainFrame mainFrame = WindowManager.getCurrentMainFrame();
            ProgressDialog progressDialog = new ProgressDialog(mainFrame, Translator.get("delete_dialog.deleting"));
            DeleteJob deleteJob = new DeleteJob(progressDialog, mainFrame, filesToDelete, false);
            progressDialog.start(deleteJob);
        }
           
View Full Code Here

  public MainFrame[] build() {
    int nbFrames = snapshot.getIntegerVariable(MuSnapshot.getWindowsCount());

    // if there're no windows saved in the snapshot file, open one window with default settings
    if (nbFrames == 0) {
      MainFrame mainFrame = new MainFrame(
          new ConfFileTableTab(getInitialPath(FolderPanelType.LEFT)),
          getFileTableConfiguration(FolderPanelType.LEFT, -1),
          new ConfFileTableTab(getInitialPath(FolderPanelType.RIGHT)),
          getFileTableConfiguration(FolderPanelType.RIGHT, -1));
     
      Dimension screenSize   = Toolkit.getDefaultToolkit().getScreenSize();
          // Full screen bounds are not reliable enough, in particular under Linux+Gnome
          // so we simply make the initial window 4/5 of screen's size, and center it.
          // This should fit under any window manager / platform
          int x      = screenSize.width / 10;
          int y      = screenSize.height / 10;
          int width  = (int)(screenSize.width * 0.8);
          int height = (int)(screenSize.height * 0.8);

          mainFrame.setBounds(new Rectangle(x, y, width, height));

          return new MainFrame[] {mainFrame};
    }
    else {
      MainFrame[] mainFrames = new MainFrame[nbFrames];
View Full Code Here

      rightTabs[i] = new ConfFileTableTab(
                  snapshot.getBooleanVariable(MuSnapshot.getTabLockedVariable(index, false, i)),
                  restoreFileURL(snapshot.getVariable(MuSnapshot.getTabLocationVariable(index, false, i))),
                  snapshot.getVariable(MuSnapshot.getTabTitleVariable(index, false, i)));
   
    MainFrame mainFrame = new MainFrame(
        leftTabs,
        getInitialSelectedTab(FolderPanelType.LEFT, index),
        getFileTableConfiguration(FolderPanelType.LEFT, index),
        rightTabs,
        getInitialSelectedTab(FolderPanelType.RIGHT, index),
        getFileTableConfiguration(FolderPanelType.RIGHT, index));
   
    // Retrieve last saved window bounds
    Dimension screenSize   = Toolkit.getDefaultToolkit().getScreenSize();
        int x      = MuConfigurations.getSnapshot().getIntegerVariable(MuSnapshot.getX(index));
        int y      = MuConfigurations.getSnapshot().getIntegerVariable(MuSnapshot.getY(index));
        int width  = MuConfigurations.getSnapshot().getIntegerVariable(MuSnapshot.getWidth(index));
        int height = MuConfigurations.getSnapshot().getIntegerVariable(MuSnapshot.getHeight(index));

        // Retrieves the last known size of the screen.
        int lastScreenWidth  = MuConfigurations.getSnapshot().getIntegerVariable(MuSnapshot.SCREEN_WIDTH);
        int lastScreenHeight = MuConfigurations.getSnapshot().getIntegerVariable(MuSnapshot.SCREEN_HEIGHT);

        // If no previous location was saved, or if the resolution has changed,
        // reset the window's dimensions to their default values.
        if(x == -1 || y == -1 || width == -1 || height == -1 ||
           screenSize.width != lastScreenWidth ||  screenSize.height != lastScreenHeight
           || width + x > screenSize.width + 5 || height + y > screenSize.height + 5) {

            // Full screen bounds are not reliable enough, in particular under Linux+Gnome
            // so we simply make the initial window 4/5 of screen's size, and center it.
            // This should fit under any window manager / platform
            x      = screenSize.width / 10;
            y      = screenSize.height / 10;
            width  = (int)(screenSize.width * 0.8);
            height = (int)(screenSize.height * 0.8);
        }

        mainFrame.setBounds(new Rectangle(x, y, width, height));
       
        return mainFrame;
  }
View Full Code Here

TOP

Related Classes of com.mucommander.ui.main.MainFrame

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.