|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.coderight.jazz.View
public abstract class View
View is part of the HMVC pattern.
The view represents the user interface.
Default event-handlers:
FormView,
Controller.setView(View),
Controller.showView(),
Controller.closeView(),
Controller.onBeforeShowView(),
Controller.onAfterShowView()| Nested Class Summary | |
|---|---|
static class |
View.ToolBarPosition
Enumeration of possible ToolBar positions. |
static class |
View.ViewPosition
Enumeration of possible View positions. |
| Constructor Summary | |
|---|---|
View()
Default constructor. |
|
| Method Summary | |
|---|---|
BufferedImage |
capture()
Returns an Image (screenshot) of this View. |
void |
center()
Center View on parent. |
void |
center(View.ViewPosition position)
Center View with given position. |
void |
close()
|
protected void |
dispose()
Invoked when view is closed. |
void |
focus()
|
JPanel |
getComponent()
|
Cursor |
getCursor()
|
JButton |
getDefaultButton()
|
protected Model |
getModel()
|
Point |
getPosition()
|
ProgressMonitor |
getProgressMonitor()
|
Object |
getResource(String name)
|
Icon |
getResourceAsIcon(String name)
|
Image |
getResourceAsImage(String name)
|
Dimension |
getSize()
|
String |
getTitle()
|
void |
handleEvent(ModelEvent evt)
|
protected abstract void |
init()
Invoked after Controller.showView(). |
boolean |
isEnabled()
|
boolean |
isMaximizable()
|
boolean |
isMinimizable()
|
boolean |
isModal()
|
boolean |
isOpaque()
|
boolean |
isResizable()
|
void |
maximize()
|
void |
minimize()
|
protected void |
onActivate()
Invoked when view is activated. |
protected void |
onClose()
Invoked when view is closed. |
protected void |
onDeactivate()
Invoked when view is de-activated. |
protected void |
onMaximize()
Invoked when view is de-iconified. |
protected void |
onMinimize()
Invoked when view is iconified. |
protected void |
onOpen()
Invoked when view is opened. |
protected void |
onShow()
Invoked when view has been made visible. |
void |
postEvent(Event event)
|
void |
print()
Print the contents of this view. |
void |
propagateEvent(Event event)
|
void |
registerKeyboardAction(Action action)
Provides keyboard bindings for Actions. |
protected abstract void |
reset()
Invoked after onOpen() and before onShow(). |
void |
restore()
|
void |
setBackground(Color color)
|
void |
setBorder(Border border)
|
void |
setCloseEvent(Event closeEvent)
Sets a custom close Event. |
void |
setCursor(Cursor cursor)
|
void |
setDefaultButton(JButton defaultButton)
|
void |
setEnabled(boolean enabled)
|
void |
setForeground(Color color)
|
void |
setIcon(Icon icon)
|
void |
setLayout(LayoutManager layoutManager)
|
void |
setMaximizable(boolean maximizable)
|
void |
setMenuBar(MenuBar menuBar)
Sets a MenuBar for this view. |
void |
setMinimizable(boolean minimizable)
|
void |
setOpacity(float opacity)
|
void |
setOpaque(boolean opaque)
|
void |
setPainter(Painter painter)
|
void |
setPosition(int x,
int y)
|
void |
setPosition(Point position)
|
void |
setProgressMonitor(ProgressMonitor progressMonitor)
|
void |
setResizable(boolean resizable)
|
void |
setSize(Dimension size)
|
void |
setSize(int width,
int height)
|
void |
setStatusBar(StatusBar statusBar)
Sets a StatusBar for this view. |
void |
setTimer(Timer timer)
|
void |
setTitle(String title)
|
void |
setToolBar(ToolBar toolBar)
Sets a ToolBar for this view. |
void |
setToolBar(ToolBar toolBar,
View.ToolBarPosition position)
Sets a ToolBar for this view. |
void |
setViewPosition(View.ViewPosition position)
|
String |
translate(String key)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public View()
Default the following settings are used:
| Method Detail |
|---|
public JPanel getComponent()
public void close()
Controller.closeView()public void setCloseEvent(Event closeEvent)
Event.
When a user closes a view by clicking the window close ('X') button
default a ViewEvent ViewEvent.ViewEventType.CLOSE is sent and
the view is closed.
Sometimes this default behavior is not desired, for example with dialogs
that have a cancel button, you want the cancel event.
public void setLayout(LayoutManager layoutManager)
Container.setLayout(LayoutManager)public void setBorder(Border border)
JComponent.setBorder(Border)public void setBackground(Color color)
JComponent.setBackground(Color)public void setForeground(Color color)
JComponent.setForeground(Color)public void setPainter(Painter painter)
public void setOpacity(float opacity)
public boolean isOpaque()
JComponent.isOpaque()public void setOpaque(boolean opaque)
JComponent.setOpaque(boolean)public final void setTitle(String title)
Frame.setTitle(String)public final String getTitle()
Frame.getTitle()public Dimension getSize()
Component.getSize()
public void setSize(int width,
int height)
Component.setSize(int, int)public void setSize(Dimension size)
Component.setSize(Dimension)public boolean isResizable()
Frame.isResizable()public void setResizable(boolean resizable)
Frame.setResizable(boolean)public final boolean isModal()
Dialog.isModal()public void center()
View on parent.
public void center(View.ViewPosition position)
View with given position.
public void focus()
JComponent.requestFocus()public void restore()
Frame.NORMALpublic boolean isMinimizable()
JInternalFrame.isIconifiable()public void setMinimizable(boolean minimizable)
JInternalFrame.setIconifiable(boolean)public void minimize()
Frame.ICONIFIEDpublic boolean isMaximizable()
JInternalFrame.isMaximizable()public void setMaximizable(boolean maximizable)
JInternalFrame.setMaximizable(boolean)public void maximize()
Frame.MAXIMIZED_BOTHpublic BufferedImage capture()
Image (screenshot) of this View.
public void print()
public void setMenuBar(MenuBar menuBar)
MenuBar for this view.
public void setToolBar(ToolBar toolBar)
ToolBar for this view.
public void setToolBar(ToolBar toolBar,
View.ToolBarPosition position)
ToolBar for this view.
public void setViewPosition(View.ViewPosition position)
public void setStatusBar(StatusBar statusBar)
StatusBar for this view.
public JButton getDefaultButton()
JRootPane.getDefaultButton()public void setDefaultButton(JButton defaultButton)
JRootPane.setDefaultButton(JButton)public void setIcon(Icon icon)
JFrame.setIconImage(Image)public Point getPosition()
Component.getLocation()
public void setPosition(int x,
int y)
Component.setLocation(int, int)public void setPosition(Point position)
Component.setLocation(Point)public boolean isEnabled()
Component.isEnabled()public void setEnabled(boolean enabled)
JComponent.setEnabled(boolean)public String translate(String key)
JazzUtil.translate(String)public final ProgressMonitor getProgressMonitor()
ProgressMonitorpublic void setProgressMonitor(ProgressMonitor progressMonitor)
ProgressMonitorpublic Cursor getCursor()
Component.getCursor()public void setCursor(Cursor cursor)
Component.setCursor(java.awt.Cursor)public Object getResource(String name)
JazzUtil.getResource(String)public Icon getResourceAsIcon(String name)
JazzUtil.getResourceAsIcon(String)public Image getResourceAsImage(String name)
JazzUtil.getResourceAsImage(String)public final void postEvent(Event event)
public final void propagateEvent(Event event)
protected void onOpen()
protected void onShow()
protected void onClose()
protected void onActivate()
protected void onDeactivate()
protected void onMinimize()
protected void onMaximize()
protected abstract void init()
Controller.showView().
protected abstract void reset()
onOpen() and before onShow().
protected void dispose()
protected final Model getModel()
public final void handleEvent(ModelEvent evt)
public void registerKeyboardAction(Action action)
Performs the Action Event when the accelerator key is pressed.
Actionpublic void setTimer(Timer timer)
Timer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||