|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.opensha.commons.gui.LabeledBoxPanel
public class LabeledBoxPanel
Title: LabeledBoxPanel
Description: GUI Widget that contains a Header panel with a title lable and an editor panel withing a scroll pane. Is the base class for the ParameterListEditor. This is a generic component so it was useful to pull this functionality out of the ParameterListEditor and make that a subclass.
The main use is to add any component to the editor panel, and the results will be scrollable. See the add() functions below.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected boolean |
addDefault
|
protected Color |
borderColor
|
protected static String |
C
|
protected static boolean |
D
|
protected JPanel |
editorPanel
|
protected static GridBagLayout |
GBL
|
protected JLabel |
headerLabel
|
protected JPanel |
headerPanel
|
protected Color |
headerPanelBackgroundColor
|
protected JScrollPane |
jScrollPane1
|
protected String |
title
|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
LabeledBoxPanel()
Creates a new JPanel with a double buffer
and a flow layout. |
|
LabeledBoxPanel(boolean isDoubleBuffered)
Creates a new JPanel with FlowLayout
and the specified buffering strategy. |
|
LabeledBoxPanel(LayoutManager layout)
Create a new buffered JPanel with the specified layout manager |
|
LabeledBoxPanel(LayoutManager layout,
boolean isDoubleBuffered)
Creates a new JPanel with the specified layout manager and buffering strategy. |
|
| Method Summary | |
|---|---|
Component |
add(Component comp)
Appends the specified component to the end of this container. |
Component |
add(Component comp,
int index)
Adds the specified component to this container at the given position. |
void |
add(Component comp,
Object constraints)
Adds the specified component to the end of this container. |
void |
add(Component comp,
Object constraints,
int index)
Adds the specified component to this container with the specified constraints at the specified index. |
Component |
add(String name,
Component comp)
Adds the specified component to this container. |
void |
addPanel(JPanel panel)
|
Color |
getBorderColor()
Gets the borderColor of this boxPanel |
Color |
getHeaderPanelBackgroundColor()
|
String |
getTitle()
Gets the title in this boxPanel |
protected void |
jbInit()
Initializes the GUI components and layout |
void |
remove(Component comp)
Removes the specified component from this container. |
void |
remove(int index)
Removes the component, specified by index, from this container |
void |
removeAll()
Removes all the components from this container. |
void |
setHeaderPanelBackgroundColor(Color background)
|
void |
setLayout(LayoutManager mgr)
Sets the layout manager for this container. |
void |
setTitle(String newTitle)
Sets the title in this boxPanel |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final String C
protected static final boolean D
protected JScrollPane jScrollPane1
protected JPanel editorPanel
protected JPanel headerPanel
protected JLabel headerLabel
protected static GridBagLayout GBL
protected String title
protected Color borderColor
protected Color headerPanelBackgroundColor
protected boolean addDefault
| Constructor Detail |
|---|
public LabeledBoxPanel(LayoutManager layout,
boolean isDoubleBuffered)
layout - the LayoutManager to useisDoubleBuffered - a boolean, true for double-buffering, which
uses additional memory space to achieve fast, flicker-free
updatespublic LabeledBoxPanel(LayoutManager layout)
layout - the LayoutManager to usepublic LabeledBoxPanel(boolean isDoubleBuffered)
JPanel with FlowLayout
and the specified buffering strategy.
If isDoubleBuffered is true, the JPanel
will use a double buffer.
layout - the LayoutManager to useisDoubleBuffered - a boolean, true for double-buffering, which
uses additional memory space to achieve fast, flicker-free
updatespublic LabeledBoxPanel()
JPanel with a double buffer
and a flow layout.
| Method Detail |
|---|
public void setLayout(LayoutManager mgr)
setLayout in class Containermgr - the specified layout managerContainer.doLayout(),
Container.getLayout()public void setTitle(String newTitle)
newTitle - The new title valuepublic void setHeaderPanelBackgroundColor(Color background)
public Color getHeaderPanelBackgroundColor()
public String getTitle()
public Color getBorderColor()
protected void jbInit()
throws Exception
Exceptionpublic void addPanel(JPanel panel)
public Component add(Component comp)
Container.addImpl(java.awt.Component, java.lang.Object, int).
add in class Containercomp - the component to be added
Container.addImpl(java.awt.Component, java.lang.Object, int)
public Component add(String name,
Component comp)
Container.addImpl(java.awt.Component, java.lang.Object, int).
This method is obsolete as of 1.1. Please use the
method add(Component, Object) instead.
add in class Container
public Component add(Component comp,
int index)
Container.addImpl(java.awt.Component, java.lang.Object, int).
add in class Containercomp - the component to be addedindex - the position at which to insert the component,
or -1 to append the component to the end
compContainer.addImpl(java.awt.Component, java.lang.Object, int),
remove(int)
public void add(Component comp,
Object constraints)
Container.addImpl(java.awt.Component, java.lang.Object, int).
add in class Containercomp - the component to be addedconstraints - an object expressing
layout contraints for this componentContainer.addImpl(java.awt.Component, java.lang.Object, int),
LayoutManagerpublic void remove(int index)
remove in class Containerindex - the index of the component to be removedpublic void remove(Component comp)
remove in class Containercomp - public void removeAll()
removeAll in class Container
public void add(Component comp,
Object constraints,
int index)
Container.addImpl(java.awt.Component, java.lang.Object, int).
add in class Containercomp - the component to be addedconstraints - an object expressing layout contraints for thisindex - the position in the container's list at which to insert
the component. -1 means insert at the end.
componentContainer.addImpl(java.awt.Component, java.lang.Object, int),
remove(int),
LayoutManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||