Each component contained in an instance of this class that
responds to key events should forward to its parent container
key events that the component is not interested in. One way to do
this it to have each component contained in an instance of this
class override the processKeyEvent method to do the following.
public void processKeyEvent(KeyEvent e) {
super.processKeyEvent(e);
if (!e.isConsumed()) {
Container parent = getParent();
if (parent instanceof KeyEventProcessor) {
((KeyEventProcessor)parent).processKeyEvent(e);
}
}
}
-
HORIZONTAL_DEFAULT
- The default limit on the width of this container as a percentage
of the width of the limiting container.
-
PERCENT_MAX
- The maximum percent value allowed.
-
PERCENT_MIN
- The minimum percent value allowed.
-
VERTICAL_DEFAULT
- The default limit on the height of this container as a percentage
of the height of the limiting container.
-
LegendPane()
- Construct a LegendPane where the width and height are at most the
default percent of the width and height of the outermost container.
-
LegendPane(int, int)
- Construct a LegendPane where the width and height are at
most the given percent of the width and height of the innermost
heavyweight container.
-
add(Component)
- Have add forwarded request to the body container.
-
adjustmentValueChanged(AdjustmentEvent)
- Implement the AdjustmentListener interface.
-
doLayout()
- Override doLayout() to add a horizontal scrollbar when necessary.
-
getBlockIncrementPercent()
- Return the percent of the height of this container scrolled by
a block increment.
-
getBody()
- Return the body container.
-
getHorizontalPercentLimit()
- Return the horizontal percent limit.
-
getMinimumSize()
- Override getMinimumSize to return the preferred size.
-
getPreferredSize()
- Override getPreferredSize() to return a size limited to
percentages of the available width and height of the limiting
enclosing container (innermost Applet or outermost Container)
-
getUnitIncrement()
- Return the number of pixels scrolled by a unit increment.
-
getVerticalPercentLimit()
- Return the vertical percent limit.
-
keyPressed(KeyEvent)
- Implement KeyListener.keyPressed.
-
keyReleased(KeyEvent)
- Implement KeyListener.keyReleased.
-
keyTyped(KeyEvent)
- Implement KeyListener.keyTyped.
-
processKeyEvent(KeyEvent)
- Override processKeyEvent to make it visible to inner Body class.
-
remove(Component)
- Have remove forwarded request to the body containter.
-
removeAll()
- Have removeAll request forwarded to the body container.
-
repaint(long, int, int, int, int)
- Override repaint for implementation reasons.
-
setBlockIncrementPrecent(int)
- Set the percent of the height of this container scrolled by a
block increment.
-
setHorizontalPercentLimit(int)
- Set the horizontal percent limit.
-
setUnitIncrement(int)
- Set the number of pixels scrolled by a unit increment.
-
setVerticalPercentLimit(int)
- Set the veritcal percent limit.
-
update(Graphics)
- Override update for implementation reasons.
HORIZONTAL_DEFAULT
public static final int HORIZONTAL_DEFAULT
- The default limit on the width of this container as a percentage
of the width of the limiting container.
VERTICAL_DEFAULT
public static final int VERTICAL_DEFAULT
- The default limit on the height of this container as a percentage
of the height of the limiting container.
PERCENT_MIN
public static final int PERCENT_MIN
- The minimum percent value allowed.
PERCENT_MAX
public static final int PERCENT_MAX
- The maximum percent value allowed.
LegendPane
public LegendPane(int horzPercent,
int vertPercent)
- Construct a LegendPane where the width and height are at
most the given percent of the width and height of the innermost
heavyweight container. The percentages are rounded to the
allowable range of values.
- Parameters:
- horzPercent - the maximum percent width
- vertPercent - the maximum percent height
LegendPane
public LegendPane()
- Construct a LegendPane where the width and height are at most the
default percent of the width and height of the outermost container.
getBody
public final Container getBody()
- Return the body container.
getBlockIncrementPercent
public int getBlockIncrementPercent()
- Return the percent of the height of this container scrolled by
a block increment.
setBlockIncrementPrecent
public void setBlockIncrementPrecent(int percent)
- Set the percent of the height of this container scrolled by a
block increment. A percent argument value less than
1 treated as if it were 1; a percent argument value
greater than 100 is treated as if it were 100.
- Parameters:
- precent - the percent to use
getUnitIncrement
public int getUnitIncrement()
- Return the number of pixels scrolled by a unit increment.
setUnitIncrement
public void setUnitIncrement(int crement)
- Set the number of pixels scrolled by a unit increment.
- Parameters:
- crement - the amount to increment or decrement the scrollbar's value
add
public Component add(Component comp)
- Have add forwarded request to the body container.
- Overrides:
- add in class Container
remove
public void remove(Component comp)
- Have remove forwarded request to the body containter.
- Overrides:
- remove in class Container
removeAll
public void removeAll()
- Have removeAll request forwarded to the body container.
- Overrides:
- removeAll in class Container
getHorizontalPercentLimit
public int getHorizontalPercentLimit()
- Return the horizontal percent limit.
setHorizontalPercentLimit
public void setHorizontalPercentLimit(int horzPercent)
- Set the horizontal percent limit.
- Parameters:
- horzPercent - the maximum percent width
getVerticalPercentLimit
public int getVerticalPercentLimit()
- Return the vertical percent limit.
setVerticalPercentLimit
public void setVerticalPercentLimit(int vertPercent)
- Set the veritcal percent limit.
- Parameters:
- vertPercent - the maximum percent width
doLayout
public void doLayout()
- Override doLayout() to add a horizontal scrollbar when necessary.
- Overrides:
- doLayout in class Container
getMinimumSize
public Dimension getMinimumSize()
- Override getMinimumSize to return the preferred size.
- Overrides:
- getMinimumSize in class Container
getPreferredSize
public synchronized Dimension getPreferredSize()
- Override getPreferredSize() to return a size limited to
percentages of the available width and height of the limiting
enclosing container (innermost Applet or outermost Container)
- Overrides:
- getPreferredSize in class Container
processKeyEvent
protected void processKeyEvent(KeyEvent e)
- Override processKeyEvent to make it visible to inner Body class.
- Overrides:
- processKeyEvent in class Component
repaint
public void repaint(long tm,
int x,
int y,
int width,
int height)
- Override repaint for implementation reasons.
- Overrides:
- repaint in class Component
update
public void update(Graphics g)
- Override update for implementation reasons.
- Overrides:
- update in class Container
adjustmentValueChanged
public void adjustmentValueChanged(AdjustmentEvent e)
- Implement the AdjustmentListener interface.
keyPressed
public void keyPressed(KeyEvent e)
- Implement KeyListener.keyPressed.
keyReleased
public void keyReleased(KeyEvent e)
- Implement KeyListener.keyReleased.
keyTyped
public void keyTyped(KeyEvent e)
- Implement KeyListener.keyTyped.
All Packages Class Hierarchy This Package Previous Next Index