当前位置: 首页>>代码示例>>Java>>正文


Java Application.getInstance方法代码示例

本文整理汇总了Java中org.jdesktop.application.Application.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java Application.getInstance方法的具体用法?Java Application.getInstance怎么用?Java Application.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jdesktop.application.Application的用法示例。


在下文中一共展示了Application.getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: canExit

import org.jdesktop.application.Application; //导入方法依赖的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: getApplication

import org.jdesktop.application.Application; //导入方法依赖的package包/类
public static MainApp getApplication()
/* 18:   */   {
/* 19:35 */     return (MainApp)Application.getInstance(MainApp.class);
/* 20:   */   }
 
开发者ID:xiwc,项目名称:confluence.keygen,代码行数:5,代码来源:MainApp.java

示例3: showCalendarFrame

import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
 * 
 */
public void showCalendarFrame() {
    calendarFrame = new JXFrame("Calendar 2010");
    calendarFrame.setName("calendar2010");
    calendarFrame.setDefaultCloseOperation(JXFrame.DO_NOTHING_ON_CLOSE);
    WindowListener l = new WindowAdapter() {

        @Override
        public void windowClosing(WindowEvent e) {
            calendarFrame.removeWindowListener(this);
            hideCalendarFrame();
        }
        
    };
    calendarFrame.addWindowListener(l);
    JXPanel calendar = new JXPanel();
    calendar.setBackground(Color.WHITE);
    Painter<?> painter = createBackgroundPainter();
    calendar.setBackgroundPainter(painter);

    JXMonthView monthView = new JXMonthView();
    Calendar cal = monthView.getCalendar();
    cal.set(Calendar.YEAR, 2010);
    cal.set(Calendar.MONTH, Calendar.JANUARY);
    monthView.setFirstDisplayedDay(cal.getTime());
    monthView.setOpaque(false);
    monthView.setPreferredColumnCount(3);
    monthView.setPreferredRowCount(4);
    // old style: set visual property with JXMonthView api
    monthView.setDayForeground(Calendar.SUNDAY, Color.MAGENTA);
    // <snip> Custom CalendarRenderingHandler
    // new style: install a custom renderingHandler 
    // (as client property, because no public api support yet)
    // which allows to add Highlighters
    monthView.putClientProperty(DemoMonthViewUI.RENDERING_HANDLER_KEY, 
            createRenderingHandler());
    // </snip>
    DemoUtils.setSnippet("Custom CalendarRenderingHandler", monthView);
    calendar.add(monthView);
    calendarFrame.add(calendar);
    Application application = Application.getInstance(Application.class);
    if (application instanceof SingleFrameApplication) {
        ((SingleFrameApplication) application).show(calendarFrame);
    } else {
        calendarFrame.pack();
        calendarFrame.setLocationRelativeTo(this);
        calendarFrame.setVisible(true);
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:52,代码来源:MonthViewExtDemo.java

示例4: getApplication

import org.jdesktop.application.Application; //导入方法依赖的package包/类
/** A convenient static getter for the application instance. */
public static NeuGenApp getApplication() {
    return Application.getInstance(NeuGenApp.class);
}
 
开发者ID:NeuroBox3D,项目名称:NeuGen,代码行数:5,代码来源:NeuGenApp.java

示例5: getApplication

import org.jdesktop.application.Application; //导入方法依赖的package包/类
public static WolfIDE getApplication()
{
    return Application.getInstance(WolfIDE.class);
}
 
开发者ID:Superloup10,项目名称:Wolf_IDE,代码行数:5,代码来源:WolfIDE.java

示例6: getApplication

import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
 * A convenient static getter for the application instance.
 * @return the instance of SampleDesktopApplication
 */
public static SampleDesktopApplication getApplication() {
    return Application.getInstance(SampleDesktopApplication.class);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:SampleDesktopApplication.java

示例7: getApplication

import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
 * A convenient static getter for the application instance.
 * @return the instance of SumoPlatform
 */
public static SumoPlatform getApplication() {
    return Application.getInstance(SumoPlatform.class);
}
 
开发者ID:ec-europa,项目名称:sumo,代码行数:8,代码来源:SumoPlatform.java

示例8: getApplication

import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
 * A convenient static getter for the application instance.
 * @return the instance of ConverterApp
 */
public static ConverterApp getApplication() {
    return Application.getInstance(ConverterApp.class);
}
 
开发者ID:shoaib-a-khan,项目名称:iConA,代码行数:8,代码来源:ConverterApp.java

示例9: getApplication

import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
 * Report the single instance of this GUI SAF application.
 *
 * @return the SingleFrameApplication instance
 */
public static SingleFrameApplication getApplication ()
{
    return (SingleFrameApplication) Application.getInstance();
}
 
开发者ID:Audiveris,项目名称:audiveris,代码行数:10,代码来源:OmrGui.java

示例10: getApplication

import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
 * A convenient static getter for the application instance.
 *
 * @return the instance of CanRegClientApp
 */
public static CanRegClientApp getApplication() {
    return Application.getInstance(CanRegClientApp.class);
}
 
开发者ID:IARC-CSU,项目名称:CanReg5,代码行数:9,代码来源:CanRegClientApp.java

示例11: getApplication

import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
 * A convenient static getter for the application instance.
 * @return the instance of MainApp
 */
public static MainApp getApplication() {
    return Application.getInstance(MainApp.class);
}
 
开发者ID:nblookup,项目名称:HiJson,代码行数:8,代码来源:MainApp.java

示例12: getApplication

import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
 * A convenient static getter for the application instance.
 * @return the instance of RattingAdvisorApp
 */
public static RattingAdvisor getApplication() {
    return Application.getInstance(RattingAdvisor.class);
}
 
开发者ID:ANBAL534,项目名称:EORA,代码行数:8,代码来源:RattingAdvisor.java

示例13: getApplication

import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
 * A convenient static getter for the application instance.
 * @return the instance of EmailApp
 */
public static EmailApp getApplication() {
    return Application.getInstance(EmailApp.class);
}
 
开发者ID:Cryin,项目名称:Cookmail,代码行数:8,代码来源:EmailApp.java

示例14: getApplication

import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
 * A convenient static getter for the application instance.
 * @return the instance of PictoWordApp
 */
public static AraWordApp getApplication() {
    return Application.getInstance(AraWordApp.class);
}
 
开发者ID:ProgettoRadis,项目名称:ArasuiteIta,代码行数:8,代码来源:AraWordApp.java

示例15: getApplication

import org.jdesktop.application.Application; //导入方法依赖的package包/类
/**
 * A convenient static getter for the application instance.
 * @return the instance of CacheModeler_SingleVersionApp
 */
public static CacheModeler_MultyprocessorVersionApp getApplication() {
    return Application.getInstance(CacheModeler_MultyprocessorVersionApp.class);
}
 
开发者ID:TsMaster7,项目名称:MultiprocessorModel,代码行数:8,代码来源:CacheModeler_MultyprocessorVersionApp.java


注:本文中的org.jdesktop.application.Application.getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。