|
JHotDraw 7.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface View
A view on a document or a set of related documents within an Application.
After a view has been initialized using init(), either method clear() must be called or method read(), in order to fully initialize the View.
Field Summary | |
---|---|
static java.lang.String |
APPLICATION_PROPERTY
The name of the application property. |
static java.lang.String |
ENABLED_PROPERTY
The name of the enabled property. |
static java.lang.String |
FILE_PROPERTY
The name of the file property. |
static java.lang.String |
HAS_UNSAVED_CHANGES_PROPERTY
The name of the hasUnsavedChanges property. |
static java.lang.String |
MULTIPLE_OPEN_ID_PROPERTY
The name of the multipleOpenId property. |
static java.lang.String |
SHOWING_PROPERTY
The name of the showing property. |
static java.lang.String |
TITLE_PROPERTY
The name of the title property. |
Method Summary | |
---|---|
void |
activate()
Activates the view. |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a property change listener. |
boolean |
canSaveTo(java.io.File file)
Returns true, if this view can be saved to the specified file. |
void |
clear()
Clears the view, for example by emptying the contents of the view, or by reading a template contents from a file. |
void |
deactivate()
Deactivates the view. |
void |
dispose()
Gets rid of all the resources of the view. |
void |
execute(java.lang.Runnable worker)
Executes the specified runnable on the worker thread of the view. |
javax.swing.Action |
getAction(java.lang.String id)
Returns the action with the specified id. |
Application |
getApplication()
Gets the application to which this view belongs. |
javax.swing.JComponent |
getComponent()
Returns the visual component of the view. |
java.io.File |
getFile()
Returns the file which holds the document of the view. |
int |
getMultipleOpenId()
Returns the multiple open id. |
javax.swing.JFileChooser |
getOpenChooser()
Gets the open file chooser for the view. |
javax.swing.JFileChooser |
getSaveChooser()
Gets the save file chooser for the view. |
java.lang.String |
getTitle()
Gets the title of the view. |
boolean |
hasUnsavedChanges()
Returns true, if the view has unsaved changes. |
void |
init()
Initializes the view. |
boolean |
isEnabled()
Returns the enabled state of the view. |
boolean |
isShowing()
This is used by Application to keep track if a view is showing. |
void |
markChangesAsSaved()
Marks all changes as saved. |
void |
putAction(java.lang.String id,
javax.swing.Action action)
Puts an action with the specified id. |
void |
read(java.io.File f)
Reads the view from the specified file. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a property change listener. |
void |
setApplication(Application newValue)
Sets the application of the view. |
void |
setEnabled(boolean newValue)
Sets the enabled state of the view. |
void |
setFile(java.io.File newValue)
Sets the file of the view. |
void |
setMultipleOpenId(int newValue)
Sets the multiple open id. |
void |
setShowing(boolean newValue)
This is used by Application to keep track if a view is showing. |
void |
setTitle(java.lang.String newValue)
Sets the title of the view. |
void |
start()
Starts the view. |
void |
stop()
Stops the view. |
void |
write(java.io.File f)
Writes the view to the specified file. |
Field Detail |
---|
static final java.lang.String APPLICATION_PROPERTY
static final java.lang.String FILE_PROPERTY
static final java.lang.String TITLE_PROPERTY
static final java.lang.String ENABLED_PROPERTY
static final java.lang.String HAS_UNSAVED_CHANGES_PROPERTY
static final java.lang.String MULTIPLE_OPEN_ID_PROPERTY
static final java.lang.String SHOWING_PROPERTY
Method Detail |
---|
Application getApplication()
void setApplication(Application newValue)
javax.swing.JComponent getComponent()
java.io.File getFile()
void setFile(java.io.File newValue)
boolean isEnabled()
void setEnabled(boolean newValue)
void write(java.io.File f) throws java.io.IOException
java.io.IOException
void read(java.io.File f) throws java.io.IOException
java.io.IOException
void clear()
javax.swing.JFileChooser getOpenChooser()
javax.swing.JFileChooser getSaveChooser()
boolean hasUnsavedChanges()
void markChangesAsSaved()
boolean canSaveTo(java.io.File file)
The SaveAction uses this method to decide, whether to display a file dialog before saving the file.
file
- A file. If this parameter is null, a NullPointerException
is thrown.void execute(java.lang.Runnable worker)
void init()
After a view has been initialized using init(), either method clear() must be called or method read, in order to fully initialize a View.
void start()
void activate()
void deactivate()
void stop()
void dispose()
javax.swing.Action getAction(java.lang.String id)
void putAction(java.lang.String id, javax.swing.Action action)
void addPropertyChangeListener(java.beans.PropertyChangeListener l)
void removePropertyChangeListener(java.beans.PropertyChangeListener l)
void setMultipleOpenId(int newValue)
int getMultipleOpenId()
boolean isShowing()
void setShowing(boolean newValue)
void setTitle(java.lang.String newValue)
The title is generated by the application, based on the current file of the view. The application ensures that the title uniquely identifies each open view.
The application displays the title in the title bar of the view window and in all windows which are associated to the view.
This is a bound property.
java.lang.String getTitle()
|
Copyright 1996-2007 (c) JHotDraw.org. Some rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |