yu.ac.bg.etf.javaqx.qswing
Class JQContainer

java.lang.Object
  extended byyu.ac.bg.etf.javaqx.core.AbstractDisposable
      extended byyu.ac.bg.etf.javaqx.qswing.JQComponent
          extended byyu.ac.bg.etf.javaqx.qswing.JQContainer
All Implemented Interfaces:
Disposable, JQComponentProperties, JQContainerProperties
Direct Known Subclasses:
JQDesktopPane, JQMenu, JQMenuBar, JQPanel, JQStatusBar, JQTabbedPane, JQToolBar, JQWindow

public class JQContainer
extends JQComponent
implements JQContainerProperties

JQContainer is a component that contains other QSwing components.

Version:
0.2.0
Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)

Field Summary
 
Fields inherited from class yu.ac.bg.etf.javaqx.qswing.JQComponent
listenerList
 
Fields inherited from interface yu.ac.bg.etf.javaqx.qswing.properties.JQContainerProperties
PROPERTY_LAYOUT_MANAGER
 
Fields inherited from interface yu.ac.bg.etf.javaqx.qswing.properties.JQComponentProperties
PROPERTY_BACKGROUND, PROPERTY_COMPONENT_ORIENTATION, PROPERTY_CONTEXT_MENU, PROPERTY_ENABLED, PROPERTY_FIXED_SIZE, PROPERTY_FOCUSABLE, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_INSETS, PROPERTY_LOCALE, PROPERTY_MAXIMUM_SIZE, PROPERTY_MINIMUM_SIZE, PROPERTY_NAME, PROPERTY_OPAQUE, PROPERTY_PREFERRED_SIZE, PROPERTY_RESOURCE_BUNDLE_NAME, PROPERTY_STATUS_TIP_TEXT, PROPERTY_STYLE_SHEET, PROPERTY_TOOL_TIP_TEXT, PROPERTY_VISIBLE, PROPERTY_WHATS_THIS_TEXT
 
Constructor Summary
JQContainer()
          Constructs new JQContainer object.
JQContainer(LayoutManager layoutManager)
          Constructs new JQContainer object.
 
Method Summary
 JQComponent add(JQComponent component)
          Appends the specified component to the end of this container.
 JQComponent add(JQComponent component, int index)
          Adds the specified component to this container at the given position.
 JQComponent add(JQComponent component, java.lang.Object constraints)
          Appends the specified component to the end of this container.
 JQComponent add(JQComponent component, java.lang.Object constraints, int index)
          Inserts the specified component at the specified index.
protected  JQComponent addImpl(JQComponent component, java.lang.Object constraints, int index)
          Adds new component to the container.
 void doLayout()
          Lays out this container.
 JQComponent getComponent(int index)
          Returns the component at specified index.
 int getComponentCount()
          Returns the number of components in this container.
 int getComponentIndex(JQComponent component)
          Returns the index of the specified component.
 JQComponent[] getComponents()
          Returns all the components in this container.
 LayoutManager getLayout()
          Returns layout manager of this component.
 Dimension getMaximumSize()
          Returns maximum size of the component.
 Dimension getMinimumSize()
          Returns minimum size of the component.
 JQComponent[] getOwnedComponents()
          Return an array containing all the components this component currently owns.
 Dimension getPreferredSize()
          Returns preferred size of the component.
 void invalidate()
          Invalidates the component.
 void pack()
          Sets the size of the container to fit the preferred size and layouts of its subcomponents.
protected  java.lang.String paramString()
          Returns parameters string.
 JQComponent remove(int index)
          Removes index specified component from this container.
 void remove(JQComponent component)
          Removes the specified component from this container.
 void removeAll()
          Removes all the components from this container.
 void setBackground(Color background)
          Sets background color of the component.
 void setComponentOrientation(ComponentOrientation orientation)
          Sets component orientation.
 void setForeground(Color background)
          Sets foreground color of the component.
 void setLayout(LayoutManager layoutManager)
          Sets the layout manager for this container.
 void updateLocalization()
          Updates localization.
 void validate()
          Validates the component.
 
Methods inherited from class yu.ac.bg.etf.javaqx.qswing.JQComponent
addComponentListener, addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, disableEvents, disposeComponent, disposeObject, enableEvents, eventEnabled, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getClientProperty, getComponentListeners, getComponentOrientation, getContextMenu, getCursor, getEventMask, getFocusListener, getFont, getFontMetrics, getForeground, getHeight, getInsets, getKeyListeners, getLocale, getLocation, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getOwner, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getResourceBundleName, getSize, getStatusTipText, getStyleSheet, getToolTipText, getToolTipText, getWhatsThisText, getWidth, getX, getY, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLeftToRight, isLocaleSet, isOpaque, isOwnerOf, isPainting, isResizable, isResourceBundleNameSet, isUpdatesEnabled, isValid, isVisible, localizeObject, localizeString, localizeString, localizeStrings, paintComponent, processComponentEvent, processContextMenuEvent, processFocusEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, processStyleChange, putClientProperty, removeComponentListener, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, removeStyleSheet, repaint, repaint, repaint, requestFocus, revalidate, setBounds, setBounds, setContextMenu, setCursor, setDefaultResourceBundleName, setDisplayable, setEnabled, setFixedSize, setFixedSize, setFocusable, setFont, setInsets, setInsets, setLeftToRightComponentOrientation, setLocale, setLocation, setLocation, setMaximumSize, setMaximumSize, setMinimumSize, setMinimumSize, setName, setOpaque, setPreferredSize, setPreferredSize, setResizable, setResourceBundleName, setRightToLeftComponentOrientation, setSize, setSize, setStatusTipText, setStyleSheet, setStyleSheet, setToolTipText, setUpdatesEnabled, setVisible, setWhatsThisText, toString, unsetComponentOrientation, update, update, update, updateComponentOrientation
 
Methods inherited from class yu.ac.bg.etf.javaqx.core.AbstractDisposable
addDisposeListener, dispose, disposedCheck, disposedErrorString, finalize, isDisposed, removeDisposeListener
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JQContainer

public JQContainer()
Constructs new JQContainer object.


JQContainer

public JQContainer(LayoutManager layoutManager)
Constructs new JQContainer object.

Parameters:
layoutManager - the layout manager
Method Detail

add

public JQComponent add(JQComponent component)
Appends the specified component to the end of this container.

Parameters:
component - the component to be added
Returns:
the component argument

add

public JQComponent add(JQComponent component,
                       int index)
Adds the specified component to this container at the given position.

Parameters:
component - the component to be added
index - the position at which to insert the component, or -1 to append the component to the end
Returns:
the component argument

add

public JQComponent add(JQComponent component,
                       java.lang.Object constraints)
Appends the specified component to the end of this container.

Parameters:
component - the component to be added
constraints - the layout constraints
Returns:
the component argument

add

public JQComponent add(JQComponent component,
                       java.lang.Object constraints,
                       int index)
Inserts the specified component at the specified index.

Parameters:
component - the component to be added
constraints - the layout constraints
index - the component index
Returns:
the component argument

remove

public JQComponent remove(int index)
Removes index specified component from this container.

Parameters:
index - the index of the component to be removed
Returns:
component at specified index

remove

public void remove(JQComponent component)
Removes the specified component from this container.

Parameters:
component - the component to be removed

removeAll

public void removeAll()
Removes all the components from this container.


getComponentCount

public int getComponentCount()
Returns the number of components in this container.

Returns:
the number of components in this container

getComponent

public JQComponent getComponent(int index)
Returns the component at specified index.

Parameters:
index - the index of the component
Returns:
the component at specified index
Throws:
java.lang.IndexOutOfBoundsException - if index is out of range ((index < 0) | (index >= getComponentCount())).

getComponents

public JQComponent[] getComponents()
Returns all the components in this container.

Returns:
all the components in this container

getComponentIndex

public int getComponentIndex(JQComponent component)
Returns the index of the specified component.

Parameters:
component - the component
Returns:
the index of the specified component

getLayout

public LayoutManager getLayout()
Returns layout manager of this component.

Returns:
layout manager of this component

setLayout

public void setLayout(LayoutManager layoutManager)
Sets the layout manager for this container.

Parameters:
layoutManager - the layout manager

doLayout

public void doLayout()
Lays out this container.


pack

public void pack()
Sets the size of the container to fit the preferred size and layouts of its subcomponents.


addImpl

protected JQComponent addImpl(JQComponent component,
                              java.lang.Object constraints,
                              int index)
Adds new component to the container.

Parameters:
component - the component
constraints - the constraints
index - the component index
Returns:
added component

getPreferredSize

public Dimension getPreferredSize()
Returns preferred size of the component.

Overrides:
getPreferredSize in class JQComponent
Returns:
preferred size of the component

getMaximumSize

public Dimension getMaximumSize()
Returns maximum size of the component.

Overrides:
getMaximumSize in class JQComponent
Returns:
maximum size of the component

getMinimumSize

public Dimension getMinimumSize()
Returns minimum size of the component.

Overrides:
getMinimumSize in class JQComponent
Returns:
minimum size of the component

setComponentOrientation

public void setComponentOrientation(ComponentOrientation orientation)
Sets component orientation.

Overrides:
setComponentOrientation in class JQComponent
Parameters:
orientation - the component orientation

validate

public void validate()
Validates the component.

Overrides:
validate in class JQComponent

invalidate

public void invalidate()
Invalidates the component.

Overrides:
invalidate in class JQComponent

setBackground

public void setBackground(Color background)
Sets background color of the component.

Overrides:
setBackground in class JQComponent
Parameters:
background - the background color of the component

setForeground

public void setForeground(Color background)
Sets foreground color of the component.

Overrides:
setForeground in class JQComponent
Parameters:
background - the background color of the component

updateLocalization

public void updateLocalization()
Updates localization.

Overrides:
updateLocalization in class JQComponent

getOwnedComponents

public JQComponent[] getOwnedComponents()
Return an array containing all the components this component currently owns.

Overrides:
getOwnedComponents in class JQComponent
Returns:
an array containing all the components this component currently owns

paramString

protected java.lang.String paramString()
Returns parameters string.

Overrides:
paramString in class JQComponent
Returns:
parameters string


Copyright © 2007 ETF and contributors. All Rights Reserved.