Package gov.nih.mipav.view.components
Class PanelManager
java.lang.Object
gov.nih.mipav.view.components.PanelManager
Manages the adding of components to a panel, automatically tranlating between logical element placement and the
panel's layout.
- Author:
- mccreedy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate GridBagConstraintsDOCUMENT ME!private JPanelDOCUMENT ME! -
Constructor Summary
ConstructorsConstructorDescriptionConstruct the panel manager with a new panel.PanelManager(String title) Construct the panel manager with a new panel that has a titled border.PanelManager(JPanel panel) Construct the panel manager and attach it to a panel which has already been created. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(JComponent component) Adds a new component to the panel.voidadd(JComponent component, int anchorPosition) Adds a new component to the panel.voidaddOnNextLine(JComponent component) Adds a new component to the panel on a new line (vertically).voidaddOnNextLine(JComponent component, int anchorPosition) Adds a new component to the panel on a new line (vertically).Returns the current constraints of this panel manager.getPanel()Returns the managed panel.private GridBagConstraintsCreate a new set of grid bag constraints.private JPanelCreate a new panel.private voidForce new components which are added to appear on the next line in the panel (vertically).voidChanges the panel which is managed by this class.
-
Field Details
-
gbc
DOCUMENT ME! -
managedPanel
DOCUMENT ME!
-
-
Constructor Details
-
PanelManager
public PanelManager()Construct the panel manager with a new panel. -
PanelManager
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
-
PanelManager
Construct the panel manager and attach it to a panel which has already been created.- Parameters:
panel- the panel to manage
-
-
Method Details
-
add
Adds a new component to the panel.- Parameters:
component- the component to add
-
add
Adds a new component to the panel.- Parameters:
component- the component to addanchorPosition- the position to anchor the component to (from GridBagConstraints)
-
addOnNextLine
Adds a new component to the panel on a new line (vertically).- Parameters:
component- the component to add
-
addOnNextLine
Adds a new component to the panel on a new line (vertically).- Parameters:
component- the component to addanchorPosition- the position to anchor the component to (from GridBagConstraints)
-
getConstraints
Returns the current constraints of this panel manager.- Returns:
- the current grid bag constraints
-
getPanel
Returns the managed panel.- Returns:
- the managed panel
-
setPanel
Changes the panel which is managed by this class. Forces the panel to use a grid bag layout.- Parameters:
panel- the panel to manage
-
initConstraints
Create a new set of grid bag constraints.- Returns:
- new layout constraints
-
initPanel
Create a new panel.- Returns:
- a new panel, with a grid bag layout
-
moveToNextLine
private void moveToNextLine()Force new components which are added to appear on the next line in the panel (vertically).
-