public class NewSkin extends Extension implements MDIManager
Modifier and Type | Class and Description |
---|---|
class |
NewSkin.DialogWindowListener
Listener para los eventos de cerrado de los di�logos.
|
class |
NewSkin.FrameListener
DOCUMENT ME!
|
ALIGN_CENTER, ALIGN_FIRST_LINE_END, ALIGN_FIRST_LINE_END_CASCADE, ALIGN_FIRST_LINE_START, ALIGN_LAST_LINE_END, ALIGN_LAST_LINE_START, ALIGN_LINE_END, ALIGN_LINE_START, ALIGN_PAGE_END, ALIGN_PAGE_START, DIALOG, TOOL, WINDOW
Constructor and Description |
---|
NewSkin() |
Modifier and Type | Method and Description |
---|---|
IWindow |
addCentredWindow(IWindow p)
Creates a new frame with the provided contents, and shows this
new window.
|
IWindow |
addWindow(IWindow p)
Creates a new frame with the provided contents, and shows this
new window.
|
IWindow |
addWindow(IWindow p,
int align) |
void |
alignFrame(IWindow panel,
int mode) |
void |
centreFrame(IWindow panel)
Centres the Frame in the contentPane of the MainFrame.
|
void |
changeWindowInfo(IWindow w,
WindowInfo wi)
Updates the window properties (size, location, etc) according to the
provided WindowInfo object.
|
void |
closeAllWindows()
Close all the currently open windows
|
boolean |
closeSingletonWindow(Class viewClass,
Object model)
Close the SingletonWindow whose class and model are provided as
parameters.
|
boolean |
closeSingletonWindow(Object model)
Close the SingletonWindow whose model is provided as parameter.
|
void |
closeWindow(IWindow p)
Close the provided window.
|
protected FrameWindowSupport |
createFrameWindowSupport(MDIFrame mainFrame)
Create the
FrameWindowSupport instance |
void |
execute(String actionCommand)
This method is executed when the user clicks on any of the
controls associated with this extension (menus, tools, etc).
|
IWindow |
getActiveWindow()
Returns the currently active window, excluding the modal windows and the
PALETTE windows.
|
IWindow[] |
getAllWindows()
Gets all the open windows.
|
JDesktopPane |
getDesktopPane() |
IWindow |
getFocusWindow()
Returns the currently focused window, excluding the modal windows.
|
BufferedImage |
getImagePreview() |
IWindow[] |
getOrderedWindows()
Gets all the open windows (as
MDIManager.getAllWindows() ),
but in this method the windows are returned in the same
deepness order that they have in the application. |
SingletonWindow |
getSingletonWindow(Class windowClass,
Object model)
Return the window associated to the SingletonWindow class and the model
specified.
|
IWindow |
getWindow(JPanel panel)
Gets the associated IWindow to the panel shown with showWindow method.
|
WindowInfo |
getWindowInfo(IWindow w)
Gets the WindowInfo object associated with the provided window.
|
void |
init(MDIFrame f)
Initializes the MDIFrame.
|
void |
initialize()
Extension's initialization code should be here.
|
boolean |
isEnabled()
This method is invoked by Andami to check whether the extension
(and its associated controls) is enabled or disabled.
|
boolean |
isVisible()
This method is invoked by Andami to check whether the extension
(and its associated controls) is visible or hidden.
|
void |
move(IWindow panel,
int x,
int y)
Change the position of the speficied window.
|
void |
moveToFrom(IWindow win) |
void |
refresh(IWindow win)
Forces a window to be repainted.
|
void |
restoreCursor()
Sets the normal cursor and unblocks events from main window.
|
void |
setBackgroundImage(ImageIcon image,
String typeDesktop)
Sets the provided image as background image in the main window.
|
void |
setLocale(Locale locale) |
void |
setMaximum(IWindow v,
boolean bMaximum)
Maximizes or restores the provided window
|
void |
setWaitCursor()
Shows the wait cursor and blocks all the events from main window until
MDIManager.restoreCursor() is called. |
void |
showWindow(JPanel panel,
String title,
WindowManager.MODE mode)
Useful method to simplify the presentation of a window.
|
public JDesktopPane getDesktopPane()
public BufferedImage getImagePreview()
getImagePreview
in interface MDIManager
public void init(MDIFrame f)
MDIManager
init
in interface MDIManager
f
- Application's main frame.protected FrameWindowSupport createFrameWindowSupport(MDIFrame mainFrame)
FrameWindowSupport
instancemainFrame
- public IWindow addWindow(IWindow p) throws SingletonDialogAlreadyShownException
MDIManager
Creates a new frame with the provided contents, and shows this
new window. The new frame's properties are set according to
the WindowInfo object from IWindow's getWindowInfo()
method.
The new frame is disposed when closed.
If the provided IWindow also implements SingletonWindow, and another SingletonWindow already exists and uses the same model, this later window will be sent to the foreground and no new window will be created.
addWindow
in interface MDIManager
p
- Panel with the contents of the new window.SingletonDialogAlreadyShownException
public SingletonWindow getSingletonWindow(Class windowClass, Object model)
MDIManager
getSingletonWindow
in interface MDIManager
public IWindow addCentredWindow(IWindow p) throws SingletonDialogAlreadyShownException
MDIManager
Creates a new frame with the provided contents, and shows this
new window. The new frame will be centered, regardless the
position specified in the WindowInfo object from IWindow's
getWindowInfo()
method.
The new frame is disposed when closed.
If the provided IWindow also implements SingletonWindow, and another SingletonWindow already exists and uses the same model, this later window will be sent to the foreground and no new window will be created.
addCentredWindow
in interface MDIManager
p
- Panel with the contents of the new window.SingletonDialogAlreadyShownException
public IWindow addWindow(IWindow p, int align) throws SingletonDialogAlreadyShownException
addWindow
in interface MDIManager
SingletonDialogAlreadyShownException
public void move(IWindow panel, int x, int y)
MDIManager
move
in interface MDIManager
public void centreFrame(IWindow panel)
panel
- The IWindow to centrepublic void alignFrame(IWindow panel, int mode)
public void moveToFrom(IWindow win)
moveToFrom
in interface MDIManager
public IWindow getActiveWindow()
MDIManager
Returns the currently active window, excluding the modal windows and the PALETTE windows. If the currently active window is modal or PALETTE type, the previous non-modal and non-PALETTE active window is returned.
Modal windows and PALETTE windows are considered to be auxiliary windows, that is the reason why they are not returned.
getActiveWindow
in interface MDIManager
public IWindow getFocusWindow()
MDIManager
Returns the currently focused window, excluding the modal windows. If the currently focused window is modal, the previous non-modal focused window is returned.
getFocusWindow
in interface MDIManager
public void closeWindow(IWindow p)
MDIManager
closeWindow
in interface MDIManager
p
- window to be closedpublic void closeAllWindows()
MDIManager
closeAllWindows
in interface MDIManager
public WindowInfo getWindowInfo(IWindow w)
MDIManager
getWindowInfo
in interface MDIManager
w
- window whose information is to be retrievedWindowInfo
public void initialize()
IExtension
initialize
in interface IExtension
public void execute(String actionCommand)
IExtension
execute
in interface IExtension
actionCommand
- An String specifying the action to
execute. This is useful when there are different
controls associated with the same extension.public boolean isEnabled()
IExtension
isEnabled
in interface IExtension
public boolean isVisible()
IExtension
isVisible
in interface IExtension
public void setWaitCursor()
MDIManager
MDIManager.restoreCursor()
is called.setWaitCursor
in interface MDIManager
public void restoreCursor()
MDIManager
restoreCursor
in interface MDIManager
MDIManager.setWaitCursor()
public boolean closeSingletonWindow(Class viewClass, Object model)
MDIManager
closeSingletonWindow
in interface MDIManager
viewClass
- Class of the window which is to be closedmodel
- Model of the window which is to be closedpublic boolean closeSingletonWindow(Object model)
MDIManager
closeSingletonWindow
in interface MDIManager
model
- Model of the window which is to be closedpublic IWindow[] getAllWindows()
MDIManager
PluginServices.getMainFrame()
.getAllWindows
in interface MDIManager
public IWindow[] getOrderedWindows()
MDIManager
MDIManager.getAllWindows()
),
but in this method the windows are returned in the same
deepness order that they have in the application.getOrderedWindows
in interface MDIManager
public void setMaximum(IWindow v, boolean bMaximum) throws PropertyVetoException
MDIManager
setMaximum
in interface MDIManager
v
- The window to be maximized or restoredbMaximum
- If true, the window will be maximized,
if false, it will be restoredPropertyVetoException
public void changeWindowInfo(IWindow w, WindowInfo wi)
MDIManager
changeWindowInfo
in interface MDIManager
w
- The window whose properties are to be changedwi
- The WindowInfo object containing the new properties to be setpublic void refresh(IWindow win)
MDIManager
refresh
in interface MDIManager
win
- The window to be refreshed.public void setBackgroundImage(ImageIcon image, String typeDesktop)
MDIManager
typeDesktop
argument.setBackgroundImage
in interface MDIManager
image
- The image to be set as background imagetypeDesktop
- Decides whether the image should be centered, set
in mosaic or expanded. Accepted values are: Theme.CENTERED,
Theme.MOSAIC and Theme.EXPAND.public void showWindow(JPanel panel, String title, WindowManager.MODE mode)
MDIManager
showWindow
in interface MDIManager
panel
- to show as a windowtitle
- title of the windowmode
- type of the window to createpublic IWindow getWindow(JPanel panel)
MDIManager
getWindow
in interface MDIManager
public void setLocale(Locale locale)
setLocale
in interface MDIManager