swingwtx.swing
Class JInternalFrame

java.lang.Object
  extended byswingwt.awt.Component
      extended byswingwt.awt.Container
          extended byswingwtx.swing.JComponent
              extended byswingwtx.swing.JInternalFrame
All Implemented Interfaces:
ImageObserver, MenuContainer, RootPaneContainer, WindowConstants

public class JInternalFrame
extends JComponent
implements WindowConstants, RootPaneContainer

A JInternalFrame implementation. It is capable of drawing window decorations and behaving like real MDI, or can represent a tabbed container if JDesktopPane is using tabbed emulation


Nested Class Summary
protected  class JInternalFrame.DecoratedRootPane
          This is a JRootPane descendant that is capable of drawing the border around the contents of the JInternalFrame.
 
Nested classes inherited from class swingwtx.swing.JComponent
JComponent.InternalFrameSelectionListener
 
Field Summary
protected  JInternalFrame.DecoratedRootPane decoration
          Our special rootpane, cast to it's correct type
protected  JButton defaultButton
           
protected  boolean disposed
           
protected  boolean drawDecoration
          Set to true if the decoration (border, buttons, title, icon, etc.) need drawing around the JInternalFrame
protected  java.util.Vector internalFrameListeners
           
protected  JDesktopPane parentpane
           
protected  int pCloseOperation
           
protected  Icon pImage
           
protected  org.eclipse.swt.widgets.Composite ppeer
           
protected  java.lang.String pTitle
           
protected  JRootPane rootPane
           
 
Fields inherited from class swingwtx.swing.JComponent
accessibleContext, actionMap, ancestorInputMap, border, clientProperties, descendantHasPeer, focusInputMap, internalFrameAdapter, internalFrameParent, opaque, propertyChangeListeners, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW, windowInputMap
 
Fields inherited from class swingwt.awt.Container
composite, comps, containerListeners, layout, queuedValidateRequest
 
Fields inherited from class swingwt.awt.Component
actionCommand, actionListeners, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListeners, componentName, consumeAvailableHeight, consumeAvailableWidth, focusable, focusListeners, graphicsConfig, inputMethodListeners, isUserSetFont, keyListeners, layoutModifier, LEFT_ALIGNMENT, LOCK, mouseListeners, mouseMotionListeners, mouseWheelListeners, parent, pBackground, pCursor, pDoubleBuffered, peer, pEnabled, pFont, pForeground, pLayoutData, pLocation, pMaxSize, pMinSize, pPrefSize, pSize, pToolTipText, pVisible, RIGHT_ALIGNMENT, swingWTDefaultActionEventAdapter, swingWTEventAdapter, TOP_ALIGNMENT
 
Fields inherited from interface swingwtx.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface swingwt.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JInternalFrame()
           
JInternalFrame(java.lang.String title)
           
JInternalFrame(java.lang.String title, boolean resizable)
           
JInternalFrame(java.lang.String title, boolean resizable, boolean closable)
           
JInternalFrame(java.lang.String title, boolean resizable, boolean closable, boolean maximizable)
           
JInternalFrame(java.lang.String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable)
           
 
Method Summary
 Component add(Component c)
          Overridden to point to getContentPane() rather than throwing an error
 void add(Component c, java.lang.Object layoutModifier)
          Overridden to point to getContentPane() rather than throwing an error
 void addInternalFrameListener(InternalFrameListener l)
           
 void dispose()
          Destroys the component
 Container getContentPane()
           
 JButton getDefaultButton()
           
 int getDefaultCloseOperation()
           
 Icon getFrameIcon()
           
 Component getGlassPane()
           
 JDesktopPane getJDesktopPane()
           
 JMenuBar getJMenuBar()
           
 JLayeredPane getLayeredPane()
           
 LayoutManager getLayout()
          Overridden to point to getContentPane() rather than throwing an error
 MenuBar getMenuBar()
           
