本文整理匯總了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;
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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>");
}
}
示例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();
}
示例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);
}
}
});
}
示例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: */ }
示例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();
}
示例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");
}
示例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() );
}
示例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());
}
}
示例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();
}
示例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());
}
}
示例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());
}
}