|
RADi Runtime Library v1.2.1 | ||||||||
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
de.muntjak.radiloader.RadiPanel
public class RadiPanel
RadiPanel
is RADi's implementation of a JPanel
.
It can display a background image and it implements Scrollable
by means of a ScrollableDefinition
(not documented).
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.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static int |
REPEAT_BOTH
Scale mode constant: Tile a background image if it doesn't fill the panel's display area |
static int |
REPEAT_HORIZONTAL
Scale mode constant: Tile a background image horizontally if it doesn't fill the panel's display width |
static int |
REPEAT_VERTICAL
Scale mode constant: Tile a background image vertically if it doesn't fill the panel's display height |
static int |
SCALE_BOTH
Scale mode constant: Scale a background image both horizontal and vertical |
static int |
SCALE_HORIZONTAL
Scale mode constant: Scale a background image in the horizontal direction only |
static int |
SCALE_NONE
Scale mode constant: Do not scale a background image |
static int |
SCALE_TO_FILL
Scale mode constant: Scale a background image to fill the panel's display area |
static int |
SCALE_TO_FIT
Scale mode constant: Scale a background image to fit inside the panel's display area |
static int |
SCALE_VERTICAL
Scale mode constant: Scale a background image in the vertical direction only |
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 javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
RadiPanel()
Creates a new RadiPanel with no background image
and no scrollable definition. |
|
RadiPanel(boolean isDoubleBuffered)
Creates a new RadiPanel with no background image,
no scrollable definition and the specified buffering strategy. |
Method Summary | |
---|---|
ImageIcon |
getBgImage()
Get this panel's background image. |
int |
getBgImageHorizontalAlignment()
Get the horizontal alignment of the background image. |
int |
getBgImageScaleMode()
Get the scale mode of the background image. |
int |
getBgImageVerticalAlignment()
Get the vertical alignment of the background image. |
Dimension |
getPreferredScrollableViewportSize()
Returns the preferred scrollable viewport size as defined by the ScrollableDefinition or the panel's preferred size
if the ScrollableDefinition is null . |
int |
getScrollableBlockIncrement(Rectangle visibleRect,
int orientation,
int direction)
Returns the scrollable block increment as defined by the ScrollableDefinition or height respective width
of argument visibleRect if the ScrollableDefinition
is null . |
boolean |
getScrollableTracksViewportHeight()
Returns true if either the ScrollableDefinition
is null or the ScrollableDefinition was
specified to fill the viewport vertically and the preferred height of
this panel is less than the height of the viewport,
false otherwise. |
boolean |
getScrollableTracksViewportWidth()
Returns true if either the ScrollableDefinition
is null or the ScrollableDefinition was
specified to fill the viewport horizontally and the preferred width of
this panel is less than the width of the viewport,
false otherwise. |
int |
getScrollableUnitIncrement(Rectangle visibleRect,
int orientation,
int direction)
Returns the scrollable unit increment as defined by the ScrollableDefinition or 1 if the
ScrollableDefinition is null . |
boolean |
isBgImageDoubleBuffered()
Returns whether the background image should be painted using a double buffer. |
void |
paintComponent(Graphics g)
Overrides JComponent.paintComponent to paint the
background image (if one was specified) below any children. |
void |
setBackground(Color bg)
Overrides JComponent.setBackground because the
image buffer must be invalidated if the background color
changes. |
void |
setBgImage(ImageIcon icon)
Sets the new background image and repaints the component. |
void |
setBgImageDoubleBuffered(boolean b)
Sets if the background image should be painted using a double buffer or not. |
void |
setBgImageHorizontalAlignment(int alignment)
Sets the horizontal alignment of the background image. |
void |
setBgImageScaleMode(int scaleMode)
Sets the scale mode of the background image. |
void |
setBgImageVerticalAlignment(int alignment)
Sets the vertical alignment of the background image. |
void |
setOpaque(boolean b)
Overrides JComponent.setOpaque because the
panel must immediately be repainted if the opaque
property changes. |
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 |
---|
public static final int SCALE_NONE
public static final int SCALE_HORIZONTAL
public static final int SCALE_VERTICAL
public static final int SCALE_BOTH
public static final int SCALE_TO_FIT
public static final int SCALE_TO_FILL
public static final int REPEAT_HORIZONTAL
public static final int REPEAT_VERTICAL
public static final int REPEAT_BOTH
Constructor Detail |
---|
public RadiPanel()
RadiPanel
with no background image
and no scrollable definition.
public RadiPanel(boolean isDoubleBuffered)
RadiPanel
with no background image,
no scrollable definition and the specified buffering strategy.
If isDoubleBuffered
is true, the JPanel
will use a double buffer.
isDoubleBuffered
- a boolean, true for double-buffering, which
uses additional memory space to achieve fast, flicker-free
updatesMethod Detail |
---|
public ImageIcon getBgImage()
null
public int getBgImageHorizontalAlignment()
SwingConstants.LEFT
,
SwingConstants.CENTER
or SwingConstants.RIGHT
public int getBgImageScaleMode()
SCALE_NONE
, SCALE_HORIZONTAL
,
SCALE_VERTICAL
, SCALE_BOTH
,
SCALE_TO_FIT
, SCALE_TO_FILL
or REPEAT
public int getBgImageVerticalAlignment()
SwingConstants.TOP
,
SwingConstants.CENTER
or SwingConstants.BOTTOM
public Dimension getPreferredScrollableViewportSize()
ScrollableDefinition
or the panel's preferred size
if the ScrollableDefinition
is null
.
getPreferredScrollableViewportSize
in interface Scrollable
ScrollableDefinition
or the panel's preferred size
if the ScrollableDefinition
is null
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
ScrollableDefinition
or height respective width
of argument visibleRect
if the ScrollableDefinition
is null
.
getScrollableBlockIncrement
in interface Scrollable
ScrollableDefinition
or height respective width
of visibleRect
if the ScrollableDefinition
is null
public boolean getScrollableTracksViewportHeight()
true
if either the ScrollableDefinition
is null
or the ScrollableDefinition
was
specified to fill the viewport vertically and the preferred height of
this panel is less than the height of the viewport,
false
otherwise.
getScrollableTracksViewportHeight
in interface Scrollable
true
if either the ScrollableDefinition
is null
or the ScrollableDefinition
was
specified to fill the viewport vertically and the preferred height of
this panel is less than the height of the viewport,
false
otherwisepublic boolean getScrollableTracksViewportWidth()
true
if either the ScrollableDefinition
is null
or the ScrollableDefinition
was
specified to fill the viewport horizontally and the preferred width of
this panel is less than the width of the viewport,
false
otherwise.
getScrollableTracksViewportWidth
in interface Scrollable
true
if either the ScrollableDefinition
is null
or the ScrollableDefinition
was
specified to fill the viewport horizontally and the preferred width of
this panel is less than the width of the viewport,
false
otherwisepublic int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
ScrollableDefinition
or 1
if the
ScrollableDefinition
is null
.
getScrollableUnitIncrement
in interface Scrollable
ScrollableDefinition
or 1
if the
ScrollableDefinition
is null
public boolean isBgImageDoubleBuffered()
true
if the background image is
double buffered, false
otherwise.public void paintComponent(Graphics g)
JComponent.paintComponent
to paint the
background image (if one was specified) below any children.
paintComponent
in class JComponent
public void setBackground(Color bg)
JComponent.setBackground
because the
image buffer must be invalidated if the background color
changes.
setBackground
in class JComponent
public void setBgImage(ImageIcon icon)
icon
- the new background image which may be null
public void setBgImageDoubleBuffered(boolean b)
b
- true
if if the background image should
be painted using a double buffer, false
otherwisepublic void setBgImageHorizontalAlignment(int alignment)
SwingConstants.CENTER
.
alignment
- the new horizontal alignment of the
background image, one of SwingConstants.LEFT
,
SwingConstants.CENTER
or SwingConstants.RIGHT
IllegalArgumentException
- if argument is not
one of SwingConstants.LEFT
,
SwingConstants.CENTER
or SwingConstants.RIGHT
public void setBgImageScaleMode(int scaleMode)
SCALE_NONE
.
scaleMode
- the new scale mode of the background image,
one of
SCALE_NONE
SCALE_HORIZONTAL
SCALE_VERTICAL
SCALE_BOTH
SCALE_TO_FIT
SCALE_TO_FILL
REPEAT_HORIZONTAL
REPEAT_VERTICAL
REPEAT_BOTH
IllegalArgumentException
- if argument is
outside the expected rangepublic void setBgImageVerticalAlignment(int alignment)
SwingConstants.CENTER
.
alignment
- the new vertical alignment of the
background image, one of SwingConstants.TOP
,
SwingConstants.CENTER
or SwingConstants.BOTTOM
IllegalArgumentException
- if argument is not
one of SwingConstants.TOP
,
SwingConstants.CENTER
or SwingConstants.BOTTOM
public void setOpaque(boolean b)
JComponent.setOpaque
because the
panel must immediately be repainted if the opaque
property changes.
setOpaque
in class JComponent
|
RADi Runtime Library v1.2.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |