|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent bibliothek.extension.gui.dock.theme.bubble.RoundButton
@ColorCodes(value={"action.button","action.button.focus","action.button.enabled","action.button.enabled.focus","action.button.selected","action.button.selected.focus","action.button.selected.enabled","action.button.selected.enabled.focus","action.button.mouse.enabled","action.button.mouse.enabled.focus","action.button.mouse.selected.enabled","action.button.mouse.selected.enabled.focus","action.button.pressed.enabled","action.button.pressed.enabled.focus","action.button.pressed.selected.enabled","action.button.pressed.selected.enabled.focus","action.button.text","action.button.text.enabled","action.button.text.selected","action.button.text.selected.enabled","action.button.text.mouse.enabled","action.button.text.mouse.selected.enabled","action.button.text.pressed.enabled","action.button.text.pressed.selected.enabled"}) public class RoundButton
A round button is a button that has a oval form. Clients should call
setController(DockController)
for optimal usage.
Nested Class Summary |
---|
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 |
---|
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 | |
---|---|
RoundButton(BasicTrigger trigger,
BasicResourceInitializer initializer,
Dockable dockable,
DockAction action)
Creates a new round button. |
Method Summary | |
---|---|
protected void |
animate(String key,
String color)
Searches for the AbstractDockColor with id color and sets this
color in the animation . |
boolean |
contains(int x,
int y)
|
protected MiniButtonContent |
createButtonContent()
Creates the component that shows the contents of this button. |
protected AbstractDockColor |
createColor(String key,
Dockable dockable,
DockAction action,
Color backup)
Creates a new DockColor representing one color used by this button. |
protected AbstractDockColor[] |
createColors(Dockable dockable,
DockAction action)
|
void |
doLayout()
|
protected void |
doPaintBackground(Graphics g)
Paints the background of this button. |
protected void |
doPaintForeground(Graphics g)
Paints the foreground of this button. |
protected BubbleColorAnimation |
getAnimation()
Access to the BubbleColorAnimation which is responsible for repainting this button. |
protected MiniButtonContent |
getContent()
Gets the content component of this button. |
BasicButtonModel |
getModel()
|
Dimension |
getPreferredSize()
|
boolean |
isPaintFocusBorder()
Tells whether a special border is painted if this button is focused. |
protected void |
paintComponent(Graphics g)
|
void |
setController(DockController controller)
Connects this button with a controller, that is necessary to get the colors for this button. |
void |
setPaintFocusBorder(boolean paintFocusBorder)
Sets whether a special border should be painted if this button is focused. |
protected void |
updateColors()
Reads all DockColor s of this RoundButton and updates the animation
if necessary. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RoundButton(BasicTrigger trigger, BasicResourceInitializer initializer, Dockable dockable, DockAction action)
trigger
- a trigger which gets informed when the user clicks the
button.initializer
- a strategy to lazily initialize resources, can be null
dockable
- the dockable for which this button is usedaction
- the action for which this button is usedMethod Detail |
---|
protected MiniButtonContent createButtonContent()
protected AbstractDockColor[] createColors(Dockable dockable, DockAction action)
protected AbstractDockColor createColor(String key, Dockable dockable, DockAction action, Color backup)
DockColor
representing one color used by this button.
key
- the unique identifier of the colordockable
- the dockable for which the color is used, may be null
action
- the action represented by this button, may be null
backup
- the backup color that is used if no other color was found
DockColor
protected BubbleColorAnimation getAnimation()
BubbleColorAnimation
which is responsible for repainting this button. Subclasses
may use this method to insert or modify custom colors.
public void setPaintFocusBorder(boolean paintFocusBorder)
paintFocusBorder
- whether to paint the borderpublic boolean isPaintFocusBorder()
public void setController(DockController controller)
setController
in interface RoundButtonConnectable
controller
- the controller, can be null
public BasicButtonModel getModel()
public boolean contains(int x, int y)
contains
in class JComponent
protected MiniButtonContent getContent()
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public void doLayout()
doLayout
in class Container
protected void paintComponent(Graphics g)
paintComponent
in class JComponent
protected void doPaintBackground(Graphics g)
g
- the graphics context to useprotected void doPaintForeground(Graphics g)
g
- the graphics context to useprotected void updateColors()
DockColor
s of this RoundButton
and updates the animation
if necessary.
protected void animate(String key, String color)
AbstractDockColor
with id color
and sets this
color in the animation
.
key
- the key of the color in the animationcolor
- the key of the AbstractDockColor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |