public class MDIFrame extends JFrame implements ComponentListener, ContainerListener, ActionListener, MainFrame
Modifier and Type | Class and Description |
---|---|
class |
MDIFrame.TooltipListener |
JFrame.AccessibleJFrame
Frame.AccessibleAWTFrame
Window.AccessibleAWTWindow, Window.Type
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
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
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
MAIN_FRAME_EXT_STATE, MAIN_FRAME_EXT_STATE_DEFAULT, MAIN_FRAME_POS, MAIN_FRAME_POS_DEFAULT, MAIN_FRAME_SIZE, MAIN_FRAME_SIZE_DEFAULT
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e)
Metodo de callback invocado cuando se selecciona un menu o un boton
de
la barra de herramientas.
|
void |
addMenu(ActionInfo action,
String text) |
void |
addMenu(Menu menu,
ActionListener listener,
PluginClassLoader loader)
Adds the provided menu to the menu bar.
|
void |
addMenu(PluginClassLoader loader,
SkinExtensionType ext,
Menu menu)
AƱade la informacion del menu al framework.
|
void |
addPopupMenu(PluginClassLoader loader,
PopupMenu menu) |
void |
addPopupMenuListener(String popupName,
Component c,
ActionListener listener,
PluginClassLoader loader) |
void |
addSelectableTool(ActionInfo action,
String toolBarName,
String groupName,
boolean useText) |
void |
addStatusBarControl(Class<?> extensionClass,
IControl control)
Adds a control to the status bar and associate it with the
provided extension.
|
void |
addTool(ActionInfo action,
String toolBarName) |
void |
addTool(ActionInfo action,
String toolBarName,
boolean useText) |
void |
addTool(ActionInfo action,
String toolBarName,
String dropDownName) |
void |
addTool(PluginClassLoader loader,
SkinExtensionType ext,
ToolBar toolBar,
ActionTool actionTool) |
void |
addTool(PluginClassLoader loader,
SkinExtensionType ext,
ToolBar toolBar,
SelectableTool selectableTool) |
SelectableToolBar |
addToolBar(String toolBarName,
String description,
int position) |
void |
addToolBarControl(Class<?> extensionClass,
JToolBar control,
String name) |
void |
changeMenuName(String[] menu,
String newName,
PluginClassLoader loader)
Changes the menu name, and thus also its location, as the name determines
the location of the menu.
|
void |
componentAdded(ContainerEvent arg0) |
void |
componentHidden(ComponentEvent arg0) |
void |
componentMoved(ComponentEvent arg0) |
void |
componentRemoved(ContainerEvent arg0) |
void |
componentResized(ComponentEvent arg0) |
void |
componentShown(ComponentEvent arg0) |
int |
confirmDialog(String message,
String title,
int optionType,
int messageType)
Show a JOptionPane confirm dialog.
|
int |
confirmDialog(String message,
String title,
int optionType,
int messageType,
String msgid) |
Component |
createComponent(Class<? extends Component> theClass,
Object... parameters)
Creates an return a new instance of the component specified
This method ensure that the component is created in the event dispatch thread of swing.
|
Component |
createComponentWithParams(Class<? extends Component> theClass,
Object[] parameters)
Creates an return a new instance of the component specified
This method ensure that the component is created in the event dispatch thread of swing.
|
void |
enableControls()
Loop on the controls to enable/disable and show/hide them, according to
its associated action (ActionInfo)
|
JComponent |
getComponentByName(String name)
Get a previously added JComponent by name.
|
HashMap |
getInitialSelectedTools() |
static MDIFrame |
getInstance() |
MDIManager |
getMDIManager() |
JMenuItem |
getMenuEntry(String[] menuPath)
Gets the menu entry corresponding the provided menu path.
|
Map |
getSelectedTools() |
NewStatusBar |
getStatusBar()
Gets the status bar, the bar located in the bottom part of the main window.
|
String |
getTitlePrefix() |
SelectableToolBar[] |
getToolbars()
Gets an array containing all the toolbars.
|
boolean |
getToolbarVisibility(String name)
Gets wheter or not this toolbar should be shown by Andami.
|
void |
init()
Makes some initialization tasks.
|
String |
inputDialog(String message,
String title)
Show a JOptionPane input dialog.
|
String |
inputDialog(String message,
String title,
int messageType,
String initialValue)
Show a JOptionPane input dialog.
|
static boolean |
isInitialized() |
void |
message(String msg,
int messageTyoe)
Show the message in the status bar of the application.
|
void |
messageDialog(String message,
String[] messageArgs,
String title,
int messageType)
Create a message dialog with ok button.
|
void |
messageDialog(String message,
String[] messageArgs,
String title,
int messageType,
String msgid) |
void |
messageDialog(String message,
String title,
int messageType)
Create a message dialog with an ok button.
|
void |
refreshControls()
This method is thread safe.
|
void |
removeMenu(Menu menu)
Deletes the provided menu, if found.
|
void |
removePopupMenuListener(String name,
ActionListener listener) |
void |
removeStatusBarControl(String name)
Removes the providedcontrol from the status bar.
|
void |
removeStatusBarLabels(Class<?> clase)
Removes the labels associated with the provided class.
|
void |
setClassesExtensions(Map<Class<? extends IExtension>,ExtensionDecorator> classesExtensions) |
void |
setLocale(Locale locale) |
void |
setSelectedTool(String actionCommand)
You can use this function to select the appropiate
tool inside the toolbars
|
void |
setSelectedTool(String groupName,
String actionCommand)
You can use this function to select the appropiate
tool inside the toolbars
|
void |
setSelectedTools(Map selectedTools)
You can use this function to select the appropiate
tool inside the toolbars
|
void |
setStatusBarLabels(Class<?> clase,
Label[] label)
DOCUMENT ME!
|
void |
setTitle(String title)
Sets the main window title.
|
void |
setTitlePrefix(String titlePrefix) |
boolean |
setToolbarVisibility(String name,
boolean visibility)
Sets wheter or not this toolbar should be shown by Andami.
|
File[] |
showChooserDialog(String title,
int type,
int selectionMode,
boolean multiselection,
File initialPath,
FileFilter filter,
boolean fileHidingEnabled)
Creates and show a JFileChooser dialog.
|
void |
showDialog(Component contents,
String title)
Create a window with the contents and title specified as parameters
and show as a dialog windows of gvSIG.
|
File[] |
showOpenDirectoryDialog(String title,
File initialPath)
Creates and show a JFileChooser dialog for folder selection.
|
File[] |
showOpenFileDialog(String title,
File initialPath)
Creates and show a JFileChooser dialog for selection a file for open.
|
File[] |
showSaveFileDialog(String title,
File initialPath)
Creates and show a JFileChooser dialog for selection a file for save.
|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFont, postEvent
public static boolean isInitialized()
public static MDIFrame getInstance()
public void init()
RuntimeException
public void setTitle(String title)
MainFrame
public SelectableToolBar addToolBar(String toolBarName, String description, int position)
public void addTool(PluginClassLoader loader, SkinExtensionType ext, ToolBar toolBar, SelectableTool selectableTool) throws ClassNotFoundException
ClassNotFoundException
public void addTool(PluginClassLoader loader, SkinExtensionType ext, ToolBar toolBar, ActionTool actionTool) throws ClassNotFoundException
ClassNotFoundException
public void addTool(ActionInfo action, String toolBarName, String dropDownName)
public void addTool(ActionInfo action, String toolBarName)
public void addTool(ActionInfo action, String toolBarName, boolean useText)
public void addSelectableTool(ActionInfo action, String toolBarName, String groupName, boolean useText)
addSelectableTool
in interface MainFrame
public void addMenu(PluginClassLoader loader, SkinExtensionType ext, Menu menu) throws ClassNotFoundException
loader
- Posicion del menu. Se ordena por este campoext
- Array con los nombres de los padres del menumenu
- Texto del menuClassNotFoundException
RuntimeException
public void addMenu(ActionInfo action, String text)
public void setClassesExtensions(Map<Class<? extends IExtension>,ExtensionDecorator> classesExtensions)
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
e
- Evento producidopublic void addPopupMenu(PluginClassLoader loader, PopupMenu menu)
public void removePopupMenuListener(String name, ActionListener listener)
public void addPopupMenuListener(String popupName, Component c, ActionListener listener, PluginClassLoader loader)
public void enableControls()
enableControls
in interface MainFrame
RuntimeException
public void refreshControls()
MainFrame
refreshControls
in interface MainFrame
public void message(String msg, int messageTyoe)
MainFrame
public MDIManager getMDIManager()
public NewStatusBar getStatusBar()
MainFrame
getStatusBar
in interface MainFrame
public void setSelectedTool(String actionCommand)
setSelectedTool
in interface MainFrame
public void setSelectedTool(String groupName, String actionCommand)
public void setSelectedTools(Map selectedTools)
public void setStatusBarLabels(Class<?> clase, Label[] label)
setStatusBarLabels
in interface MainFrame
clase
- label
- public void removeStatusBarLabels(Class<?> clase)
MainFrame
removeStatusBarLabels
in interface MainFrame
clase
- The class whose associated labels are to be removed.public void addStatusBarControl(Class<?> extensionClass, IControl control)
MainFrame
addStatusBarControl
in interface MainFrame
extensionClass
- Extension which will determine whether the
control is enabled and visible.control
- The control to add.public void addToolBarControl(Class<?> extensionClass, JToolBar control, String name)
addToolBarControl
in interface MainFrame
public void removeStatusBarControl(String name)
MainFrame
removeStatusBarControl
in interface MainFrame
name
- The name of the control to removepublic void removeMenu(Menu menu)
MainFrame
removeMenu
in interface MainFrame
menu
- The menu to delete from the menu barpublic void addMenu(Menu menu, ActionListener listener, PluginClassLoader loader)
MainFrame
public void changeMenuName(String[] menu, String newName, PluginClassLoader loader)
MainFrame
changeMenuName
in interface MainFrame
menu
- An array of Strings which represents the full menu path,
for example, {"Vista", "export", "imagen"} is a reference to the menu
"Vista/export/imagen" (that is, the menu Image within the submenu
View-Export). Menu names are translation keys, "Vista", "export", etc will
be translated to the suitable language when they are displayed.newName
- New menu's name, in the syntax "Vista/export/symbols". Each
part of the name is a translation key.loader
- ClassLoader of the plug-in that added the menupublic void componentHidden(ComponentEvent arg0)
componentHidden
in interface ComponentListener
public void componentMoved(ComponentEvent arg0)
componentMoved
in interface ComponentListener
public void componentResized(ComponentEvent arg0)
componentResized
in interface ComponentListener
public void componentShown(ComponentEvent arg0)
componentShown
in interface ComponentListener
public void componentAdded(ContainerEvent arg0)
componentAdded
in interface ContainerListener
public void componentRemoved(ContainerEvent arg0)
componentRemoved
in interface ContainerListener
public String getTitlePrefix()
public void setTitlePrefix(String titlePrefix)
public Map getSelectedTools()
public HashMap getInitialSelectedTools()
public JComponent getComponentByName(String name)
getComponentByName
in interface MainFrame
name
- public SelectableToolBar[] getToolbars()
MainFrame
getToolbars
in interface MainFrame
public boolean getToolbarVisibility(String name)
MainFrame
getToolbarVisibility
in interface MainFrame
name
- The toolbar's namepublic boolean setToolbarVisibility(String name, boolean visibility)
MainFrame
setToolbarVisibility
in interface MainFrame
name
- The toolbar's name.public JMenuItem getMenuEntry(String[] menuPath)
MainFrame
getMenuEntry
in interface MainFrame
menuPath
- The menu path to the menu entry that we want to
retrieve. For example, if we want to retrieve the menu entry
corresponding to the XML menu "Layer/Export/Export_to_PDF" we
will provide an array containing ["Layer", "Export", "Export_to_PDF"].javax.swing.JMenuItem
,
javax.swing.JMenu
or
com.iver.andami.ui.mdiFrame.JMenuItem
.public void messageDialog(String message, String title, int messageType)
ThreadSafeDialogsManager
messageDialog
in interface ThreadSafeDialogsManager
message
- to present in the dialogtitle
- title of the dialogmessageType
- type of icon to use.JOptionPane.showMessageDialog(Component, Object, String, int)
public void messageDialog(String message, String[] messageArgs, String title, int messageType)
ThreadSafeDialogsManager
messageDialog
in interface ThreadSafeDialogsManager
message
- to present in the dialogmessageArgs
- string array of arguments used to format the messagetitle
- title of the dialogmessageType
- type of icon to use.JOptionPane.showMessageDialog(Component, Object, String, int)
public void messageDialog(String message, String[] messageArgs, String title, int messageType, String msgid)
messageDialog
in interface ThreadSafeDialogs
messageDialog
in interface ThreadSafeDialogsManager
public int confirmDialog(String message, String title, int optionType, int messageType)
ThreadSafeDialogsManager
confirmDialog
in interface ThreadSafeDialogsManager
JOptionPane.showConfirmDialog(Component, Object, String, int, int)
public int confirmDialog(String message, String title, int optionType, int messageType, String msgid)
confirmDialog
in interface ThreadSafeDialogs
confirmDialog
in interface ThreadSafeDialogsManager
public String inputDialog(String message, String title, int messageType, String initialValue)
ThreadSafeDialogsManager
inputDialog
in interface ThreadSafeDialogsManager
messageType
- an integer designating the kind of message this is;
primarily used to determine the icon from the pluggable
Look and Feel: ERROR_MESSAGE, INFORMATION_MESSAGE,
WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGEJOptionPane.showInputDialog(Component, Object, String, int)
public String inputDialog(String message, String title)
ThreadSafeDialogsManager
inputDialog
in interface ThreadSafeDialogsManager
JOptionPane.showInputDialog(Component, Object, String, int)
public void showDialog(Component contents, String title)
ThreadSafeDialogs
showDialog
in interface ThreadSafeDialogs
public Component createComponent(Class<? extends Component> theClass, Object... parameters)
ThreadSafeDialogsManager
createComponent
in interface ThreadSafeDialogsManager
theClass
- of component to be createdparameters
- passed to the constructor of the componentpublic Component createComponentWithParams(Class<? extends Component> theClass, Object[] parameters)
ThreadSafeDialogsManager
createComponentWithParams
in interface ThreadSafeDialogsManager
theClass
- of component to be createdparameters
- passed to the constructor of the componentpublic File[] showChooserDialog(String title, int type, int selectionMode, boolean multiselection, File initialPath, FileFilter filter, boolean fileHidingEnabled)
ThreadSafeDialogsManager
showChooserDialog
in interface ThreadSafeDialogsManager
type
- of the dialog, JFileChooser.SAVE_DIALOG or JFileChooser.OPEN_DIALOGselectionMode
- of the dialog, values are: JFileChooser.FILES_ONLY, JFileChooser.DIRECTORIES_ONLY, JFileChooser.FILES_AND_DIRECTORIESfilter
- used to filter the files show in the dialog.public File[] showOpenDirectoryDialog(String title, File initialPath)
ThreadSafeDialogsManager
showOpenDirectoryDialog
in interface ThreadSafeDialogsManager
ThreadSafeDialogsManager.showChooserDialog(String, int, int, boolean, File, FileFilter, boolean)
public File[] showOpenFileDialog(String title, File initialPath)
ThreadSafeDialogsManager
ThreadSafeDialogsManager.showChooserDialog(String, int, int, boolean, File, FileFilter, boolean)
call.showOpenFileDialog
in interface ThreadSafeDialogsManager
ThreadSafeDialogsManager.showChooserDialog(String, int, int, boolean, File, FileFilter, boolean)
public File[] showSaveFileDialog(String title, File initialPath)
ThreadSafeDialogsManager
ThreadSafeDialogsManager.showChooserDialog(String, int, int, boolean, File, FileFilter, boolean)
call.showSaveFileDialog
in interface ThreadSafeDialogsManager
ThreadSafeDialogsManager.showChooserDialog(String, int, int, boolean, File, FileFilter, boolean)