當前位置: 首頁>>代碼示例>>Java>>正文


Java SingleFrameApplication類代碼示例

本文整理匯總了Java中org.jdesktop.application.SingleFrameApplication的典型用法代碼示例。如果您正苦於以下問題:Java SingleFrameApplication類的具體用法?Java SingleFrameApplication怎麽用?Java SingleFrameApplication使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SingleFrameApplication類屬於org.jdesktop.application包,在下文中一共展示了SingleFrameApplication類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: canExit

import org.jdesktop.application.SingleFrameApplication; //導入依賴的package包/類
@Override
public boolean canExit (EventObject eo)
{
    // Check whether the repository has been saved (or user has declined)
    if (isModified()) {
        SingleFrameApplication appli = (SingleFrameApplication) Application.getInstance();
        int answer = JOptionPane.showConfirmDialog(
                appli.getMainFrame(),
                "Save " + SampleRepository.this + "?");

        if (answer == JOptionPane.YES_OPTION) {
            storeRepository();

            return true; // Here user has saved the repository
        }

        // True: user specifically chooses NOT to save the script
        // False: user says Oops!, cancelling the current close request
        return answer == JOptionPane.NO_OPTION;
    }

    return true;
}
 
開發者ID:Audiveris,項目名稱:audiveris,代碼行數:24,代碼來源:SampleRepository.java

示例2: actionEvent

import org.jdesktop.application.SingleFrameApplication; //導入依賴的package包/類
/**
 * Perform the action.
 */
@Override
public void actionEvent(ActionEvent event)
{
   ProdEdit app = (ProdEdit) SingleFrameApplication.getInstance();
   ProjectService projService = app.getProjectService();
   File file = projService.getProject().getFile();

   if (file == null)
   {
      super.actionEvent(event);
      return;
   }

   final JFrame mainWin = app.getMainFrame();
   try
   {
      mainWin.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
      projService.saveProject(file);
      app.setStatusMessage(I18n.formatMessage("Project.saved", projService.getProject().getName()));
   }
   finally
   {
      mainWin.setCursor(Cursor.getDefaultCursor());
   }
}
 
開發者ID:selfbus,項目名稱:development-tools-incubation,代碼行數:29,代碼來源:SaveProjectAction.java

示例3: actionEvent

import org.jdesktop.application.SingleFrameApplication; //導入依賴的package包/類
/**
 * Perform the action.
 */
@Override
public void actionEvent(ActionEvent e)
{
   SingleFrameApplication app = (SingleFrameApplication) SingleFrameApplication.getInstance();
   final JFrame mainWin = app.getMainFrame();
   try
   {
      mainWin.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
      final Settings dlg = new Settings(mainWin);
      dlg.setVisible(true);
   }
   finally
   {
      mainWin.setCursor(Cursor.getDefaultCursor());
   }
}
 
開發者ID:selfbus,項目名稱:development-tools-incubation,代碼行數:20,代碼來源:SettingsAction.java

示例4: actionEvent

import org.jdesktop.application.SingleFrameApplication; //導入依賴的package包/類
/**
 * Perform the action.
 */
@Override
public void actionEvent(ActionEvent event)
{
   DevTool app = (DevTool) SingleFrameApplication.getInstance();
   ProjectService projService = app.getProjectService();
   File file = projService.getProject().getFile();

   if (file == null)
   {
      super.actionEvent(event);
      return;
   }

   final JFrame mainWin = app.getMainFrame();
   try
   {
      mainWin.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
      projService.saveProject(file);
   }
   finally
   {
      mainWin.setCursor(Cursor.getDefaultCursor());
   }
}
 
開發者ID:selfbus,項目名稱:development-tools-incubation,代碼行數:28,代碼來源:SaveProjectAction.java

示例5: NovacomInstallerView

import org.jdesktop.application.SingleFrameApplication; //導入依賴的package包/類
public NovacomInstallerView(SingleFrameApplication app) {
    super(app);
    initComponents();
    String os = System.getProperty("os.name").toLowerCase();
    if(os.contains("windows")) {
        if(System.getenv("ProgramFiles(x86)")==null) {
            jLabel2.setText("Windows 32bit");
         } else {
            jLabel2.setText("Windows 64bit");
         }
    } else if(os.contains("mac")) {
        jLabel2.setText("Mac OS");
    } else if(os.contains("linux")) {
        if(!is64bitLinux()) {
            jLabel2.setText("Linux 32bit");
        } else {
            jLabel2.setText("Linux 64bit");
        }            
    } else {
        jLabel2.setText("<unknown>");
    }
}
 
開發者ID:123Haynes,項目名稱:universal-novacom-installer,代碼行數:23,代碼來源:NovacomInstallerView.java

示例6: RattingAdvisorMainWindow

import org.jdesktop.application.SingleFrameApplication; //導入依賴的package包/類
public RattingAdvisorMainWindow(SingleFrameApplication app) {
    super(app);

    initComponents();
    
    settingsManager = new SettingsManager();
    
    //Frame Settings
    getFrame().setTitle("EVE Online Ratting Advisor - v 0.2.1");
    getFrame().setResizable(false);//We do not want to let people resize the window
    if(settingsManager.getSetting("Style").equals("DARK")){
        
        mainPanel.setBackground(new Color(56, 56, 56));
        logTextArea.setBackground(new Color(100, 100, 100));
        checkNeutrals.setBackground(new Color(56, 56, 56));
        shieldAlarm.setBackground(new Color(56, 56, 56));
        rattingSystemText.setBackground(new Color(100, 100, 100));
        maxJumps.setBackground(new Color(100, 100, 100));
        startButton.setBackground(new Color(56, 56, 56));
        stopButton.setBackground(new Color(56, 56, 56));
        newTimer.setBackground(new Color(56, 56, 56));
        clearLogButton.setBackground(new Color(56, 56, 56));
        settingsButton.setBackground(new Color(56, 56, 56));
        searchButton.setBackground(new Color(56, 56, 56));
        
    }//Else: it is light by default
    
    //End Frame Settings

    //Initialization
    initializeShared = new InitializeShared(logTextArea, rattingSystemText, maxJumps);
    initializeShared.start();
    
    //Test the version and do the update process.
    Thread versionThread = new VersionThread(currentVersion, logTextArea, mainPanel);
    versionThread.start();
    
}
 
開發者ID:ANBAL534,項目名稱:EORA,代碼行數:39,代碼來源:RattingAdvisorMainWindow.java

示例7: EmailView

import org.jdesktop.application.SingleFrameApplication; //導入依賴的package包/類
public EmailView(SingleFrameApplication app) {
    super(app);

    initComponents();
    initControl();
    // status bar initialization - message timeout, idle icon and busy animation, etc
    ResourceMap resourceMap = getResourceMap();
    int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
    messageTimer = new Timer(messageTimeout, new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            statusMessageTime.setText("");
        }
    });
    messageTimer.setRepeats(false);
    int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
    for (int i = 0; i < busyIcons.length; i++) {
        busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
    }
    busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
            statusAnimationuseTime.setIcon(busyIcons[busyIconIndex]);
        }
    });
    idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
    statusAnimationuseTime.setIcon(idleIcon);
    myprogressBar.setVisible(false);

    // connecting action tasks to status bar via TaskMonitor
    TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
    taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
        public void propertyChange(java.beans.PropertyChangeEvent evt) {
            String propertyName = evt.getPropertyName();
            if ("started".equals(propertyName)) {
                if (!busyIconTimer.isRunning()) {
                    statusAnimationuseTime.setIcon(busyIcons[0]);
                    busyIconIndex = 0;
                    busyIconTimer.start();
                }
                myprogressBar.setVisible(true);
                myprogressBar.setIndeterminate(true);
            } else if ("done".equals(propertyName)) {
                busyIconTimer.stop();
                statusAnimationuseTime.setIcon(idleIcon);
                myprogressBar.setVisible(false);
                myprogressBar.setValue(0);
            } else if ("message".equals(propertyName)) {
                String text = (String)(evt.getNewValue());
                statusMessageTime.setText((text == null) ? "" : text);
                messageTimer.restart();
            } else if ("progress".equals(propertyName)) {
                int value = (Integer)(evt.getNewValue());
                myprogressBar.setVisible(true);
                myprogressBar.setIndeterminate(false);
                myprogressBar.setValue(value);
            }
        }
    });
}
 
開發者ID:Cryin,項目名稱:Cookmail,代碼行數:60,代碼來源:EmailView.java

示例8: MainWindow

import org.jdesktop.application.SingleFrameApplication; //導入依賴的package包/類
public MainWindow(SingleFrameApplication app)
/*  58:    */   {
/*  59: 27 */     super(app);
/*  60: 28 */     initComponents();
/*  61: 29 */     getFrame().setResizable(false);
/*  62: 30 */     getFrame().setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/nl/invisible/keygen/gui/resources/invblue-icon.png")));
/*  63:    */   }
 
開發者ID:xiwc,項目名稱:confluence.keygen,代碼行數:8,代碼來源:MainWindow.java

示例9: KoraServer2View

import org.jdesktop.application.SingleFrameApplication; //導入依賴的package包/類
public KoraServer2View(SingleFrameApplication app) {
    super(app);

    initComponents();
    
    getFrame().addWindowListener(this);
    mInitCloseButton.setVisible(false);
    
    initBlueRose();
    try {
        Thread.sleep(2500);
    } catch (InterruptedException e) {
    }
    initDevices();
}
 
開發者ID:gskbyte,項目名稱:kora,代碼行數:16,代碼來源:KoraServer2View.java

示例10: getDaten

import org.jdesktop.application.SingleFrameApplication; //導入依賴的package包/類
public static Daten getDaten(ZKN3Settings zkn3Settings) throws Exception {
	Settings settings = zkn3Settings.settings;

	ZettelkastenView zettelkastenView = new ZettelkastenView(
			new SingleFrameApplication() {
				@Override
				protected void startup() {
				}
			}, settings, TestObjectFactory.getInstance().acceleratorKeys,
			TestObjectFactory.getInstance().autoKorrektur,
			TestObjectFactory.getInstance().synonyms,
			TestObjectFactory.getInstance().stenoData,
			TestObjectFactory.getInstance().tasksData);
	return (Daten) getPrivateField(zettelkastenView, "data");
}
 
開發者ID:sjPlot,項目名稱:Zettelkasten,代碼行數:16,代碼來源:TestObjectFactory.java

示例11: CATSVisionView

import org.jdesktop.application.SingleFrameApplication; //導入依賴的package包/類
/**
 * Main CATS Vision Constructor.
 * 
 */
public CATSVisionView( SingleFrameApplication app )
{
    super( app );
    logger.info( "CATSVisionView is starting..." );

    initComponents();
    visionTabs.setActionMap( null );
    getFrame().setTitle( CatsVisionConstants.APPLICATION_TITLE );
    getFrame().setIconImage( CatsVisionUtils.getApplicationIcon() );
}
 
開發者ID:Comcast,項目名稱:cats,代碼行數:15,代碼來源:CATSVisionView.java

示例12: actionEvent

import org.jdesktop.application.SingleFrameApplication; //導入依賴的package包/類
/**
 * Perform the action.
 */
@Override
public void actionEvent(ActionEvent e)
{
   ProdEdit app = (ProdEdit) SingleFrameApplication.getInstance();
   final JFrame mainWin = app.getMainFrame();

   final Config cfg = Config.getInstance();
   String lastDir = cfg.getStringValue("project.lastDir");

   final JFileChooser dlg = new JFileChooser();
   dlg.setCurrentDirectory(new File(lastDir));
   final FileFilter fileFilter = new ProjectFileFilter();
   dlg.addChoosableFileFilter(fileFilter);
   dlg.addChoosableFileFilter(dlg.getAcceptAllFileFilter());
   dlg.setFileFilter(fileFilter);
   dlg.setDialogTitle(I18n.getMessage("SaveProjectAsAction.title"));

   if (dlg.showOpenDialog(mainWin) != JFileChooser.APPROVE_OPTION)
      return;

   File file = dlg.getSelectedFile();
   if (file == null) return;

   cfg.put("project.lastDir", file.getParent());

   try
   {
      mainWin.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
      app.getProjectService().saveProject(file);
      app.setStatusMessage(I18n.formatMessage("Project.saved", app.getProjectService().getProject().getName()));
   }
   finally
   {
      mainWin.setCursor(Cursor.getDefaultCursor());
   }
}
 