protected  JDesktopPane getParentPane()
           
 JRootPane getRootPane()
           
 Dimension getSize()
          Returns the peers actual size.
 org.eclipse.swt.widgets.Control getSWTPeer()
          Returns the SWT peer
 java.lang.String getTitle()
           
 void hide()
          Makes the component invisible
 boolean isClosable()
           
 boolean isIconifiable()
           
 boolean isMaximizable()
           
 boolean isMaximum()
           
 boolean isResizable()
           
 boolean isSelected()
           
 void pack()
           
protected  boolean processFrameClosing()
          Called when the user has closed the window - returns true if the user is allowed to close it
 void processInternalFrameEvent(int eventID)
          Allows firing of internal frame events
protected  void refreshFrame()
          Finds the component representing this JInternalFrame and updates all it's properties based on what we have stored here.
 void registerEvents()
          When the component has been added to a container, this routine gets called to tell it to set up SWT listeners for all its events.
 void remove(Component c)
          Overridden to point to getContentPane() rather than throwing an error
 void setClosable(boolean b)
           
 void setClosed(boolean b)
           
 void setContentPane(Container contentPane)
           
 void setDefaultButton(JButton button)
           
 void setDefaultCloseOperation(int operation)
           
 void setDrawDecoration(boolean b)
          SwingWT specific - if false, prevents JInternalFrame's drawing their window decorations
 void setFrameIcon(Icon icon)
           
 void setGlassPane(Component glassPane)
           
 void setIcon(boolean b)
           
 void setIconifiable(boolean b)
           
 void setJMenuBar(JMenuBar menu)
           
 void setLayeredPane(JLayeredPane layeredPane)
           
 void setLayout(LayoutManager l)
          Overridden to point to getContentPane() rather than throwing an error
 void setLayout(LayoutManager2 l)
          Overridden to point to getContentPane() rather than throwing an error
 void setLocation(int x, int y)
          Sets the component's location in it's container
 void setMaximizable(boolean b)
           
 void setMaximum(boolean b)
           
 void setMenuBar(MenuBar menu)
           
protected  void setParentPane(JDesktopPane jdp)
           
 void setResizable(boolean b)
           
 void setSelected(boolean b)
           
 void setSize(Dimension d)
          Sets the peer's actual size
 void setSize(int width, int height)
          Sets the peer's actual size
 void setSwingWTParent(Container parent)
          Callback for when this JComponent is added to a container.
 void setTitle(java.lang.String title)
           
 void show()
          Makes the component visible
 void toBack()
           
 void toFront()
           
 
Methods inherited from class swingwtx.swing.JComponent
add, add, add, addPropertyChangeListener, addPropertyChangeListener, checkInternalFrameChild, getAccessibleContext, getActionMap, getAutoscrolls, getBorder, getClientProperty, getInputMap, getInsets, getToolTipLocation, getToolTipText, getTopLevelAncestor, getVisibleRect, isDoubleBuffered, isOpaque, isOptimizedDrawingEnabled, isValidateRoot, paint, paintBackground, paintChildren, paintComponent, paintImmediately, paintImmediately, putClientProperty, remove, removePropertyChangeListener, removePropertyChangeListener, repaint, revalidate, scrollRectToVisible, setActionMap, setAutoscrolls, setBorder, setDoubleBuffered, setInputMap, setMargin, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled
 
Methods inherited from class swingwt.awt.Container
addComponentToLayout, addContainerListener, debug_showContainmentTree, doAdd, doLayout, getComponent, getComponentCount, getComponentOrientation, getComponents, getComposite, getMaximumSize, getMinimumSize, getParent, getPreferredSize, invalidate, minimumSize, preferredSize, processContainerEvent, processEvent, queuedValidate, removeAll, removeComponentFromCache, removeContainerListener, setLayoutImpl, validate
 
