|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
de.enough.polish.swing.SwingApplication
public class SwingApplication
Base class for standalong swing applications.
Copyright Enough Software 2004 - 2011
history
Dec 3, 2004 - rob creation
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JFrame |
|---|
JFrame.AccessibleJFrame |
| Nested classes/interfaces inherited from class java.awt.Frame |
|---|
Frame.AccessibleAWTFrame |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected de.enough.polish.swing.SwingApplication.ApplicationDropListener |
applicationDropListener
|
protected String |
applicationName
|
protected boolean |
isMacOsX
|
protected NativeIntegration |
nativeIntegration
|
protected boolean |
systemExitOnQuit
|
| Fields inherited from class javax.swing.JFrame |
|---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Frame |
|---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
SwingApplication(String title,
boolean systemExitOnQuit)
|
|
| Method Summary | |
|---|---|
void |
about()
|
JScrollPane |
createScrollPane(JComponent component)
|
protected String |
getAboutText()
|
protected String |
getLookAndFeel()
Retrieves the look and feel that should be set. |
protected Class |
getNativeIntegrationClass()
|
protected int |
getNativeShortcutKeyMask()
|
protected void |
loadNativeIntegration()
Loads the integration for the underlying OS. |
void |
openApplication()
|
void |
openDocument(File file)
|
void |
preferences()
|
void |
quit()
Quits the application and calls saveSettings() first. |
protected void |
registerDropTarget(Component component)
|
protected void |
registerWindowListener()
Registers a standard window listener that in turns calls quit when the main window is closed. |
protected boolean |
saveSettings()
Saves the settings of the application. |
void |
setIcon(String url)
Sets the icon for this application. |
void |
setIcon(String url,
Class applicationClass)
Sets the icon for this application. |
protected void |
setLookAndFeel()
Sets the look and feel of this application. |
protected void |
setWindowDirtyFlag(boolean isDirty)
|
void |
showErrorMessageDialog(String message,
String title)
Shows the user a error message with a OK option. |
void |
showInformationMessageDialog(String message,
String title)
Shows the user a message with a OK option. |
int |
showYesNoCancelDialog(String message,
String title)
Queries the user with a yes/no question with the option to cancel. |
boolean |
showYesNoDialog(String message,
String title)
Queries the user with a yes/no question. |
| Methods inherited from class java.awt.Frame |
|---|
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Field Detail |
|---|
protected boolean systemExitOnQuit
protected boolean isMacOsX
protected NativeIntegration nativeIntegration
protected String applicationName
protected final de.enough.polish.swing.SwingApplication.ApplicationDropListener applicationDropListener
| Constructor Detail |
|---|
public SwingApplication(String title,
boolean systemExitOnQuit)
| Method Detail |
|---|
public void setIcon(String url)
url - the URL of the icon
public void setIcon(String url,
Class applicationClass)
url - the URL of the iconapplicationClass - protected void registerDropTarget(Component component)
protected void loadNativeIntegration()
protected void setLookAndFeel()
protected String getLookAndFeel()
protected Class getNativeIntegrationClass()
throws ClassNotFoundException
ClassNotFoundExceptionprotected String getAboutText()
public JScrollPane createScrollPane(JComponent component)
protected void setWindowDirtyFlag(boolean isDirty)
protected int getNativeShortcutKeyMask()
public void quit()
quit in interface ApplicationsaveSettings()protected boolean saveSettings()
public void about()
about in interface Applicationpublic void preferences()
preferences in interface Applicationpublic void openApplication()
openApplication in interface Applicationpublic void openDocument(File file)
openDocument in interface Applicationprotected void registerWindowListener()
public boolean showYesNoDialog(String message,
String title)
message - the questiontitle - the title
public int showYesNoCancelDialog(String message,
String title)
message - the questiontitle - the title
public void showErrorMessageDialog(String message,
String title)
message - the messagetitle - the title
public void showInformationMessageDialog(String message,
String title)
message - the messagetitle - the title
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||