|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
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.jdesktop.swingx.JXPanel
org.jdesktop.swingx.JXImagePanel
com.ehsbe.commons.gui.wizard.Sidebar
public class Sidebar
A sidebar Panel, which displays a background image and short description of tasks to execute.
If insets are set, the background image gets centered and clipped wrt. the remaining space. If margins are set, the task descriptions are indented wrt. the given insets.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jdesktop.swingx.JXImagePanel |
---|
org.jdesktop.swingx.JXImagePanel.Style |
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 String |
DEFAULT_IMAGE
default background image to use |
String |
PROPERTY_DEPTH
property name of the event fired, when the depth of task descriptions to be displayed have been changed |
String |
PROPERTY_INDENT
property name of the event fired, when the indent has been changed |
String |
PROPERTY_LINESPACE
property name of the event fired, when the line spacing has been changed |
String |
PROPERTY_MARGIN
property name of the event fired, when margins have been changed |
String |
PROPERTY_TASK
property name of the event fired, when the active task has been changed |
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 | |
---|---|
Sidebar()
Create a default sidebar with a default background image, no insets and a margin of 5 pixels on all sides. |
|
Sidebar(String imagePath)
Create a default sidebar with no insets and a margin of 5 pixels on all sides. |
Method Summary | |
---|---|
void |
adjustActive(TaskControl control)
Adjust the display wrt. the new task in action. |
void |
adjustList(TaskControl control)
Adjust the current list of task, i.e. reflect the change in the structure of a task tree. |
Font |
getBoldFont()
Get the font, which is used to draw the description for the current task in action. |
int |
getDepth()
Get the depth of task used to draw descriptions. |
int |
getIndent()
Get the indent size as number of 'em's for nested descritions. |
int[] |
getLineSpacing()
Get the spaces between the lines. |
Insets |
getMargins()
Get the margins currently set. |
boolean |
isOptimizedDrawingEnabled()
|
protected void |
paintComponent(Graphics g)
|
void |
setBoldFont(Font boldFont)
Set the font, which should be used to draw the description for the current task in action. |
void |
setDepth(int depth)
Set the depth of tasks, which should be displayed in this panel. |
void |
setFont(Font font)
|
void |
setImage(Image image)
Same as JXImagePanel.setImage(Image) , but waits 'til image loading
is complete. |
void |
setImage(String imagePath)
Set the image, which should be used as the background for this sidebar. |
void |
setIndent(int indent)
Set the indent size as number of 'em's for nested descritions. |
void |
setLineSpacing(int[] spacing)
Set the spaces between the lines. |
void |
setLocale(Locale l)
|
void |
setMargins(Insets margins)
Set the margins for the task descriptions to be displayed. |
Methods inherited from class org.jdesktop.swingx.JXImagePanel |
---|
getImage, getPreferredSize, getStyle, isEditable, setDefaultImage, setEditable, setImageLoader, setStyle |
Methods inherited from class org.jdesktop.swingx.JXPanel |
---|
getAlpha, getBackgroundPainter, getEffectiveAlpha, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, isInheritAlpha, isPaintBorderInsets, paint, setAlpha, setBackground, setBackgroundPainter, setInheritAlpha, setPaintBorderInsets, setScrollableTracksViewportHeight, setScrollableTracksViewportWidth |
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 String DEFAULT_IMAGE
public String PROPERTY_MARGIN
public String PROPERTY_DEPTH
public String PROPERTY_TASK
public String PROPERTY_INDENT
public String PROPERTY_LINESPACE
Constructor Detail |
---|
public Sidebar()
public Sidebar(String imagePath)
imagePath
- resource path of the background image to use. Might be
null
.Method Detail |
---|
public void setImage(String imagePath)
NOTE: The path gets not tracked and thus causes always the image to be loaded, even if it is the same, which is already set!
imagePath
- a resource path, i.e. which can be fetched via current
ClassLoader.getResourceAsStream(String)
. If null
a default image gets loaded.public void setImage(Image image)
JXImagePanel.setImage(Image)
, but waits 'til image loading
is complete.
setImage
in class org.jdesktop.swingx.JXImagePanel
public Insets getMargins()
public void setMargins(Insets margins)
margins
- margins to set. If null
default values gets set.public void setBoldFont(Font boldFont)
boldFont
- font to use. If null
, the font gets derived from
the Component.getFont()
.public Font getBoldFont()
public boolean isOptimizedDrawingEnabled()
isOptimizedDrawingEnabled
in class JComponent
public void setDepth(int depth)
1
, the description of the origins Task.getSubTasks()
are drawn,
only. If 2
, the descriptions of the sub tasks will from all
origins sub task will be drawn and so on.
depth
- depth to set.public int getDepth()
public void setIndent(int indent)
indent
- indent to set.public int getIndent()
public void setLineSpacing(int[] spacing)
spacing
- linespacing to set. If null
default linespacing
will be used.public int[] getLineSpacing()
null
.public void adjustActive(TaskControl control)
control
- controller of the current executing task.public void adjustList(TaskControl control)
control
- controller of the current executing task.public void setFont(Font font)
setFont
in class JComponent
public void setLocale(Locale l)
setLocale
in class Component
protected void paintComponent(Graphics g)
paintComponent
in class org.jdesktop.swingx.JXImagePanel
|
ehsbe CommonsTM Version 1.1.0rc3 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |