|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.tooltip.ExpandedTip<S>
S
- public abstract class ExpandedTip<S extends JComponent>
ExpandedTip
makes a component showing an expanded tooltip when the mouse is a node or a cell. It is the
base class and has subclasses to implement for different components. It is useful for JList and JTree when they are
narrow but the content is wide.
Field Summary | |
---|---|
protected S |
_component
|
static String |
CLIENT_PROPERTY_EXPANDED_TIP
The client property for ExpandedTip instance. |
Constructor Summary | |
---|---|
protected |
ExpandedTip(S component)
|
Method Summary | |
---|---|
protected BufferedImage |
createImage(int width,
int height)
Creates a BufferedImage. |
protected Point |
createToolTipImage(int index,
boolean rightOrLeft)
|
protected void |
fillBackground(Graphics2D g,
int width,
int height)
Fills the background on the tip component. |
S |
getComponent()
Gets the component where the ExpandedTip is installed on. |
protected Component |
getComponent(int index)
Gets the target component. |
static ExpandedTip |
getExpandedTip(JComponent component)
Gets the ExpandedTip installed on the component. |
protected abstract Rectangle |
getRowBounds(int index)
Gets the bounds of the image that will be put on the tip. |
protected Rectangle |
getVisibleRect(int index)
Gets the visible rect of the component. |
protected void |
handleSelectionChange(int selected)
|
protected void |
handleSelectionChange(int selected,
boolean processIfUnfocused)
|
void |
hideTip()
|
protected void |
paintTipImage(Graphics2D g,
Component component,
Rectangle bounds,
int index)
Paints the tip image. |
protected abstract int |
rowAtPoint(Point point)
Gets the row index or the node index on the location. |
protected void |
setWindowShape(JWindow window,
boolean rightOrLeft)
Adjusts the window shape in case the tip window is not rectangular. |
protected boolean |
shouldDrawBorder()
|
void |
showTip()
|
void |
uninstall()
|
protected void |
updateCurrentSelection()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CLIENT_PROPERTY_EXPANDED_TIP
protected final S extends JComponent _component
Constructor Detail |
---|
protected ExpandedTip(S component)
Method Detail |
---|
public void uninstall()
protected void updateCurrentSelection()
protected void handleSelectionChange(int selected)
protected void handleSelectionChange(int selected, boolean processIfUnfocused)
public void showTip()
public void hideTip()
protected void setWindowShape(JWindow window, boolean rightOrLeft)
NavigationTree
and NavigationList
.
window
- the window.rightOrLeft
- right or left.protected Point createToolTipImage(int index, boolean rightOrLeft)
protected boolean shouldDrawBorder()
protected BufferedImage createImage(int width, int height)
width
- the width of the imageheight
- the height of the image
protected void fillBackground(Graphics2D g, int width, int height)
g
- the graphicswidth
- the widthheight
- the heightprotected void paintTipImage(Graphics2D g, Component component, Rectangle bounds, int index)
g
- the graphicscomponent
- the component where the sub-image is taken frombounds
- the bounds where the sub-image is atindex
- the index of the row or the nodeprotected Rectangle getVisibleRect(int index)
index
- the index of the row or node
public S getComponent()
protected Component getComponent(int index)
getRowBounds(int)
. What we will do is to take a capture of the image at the bounds on
the component and copy it to the tip component.
index
- the index of the row or node.
protected abstract Rectangle getRowBounds(int index)
getComponent(int)
. The bounds should cover the row or the node. We will calculate it so that only the
invisible area is shown on the tip component.
index
- the index of the row or node.
protected abstract int rowAtPoint(Point point)
point
- the location.
public static ExpandedTip getExpandedTip(JComponent component)
component
- the component
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |