public class JCMPanel extends Panel
The disadvantage of this is that all the data used in the interface is recomputed, even if the input objects that they depend on have not changed. For example. if the user changes the value in a VarialbleInput, all the points on a graph will be recomputed even if the function has not changed. The alternative is to use regular Panels for all or part of the interface and configure some Controllers by hand.
Panel.AccessibleAWTPanel
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
JCMPanel()
Create a JCMPanel that uses a BorderLayout with horizontal and veritcal
gaps of 3 pixels.
|
JCMPanel(int gap)
Create a JCMPanel that uses a BorderLayout with horizontal and vertical
gaps of "gap" pixels.
|
JCMPanel(int rows,
int columns)
Create a JCMPanel that uses a GridLayout with the specified number of rows
and columns and with horizontal and veritcal gaps of 3 pixels between components.
|
JCMPanel(int rows,
int columns,
int gap)
Create a JCMPanel that uses a GridLayout with the specified number of rows
and columns and with horizontal and vertical gaps of "gap" pixels.
|
JCMPanel(LayoutManager layout)
Create a JCMPanel that uses a given layout manager.
|
Modifier and Type | Method and Description |
---|---|
void |
gatherInputs()
This method will set all the input objects in this JCMPanel
and in sub-JCMPanels, as well as any other input objects that have been
added to the panels' Controllers, to notify the Controller of this JCMPanel
when they change.
|
Controller |
getController()
Return the controller associated with this JCMPanel.
|
Insets |
getInsets()
Called by the system to determine how much of a gap to leave
on each edge of the panel.
|
void |
processContainerEvent(ContainerEvent evt)
Called by the system when a component is added to or removed from
this panel.
|
void |
setInsetGap(int x)
Set the size of the "Insets" for this JCMPanel.
|
addNotify, getAccessibleContext
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public JCMPanel(LayoutManager layout)
layout
- layout manager to use. (This could be null.)public JCMPanel()
public JCMPanel(int gap)
gap
- inset gap to use.public JCMPanel(int rows, int columns)
rows
- number of rows in the GridLayout.columns
- number of columns in the GridLayout.public JCMPanel(int rows, int columns, int gap)
rows
- number of rows in the GridLayout.columns
- number of columns in the GridLayout.gap
- number of pixels between rows and columnspublic void setInsetGap(int x)
x
- inset gap to use.public Insets getInsets()
public Controller getController()
public void gatherInputs()
public void processContainerEvent(ContainerEvent evt)
processContainerEvent
in class Container