開發者ID:selfbus,項目名稱:development-tools-incubation,代碼行數:40,代碼來源:SaveProjectAsAction.java

示例13: actionEvent

import org.jdesktop.application.SingleFrameApplication; //導入依賴的package包/類
/**
    * Perform the action.
    */
   @Override
   public void actionEvent(ActionEvent e)
   {
      ProdEdit app = (ProdEdit) SingleFrameApplication.getInstance();
//      final JFrame mainWin = app.getMainFrame();

      app.getProjectService().createProject();
   }
 
開發者ID:selfbus,項目名稱:development-tools-incubation,代碼行數:12,代碼來源:NewProjectAction.java

示例14: actionEvent

import org.jdesktop.application.SingleFrameApplication; //導入依賴的package包/類
/**
 * Perform the action.
 */
@Override
public void actionEvent(ActionEvent e)
{
   SingleFrameApplication app = (SingleFrameApplication) SingleFrameApplication.getInstance();
   final JFrame mainWin = app.getMainFrame();

   final Config cfg = Config.getInstance();
   String lastDir = cfg.getStringValue("project.lastDir");

   final JFileChooser dlg = new JFileChooser();
   dlg.setCurrentDirectory(new File(lastDir));
   final FileFilter fileFilter = new ProjectFileFilter(true);
   dlg.addChoosableFileFilter(fileFilter);
   dlg.addChoosableFileFilter(dlg.getAcceptAllFileFilter());
   dlg.setFileFilter(fileFilter);
   dlg.setDialogTitle(I18n.getMessage("OpenProjectAction.title"));

   if (dlg.showOpenDialog(mainWin) != JFileChooser.APPROVE_OPTION)
      return;

   final File file = dlg.getSelectedFile();
   if (file == null) return;

   cfg.put("project.lastDir", file.getParent());

   try
   {
      mainWin.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
      DevTool.getInstance().getProjectService().loadProject(file);
   }
   finally
   {
      mainWin.setCursor(Cursor.getDefaultCursor());
   }
}
 
開發者ID:selfbus,項目名稱:development-tools-incubation,代碼行數:39,代碼來源:OpenProjectAction.java

示例15: actionEvent

import org.jdesktop.application.SingleFrameApplication; //導入依賴的package包/類
/**
 * Perform the action.
 */
@Override
public void actionEvent(ActionEvent e)
{
   DevTool app = (DevTool) SingleFrameApplication.getInstance();
   final JFrame mainWin = app.getMainFrame();

   final Config cfg = Config.getInstance();
   String lastDir = cfg.getStringValue("project.lastDir");

   final JFileChooser dlg = new JFileChooser();
   dlg.setCurrentDirectory(new File(lastDir));
   final FileFilter fileFilter = new ProjectFileFilter(false);
   dlg.addChoosableFileFilter(fileFilter);
   dlg.addChoosableFileFilter(dlg.getAcceptAllFileFilter());
   dlg.setFileFilter(fileFilter);
   dlg.setDialogTitle(I18n.getMessage("SaveProjectAsAction.title"));

   if (dlg.showOpenDialog(mainWin) != JFileChooser.APPROVE_OPTION)
      return;

   File file = dlg.getSelectedFile();
   if (file == null) return;

   cfg.put("project.lastDir", file.getParent());

   try
   {
      mainWin.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
      app.getProjectService().saveProject(file);
   }
   finally
   {
      mainWin.setCursor(Cursor.getDefaultCursor());
   }
}
 
開發者ID:selfbus,項目名稱:development-tools-incubation,代碼行數:39,代碼來源:SaveProjectAsAction.java


注:本文中的org.jdesktop.application.SingleFrameApplication類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。