Package gov.nih.mipav.view.components
Class PanelManager
- java.lang.Object
- 
- gov.nih.mipav.view.components.PanelManager
 
- 
 public class PanelManager extends java.lang.ObjectManages the adding of components to a panel, automatically tranlating between logical element placement and the panel's layout.- Author:
- mccreedy
 
- 
- 
Field SummaryFields Modifier and Type Field Description private java.awt.GridBagConstraintsgbcDOCUMENT ME!private javax.swing.JPanelmanagedPanelDOCUMENT ME!
 - 
Constructor SummaryConstructors Constructor Description PanelManager()Construct the panel manager with a new panel.PanelManager(java.lang.String title)Construct the panel manager with a new panel that has a titled border.PanelManager(javax.swing.JPanel panel)Construct the panel manager and attach it to a panel which has already been created.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(javax.swing.JComponent component)Adds a new component to the panel.voidadd(javax.swing.JComponent component, int anchorPosition)Adds a new component to the panel.voidaddOnNextLine(javax.swing.JComponent component)Adds a new component to the panel on a new line (vertically).voidaddOnNextLine(javax.swing.JComponent component, int anchorPosition)Adds a new component to the panel on a new line (vertically).java.awt.GridBagConstraintsgetConstraints()Returns the current constraints of this panel manager.javax.swing.JPanelgetPanel()Returns the managed panel.private java.awt.GridBagConstraintsinitConstraints()Create a new set of grid bag constraints.private javax.swing.JPanelinitPanel()Create a new panel.private voidmoveToNextLine()Force new components which are added to appear on the next line in the panel (vertically).voidsetPanel(javax.swing.JPanel panel)Changes the panel which is managed by this class.
 
- 
- 
- 
Constructor Detail- 
PanelManagerpublic PanelManager() Construct the panel manager with a new panel.
 - 
PanelManagerpublic PanelManager(java.lang.String title) Construct the panel manager with a new panel that has a titled border.- Parameters:
- title- the title to put on the new panel's border
 
 - 
PanelManagerpublic PanelManager(javax.swing.JPanel panel) Construct the panel manager and attach it to a panel which has already been created.- Parameters:
- panel- the panel to manage
 
 
- 
 - 
Method Detail- 
addpublic void add(javax.swing.JComponent component) Adds a new component to the panel.- Parameters:
- component- the component to add
 
 - 
addpublic void add(javax.swing.JComponent component, int anchorPosition)Adds a new component to the panel.- Parameters:
- component- the component to add
- anchorPosition- the position to anchor the component to (from GridBagConstraints)
 
 - 
addOnNextLinepublic void addOnNextLine(javax.swing.JComponent component) Adds a new component to the panel on a new line (vertically).- Parameters:
- component- the component to add
 
 - 
addOnNextLinepublic void addOnNextLine(javax.swing.JComponent component, int anchorPosition)Adds a new component to the panel on a new line (vertically).- Parameters:
- component- the component to add
- anchorPosition- the position to anchor the component to (from GridBagConstraints)
 
 - 
getConstraintspublic java.awt.GridBagConstraints getConstraints() Returns the current constraints of this panel manager.- Returns:
- the current grid bag constraints
 
 - 
getPanelpublic javax.swing.JPanel getPanel() Returns the managed panel.- Returns:
- the managed panel
 
 - 
setPanelpublic void setPanel(javax.swing.JPanel panel) Changes the panel which is managed by this class. Forces the panel to use a grid bag layout.- Parameters:
- panel- the panel to manage
 
 - 
initConstraintsprivate java.awt.GridBagConstraints initConstraints() Create a new set of grid bag constraints.- Returns:
- new layout constraints
 
 - 
initPanelprivate javax.swing.JPanel initPanel() Create a new panel.- Returns:
- a new panel, with a grid bag layout
 
 - 
moveToNextLineprivate void moveToNextLine() Force new components which are added to appear on the next line in the panel (vertically).
 
- 
 
-