Methods inherited from class swingwt.awt.Component
add, addActionListener, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, calculatePreferredSize, componentOnlyDispose, computePreferredSize, contains, contains, createImage, createListenerArrayFromVector, createVolatileImage, dispatchEvent, getActionCommand, getAlignmentX, getAlignmentY, getBackground, getBounds, getCursor, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getListeners, getLocation, getLocationOnScreen, getName, getPeer, getPeerSize, getSize, getToolkit, getToolTipText, getTreeLock, getWidth, getX, getY, grabFocus, hasFocus, hasSetFont, imageUpdate, inside, isEnabled, isFocusable, isMinimumSizeSet, isShowing, isVisible, processActionEvent, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, processTraverseEvent, registerActionEvents, registerComponentEvents, registerExtendedModifyEvents, registerFocusEvents, registerKeyEvents, registerModifyEvents, registerMouseEvents, registerPaintEvents, registerTraversalEvents, remove, removeActionListener, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, repaint, repaint, repaint, requestFocus, setActionCommand, setAlignmentX, setAlignmentY, setBackground, setBounds, setBounds, setCachedProperties, setComponentOrientation, setComponentRemoved, setCursor, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setFont, setForeground, setHeight, setLocation, setMaximumSize, setMinimumSize, setName, setToolTipText, setVisible, setWidth, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ppeer

protected org.eclipse.swt.widgets.Composite ppeer

internalFrameListeners

protected java.util.Vector internalFrameListeners

parentpane

protected JDesktopPane parentpane

pImage

protected Icon pImage

pTitle

protected java.lang.String pTitle

pCloseOperation

protected int pCloseOperation

defaultButton

protected JButton defaultButton

disposed

protected boolean disposed

rootPane

protected JRootPane rootPane

drawDecoration

protected boolean drawDecoration
Set to true if the decoration (border, buttons, title, icon, etc.) need drawing around the JInternalFrame


decoration

protected JInternalFrame.DecoratedRootPane decoration
Our special rootpane, cast to it's correct type

Constructor Detail

JInternalFrame

public JInternalFrame()

JInternalFrame

public JInternalFrame(java.lang.String title)

JInternalFrame

public JInternalFrame(java.lang.String title,
                      boolean resizable)

JInternalFrame

public JInternalFrame(java.lang.String title,
                      boolean resizable,
                      boolean closable)

JInternalFrame

public JInternalFrame(java.lang.String title,
                      boolean resizable,
                      boolean closable,
                      boolean maximizable)

JInternalFrame

public JInternalFrame(java.lang.String title,
                      boolean resizable,
                      boolean closable,
                      boolean maximizable,
                      boolean iconifiable)
Method Detail

add

public Component add(Component c)
Overridden to point to getContentPane() rather than throwing an error

Overrides:
add in class JComponent

add

public void add(Component c,
                java.lang.Object layoutModifier)
Overridden to point to getContentPane() rather than throwing an error

Overrides:
add in class JComponent

remove

public void remove(Component c)
Overridden to point to getContentPane() rather than throwing an error

Overrides:
remove in class JComponent

getLayout

public LayoutManager getLayout()
Overridden to point to getContentPane() rather than throwing an error

Overrides:
getLayout in class Container

setLayout

public void setLayout(LayoutManager l)
Overridden to point to getContentPane() rather than throwing an error

Overrides:
setLayout in class Container

setLayout

public void setLayout(LayoutManager2 l)
Overridden to point to getContentPane() rather than throwing an error


dispose

public void dispose()
Description copied from class: JComponent
Destroys the component

Overrides:
dispose in class JComponent

addInternalFrameListener

public void addInternalFrameListener(InternalFrameListener l)

getDefaultCloseOperation

public int getDefaultCloseOperation()

setDefaultCloseOperation

public void setDefaultCloseOperation(int operation)

getJDesktopPane

public JDesktopPane getJDesktopPane()

getFrameIcon

public Icon getFrameIcon()

setFrameIcon

public void setFrameIcon(Icon icon)

getTitle

public java.lang.String getTitle()

setTitle

public void setTitle(java.lang.String title)

getSWTPeer

public org.eclipse.swt.widgets.Control getSWTPeer()
Description copied from class: Component
Returns the SWT peer

Overrides:
getSWTPeer in class Component

show

public void show()
Description copied from class: Component
Makes the component visible

Overrides:
show in class Component

hide

public void hide()
Description copied from class: Component
Makes the component invisible

Overrides:
hide in class Component

pack

public void pack()

setParentPane

protected void setParentPane(JDesktopPane jdp)

getParentPane

protected JDesktopPane getParentPane()

isClosable

public boolean isClosable()

isResizable

public boolean isResizable()

isMaximizable

public boolean isMaximizable()

isIconifiable

public boolean isIconifiable()

isMaximum

public boolean isMaximum()

setClosed

public void setClosed(boolean b)

setClosable

public void setClosable(boolean b)

setResizable

public void setResizable(boolean b)

setMaximizable

public void setMaximizable(boolean b)

setIconifiable

public void setIconifiable(boolean b)

setMaximum

public void setMaximum(boolean b)

setIcon

public void setIcon(boolean b)

toFront

public void toFront()

toBack

public void toBack()

refreshFrame

protected void refreshFrame()
Finds the component representing this JInternalFrame and updates all it's properties based on what we have stored here. Just delegates the job to the desktop pane


getSize

public Dimension getSize()
Description copied from class: Component
Returns the peers actual size. Or, if the peer is embedded inside a ScrollPane component, the larger of the preferredSize/peers actual size. This works rather nicely for handling layouts inside a scrollbar as we can simply offset a large composite according to the scrollbar positions inside JScrollPane. One note - if the component is JTree, JTable, JTextArea or JEditorPane, then we return the size as usual since these components handle their own scrolling and we don't want the JScrollPane behaving weirdly.

Overrides:
getSize in class Component

setSize

public void setSize(Dimension d)
Description copied from class: Component
Sets the peer's actual size

Overrides:
setSize in class Component

setSize

public void setSize(int width,
                    int height)
Description copied from class: Component
Sets the peer's actual size

Overrides:
setSize in class Component

setLocation

public void setLocation(int x,
                        int y)
Description copied from class: Component
Sets the component's location in it's container

Overrides:
setLocation in class Component

isSelected

public boolean isSelected()

setSelected

public void setSelected(boolean b)
                 throws java.beans.PropertyVetoException
Throws:
java.beans.PropertyVetoException

registerEvents

public void registerEvents()
Description copied from class: Component
When the component has been added to a container, this routine gets called to tell it to set up SWT listeners for all its events. We can map these then to the AWT-style events

Overrides:
registerEvents in class Component

processFrameClosing

protected boolean processFrameClosing()
Called when the user has closed the window - returns true if the user is allowed to close it


getContentPane

public Container getContentPane()
Specified by:
getContentPane in interface RootPaneContainer

getGlassPane

public Component getGlassPane()
Specified by:
getGlassPane in interface RootPaneContainer

getLayeredPane

public JLayeredPane getLayeredPane()
Specified by:
getLayeredPane in interface RootPaneContainer

getRootPane

public JRootPane getRootPane()
Specified by:
getRootPane in interface RootPaneContainer

setContentPane

public void setContentPane(Container contentPane)
Specified by:
setContentPane in interface RootPaneContainer

setGlassPane

public void setGlassPane(Component glassPane)
Specified by:
setGlassPane in interface RootPaneContainer

setLayeredPane

public void setLayeredPane(JLayeredPane layeredPane)
Specified by:
setLayeredPane in interface RootPaneContainer

setJMenuBar

public void setJMenuBar(JMenuBar menu)

getJMenuBar

public JMenuBar getJMenuBar()

setMenuBar

public void setMenuBar(MenuBar menu)

getMenuBar

public MenuBar getMenuBar()

setDefaultButton

public void setDefaultButton(JButton button)

getDefaultButton

public JButton getDefaultButton()

processInternalFrameEvent

public void processInternalFrameEvent(int eventID)
Allows firing of internal frame events


setDrawDecoration

public void setDrawDecoration(boolean b)
SwingWT specific - if false, prevents JInternalFrame's drawing their window decorations


setSwingWTParent

public void setSwingWTParent(Container parent)
                      throws java.lang.Exception
Description copied from class: JComponent
Callback for when this JComponent is added to a container.

Overrides:
setSwingWTParent in class JComponent
Throws:
java.lang.Exception