|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--adavid.awt.ImageTNodeRenderer
default tree renderer, with image
Field Summary | |
protected static java.awt.Dimension |
dim
dimension of the rendered image |
static int |
DIR_ONLY
the modes |
static int |
FILES_AND_DIR
the modes |
static int |
FILES_ONLY
the modes |
static ImageTNodeRenderer |
INSTANCE
the shared instance of this class ; shared since its only purpose is to draw an image ; I adopt here a weak programming model, namely the icons are assumed not to be modified by a process while the instance is rendering them, or updating the size information. |
static java.lang.String |
path$icons
the path of the default icons, so that Bundle finds them |
static int[] |
pictx
|
static int[] |
picty
|
static int |
SIZE
constants to draw the triangle |
static java.awt.Image |
TreeLeaf
the icons to be drawn |
static java.awt.Image |
TreeLeafSelected
the icons to be drawn |
static java.awt.Image |
TreeNode
|
static java.awt.Image |
TreeOpen
|
static java.awt.Image |
TreeOpenSelected
|
static java.awt.Image |
TreeSelected
|
Constructor Summary | |
protected |
ImageTNodeRenderer()
protected in order not to be called directly and still allow extension |
|
ImageTNodeRenderer(int mode)
and a configurable renderer |
Method Summary | |
int |
getHeight()
the dimension taken by the rendered image and triangle ; updateDim() is assumed to be called before ; has to be done explicitely if one changes one icon |
int |
getWidth()
|
static void |
lookDim(java.awt.Image img,
java.awt.Dimension checkDim)
update the dimension if the needed size is bigger than this dimension |
void |
paint(TNode c,
java.awt.Graphics g,
boolean isExpanded,
boolean isSelected,
boolean isLeaf)
we render the node here: draw the icon and the triangle note that the TNode chooses the color of the triangle |
static void |
updateDim()
update the size information of the icons |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final ImageTNodeRenderer INSTANCE
public static int FILES_AND_DIR
public static int FILES_ONLY
public static int DIR_ONLY
public static final int SIZE
public static final int[] pictx
public static final int[] picty
protected static java.awt.Dimension dim
public static java.lang.String path$icons
public static java.awt.Image TreeLeaf
public static java.awt.Image TreeLeafSelected
public static java.awt.Image TreeNode
public static java.awt.Image TreeSelected
public static java.awt.Image TreeOpen
public static java.awt.Image TreeOpenSelected
Constructor Detail |
protected ImageTNodeRenderer()
public ImageTNodeRenderer(int mode)
Method Detail |
public static void updateDim()
public static void lookDim(java.awt.Image img, java.awt.Dimension checkDim)
public void paint(TNode c, java.awt.Graphics g, boolean isExpanded, boolean isSelected, boolean isLeaf)
node
- the node to be repaintedg
- Graphics object to repaint the nodeexpanded
- state of the nodeselected
- state of the nodeleaf
- nature of the nodepublic int getHeight()
public int getWidth()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |